The easiest way to get started is to download our example files and then follow the directions on how to work with an existing LaTeX file. You should be able to examine and edit the file in any word processor. You should view the file and save it as a regular text file.
The basic structure of a file is given below. Here we assume that we have a file called "silly.tex" given by the following:
\documentclass[12pt]{article}
% Anything following a % is a comment
% This part of the document is called the "preamble"
% There are certain commands that can only appear here.
\begin{document}
% This is where the printed document is.
Brilliant observations appear hear. [sic]
\end{document}
The file can now be converted into something viewable. The way to do this varies from system to system. If you use Windows or Mac OSX then you will most likely use a "front-end" which looks like an editor. If you use a unix like system then you simply use the "latex" command:
% latex sillyThe program looks for a file called silly.tex and creates several new files. One of the files, "silly.dvi," is the file that can be converted into a printable document.
You can then view this file using "xdvi":
% xdvi silly&The program looks for a file called "silly.dvi" and displays it on the screen. See the other sections in this documents for more information.
\documentclass[12pt]{article}
% Anything following a % is a comment
% This part of the document is called the "preamble"
% There are certain commands that can only appear here.
\begin{document}
% This is where the printed document is.
Brilliant observations appear hear. [sic]
The observations are not only brilliant, but they are clear and
concise. We cannot help but be astounded by there astuteness.
\end{document}
\textit{}
\textbf{}
The command, \textit for example, tells LaTeX that the text should take on the indicated property. You must then specify which text should be changed. To do this, place the text that you want to change within the braces. An example is given below.
\documentclass[12pt]{article}
% Anything following a % is a comment
% This part of the document is called the "preamble"
% There are certain commands that can only appear here.
\begin{document}
% This is where the printed document is.
Brilliant observations \textit{appear hear}. [sic]
The observations are not only brilliant, but they are \textbf{clear and
concise}. We cannot help but be astounded by there astuteness.
\end{document}
You can use this to create a title page for your work. In this title page you will need the title, the author, the date, and an abstract. The first three items, the title, author, and date will need to be centered on the page. These items will be placed within a center environment. We will need to tell LaTeX where to break the lines, though. This is done using "\\" where we want to break the lines. We will specify the date using the \today command.
\begin{center}
The Title of This Work \\
Stuart Dent \\
\today
\end{center}
We will want this centered on the page which can be done by filling in white space above and below the title using the command to insert vertical space:
\vfill
Finally, we will need to add the abstract. This is done using the abstract environment:
\begin{abstract}
This is a brief overview of my work. I worked really hard on my
work. In fact I am quite proud of the work that I worked on. It was
hard work to produce this kind of work.
\end{abstract}
When this is all put together our new document looks like the following:
\documentclass[12pt]{article}
% Anything following a % is a comment
% This part of the document is called the "preamble"
% There are certain commands that can only appear here.
\begin{document}
% This is where the printed document is.
\vfill
\begin{center}
The Title of This Work \\
Stuart Dent \\
\today
\end{center}
\vfill
\begin{abstract}
This is a brief overview of my work. I worked really hard on my
work. In fact I am quite proud of the work that I worked on. It was
hard work to produce this kind of work.
\end{abstract}
\vfill
\clearpage
Brilliant observations \textit{appear hear}. [sic]
The observations are not only brilliant, but they are \textbf{clear and
concise}. We cannot help but be astounded by there astuteness.
\end{document}
Note that we added a new command \clearpage. This command tells LaTeX to start a new page for everything that follows.
In a long document you will want to break your text into separate sections. This makes it much easier for people to read the work and is an effective way to deal with substantial transitions. There are several commands to do this. The basic idea is that an article is divided up into sections, subsections, subsubsections. The commands to do this are the following:
\section{}
\subsection{}
\subsubsection{}
\subsubsubsection{}
The argument that is given to each of the sectioning commands is the title of the section. We now add a number of sections to our growing example:
\documentclass[12pt]{article}
% Anything following a % is a comment
% This part of the document is called the "preamble"
% There are certain commands that can only appear here.
\begin{document}
% This is where the printed document is.
\vfill
\begin{center}
The Title of This Work \\
Stuart Dent \\
\today
\end{center}
\vfill
\begin{abstract}
This is a brief overview of my work. I worked really hard on my
work. In fact I am quite proud of the work that I worked on. It was
hard work to produce this kind of work.
\end{abstract}
\vfill
\clearpage
\tableofcontents
\clearpage
\section{Introduction}
Brilliant observations \textit{appear hear}. [sic]
\section{The Work}
The observations are not only brilliant, but they are \textbf{clear and
concise}. We cannot help but be astounded by there astuteness.
And there is yet other stuff ya know.
\subsection{First Stuff}
Cause I could have done this.
\subsection{Second Stuff}
But this was also neat.
\subsubsection{Problems}
It was not all sweetness and light.
\subsubsection{Goodness}
But it all worked out in the end.
\section{Conclusions}
I done did what I did what I did and I like it\footnote{ZZ Top}.
\end{document}
Note that a new command was introduced here, \tableofcontents. This command automatically generates a table of contents based on the sections that you have defined.
There are many ways to create an equation. Here we look at only one of the ways to do this using the eqnarray environment. The text of your equations is set apart from the rest of the text:
\begin{eqnarray}
y & = & mx + b.
\end{eqnarray}
It is a special environment that allows you to line up your equations. We can extend the example above to add another line. All of the text between the ampersands will be automatically lined up. The way to tell LaTeX to start a new line is using the characters \\.
\begin{eqnarray}
y & = & mx + b. \\
c^{2} & = & a^{2} + b^{2}.
\end{eqnarray}
When the equations are printed out the equal signs will be neatly lined up. Note that we added a new command. The up caret is used to denote superscripts. We can now add new equations to our example.
\documentclass[12pt]{article}
% Anything following a % is a comment
% This part of the document is called the "preamble"
% There are certain commands that can only appear here.
\begin{document}
% This is where the printed document is.
\vfill
\begin{center}
The Title of This Work \\
Stuart Dent \\
\today
\end{center}
\vfill
\begin{abstract}
This is a brief overview of my work. I worked really hard on my
work. In fact I am quite proud of the work that I worked on. It was
hard work to produce this kind of work.
\end{abstract}
\vfill
\clearpage
\tableofcontents
\clearpage
\section{Introduction}
Brilliant observations \textit{appear hear}. [sic]
\section{The Work}
The observations are not only brilliant, but they are \textbf{clear and
concise}. We cannot help but be astounded by there astuteness.
And there is yet other stuff ya know.
\subsection{First Stuff}
Cause I could have done this.
\subsection{Second Stuff}
But this was also neat.
\subsubsection{Problems}
It was not all sweetness and light,
\begin{eqnarray}
y & = & mx + b, \\
c^{2} & = & a^{2} + b^{2}.
\end{eqnarray}
\subsubsection{Goodness}
But it all worked out in the end to give us
\begin{eqnarray}
\int^{\infty}_{-\infty} e^{-x^2} ~ dx & = & \sqrt{\pi}.
\end{eqnarray}
\section{Conclusions}
I done did what I did what I did and I like it\footnote{ZZ Top}.
And by the way we do not understand why people are so focused on
\begin{eqnarray}
\frac{1}{\sqrt{2}} & = & \frac{\sqrt{2}}{2}.
\end{eqnarray}
\end{document}
Note that we added a few extra commands in the last two equations. We will leave it as an exercise for you to figure out what each new command does.
A number of example files are available. Each one focuses on a particular example:
One of the most commone LaTeX systems for the Macintosh is OzTeX. Another way to use LaTeX on Mac OSX is using i-Installer. Both systems are under active development. Please check their webpages for more information and installation instructions. Because of the system changes we do not include information about them here because it will rapidly be out of date.
A number of editors and "front-ends" is given on the
One system for using LaTeX on a Windows PC is called mikTeX. It is a system that is relatively easy to install, but it is under constant development. Rather than try to include some information that will be out of date very soon we instead provide a link to mikTeX. Please see their documentation on how to use and install the package.
There are many LaTeX editors available. One of the free editors is WinShell. Another popular editor, WinEDT, is available at a fixed cost.
Note that there is also a new LaTeX system for windows called protext. We have not used it and cannot provide any other information other than that it exists and appears to be under active development.
Here we assume that you are using a unix system. If you are using Windows or a Mac computer then the steps you need to take will be different, and they will depend on the editor and LaTeX system that you are using. The overview below, though, will help in giving you an idea of the steps that you need to take to convert a LaTeX document into a hard copy.
When you create a LaTeX file you can use any editor that you prefer. Once you have created and saved the file it is time to use LaTeX to typeset your document. For now we will assume that you created a file and called it document.tex. You can typeset the file using the latex command,
%latex documentYou may have to edit the document several times to get it right. If LaTeX finds something it doesn't like it will stop and ask directions. Just type 'q' to quit and go to the line number it gives you to see what went wrong. Sometimes the error occured before the line number and LaTeX couldn't figure out what happened.
You may have had some of your references change and you may have to use latex a second time. The second time through will clear things up. This is a bit akward, but it is a necessary step to make sure that any references or citations are correct.
The program used to view a file is called "xdvi." To view a file call xdvi with the filename:
% xdvi filenameA viewer will appear on your screen which will show the current latex'ed version of the file.
The xdvi program will assume that the extension is .dvi so you do not have to provide it. A new window will appear on your machine and you can step through the document using the space key. The b key will let you back-up through the document. Other keys allow you to do different things. See the manual pages for xdvi to get a full explanation,
% man xdvi
Important keys include the following:
Once you have a document that LaTeX can typeset you are ready to print. Before printing make sure you run the document through LaTeX a second time.
You print the file by using dvips,
% dvips -t letter documentThis will take the dvi file, convert it into postscript, and then send it to the default printer. You need to add the "-t letter" option to make sure that the formater uses an 8.5" by 11" paper size. There are times when you want to convert the file into a postscript file rather than print it. For example, if you want to send your paper via email you likely want to just send the postscript file.
The command to convert a file to postscript is
%dvips -t letter document -oThis will create the new file document.ps (on some systems it creates texfile.ps so be careful!). You can print this file using the "lpr" command.
