| Document Templates for TeX and LaTeX |
| Courtesy: Nitin | |
|
To make a document with TeX or LaTeX, you generally use your favorite text editor to write an input file containing the text with the appropriate markup. Then, you process this TeX or LaTeX input file to create an output file in the DVI format, which you can then preview, convert or print.
What an input file looks like For presenting a programming language, it's an old tradition among programmers to give a simple program that just outputs the text "Hello, world" to the screen; such a program is usually just detailed enough to give those unfamiliar with the language a feel for its basic syntax. We can do the same with document processing languages like TeX and LaTeX. Here's the "Hello, world" for a TeX document: Hello, world \end If you processed this file with tex, it would output a DVI file that displayed the text "Hello, world" in the default font on the default page, with default margins. Here's the LaTeX equivalent: \documentclass{article} \begin{document} Hello, world. \end{document} Even though the TeX example is simpler, LaTeX is generally easier to use for making structured documents, while TeX is better for more experimental layouts or specialized documents. Using the templates To write a document with a template, insert the contents of the template file into a new file that has a .tex or .ltx extension, and edit that. (Use your favorite text editor.) To make sure that you don't accidentally overwrite the actual template files, you can make them read only, like this: $ chmod a-w template-file-names RET The bracketed, uppercase text in the templates explains what belongs there; fill in these lines with your own text, and delete the ones you don't need. Then, process your file with either the latex or tex command as discussed last week, and you've got a typeset document! LaTeX templates Use the latex command to process these templates. * A letter or other correspondence (letter.ltx) * An article, research or term paper (article.ltx) * A book manuscript (manuscript.ltx) This template requires that you have the LaTeX style file called "manuscript.sty", which most TeX distributions have installed at /usr/share/texmf/tex/latex/misc/manuscript.sty. TeX templates Use the tex command to process the these templates. * A cover sheet for sending fax messages (fax.tex) * A No. 10 mailing envelope (envelope.tex) * A single mailing label for printing on standard 15-up sheets (label.tex) (There is a more advanced LaTeX style for printing many different kinds of shipping and package labels; it's normally installed at /usr/share/texmf/tex/latex/labels/). More templates Here are some more complex template packages on the net that you might want to look at: * Rob Rutten has assembled a very nice collection of LaTeX templates, which are available at http://www.astro.uu.nl/~rutten/rrtex/templates/. * The TeX Catalogue Online contains the largest listing of LaTeX and TeX templates and style files. * Midnight Macros, a collection of TeX macros for printing booklets, bulk letters, outlines, etc. * LaTeX templates for folder and register labels. |
| < Prev | Next > |
|---|




