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

Advertisements

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.

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