<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <meta name="generator" content="hevea 2.32"> <meta name="Author" content="Luc Maranget"> <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"></script><link rel="stylesheet" type="text/css" href="manual.css"> <title>Commands and Environments</title> </head> <body> <a href="manual022.html"><img src="contents_motif.svg" alt="Up"></a> <a href="manual024.html"><img src="next_motif.svg" alt="Next"></a> <hr> <h2 class="section" id="sec100">B.1  Commands and Environments</h2> <ul> <li><a href="manual023.html#sec101">Command Names and Arguments</a> </li><li><a href="manual023.html#sec102">Environments</a> </li><li><a href="manual023.html#sec103">Fragile Commands</a> </li><li><a href="manual023.html#sec104">Declarations</a> </li><li><a href="manual023.html#sec105">Invisible Commands</a> </li><li><a href="manual023.html#sec106">The <span class="c013">\\</span> Command</a> </li></ul> <h3 class="subsection" id="sec101">B.1.1  Command Names and Arguments</h3> <p>L<sup>A</sup>T<sub>E</sub>X comments that start with “<code>%</code>” and end at end of line are ignored and produce no output. Usually, H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A ignore such comments. However, H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A processes text that follows “<code>%HEVEA</code>” and some other comments have a specific meaning to it (see section <a href="manual007.html#comments">5.3</a>).</p><p><a id="hevea_default143"></a> Command names follow strict L<sup>A</sup>T<sub>E</sub>X syntax. That is, apart from <code>#</code>, <code>$</code>, <code>~</code>, <code>_</code> and <code>^</code>, they either are “<code>\</code>” followed by a single non-letter character or “<code>\</code>” followed by a sequence of letters. Additionally, the letter sequence may be preceded by “<code>@</code>” (and this is the case of many of H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A internal commands), or terminated by “<code>*</code>” (starred variants are implemented as plain commands).</p><p>Users are strongly advised to follow strict L<sup>A</sup>T<sub>E</sub>X syntax for arguments. That is, mandatory arguments are enclosed in curly braces <code>{</code>… <code>}</code> and braces inside arguments must be properly balanced. Optional arguments are enclosed in square brackets <code>[</code>… <code>]</code>. However, H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A does its best to read arguments even when they are not enclosed in curly braces. Such arguments are a single, different from “<code>\</code>”, “<code>{</code>” and “<code> </code>”, character or a command name. Thus, constructs such as <code>\'ecole</code>, <code>$a_1$</code> or <code>$a_\Gamma$</code> are recognized and processed as école <span class="c019">a</span><sub>1</sub> and <span class="c019">a</span><sub>Γ</sub>. By contrast, <code>a^\mbox{...}</code> is not recognized and must be written <code>a^{\mbox{...}}</code>.</p><p>Also note that, by contrast with L<sup>A</sup>T<sub>E</sub>X, comments are parsed during argument scanning, as an important consequence brace nesting is also checked inside comments.</p><p><a id="hevea_default144"></a> <a id="hevea_default145"></a> With respect to previous versions, H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A has been improved as regards emulation of complicated argument passing. That is, commands and their arguments can now appear in different static text bodies. As a consequence, H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A correctly processes the following source: </p><pre class="verbatim">\newcommand{\boite}{\textbf} \boite{In bold} </pre><p> The definition of <code>\boite</code> makes it reduces as <code>\textbf</code> and H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A succeeds in fetching the argument “<code>{In bold}</code>”. We get </p><blockquote class="quote"> <span class="c023">In bold</span> </blockquote><p>The above example arguably is no “legal” L<sup>A</sup>T<sub>E</sub>X, but H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A handles it. Of course, there remains numerous “clever” L<sup>A</sup>T<sub>E</sub>X tricks that exploits T<sub>E</sub>X internal behaviour, which H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A does not handle. For instance consider the following source: </p><pre class="verbatim">\newcommand{\boite}[1]{\textbf#1} \boite{{In bold}, Not in Bold.} </pre><p> L<sup>A</sup>T<sub>E</sub>X typesets the text “In bold” using bold font, leaving the rest of the text alone. While H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A typesets everything using bold font. Here is H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A output: </p><blockquote class="quote"> <span class="c023">In bold, Not in Bold.</span> </blockquote><p> Note that, in most similar situations, H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A will likely crash.</p><p>As a conclusion of this important section, Users are strongly advised to use ordinary command names and curly braces and not to think too much the T<sub>E</sub>X way.</p> <h3 class="subsection" id="sec102">B.1.2  Environments</h3> <p>Environment opening and closing is performed like in L<sup>A</sup>T<sub>E</sub>X, with <code>\begin{</code><span class="c019">env</span><code>}</code> and <code>\end{</code><span class="c019">env</span><code>}</code>. The <code>*</code>-form of an environment is a plain environment.</p><p>It is not advised to use <code>\</code><span class="c019">env</span> and <code>\end</code><span class="c019">env</span> in place of <code>\begin{</code><span class="c019">env</span><code>}</code> and <code>\end{</code><span class="c019">env</span><code>}</code>.</p> <h3 class="subsection" id="sec103">B.1.3  Fragile Commands</h3> <p> Fragile commands are not relevant to H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A and <code>\protect</code> is defined as a null command.</p> <h3 class="subsection" id="sec104">B.1.4  Declarations</h3> <p> Scope rules are the same as in L<sup>A</sup>T<sub>E</sub>X.</p> <h3 class="subsection" id="sec105">B.1.5  Invisible Commands</h3> <p> I am a bit lost here. However spaces in the output should correspond to users expectations. Note that, to H<span class="c016"><sup>E</sup></span>V<span class="c016"><sup>E</sup></span>A being invisible commands is a static property attached to command name.</p> <h3 class="subsection" id="sec106">B.1.6  The <span class="c013">\\</span> Command</h3> <p>The <code>\\</code> and <code>\\*</code> commands are the same, they perform a line break, except inside arrays where they end the current row. Optional arguments to <code>\\</code> and <code>\\*</code> are ignored.</p> <hr> <a href="manual022.html"><img src="contents_motif.svg" alt="Up"></a> <a href="manual024.html"><img src="next_motif.svg" alt="Next"></a> </body> </html>