Category Archives: Getting Started

LaTeX Training Course in Cambridge

The UK TeX Users Group is organising another introductory LaTeX course on April 15th, 2011 in Cambridge.

Using LaTeX to Write a Thesis

This course is aimed at beginners and will cover a range of topics connected with writing a dissertation in LaTeX, including:

  • Installing LaTeX for the first time
  • Creating a document
  • Document structure
  • Graphics
  • Managing a bibliography with BibTeX

Registration

The course only costs £10, so I imagine places will be taken very quickly.

To register, e-mail Joseph Wright <joseph.wright@morningstar2.co.uk> and include:

  • Your completed UK-TUG membership form as an attachment (a year’s membership is included in the course fee)
  • Details of your LaTeX experience (if any), including which operating system you use
  • What your general subject area is (to help plan the course content)

Useful Links

Full details of the course and more information about booking conditions are posted here: http://uk.tug.org/2011/03/12/latex-training-course-15th-april-2011-cambridge/

LaTeX Training Course at Oxford University

For those of you who missed the UK TeX Users Group and University of East Anglia course back in July, there’s another LaTeX training session happening at Oxford this October.

An Introduction to LaTeX

The Department for Continuing Education at Oxford University is organising a full-day course on October 16th.

It is aimed at beginners and will cover creating documents (including letters), graphics and bibliography.

Registration

The course costs £50 and enrolment is either online or by downloading an application form – both available on the course webpage:

http://www.conted.ox.ac.uk/courses/details.php?id=O10P133MAJ

LaTeX Training Course – Update

I’ve just discovered that the LaTeX course organised by the UK TeX Users Group and the University of East Anglia is now fully booked.

There’s clearly a need for introductory courses like these!

Future Courses

It sounds like the UK TeX Users Group will repeat this course later in the year if there’s sufficient demand. Joseph Wright writes:

We are starting a list of interested people in case anyone drops out, and will be looking at holding another course later in the year if there is the interest. So do consider sending a registration e-mail: the more people we know are interested the more likely it is that another course can be organised.

Who to Contact

As before, please email Joseph Wright <joseph.wright@morningstar2.co.uk> with details of your experience with LaTeX and your academic subject area.

LaTeX Training Course

In London on July 30th the UK TeX Users Group and the University of East Anglia will be running a course on how to use LaTeX to write a thesis.

Course Content

You don’t need to be an expert to take part – the course is aimed at people new to LaTeX. The topics covered include:

  • Creating a document
  • Document structure
  • Graphics
  • Managing a bibliography with BibTeX

Registration

The course only costs £10, so I imagine places will be taken very quickly.

To register, e-mail Joseph Wright <joseph.wright@morningstar2.co.uk> and include:

  • Details of your LaTeX experience (if any)
  • If you’re bringing a laptop  with you to the course
  • What your general subject area is (to help plan the course content)
  • Any special requirements (diet, access, etc.)

Useful Links

Full details of the course (including the programme) are posted here: http://uk.tug.org/2010/06/17/latex-training-course-using-latex-to-write-a-thesis/.

Getting Started: Subdividing a Large Document

It’s easy and convenient to use just one .tex file when writing short documents. But for anything larger than, say, 10,000 words, I tend to divide the document into smaller parts so each chapter is its own .tex file.

For example, you might be writing a thesis that includes three chapters (introduction, results, conclusion) and an appendix. These are called introduction.tex, results.tex, conclusion.tex and appendix.tex.

These four files are like any other .tex file except you omit the preamble (\documentclass, \usepackage, etc.) and the \begin{document} and \end{document} commands. The reason you don’t include these commands is that they are included in your main file, thesis.tex, ensuring that your formatting is consistent throughout the final output document. This also means that page numbers and footnotes will be numbered correctly all the way through.

Which Commands to Use

There are two commands you can use in your main file, thesis.tex, to insert your four chapter files: \include and \input.

The \input command slots each chapter in straight after the one before it without any pagebreaks, while \include works by starting each new chapter on a new page and ends it with a clearpage command. (Thanks to the latex-community forum for help on explaining this to me!)

In other words, ‘natural candidates for \include are whole chapters of a book but not necessarily small fractions of text,’ for which \input would be more appropriate. (Quotation from The LaTeX Companion.)

Your thesis.tex file would therefore look something like this:

\documentclass{article}
\usepackage{semtrans}

\begin{document}

\title{My Thesis}
\author{John E. Smith}
\maketitle
\clearpage

\include{introduction}
\include{results}
\include{conclusion}
\include{appendix}

