28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

470 Appendix D. L AT E X Programming<br />

number. In the second case, the code lines are not numbered, unless the<br />

declaration \CodelineNumbered is also issued.<br />

Since not all comm<strong>and</strong>s in the coding really need <strong>to</strong> be indexed, especially<br />

those that are part of st<strong>and</strong>ard L AT E X <strong>and</strong> T E X, the comm<strong>and</strong><br />

\DoNotIndex{list of comm<strong>and</strong> names}<br />

is given, often repeatedly, near the beginning, <strong>to</strong> exempt the listed comm<strong>and</strong>s<br />

from being indexed.<br />

The au<strong>to</strong>matic indexing of all the comm<strong>and</strong>s in the code slows down<br />

the processing considerably. Once the index.idx file has been produced,<br />

future runs do not need <strong>to</strong> repeat this effort (unless there have been<br />

changes <strong>to</strong> the code). The comm<strong>and</strong><br />

\DisableCrossrefs<br />

will suppress this indexing, but it may be counterm<strong>and</strong>ed by an earlier<br />

\EnableCrossrefs which neutralizes the disabling comm<strong>and</strong>.<br />

The text of the index is generated from the .idx data file by the<br />

MakeIndex program (Section 9.4.3), which must be run with the special<br />

indexing style gind.ist as<br />

makeindex -s gind.ist filename<br />

The indexing style file gind.ist can be extracted from doc.dtx.<br />

To print the index, the comm<strong>and</strong><br />

\PrintIndex<br />

is placed where it should appear. Often this is part of the final text in<br />

\S<strong>to</strong>pEventually. An up-<strong>to</strong>-date index can only appear after MakeIndex<br />

has been run between two L AT E X processings.<br />

A record of changes <strong>to</strong> the software can be made by inserting<br />

\changes{version}{date}{text}<br />

throughout the documentation, in both the description <strong>and</strong> coding parts.<br />

To form the change his<strong>to</strong>ry list, the comm<strong>and</strong><br />

\RecordChanges<br />

must be placed in the preamble. This enables the change entries <strong>to</strong> be<br />

placed in a glossary file, which is then processed by MakeIndex as<br />

makeindex -s gglo.ist -o filename.gls filename.glo<br />

(The indexing style file gglo.ist is also extracted from doc.dtx.) The<br />

change his<strong>to</strong>ry is then printed in the documentation where<br />

\PrintChanges<br />

is located, again often as part of final text. The texts of the \changes<br />

comm<strong>and</strong>s are ordered, first by version number, then by the name of the<br />

macro or environment in which they appear.

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

Saved successfully!

Ooh no, something went wrong!