Info Node: (texinfo)@ifset @ifclear

CFHT HOME texinfo: @ifset @ifclear


up: @set @clear @value next: @value Example prev: @set @value Back to Software Index

18.5.2 '@ifset' and '@ifclear'
------------------------------

When a FLAG is set, the Texinfo formatting commands format text between
subsequent pairs of '@ifset FLAG' and '@end ifset' commands.  When the
FLAG is cleared, the Texinfo formatting commands do _not_ format the
text.  '@ifclear' operates analogously.

  Write the conditionally formatted text between '@ifset FLAG' and '@end
ifset' commands, like this:

     @ifset FLAG
     CONDITIONAL-TEXT
     @end ifset

  For example, you can create one document that has two variants, such
as a manual for a 'large' and 'small' model:

     You can use this machine to dig up shrubs
     without hurting them.

     @set large

     @ifset large
     It can also dig up fully grown trees.
     @end ifset

     Remember to replant promptly ...

In the example, the formatting commands will format the text between
'@ifset large' and '@end ifset' because the 'large' flag is set.

  When FLAG is cleared, the Texinfo formatting commands do _not_ format
the text between '@ifset FLAG' and '@end ifset'; that text is ignored
and does not appear in either printed or Info output.

  For example, if you clear the flag of the preceding example by writing
an '@clear large' command after the '@set large' command (but before the
conditional text), then the Texinfo formatting commands ignore the text
between the '@ifset large' and '@end ifset' commands.  In the formatted
output, that text does not appear; in both printed and Info output, you
see only the lines that say, "You can use this machine to dig up shrubs
without hurting them.  Remember to replant promptly ...".

  If a flag is cleared with an '@clear FLAG' command, then the
formatting commands format text between subsequent pairs of '@ifclear'
and '@end ifclear' commands.  But if the flag is set with '@set FLAG',
then the formatting commands do _not_ format text between an '@ifclear'
and an '@end ifclear' command; rather, they ignore that text.  An
'@ifclear' command looks like this:

     @ifclear FLAG


automatically generated by info2www version 1.2