\end{document}

Note: your four files (introduction.tex, results.tex, conclusion.tex and appendix.tex) must be saved in the same folder as thesis.tex, otherwise it won’t work.

Omitting Files

If you wanted to produce a PDF from the file thesis.tex without the appendix, all you have to do is comment out that particular \include command (you just add a % at the beginning of the line): %\include{appendix}

Useful Links

Getting Started: Creating a Basic LaTeX Document

Step-by-Step Guide

Basic LaTeX Document
Basic LaTeX Document

Here are some easy instructions for creating your first LaTeX document.

1. Opening a New Document

Open TeXnicCenter and click on File > New. This will load a blank document. Select File > Save As and give your file a suitable name. I will use ‘test’.

You’ll see that this file is a .tex file (test.tex). The TEX file is the one you use to write and edit your document.

2. Preamble

Document Class

Before you can start writing, you need to specify exactly what type of document you want to create. This is done in the preamble.

LaTeX supports several different document types, such as article, report, book, beamer, etc. These are called document classes.

All LaTeX commands begin with a backslash ‘\‘ and are followed by special characters or letters. So to specify your type of document, the command is:

\documentclass[options]{class}

See section 1.4 of The Not So Short Introduction to LaTeX for basic information and section 1.6.1 for detailed information about all the options.

Packages

As I’ve mentioned in a previous post, add-on features for the LaTeX system are known as packages. If, for example, you want to use the semtrans package to display special transliteration characters in your document, you need to state that in the preamble.

The general command for specifying the package you want to use is:

\usepackage[options]{package}

Sometimes, there won’t be any options to specify (like with semtrans). You can also include a whole list of packages you want to use in the preamble, but you have to use a new command each time. For example:

\documentclass{report}
\usepackage{babel}
\usepackage{url}

3. Body Text

Now to begin the text you want to write, you start with the command:

\begin{document}

and end with the command:

\end{document}

This \end{document} command should be the very last thing in your document.  Anything that comes after it will be ignored by LaTeX.

4. Example Document

You are now ready to write your first document. Type the following into your test.tex file in TeXnicCenter (I have specified an article of 10pt type on A4 paper):

\documentclass[10pt,a4paper]{article}

\begin{document}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque ut ante pulvinar mauris interdum euismod. Aliquam dui tellus, blandit at, tincidunt ac, feugiat id, nibh.

Phasellus id metus. Aliquam erat volutpat. Donec fringilla. Donec euismod, velit quis adipiscing hendrerit, enim eros tempor mi, a hendrerit ipsum eros eget leo.
\end{document}

Save the document. Note that to start a new paragraph, you just need to leave an empty line in the text.

5. Generating a PDF

LaTeX => PDF
LaTeX => PDF

Step 1: On the toolbar, you’ll see a drop-down option. Select LaTeX => PDF. See the picture on the right.

Step 2: Click on Build > Current File > Build. The shortcut is ctrl+F7 and there is also an icon on the toolbar.

You’ll see the document compiling if you have the output bar open. If not, click on View > Output Bar. If there are any errors in your document, you will see them listed in the output bar.

Step 3: To view your PDF, click on Build > View Output. The shortcut is F5 and there is also an icon on the toolbar.

If you want to combine steps 2 and 3, you can just click on Build > Build and View. The shortcut is ctrl+shift+F5 and there is an icon on the toolbar.

N.B. If you add more text to your document, save it, and want to generate the PDF again, you must close the test.pdf file first. Otherwise it won’t work.

An alternative to using PDFs is viewing your output as a DVI file. To do this, start at step 1 again, but select LaTeX => DVI, then steps 2 and 3 are the same.

The advantage of using a DVI file during the draft stage is that you don’t have to keep closing it before generating a new version again.

test.pdf
test.pdf

Here is the output PDF of the document: test.pdf

6. A Note on File Types

If you now have a look at the folder where you saved test.tex, you’ll see test.pdf there as well.

But there are a whole lot of other files too, such as:

test.aux
test.bbl
test.blg
test.log

Just ignore these.

If you want to edit your text, click on the TEX file, test.tex. If you want to re-open the PDF or DVI files, click on test.pdf or test.dvi.

Useful Links

Getting Started: Finding a LaTeX Editor

This is the program you will use to write your LaTeX files and to generate a final PDF output. The reasons for using an editor include:

  • it helps manage the file generation process – there are short-cuts to the most common commands, such as generating a PDF file
  • there are short-cuts to formatting controls
  • it has syntax highlighting
  • there are good text navigation features

For Windows, I recommend TeXnicCenter. See http://www.toolscenter.org/.

TeXnicCenter Screenshot
TeXnicCenter Screenshot

Another alternative is WinEdt. This can be downloaded and used free for a trial period of 31 days. Thereafter you have to buy it – currently $40 for educational use. See http://www.winedt.com/.

WinEdt Screenshot
WinEdt Screenshot

For Linux there is Kile. See http://kile.sourceforge.net/ for screenshots.

These are just the programs I’m familiar with – there are lots of other editors out there. And for the minimalist approach you can just use Notepad and generate a PDF from the command line…

Important Features

Here are some things to bear in mind when choosing an editor:

Can you do a word count? TeXnicCenter doesn’t have one, so I use a free PDF wordcount called Translator’s Abacus. (Beware of a program called LaTeX Word Counter – it doesn’t seem to count footnotes.)

Is there a spell-check? TeXnicCenter automatically has one for US English and German, but you can add more languages:

  • Download the dictionary you want from http://lingucomponent.openoffice.org/download_dictionary.html – it’s a .zip file (TeXnicCenter uses the spelling engine of OpenOffice).
  • Unzip the .zip file and copy the .aff and .dic files in it to C:\Program Files\TeXnicCenter\language (you’ll see the English and German files already there).
  • Restart TeXnicCenter. Select ‘Tools’ then ‘Options’. Click on the ‘Spelling’ tab and select the new dictionary you want to add.

Getting Started: Installing LaTeX

What you need:

  1. A computer to install the LaTeX on.
  2. A LaTeX editor. This is the piece of software you will use to write your LaTeX files and to generate a final PDF output.
  3. Somewhere to save all your files.
  4. Patience.

Installing LaTeX

LaTeX comes in several flavours – they all effectively do the same job. Some are specific to certain platforms (Windows/Mac/Linux/etc.).

MikTeX

I work on Windows and use MikTeX. To download this, go to http://miktex.org/. As of today, the latest stable version is MikTeX 2.7. Click on the link to this under ‘Downloads’ in the navigation bar. You will then find a page with simple installation instructions.

Useful links

University of Cambridge PWF Machines

According to the Cambridge University Computing Service pages, LaTeX and TeX are installed on the Windows PWF machines. For details, see http://www.cam.ac.uk/cs/pwf/pclist.html.

The Engineering Dept. has a useful webpage about LaTeX: http://www.eng.cam.ac.uk/help/tpl/textprocessing/.

The Best Guides to LaTeX

PDF Manual

The manual, The Not So Short Introduction to LaTeX, is freely available as a PDF in a dozen languages. It contains a lot of useful information.

Published Guides

The LaTeX Companion
The LaTeX Companion

I highly recommend The LaTeX Companion by Frank Mittelbach et al., second edition (Boston: Addison Wesley, 2006).

Paperback details:
ISBN-10: 0201362996
ISBN-13: 978-0201362992

It covers everything you’re likely to need – and more. At the moment, it costs about £35 from online retailers.

It can sometimes be tricky to find what you’re looking for in the index, but if you look back at the table of contents, you can usually work out which section it might be under.

Why use LaTeX?

The bottom line: if you’re writing a short document in English with no special characters, use Microsoft Word.

For longer documents, like a masters or doctoral dissertation – invest your time in learning how to use LaTeX.

LaTeX lets you concentrate on what you are writing, not what it looks like. It’s efficient – formatting, structuring, numbering, indexing and referencing are all taken care of – you can just write.

Advantages of using LaTeX

  • excellent support for transliteration and for non-latin alphabets
  • separation of content and style (you type, it makes it pretty)
  • scalability – LaTeX can be used for a one-page letter or a 300 page book
  • high quality output – PDFs produced look elegant and professional
  • performance – LaTeX doesn’t crash like Word
  • can be used with the bibliography/reference package, BibTeX
  • files are very small – a LaTeX file is just a text file
  • it’s free
  • platform independent – can be used on Windows, Macs, Linux
  • you never have to write an English/Arabic document in Word again!

Disadvantages of using LaTeX

  • it can be a bit overwhelming at first
  • learning how to use it takes time
  • complicated workflow – there are several steps to write, generate and produce a finished file
  • just as with any software, there are occasional bugs – but I’ve only come across one so far

Summary

I use LaTeX because of its excellent handling of Arabic script, transliteration and typesetting control. If any of the above sounds interesting, read on and try it out.

Useful links to reviews of LaTeX