Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
Prochaine révision Les deux révisions suivantes
3_composition:texte:renvois:detecter_qu_un_label_est_vide [2018/05/23 18:49]
joseph.wright
3_composition:texte:renvois:detecter_qu_un_label_est_vide [2018/12/04 00:55]
jejust
Ligne 1: Ligne 1:
---- +====== ​Finding if a label is undefined ​====== 
-ID: Q-labundef +
-revised: 2014-06-10 +
---- +
-Finding if a label is undefined+
  
 People seem to want to know (at run time) if a label is undefined (I People seem to want to know (at run time) if a label is undefined (I
-don't actually understand ​_why_, particularly:​ it's a transient+don't actually understand ​//why//, particularly:​ it's a transient
 state, and LaTeX deals with it quite well). state, and LaTeX deals with it quite well).
  
 A resolved label is simply a command: A resolved label is simply a command:
-`\r@``&​lsaquo;​_label-name_&​rsaquo;​`; determining if the label is set is+''​\r@<label-name>''​; determining if the label is set is
 then simply a matter of detecting if the command exists. ​ The usual then simply a matter of detecting if the command exists. ​ The usual
 LaTeX internal way of doing this is to use the command LaTeX internal way of doing this is to use the command
-`ifundefined`+''​\@ifundefined''​
-  ​`ifundefined{r@label-name}{undef-cmds}{def-cmds}` +  ​''​\@ifundefined{r@label-name}{undef-cmds}{def-cmds}''​ 
-In which, ​&​lsaquo;​_label-name_&​rsaquo; ​is exactly what you would use in +In which, ​<//label-name//> ​is exactly what you would use in 
-`\labelcommand, and the remaining two arguments are command+''​\label'' ​command, and the remaining two arguments are command
 sequences to be used if the label is undefined sequences to be used if the label is undefined
-(&​lsaquo;​_undef-cmds_&​rsaquo;​) or if it is defined +(<//undef-cmds//>) or if it is defined 
-(&​lsaquo;​_def-cmds_&​rsaquo;​).+(<//def-cmds//>).
  
-Note that any command that incorporates ​`ifundefinedis naturally +Note that any command that incorporates ​''​\@ifundefined'' ​is naturally 
-fragile, so remember to create it with `\DeclareRobustCommandor to +fragile, so remember to create it with ''​\DeclareRobustCommand'' ​or to 
-use it with `\protectin a moving argument.+use it with ''​\protect'' ​in a moving argument.
  
 If you're into this game, you may well not care about LaTeX'​s If you're into this game, you may well not care about LaTeX'​s
 warning about undefined labels at the end of the document; however, warning about undefined labels at the end of the document; however,
-if you are, include the command ​`\G@refundefinedtruein +if you are, include the command ​''​\G@refundefinedtrue'' ​in 
-&​lsaquo;​_`undef-cmds`_&​rsaquo;​.+<//''​undef-cmds''//>​.
  
 And of course, remember you're dealing in internal commands, and pay And of course, remember you're dealing in internal commands, and pay
-attention to the [at-signs](FAQ-atsigns.md).+attention to the [[FAQ-atsigns|at-signs]].
  
-All the above can be avoided by using the [`labelcas`](https://​ctan.org/​pkg/​labelcaspackage:+All the above can be avoided by using the [[ctanpkg>​labelcas|labelcas]] package:
 it provides commands that enable you to switch according to the state it provides commands that enable you to switch according to the state
 of a single label, or the states of a list of labels. ​ The package'​s of a single label, or the states of a list of labels. ​ The package'​s
Ligne 39: Ligne 36:
 powerful. powerful.
  
 +
 +-----
 +
 +//Source:// [[faquk>​FAQ-labundef|Finding if a label is undefined]]
 +
 +{{htmlmetatags>​metatag-keywords=(LaTeX,​latex,​macros,​programming)
 +metatag-og:​title=(Finding if a label is undefined)
 +metatag-og:​site_name=(FAQ LaTeX francophone)
 +}}
  
3_composition/texte/renvois/detecter_qu_un_label_est_vide.txt · Dernière modification: 2021/01/19 14:01 par yannick.tanguy
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0