LaTeX for the Slightly Timid
I admit it. LaTeX was not my first choice for a text formatter. I was pressured into using LaTeX by my (then) fiancé, and the fact that at the end of the semester, all the IBM PCs and the Macs were being used 24 hours a day, while the Unix terminals were almost totally free. Also, I had to reboot from Linux into DOS every time I wanted to use one of my favorite word processing programs on my fiancé's computer, which was no fun. So, armed with a topology assignment I wanted to type, I started to learn LaTeX.
Even after the first week or so of using LaTeX, it was not my favorite program. It wasn't a word processor or an editor—it was something new to me. I didn't see the italics or the underlining or my math equations on the screen as I entered or edited my papers. After a while, though, I got used to the rules, and my papers looked so beautiful that I fell in love with LaTeX. I am not a LaTeX or TeX (LaTeX is based on TeX) guru—it is all I can do to remember how to start a document. But the freedom and power of LaTeX make it well worth the initial time investment to learn it, and if you are doing ordinary everyday writing, LaTeX is not terribly difficult to use.
There are a few major differences between LaTeX and your favorite word processor. It is not WYSIWYG (what you see is what you get) or WYSLRN (what you see looks really neat—bold is bold, italic is italic, but new lines and page breaks aren't necessarily where they will be when the document is printed). With LaTeX, what you see is what LaTeX sees, and you type in the exact commands that you want LaTeX to use. This means that WYSLRU (what you see looks really ugly) while you are entering your text. [There are so-called front ends to LaTeX that are almost WYSIWYG. Linux Journal will probably contain articles on those in later issues, because they can make it much easier for you to use LaTeX—ED] However, because what you see is exactly what LaTeX sees, if something in your document output doesn't look right, you can perhaps find it and fix it more easily than you could with a word processor.
Another difference is that when it comes to formatting decisions, LaTeX will handle the details if you handle the general idea. For example, if you want your footnotes labeled with letters instead of numbers, or the numbering of footnotes to begin at 1 on every page, or some other labeling scheme, you need only instruct LaTeX once at the beginning of your document. If you change your mind, you don't need to change all your footnotes—just change the instructions at the beginning, and LaTeX will handle the rest.
The last difference is that there is no standard user interface for LaTeX; you can use whatever text editor you want. I use Emacs, but any Emacs clone, or vi or another editor which uses plain text, will work. Because you can use any editor, starting an article or paper is a little more complex than in a word processor. You need to tell LaTeX the type of document you are creating, normally a “book”, “article”, “report”, or “letter”. Any book on LaTeX will explain the specific differences between the document types; their names should give a good idea of what they are for.
Having told LaTeX which type of document you are doing, it figures out the page formatting and the special options needed throughout the document. I will use the “letter” document style to demonstrate the basics of typing documents in LaTeX, as well as the power of LaTeX to make documents easy to format and beautiful.
To begin any document, after starting your editor you need to place a preamble at the start of the file, of the form:
documentstyle[...]{...}
A few things need to be noted about this preamble. First, the backslash. LaTeX uses the backslash before most commands, so you should get familiar with its location on your keyboard. The brackets contain options that change something less drastic than the document style. For instance, you can change the type size from 10 point to 11 or 12 point, set the entire document in two columns, or use other more advanced options. The braces hold the name of the document type: usually article or letter. The braces and their contents are required.
Since we are writing a letter, we will start out with:
documentstyle{letter}
All documents need \begin{document} at the beginning (preceded, of course, by the documentstyle command and, often, by other more advanced commands) and end{document} at the end.
Letters are unique among the styles. You may want to write several letters in the same file, reusing the same return address and signature. LaTeX allows you to do this by stating the address and signature before the \begin{document} statement. Then, each letter is begun with \begin{letter} and ended with end{letter}. After all your letters, put end{document} to end the document.
The format of the address and signature commands are similar and something you will become very familiar with in LaTeX. Type the command, followed by the argument (for these commands, your address and your name and title) in braces:
address{Linux Journal\\P.O. Box 85867\\
Seattle, WA 98145—1867}
signature{Kim Johnson\\Chief Bottle Washer}
Notice the double backslashes; these are added to force a new line—simply pressing return will not work, as I explain later.
Now, begin your first letter:
\begin{document}
\begin{letter}{Aunt Jane\\
St. Mary Mead\\England}
The argument in the second set of braces is the address of the recipient of the letter. Note the recurring double backslashes and the tendency to put arguments in braces to set them apart. You may want to add an end{letter} at this point and then type the rest of the letter between the \begin and end—it saves a lot of time debugging later.
The other options are mostly self-explanatory from the example letter.
opening{Dearest Aunt Jane,}
This is a very short letter.
closing{With love,}
cc{Hercule Poirot\\Tuppence}
encl
ps{P.S. This is a postscript.}
end{letter}
end{document}
Your name is added underneath the closing of the letter from the signature command that was used before the \begin{letter}, as shown in Figure 1.

Figure 1. Output from LaTeX
It would be possible to arrange this letter on the page “by hand” on most word processors, and even on LaTeX, but the point is LaTeX does the formatting and you do the writing. The other document styles do not format quite so aggressively, but they do allow you to add your title and dedications without having to worry about getting everything centered and on the correct page.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




1 hour 52 min ago
3 hours 45 min ago
10 hours 39 min ago
10 hours 55 min ago
12 hours 47 min ago
18 hours 38 min ago
23 hours 10 min ago
23 hours 11 min ago
1 day 1 hour ago
1 day 9 hours ago