Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > e8b7ce893d130f732758286a15c74b5e > files > 53

hevea-1.10-4mdv2010.0.i586.rpm

<!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>Definitions, Numbering</TITLE>
</HEAD>
<BODY >
<A HREF="manual029.html"><IMG SRC="previous_motif.gif" ALT="Previous"></A>
<A HREF="manual022.html"><IMG SRC="contents_motif.gif" ALT="Up"></A>
<A HREF="manual031.html"><IMG SRC="next_motif.gif" ALT="Next"></A>
<HR>
<H2 CLASS="section"><A NAME="htoc91">B.8</A>&#XA0;&#XA0;Definitions, Numbering</H2><UL>
<LI><A HREF="manual030.html#toc72">Defining Commands</A>
</LI><LI><A HREF="manual030.html#toc73">Defining Environments</A>
</LI><LI><A HREF="manual030.html#toc74">Theorem-like Environments</A>
</LI><LI><A HREF="manual030.html#toc75">Numbering</A>
</LI><LI><A HREF="manual030.html#toc76">The <TT>ifthen</TT> Package</A>
</LI></UL>
<H3 CLASS="subsection"><A NAME="toc72"></A><A NAME="htoc92">B.8.1</A>&#XA0;&#XA0;Defining Commands</H3><P><A NAME="usermacro"></A></P><P><A NAME="@default169"></A>
<A NAME="@default170"></A>
<A NAME="@default171"></A>
H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A understands command definitions given in L<sup>A</sup>T<sub>E</sub>X style. Such
definitions are made using
<CODE>\newcommand</CODE>, <CODE>\renewcommand</CODE> and <CODE>\providecommand</CODE>.
These three constructs accept the same arguments and have the same
meaning as in L<sup>A</sup>T<sub>E</sub>X, in particular it is possible to define an user
command with one optional argument.
However, H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A is more tolerant: if command
<I>name</I> already exists, then a subsequent <CODE>\newcommand{</CODE><I>name</I><CODE>}</CODE>&#X2026;is ignored. If macro <I>name</I> does not exists, then
<CODE>\renewcommand{</CODE><I>name</I><CODE>}</CODE>&#X2026;performs a definition of <I>name</I>. In both cases, L<sup>A</sup>T<sub>E</sub>X would crash, H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A just issues
warnings.</P><P>The behavior of <CODE>\newcommand</CODE> allows to shadow document
definition, provided the new definitions are processed before the
document definitions.
This is easily done by grouping the shadowing definition in a
specific style file given as an argument to H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A (see section&#XA0;<A HREF="manual007.html#heveaonly">5.1</A>).
Conversely, changes of base macros (<EM>i.e.</EM> the ones that H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A
defines before loading any user-specified file) must be performed
using <CODE>\renewcommand</CODE>.</P><P>Scoping rules apply to macros, as they do in L<sup>A</sup>T<sub>E</sub>X.
Environments and groups define a scope and command definition
are local to the scope they occur.</P><P>It is worth noticing that H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A also partly implements T<sub>E</sub>X definitions
(using <CODE>\def</CODE>) and bindings (using <CODE>\let</CODE>), see
section&#XA0;<A HREF="manual038.html#texmacro">B.16.1</A> for details.</P><H3 CLASS="subsection"><A NAME="toc73"></A><A NAME="htoc93">B.8.2</A>&#XA0;&#XA0;Defining Environments</H3><P>
H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A accepts environment definitions and redefinitions
by <CODE>\newenvironment</CODE> and <CODE>\renewenvironment</CODE>.
The support is complete and should conform
to&#XA0;[<A HREF="manual047.html#latex">L<sup>A</sup>T<sub>E</sub>X</A>, Sections&#XA0;C.8.2].</P><P>Environments define a scope both for commands and environment
definitions.</P><H3 CLASS="subsection"><A NAME="toc74"></A><A NAME="htoc94">B.8.3</A>&#XA0;&#XA0;Theorem-like Environments</H3><P>
New theorem-like environments can also be introduced and redefined,
using <CODE>\newtheorem</CODE> and <CODE>\renewtheorem</CODE>.</P><P>Note that, by contrast with plain environments definitions,
theorem-like environment definitions are global definitions.</P><H3 CLASS="subsection"><A NAME="toc75"></A><A NAME="htoc95">B.8.4</A>&#XA0;&#XA0;Numbering</H3><P>
L<sup>A</sup>T<sub>E</sub>X counters are (fully ?) supported.
In particular, defining a counter <I>cmd</I> with
<CODE>\newcounter{</CODE><I>cmd</I><CODE>}</CODE> creates a macro
<CODE>\the</CODE><I>cmd</I> that outputs the counter value.
Then the <CODE>\the</CODE><I>cmd</I> command can be redefined.
For instance, section numbering can be turned into alphabetic style by:
</P><PRE CLASS="verbatim">\renewcommand{\thesection}{\alph{section}}
</PRE><P>Note that T<sub>E</sub>X style for counters is not supported at all and that using
this style will clobber the output. However, H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A implements
the <I>calc</I> package that makes using T<sub>E</sub>X style for counters
useless in most situations (see section&#XA0;<A HREF="manual-packages.html#calc">B.17.3</A>).</P><H3 CLASS="subsection"><A NAME="toc76"></A><A NAME="htoc96">B.8.5</A>&#XA0;&#XA0;The <TT>ifthen</TT> Package</H3><P><A NAME="ifthen"></A>
<A NAME="@default172"></A>
The <TT>ifthen</TT> package is partially supported.
The one unsupported construct is the
<CODE>\lengthtest</CODE> test expression, which is
undefined.</P><P>As a consequence, H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A accepts the following example from the
L<sup>A</sup>T<sub>E</sub>X manual:
</P><PRE CLASS="verbatim">\newcounter{ca}\newcounter{cb}%
\newcommand{\printgcd}[2]{%
  \setcounter{ca}{#1}\setcounter{cb}{#2}%
  Gcd(#1,#2) =
  \whiledo{\not\(\value{ca}= \value{cb}\)}%
    {\ifthenelse{\value{ca}&gt;\value{cb}}%
      {\addtocounter{ca}{-\value{cb}}}%
      {\addtocounter{cb}{-\value{ca}}}%
    gcd(\arabic{ca}, \arabic{cb}) = }%
  \arabic{ca}.}%
For example: \printgcd{54}{30}
</PRE><P>For example: Gcd(54,30) =
gcd(24, 30) = gcd(24, 6) = gcd(18, 6) = gcd(12, 6) = gcd(6, 6) = 6.</P><P>Additionally, a few boolean registers are defined by H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A.
Some of them are of interest to users.
</P><DL CLASS="description"><DT CLASS="dt-description">
<TT><B>hevea</B></TT></DT><DD CLASS="dd-description"> Initial value is <TT>true</TT>.
The <TT>hevea.sty</TT> style file also defines this register with
initial value <I>false</I>.
</DD><DT CLASS="dt-description"><TT><B>mmode</B></TT></DT><DD CLASS="dd-description"> This register value reflects H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A operating
mode, it is <I>true</I> in math-mode and <I>false</I> otherwise.
</DD><DT CLASS="dt-description"><TT><B>display</B></TT></DT><DD CLASS="dd-description"> This register value reflects H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A operating
mode, it is <I>true</I> in display-mode and <I>false</I> otherwise.
</DD><DT CLASS="dt-description"><TT><B>footer</B></TT></DT><DD CLASS="dd-description"> Initial value is <TT>true</TT>.
When set false, H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A does not insert its footer &#X201C;<EM>This
document has been translated by H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A</EM>&#X201D;.</DD></DL><P>Finally, note that H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A also recognized &#XE0; la T<sub>E</sub>X conditional
macros (see section&#XA0;<A HREF="manual038.html#texcond">B.16.1.4</A>). Such macros are fully compatible
with the boolean registers of the <TT>ifthen</TT> package, as it is
the case in L<sup>A</sup>T<sub>E</sub>X.</P><HR>
<A HREF="manual029.html"><IMG SRC="previous_motif.gif" ALT="Previous"></A>
<A HREF="manual022.html"><IMG SRC="contents_motif.gif" ALT="Up"></A>
<A HREF="manual031.html"><IMG SRC="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>