Advertisment

Typesetting Technical Documents With LaTeX

LaTeX, pronounced as “Lay-tech”, is a package used to lay out technical documents for print

author-image
PCQ Bureau
New Update
imageslkk

-Ishita Kathuria (Dept of CSE, MSIT, New Delhi) & Sumit Goswami (Dte of MIST, DRDO, New Delhi)

Advertisment

LaTeX, pronounced as “Lay-tech”, is a package used to lay out technical documents for print. It uses TeX formatter as a typesetting engine, which was released in 1982 by D. Knuth. Subsequently, LaTeX was developed by Leslie Lamport in 1985. Unlike word processing software, where the author is required to decide the layout design, the font styles to choose, and so on, LaTeX works on a pre-defined format, and so authors are at liberty to focus on content. It comes in different flavors for different OSes---for UNIX/Linux download teTeX and TeX Live, for Mac OS use MaCTeX which supports TeX, LaTeX, AMSTeX, ConTeXt, XeTeX and for Windows download MiKTeX.

SnapshotApplies to: Researchers, tech writers, publishers

Price: Free

USP: Learn about a useful document preparation package that makes creation of technical documents simpler and elegant

Related articles/Reference: http://www.latex-project.org/guides/)

Search engine keywords: LaTeX, TeX, technical text processing and typesetting

The following steps are required to create and run a file in LaTeX:

Advertisment

* Download and install any popular TeX distribution like MiKTex or TeX Live.

* Open a text editor, such as Notepad and write contents with the help of LaTeX commands. Save the file with .tex extension. (eg: file.tex).

* Now in the command line, type latex file.tex. A DVI file is obtained which can be seen with the help of DVI Viewer.

Advertisment

* If the user intends to obtain a post script file then type dvipdfm file.dvi in the command line. If there are no errors and the file compiles successfully, then file.ps is formed. To view this post script file, download GSView.

* If a PDF file is required, then dvipdfm test.dvi should be typed on the command line. This command converts the DVI file to PDF file---file.pdf.

LaTeX commands

Advertisment

LaTeX commands are case sensitive. They start with a backslash and are terminated by a space, a number or any other 'non-letter.' If a command requires a parameter then that should be given within curly braces { } after the command name while commands that support optional parameters are added after the command name in square brackets < >.

File structure

The input file in LaTeX starts with documentclass{class} which specifies the type of document we intend to write. Here a class can be article (for writing articles), proc (used for proceedings based on articles), minimal (facilitates the diagnostic process and helps in debugging), reports (for generation of reports), books (creation of chapters) or slides and options parameter, which customizes the behavior of the document class. The 11 pt argument is optional, whereas the article class name is mandatory.

Advertisment

Packages are used to enhance capabilities of LaTeX to include graphics or colored texts where LaTeX alone can't solve the problem or give the desired effects. The common packages used are doc, exscale, fontenc, ifthen, laytexsym, makeidx, syntonly and inputenc. To use the existing package already stored in LaTeX, the command usepackage{package...name} is used. Some packages have additional specifications which can be provided in square brackets.

You begin the body of the document with begin{document}and after writing the entire text with general commands required to style the document, the document is ended with end{document}. Other important features are listed below.

Advertisment

Spaces: Whitespace characters like blank or tab, are treated uniformly as space by LaTeX. If there is more than one consecutive whitespace character then it is treated as one whitespace character. Space at the start of a line is generally ignored. An empty line starts a new paragraph. Several empty lines are treated equivalent to one empty line.

Special Characters: Special Characters such as &, _, { }, ~#, $, %, ^, and will not be printed if used directly into the text. These characters can be used in the documents by adding a prefix backslash like #, $, %, ^ {}, &, _, {, }, ~ {}.

Comments: % is used to convert a line to a comment. Whenever % is encountered, the rest of the line is ignored and treated as a comment.

Advertisment

Sections: The document can be divided into sections, sub-sections or sub-sub-sections by section {Section Title}, subsection{Title}, subsubsection{Title} commands. As shown in Fig 2 various levels of sections are created.

Font Styles: Various kinds of font styles can be tiny scriptsize, footnotesize, small, textbf, textit, large, Large, LARGE, huge and Huge. Fig 3 displays bold and italics font style. It also shows that bullets or numbering can be done in LaTeX with item command.

Page Styles: pagestyle{style} command is used to set the style of the page with a few combinations of header and footer. The default page style is plain which prints the page number in the middle of the footer. Heading prints the current chapter heading and page number on each page leaving the footer empty. In the empty style both the header and footer are empty.

Mathematical text: Mathematical text which can't be printed on a word processor can easily be used in LaTeX using math which is obtained by a paragraph started with begin{displaymath} and ended byend{displaymath}.

Tables: To create column command begin{tabular}{|...|...|} followed by end{tabular} and option like l for left justified, r for right justified and c for central text is used. While entering data into the row '&' is used to differentiate between columns and \ specifies the end of line. Lines are created by using hline command.< /p>

Index and list of figures: Contents are created by simply adding the command tableofcontents in the document where Table of Contents is required. Similarly, list of figures can be generated by using the command listoffigures. This command will capture the line number, figure number and the caption of each figure and display it on the list.

Bibliography: Bibliography is created with each entry bibitem

Conclusion

LaTeX is a package having a structured layout where a user need not worry about designing the document or creating index, list of tables, references or bibliography, as these can be generated easily with the help of simple commands. A new layout creation may take time but templates can be useful in such a case. Also free add-on packages for various typographical tasks are available. Mathematical formulae are also supported in a user-friendly manner. LaTeX is a free and portable software as its file is a text file that should run on almost any hardware platform available. And even though LaTeX makes important typesetting decisions for the user, one can have total control on the layout. Unlike a word processor, where formatting images and pictures is a heavy task, LaTeX positions them with a lot more sense. In LaTeX, large documents having several pages can be broken down into chunks like chapters and combined to form the entire document. The best part of LaTeX is that one gets an extremely mature typesetting system free of cost.

latex documents
Advertisment