1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<META name="GENERATOR" content="hevea 1.10">
<META name="Author" content="Luc Maranget">
<LINK rel="stylesheet" type="text/css" href="manual.css">
<TITLE>Commands and Environments</TITLE>
</HEAD>
<BODY >
<A HREF="manual022.html"><IMG SRC="contents_motif.gif" ALT="Up"></A>
<A HREF="manual024.html"><IMG SRC="next_motif.gif" ALT="Next"></A>
<HR>
<H2 CLASS="section"><A NAME="htoc56">B.1</A>  Commands and Environments</H2><UL>
<LI><A HREF="manual023.html#toc43">Command Names and Arguments</A>
</LI><LI><A HREF="manual023.html#toc44">Environments</A>
</LI><LI><A HREF="manual023.html#toc45">Fragile Commands</A>
</LI><LI><A HREF="manual023.html#toc46">Declarations</A>
</LI><LI><A HREF="manual023.html#toc47">Invisible Commands</A>
</LI><LI><A HREF="manual023.html#toc48">The <TT>\\</TT> Command</A>
</LI></UL>
<H3 CLASS="subsection"><A NAME="toc43"></A><A NAME="htoc57">B.1.1</A>  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<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A ignore such comments. However, H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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 NAME="@default141"></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<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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 <I>a</I><SUB>1</SUB> and <I>a</I><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 NAME="@default142"></A>
<A NAME="@default143"></A>
With respect to previous versions,
H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A succeeds in fetching the argument
“<CODE>{In bold}</CODE>”. We get
</P><BLOCKQUOTE CLASS="quote"><HR NOSHADE SIZE=1 ALIGN=center>
<B>In bold</B>
<HR NOSHADE SIZE=1 ALIGN=center></BLOCKQUOTE><P>The above example arguably is no “legal” L<sup>A</sup>T<sub>E</sub>X,
but H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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
behavior, which H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A typesets everything using
bold font. Here is H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A output:
</P><BLOCKQUOTE CLASS="quote"><HR NOSHADE SIZE=1 ALIGN=center>
<B>In bold, Not in Bold.</B>
<HR NOSHADE SIZE=1 ALIGN=center></BLOCKQUOTE><P>
Note that, in most similar situations, H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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"><A NAME="toc44"></A><A NAME="htoc58">B.1.2</A>  Environments</H3><P>Environment opening and closing is performed like in L<sup>A</sup>T<sub>E</sub>X, with
<CODE>\begin{</CODE><I>env</I><CODE>}</CODE> and
<CODE>\end{</CODE><I>env</I><CODE>}</CODE>.
The <CODE>*</CODE>-form of an environment is a plain environment.</P><P>It is not advised to use <CODE>\</CODE><I>env</I> and
<CODE>\end</CODE><I>env</I> in place of <CODE>\begin{</CODE><I>env</I><CODE>}</CODE> and
<CODE>\end{</CODE><I>env</I><CODE>}</CODE>.</P><H3 CLASS="subsection"><A NAME="toc45"></A><A NAME="htoc59">B.1.3</A>  Fragile Commands</H3><P>
Fragile commands are not relevant to H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A and <CODE>\protect</CODE> is
defined as a null command.</P><H3 CLASS="subsection"><A NAME="toc46"></A><A NAME="htoc60">B.1.4</A>  Declarations</H3><P>
Scope rules are the same as in L<sup>A</sup>T<sub>E</sub>X.</P><H3 CLASS="subsection"><A NAME="toc47"></A><A NAME="htoc61">B.1.5</A>  Invisible Commands</H3><P>
I am a bit lost here. However spaces in the output should correspond
to users expectations. Note that, to H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A being
invisible commands is a static property attached to command name.</P><H3 CLASS="subsection"><A NAME="toc48"></A><A NAME="htoc62">B.1.6</A>  The <TT>\\</TT> 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.gif" ALT="Up"></A>
<A HREF="manual024.html"><IMG SRC="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
|