blob: f7e0a29c013e92a5c18b70f20ed5785d778b0717 [file] [log] [blame]
<!DOCTYPE html>
<html>
<!-- Created by Texinfo 6.8dev+dev, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This manual is for GNU Texinfo (version 6.8dev, 23 February 2022),
a documentation system that can produce both online information and a
printed manual from a single source using semantic markup.
Copyright (C) 1988, 1990-1993, 1995-1999, 2001-2022 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
"GNU Free Documentation License". -->
<title>@ifset @ifclear (GNU Texinfo 6.8dev)</title>
<meta name="description" content="@ifset @ifclear (GNU Texinfo 6.8dev)">
<meta name="keywords" content="@ifset @ifclear (GNU Texinfo 6.8dev)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2any">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Command-and-Variable-Index.html" rel="index" title="Command and Variable Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="_0040set-_0040clear-_0040value.html" rel="up" title="@set @clear @value">
<link href="_0040inlineifset-_0040inlineifclear.html" rel="next" title="@inlineifset @inlineifclear">
<link href="_0040set-_0040value.html" rel="prev" title="@set @value">
<style type="text/css">
<!--
div.example {margin-left: 3.2em}
-->
</style>
</head>
<body lang="en">
<div class="subsection-level-extent" id="g_t_0040ifset-_0040ifclear">
<div class="nav-panel">
<p>
Next: <a href="_0040inlineifset-_0040inlineifclear.html" accesskey="n" rel="next"><code class="code">@inlineifset</code> and <code class="code">@inlineifclear</code></a>, Previous: <a href="_0040set-_0040value.html" accesskey="p" rel="prev"><code class="code">@set</code> and <code class="code">@value</code></a>, Up: <a href="_0040set-_0040clear-_0040value.html" accesskey="u" rel="up">Flags: <code class="code">@set</code>, <code class="code">@clear</code>, conditionals, and <code class="code">@value</code></a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="g_t_0040ifset-and-_0040ifclear">15.5.2 <code class="code">@ifset</code> and <code class="code">@ifclear</code></h4>
<a class="anchor" id="ifset-ifclear"></a><a class="index-entry-id" id="index-ifset"></a>
<p>When a <var class="var">flag</var> is set, the Texinfo formatting commands format text
between subsequent pairs of <code class="code">@ifset <var class="var">flag</var></code> and <code class="code">@end
ifset</code> commands. When the <var class="var">flag</var> is cleared, the Texinfo formatting
commands do <em class="emph">not</em> format the text. <code class="code">@ifclear</code> operates
analogously.
</p>
<p>Write the conditionally formatted text between <code class="code">@ifset <var class="var">flag</var></code>
and <code class="code">@end ifset</code> commands, like this:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">@ifset <var class="var">flag</var>
<var class="var">conditional-text</var>
@end ifset
</pre></div></div>
<p>For example, you can create one document that has two variants, such as
a manual for a &lsquo;large&rsquo; and &lsquo;small&rsquo; model:
</p>
<a class="index-entry-id" id="index-Shrubbery"></a>
<div class="example">
<pre class="example-preformatted">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 &hellip;
</pre></div>
<p>In the example, the formatting commands will format the text between
<code class="code">@ifset large</code> and <code class="code">@end ifset</code> because the <code class="code">large</code>
flag is set.
</p>
<p>When <var class="var">flag</var> is cleared, the Texinfo formatting commands do
<em class="emph">not</em> format the text between <code class="code">@ifset <var class="var">flag</var></code> and
<code class="code">@end ifset</code>; that text is ignored and does not appear in either
printed or Info output.
</p>
<p>For example, if you clear the flag of the preceding example by writing
an <code class="code">@clear large</code> command after the <code class="code">@set large</code> command
(but before the conditional text), then the Texinfo formatting commands
ignore the text between the <code class="code">@ifset large</code> and <code class="code">@end ifset</code>
commands. In the formatted output, that text does not appear; in both
printed and Info output, you see only the lines that say, &ldquo;You can use
this machine to dig up shrubs without hurting them. Remember to replant
promptly &hellip;&rdquo;.
</p>
<a class="index-entry-id" id="index-ifclear"></a>
<p>If a flag is cleared with a <code class="code">@clear <var class="var">flag</var></code> command, then
the formatting commands format text between subsequent pairs of
<code class="code">@ifclear</code> and <code class="code">@end ifclear</code> commands. But if the flag
is set with <code class="code">@set <var class="var">flag</var></code>, then the formatting commands do
<em class="emph">not</em> format text between an <code class="code">@ifclear</code> and an <code class="code">@end
ifclear</code> command; rather, they ignore that text. An <code class="code">@ifclear</code>
command looks like this:
</p>
<div class="example">
<pre class="example-preformatted">@ifclear <var class="var">flag</var>
</pre></div>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="_0040inlineifset-_0040inlineifclear.html"><code class="code">@inlineifset</code> and <code class="code">@inlineifclear</code></a>, Previous: <a href="_0040set-_0040value.html"><code class="code">@set</code> and <code class="code">@value</code></a>, Up: <a href="_0040set-_0040clear-_0040value.html">Flags: <code class="code">@set</code>, <code class="code">@clear</code>, conditionals, and <code class="code">@value</code></a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>