★ wanayoo — archive 1999 http://oreilly.linux.com/pub/a/170Nouvelle recherche | Portail wanayoo


O'Reilly NetworkO'Reilly.comlinux.com spacer
Search To FeaturesTo MeerkatFAQsForumsAll ArticlesFree Newsletter
Linux DevCenter Linux FAQsLinux ForumsLinux Articles
spacer
O'Reilly Network: Linux DevCenter
Linux.com
TOPICS

Game Development
Administration
Browsers
Certification
Desktop
Device Drivers
Firewalls
Getting Started
Kernel
Multimedia
Networking
Programming
Security
X Window System


Articles
Go to distributions. Linux Distributions
Go to Linux Professional Linux Professional
Go to Living Linux. Living Linux
Go to Linux in the Enterprise In the Enterprise
Go to Linux Network Administration Network Admin
Go to interviews. Interviews
Go to tutorials. Tutorials
Go to Power Tools. Linux Power Tools


Print this article


spacer spacer spacer

Sponsored by:

Living Linux

Document Templates for TeX and LaTeX

04/21/2000

Last week I showed how to process TeX and LaTeX input files. Now that you're familiar with how to print and preview these files, we can start making input files using these simple, boilerplate templates.

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!

Continue to the next page for the templates.

Pages: 1, 2

Next Pagearrow

spacer
Contact UsMedia KitPrivacy PolicyPress NewsJobs @ O'Reilly Network
Copyright © 2000 O'Reilly and Associates, Inc. All Rights Reserved.
All trademarks and registered trademarks appearing on the O'Reilly Network are the property of their respective owners.