Eric Partlo edited Chapter_4_SpecialitiesWhen_putting_together__.html  over 8 years ago

Commit id: 0ebe9f12a00107e6634975b6843019009982d316

deletions | additions      

       

Chapter 4 - Specialities
When putting together a large document, LaTeX will help with some special features like index generation, bibliography management, and other things.  A much more complete description of specialities and enhancements possible with LaTeX can be found in the LaTeX Manual and The LaTeX Companion.
Leslie Lamport. L A TEX: A Document Preparation System. Addison-
Wesley, Reading, Massachusetts, second edition, 1994, ISBN 0-201-
52983-1.

Frank Mittelbach, Michel Goossens, Johannes Braams, David Carlisle,
Chris Rowley. The L A TEX Companion, (2nd Edition). Addison-Wesley,
Reading, Massachusetts, 2004, ISBN 0-201-36299-6.

4.1 Including Encapsulated PostScript
LaTeX provides the basic facilities to work with floating bodies, such as images or graphics, with the figure and table environments.  There are several ways to generate the actual graphics with basic LaTeX or LaTeX extension package.  A much easier way to get graphics into a document is to generate them with a specialised software package and then include the finished graphics in the document.  LaTeX packages offer many ways to do this through Encapsulated PostScript (EPS) graphics, because it is quite easy to do and widely used.  

When working on a system with a PostScript printer available for output and with the graphicx package installed, use the following step by step guide to include a picture into your document:
  1. Export the picture from your graphics program to EPS format
  2. Load the graphicx package in the preamble of the input file with \usepackage[driver]{graphicx} where driver is the name of your "dvi to PostScript" converter program
  3. \includegraphics[key=value,...]{file} The optional parameter accepts a comma separated list of keys and associated values.  The keys can be used to alter the width, height, and rotation of the included graphic.  

4.2 Bibliography
Produce a bibliography with the thebibliography environment.  Each entry starts with \bibitem[label]{marker}
The marker is then used to cite the book, article or paper within the document. \cite{marker}

For larger projects, you might want to check out the BibTeX program.  BibTeX is included with most TeX distributions.  It allows you to maintain a bibliographic database and then extract the references relevant to things you cited in your paper.  

4.3 Indexing
A very useful feature of many books is their index.  With LaTeX and the support program makeindex, an index can be generated quite easily.  

To enable their indexing feature of LaTeX, the makeidx package must be loaded in the preamble with \usepackage{makeidx} and the special indexing commands must be enabled by putting the \makeindex command in the preamble.  The content of the index is specified with \index{key@formatted_entry}

When the input file is processed with LaTeX, each \index command writes an appropriate index entry, together with the current page number, to a special file.  The file has the same name as the LaTeX input file, but a different extension (.dix).  This .idx file can then be processed with the makeindex program: makeindex filename

The makeindex program generates a sorted index with the same base file name, but this time with the extension .ind.

4.2 Fancy Headers
The tricky problem when customising headers and footers is to get things like running section and chapter names in there.  LaTeX accomplishes this with a two-stage approach.  In the header and footer definition, you use the commands \rightmark and \leftmark to represent the current section and chapter heading, respectively.  The values of these two commands are overwritten whenever a chapter or section command is processed.  

4.5 The Verbatim Package
The verbatim package is basically a re-implementation of the verbatim environment that works around some of the limitations of the original verbatim environment.  The verbatim package provides the \verbatiminput{filename} command, which allows you to include raw ASCII text into your document as if it were inside a verbatim environment.

4.6 Installing Extra Packages

 Packages
Most LaTeX installations come with a large set of pre-installed style packages, but many more are available on the net.  The main place to look for style packages on the Internet is CTAN http://www.ctan.org  Packages such as geometry, hyphenate, and many others are typically made up of two files: a file with the extension .ins and another with the extension .dtx

Once you have copied the package files onto your machine, you still have to process them in a way that:
  1. tells your TeX distribution about the new style package
    1. Run LaTeX on the .ins file, this will extract a .sty file
    2. Move the .sty file to a place where your distribution can find it
    3. Refresh your distribution's file-name database.  The command depends on the LaTeX distribution you use: texlive - texhash, maktexlsr, initexmf --update-fndb
  2. gives you the documentation
    1. Run LaTeX on the .dtx file.  This will generate a .dvi file
    2. Check to see if LaTeX has produced a .idx file among the various files you now have
    3. In order to generate the index, type the following: makeindex -s gind.ist [name] (where name stands for the main-file name without any extension)
    4. Run LaTeX on the .dtx file
    5. Last but not least, make a .ps or .pdf file to increase your reading pleasure

4.7 Working with pdfLaTeX