Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| composition:texte:renvois:detecter_qu_un_label_est_vide [2018/05/30 22:10] – d.p.carlisle | 3_composition:texte:renvois:detecter_qu_un_label_est_vide [2021/11/29 22:56] (Version actuelle) – Correction de la mise en forme. yannick.tanguy | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | --- | + | ====== Comment savoir si une étiquette n'est pas définie? ====== |
| - | title: Finding if a label is undefined | + | |
| - | category: programming | + | |
| - | tags: latex macros | + | |
| - | permalink: / | + | |
| - | date: 2014-06-10 | + | |
| - | --- | + | |
| - | # Finding if a label is undefined | + | Au moment de l' |
| - | People seem to want to know (at run time) if a label is undefined (I | + | ===== Avec les commandes de base ===== |
| - | don't actually understand _why_, particularly: | + | |
| - | state, and LaTeX deals with it quite well). | + | |
| - | A resolved label is simply a command: | + | Une étiquette définie est simplement une commande |
| - | `\r@``& | + | * '' |
| - | then simply a matter of detecting if the command exists. The usual | + | * et les deux autres |
| - | LaTeX internal way of doing this is to use the command | + | |
| - | `\@ifundefined`: | + | |
| - | `\@ifundefined{r@label-name}{undef-cmds}{def-cmds}` | + | |
| - | In which, & | + | |
| - | a `\label` command, and the remaining two arguments | + | |
| - | sequences to be used if the label is undefined | + | |
| - | (& | + | |
| - | (& | + | |
| - | Note that any command that incorporates `\@ifundefined` is naturally | + | Notez que toute commande qui intègre '' |
| - | fragile, | + | |
| - | use it with `\protect` in a moving argument. | + | |
| - | If you're into this game, you may well not care about LaTeX's | + | Si vous suivez cette piste, vous ne soucierez peut-être pas de l'avertissement de < |
| - | warning about undefined labels at the end of the document; however, | + | |
| - | if you are, include the command `\G@refundefinedtrue` in | + | |
| - | & | + | |
| - | And of course, remember you're dealing in internal commands, and pay | + | Enfin, bien sûr, rappelez-vous que vous avez affaire à des commandes internes. En cas de doute, consultez la question : « [[2_programmation: |
| - | attention to the [at-signs](/ | + | |
| - | All the above can be avoided by using the [`labelcas`](https:// | + | ===== Avec l' |
| - | it provides commands that enable you to switch according to the state | + | |
| - | of a single label, or the states of a list of labels. | + | |
| - | definition is a bit complicated, | + | |
| - | powerful. | + | |
| + | Tout ce qui précède peut être évité en utilisant l' | ||
| + | ----- | ||
| + | |||
| + | //Source:// [[faquk> | ||
| + | |||
| + | {{htmlmetatags> | ||
| + | metatag-og: | ||
| + | metatag-og: | ||
| + | }} | ||

