About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account
Smile for the Camera: a new cybercrime short story ebook.


3. From Source Code to Typeset Output

Every time you want to create or edit a LaTeX document, there are three basic steps you will always need to follow:

  1. Write or edit the source code.

  2. Pass the source code to the latex or pdflatex application (“LaTeX the document”).

    • If there are any error messages, return to Step 1.
    • If there are no error messages, a PDF file is created.

  3. View the PDF file to check the result. If you need to modify your document, go back to Step 1.

You will therefore need:

  1. A text editor (to perform Step 1). For example Vim, Emacs or Gedit.

  2. The TeX software[(La)TeX for different machines] (to perform Step 2). If you don't already have TeX on your machine, you will need to install it. The most convenient way to do this is to install from the TeX Collection DVD ROM, which is distributed to all TeX User Group (TUG) members, but you can also download and install free TeX distributions, such as TeX Live, MiKTeX or MacTeX, from the Internet (see below). There is also proTeXt, an enhancement of MiKTeX that aims to be an easy-to-install TeX Distribution. For more information including up-to-date links, go to http://www.ctan.org/starter.html.

  3. A PDF viewer (to perform Step 3). For example Adobe Reader, Sumatra, Evince or Okular.

This can be rather complicated for a beginner, especially for those with no experience writing computer code. Fortunately, there are some all-in-one applications (often called a front-end) that provide a text editor (for Step 1), buttons or menu items to run the latex or pdflatex command-line application (for Step 2) and, in some cases, a viewer to perform Step 3.

The next section describes one such front-end called TeXWorks. I have chosen to describe TeXWorks because it is a free, cross-platform application. Binaries are available for Microsoft Windows, Mac OS X and GNU/Linux. The screen shots of TeXWorks in this book were taken from the Linux version running under Fedora. If you run TeXWorks on other operating systems, it may have a slightly different look, but it has the same functionality.

New versions of TeX Live and MiKTeX include TeXWorks for MS Windows, and new versions of MacTeX include TeXWorks for Mac OS X users. GNU/Linux users can use their Add/Remove Software utility to install TeXWorks. Alternatively, you can download TeXWorks by following the links provided at http://www.tug.org/texworks/.

If you're confused by all the options, let's keep things as simple as possible:

If you run into problems, there are mailing lists at http://tug.org/mailman/listinfo/tex-live and http://docs.miktex.org/manual/lists.html for TeX Live and MiKTeX, and MacTeX help at http://www.tug.org/mactex/help/. There is also a list of places where you can ask for help in Appendix C. Need More Help?.


This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs