Notes Package: todonotes

\missingfigure{}
\missingfigure{}

This is a package I recently stumbled upon. It allows you to easily insert notes into a document – either inline or in the margins.

It can also create a list of to-do notes, which would be helpful when editing drafts.

I particularly like the \missingfigure{} command. This inserts a bright, bold image into your text – so you won’t forget to add the final figure to your document.

The other commands are \todo{} and \listoftodos. You can customize the colour, font size and placement of each note.

\todo{Some note or other.}
\todo{Some note or other.}

For my example document, these are the commands I included:

\listoftodos

\todo{Some note or other.}

\todo[noline]{Another note.}

\todo[inline]{And another one.}

\missingfigure{Add my picture here.}

Here is the code for my sample document: SimpleToDoNotesTex.pdf

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

This is a new package, so there may still be some glitches with it – but I think it’s useful for editing and writing up long documents.

The todonotes package was created by Henrik Skov Midtiby.

Useful Links

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

Cambridge University LaTeX Courses

Students and staff at the University of Cambridge may be interested in the following courses on offer this term:

  • 10-11 February LaTeX: Introduction
  • 13 February LaTeX Follow-up Practical Using TeXshop on a Macintosh

See http://www.cam.ac.uk/cs/courses/timetable.html for course descriptions and booking information.

Eligibility: The standard programme of short courses run by the Computing Service is aimed at the staff and students of Cambridge University. Others may also be eligible to attend if from certain related institutions. For details see: http://www.cam.ac.uk/cs/courses/genreg.html#charging

I would encourage readers of this blog to submit information about other LaTeX courses being run near you. You can do this by adding a comment to this post.

Academic Writing

A great deal of academic writing is convoluted and dull (well, at least what I’ve been reading), and the American trend of using ungrammatical jargon to dress up second-rate thinking is sadly spreading to the UK.

But it doesn’t have to be that way – Nabokov’s scientific writings on butterflies have a lyrical quality, while Russell’s works on philosophy are clear and concise.

I have found George Orwell’s rules of writing to be very helpful:

  1. Never use a metaphor, simile, or other figure of speech which you are used to seeing in print.
  2. Never us a long word where a short one will do.
  3. If it is possible to cut a word out, always cut it out.
  4. Never use the passive where you can use the active.
  5. Never use a foreign phrase, a scientific word, or a jargon word if you can think of an everyday English equivalent.
  6. Break any of these rules sooner than say anything outright barbarous.

From Politics and the English Language (1946) – http://www.k-1.com/Orwell/index.cgi/work/essays/language.html

Bertrand Russell also wrote a short essay entitled How I Write (1954) – http://www.davemckay.co.uk/philosophy/russell/russell.php?name=how.i.write

Useful Links

Header Package: fancyhdr

Using fancyhdr
Using fancyhdr

This package allows you to customize headers and footers in the LaTeX document.

You can find comprehensive information on this package in The LaTeX Companion.

Here I’ll explain how to make a simple header showing your name and the date.

This is what you need to include:

\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancyplain}

\begin{document}

\lhead{John E. Smith}
\rhead{\today}

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.

Simple Header
Simple Header

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}

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

The fancyhdr package was created by Piet van Oostrum.

Useful Links

Symbols

The Comprehensive LaTeX Symbol List

If you find yourself wondering how to create your chosen transliteration style and can’t find the right character input, this will make happy reading:

The Comprehensive LaTeX Symbol List by Scott Pakin (4.3Mb PDF)

Common Transliteration Symbols in LaTeX

PDF Preview
PDF Preview

At 152 pages, the comprehensive symbol list is a bit unwieldy.

As a quick reference, I’ve made a one-page table of the most commonly used transliteration symbols for dealing with French, German, Spanish and transliterated Arabic – along with some examples.

You can download it from here:

Common Transliteration Symbols in LaTeX (61Kb PDF)

Semtrans Package

For people working with Semitic languages, the Semtrans package can be useful.

I found this after weeks searching for how to represent the Arabic letter kha’ in the style commonly used in German scholarship (a letter ‘h’ with a little u underneath). You get this by typing \U{h}. See page 14 of the comprehensive symbol list. `Ayn is \Ayn.

N.B. When using the command \U{h} in a section heading, you need to add \protect beforehand, so the command becomes \protect\U{h}. Otherwise, you will get error messages and the symbol won’t display. Thanks to Berteun for this tip. I haven’t found any difficulties with the \Ayn command.

LaTeX Package Reviews

For people who already use LaTeX, I’ll be discussing some LaTeX packages relevant to the humanities (particularly to Middle Eastern Studies).  Hopefully this will save you trawling the internet for information.

These posts will be interspersed between more basic information that I’ve categorized ‘Getting Started’.

For newcomers to LaTeX, add-on features for the system are known as packages. For example, multicol allows you to use multiple columns in a document, while the url package lets you properly format 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.

For LaTeX users in the humanities