12.07.2015 Views

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

E. LATEX AND TEX• Within the document environment there may be macros that write information tothe aux file, such as the sectioning or captioning commands. However, these macroswill not write their information if \nofiles has been specified.• At the end of the document environment the contents of the aux file are read.Under normal circumstances new output files are produced each time La<strong>TeX</strong> is run, butwhen \nofiles is specified only the dvi and log files will be new — any other files areunchanged.In the case of the sectioning commands these write macros into the aux file that in turnwrite information into a toc file, and the \tableofcontents command reads the toc filewhich contains the information for the Table of Contents. To make this a bit more concrete,as La<strong>TeX</strong> processes a new document through the first two runs, the following events occur.1. Initially there is neither an aux nor a toc file. At the start of the document environmenta new empty aux file is created.2. During the first run the \tableofcontents typesets the Contents heading and createsa new empty toc file.During the run sectional commands write information into the new aux file. At theend of the document environment the aux file is read. Contents information in theaux file is written to the toc file. Lastly all the output files are closed.3. For the second run the aux file from the previous run is read at the start of thedocument environment; no information can be written to a toc file because the tocfile is only made available by the \tableofcontents command. <strong>The</strong> aux file fromthe previous run is closed and the new one for this run is created.This time the \tableofcontents reads toc file that was created during the previousrun which contains the typesetting instructions for the contents, and then startsa new toc file.And so the process repeats itself.<strong>The</strong> aux file mechanism means that, except for the simplest of documents, La<strong>TeX</strong> has tobe run at least twice in order to have all the information to hand for typesetting. If sectionsare added or deleted, two runs are necessary afterwards to ensure that everything is upto date. Sometimes three, or even more, runs are necessary to guarantee that things aresettled.E.3 SYNTAX<strong>The</strong> La<strong>TeX</strong> syntax that you normally see is pretty regular. Mandatory arguments are enclosedin curly braces and optional arguments are enclosed in square brackets. One exceptionto this rule is in the picture environment where coordinate and direction pairs areenclosed in parentheses.<strong>The</strong> <strong>TeX</strong> syntax is not regular in the above sense. For example, if in La<strong>TeX</strong> you said\newcommand*{\cmd}[2]{#1 is no. #2 of}\cmd{M}{13} the alphabet. % prints: M is no. 13 of the alphabet432

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!