## LaTeX length units

Posted: 26th May 2010 by Tim in LaTeX
Tags: , , , , , , , , , , ,

There are many configurations and commands in LaTeX which require lengths to be set. The following length units can be used: in – imperial inch pt – point (1/72 of an inch) cm – metric centimeter mm – metric millimeter em – width of a capital “M” in the current font settings ex – width […]

## Union and Intersection symbols in LaTeX

Posted: 22nd May 2010 by Tim in LaTeX
Tags: , , , , , , , , , ,

Union (∪) and Intersection (∩) symbols in LaTeX can be produced via the \cup and \cap definitions while in math mode. No extra packages are required to use these symbols. For example: Let $L_C = L_A \cap (L_B \cup L_C)$ will produce:

## My second LaTeX document

Posted: 16th May 2010 by Tim in LaTeX
Tags: , , , , , , , , , , , , , , ,

This tutorial is for those who have gone through the first tutorial. Here we will cover new lines and paragraphs, comments, font decoration (bold, italic and underline) and sections. Fun. New lines and paragraphs First we will look at paragraphs. In LaTeX, having a new line in your .tex file (which we will refer to […]

## Math blackboard (double-barred) font in LaTeX

Posted: 28th April 2010 by Tim in LaTeX
Tags: , , , , , , , , , , ,

In math, certain blackboard (double-barred) letters Z, N, R, etc. represent sets of numbers (integers, natural numbers, rational numbers, etc). These can be included in a LaTeX document using the \mathbb{[letter]} tag from within the math environment. Note that this requires the amssymb package to be included (ie: add \usepackage{amssymb} to the top of the […]

## Referencing all BibTeX entries without citing in LaTeX

Posted: 17th April 2010 by Tim in LaTeX
Tags: , , , , , ,

Often times you want to add entries to the references section of a LaTeX document without actualy citing them. The \nocite{reference} may be used to add the record to the references, but writing \nocite for each reference can get tedious. Luckily, adding \nocite{*} to the document will ensure that everything is added to the references.

## Underline text in LaTeX

Posted: 13th April 2010 by Tim in LaTeX
Tags: , , , , ,

Underlining text in LaTeX is very easy – simply wrap the text with \underline{text}. For example, The cake was \underline{huge}. will produce: The cake was huge.

## Referencing website URLs with LaTeX (BibTeX)

Posted: 4th April 2010 by Tim in LaTeX
Tags: , , , , , , , , ,

In BibTeX there is no bibliography record type for website references. Luckily, the Misc bibliography record type has a howpublished attribute, which may be mixed with the \url command to allow website referencing. Below is an example of a document named urlbib which demonstrates this. File: urlbib.tex \documentclass[a4paper,11pt]{article} \usepackage{url} \begin{document} \section*{Testing the URL citations} Line […]

Posted: 30th March 2010 by Tim in LaTeX
Tags: , , , ,

In a LaTeX document, the parts of the document are broken up into \section{}, \subsection{} and \subsubsection{} blocks. Because the document sections are so clearly defined, adding a table of contents is as simple as adding \tableofcontents wherever you want the table of contents to be printed. For example: \documentclass[11pt, a4paper]{article} \begin{document} \tableofcontents \newpage \section{First […]

## Rotating images in LaTeX

Posted: 19th March 2010 by Tim in LaTeX
Tags: , , , , , , , ,

Sometimes you want to display an image sideways if, for example, it’s wider than it is tall. Or sometimes you just want to show images at funny angles. Each to their own. In LaTeX, you can add parameters to the \includegraphics call (See this post on LaTeX figures to see how to add the images). […]

## Getting the current and last page numbers in LaTeX

Posted: 10th March 2010 by Tim in LaTeX
Tags: , , , , , , , , , , ,

Standard LaTeX allows you to extract the current page number using the thepage command. That’s an easy one. To get the total number of pages (ie: number of the last page) is a little more involved. To do this, you need to use the \lastpage package and use \pageref{LastPage}. For example: \usepackage{lastpage} … You are […]

## My first LaTeX document

Posted: 28th February 2010 by Tim in LaTeX, Ubuntu
Tags: , , , , , , , , , , ,

The learning curve for LaTeX documents can be a steep one. This step-by-step guide covers installing and setting up the LaTeX environment, and creating and compiling your first document so that you can read and distribute it. Setting up the LaTeX environment A few things need to be installed before we can start creating documents. […]

## Incorrect referencing in LaTeX documents

Posted: 24th February 2010 by Tim in LaTeX
Tags: , , , , , , , ,

If you’ve written up a LaTeX document and find that some of the figures, tables, algorithms, etc. are being referenced wrong (such as Figure 2.4 being referenced as figure 6), chances are you’ve put your caption and \label tags in the wrong order. LaTeX needs \label to be after \caption, or for \label to be […]

## Referencing in LaTeX

Posted: 12th December 2009 by Tim in LaTeX
Tags: , , , ,

One of the nice things about LaTeX is that it sorts out reference numbers for you. This is done through the use of the \label, \ref and \pageref commands. This allows us to add, remove or re-arrange elements without worrying about where they are referenced in the rest of the document The \label is a […]

## Verbatim in LaTeX

Posted: 5th November 2009 by Tim in LaTeX
Tags: , , , , , ,

## Bold and Italic font in LaTeX

Posted: 16th August 2009 by Tim in LaTeX
Tags: , , , , , , , , ,

There are two ways to make text italic in LaTeX. The first and most common method is the \emph{text here} tag. This is used for emphasizing words within a block of text. For example: The cake was \emph{huge} for a cup cake If you’re looking to italicize a whole block of text, then use the […]

## Math summation symbol in LaTeX

Posted: 15th August 2009 by Tim in LaTeX
Tags: , , , , , , , ,

LaTeX is great in that it can display all those strange math symbols for you.  Summation is a common symbol in math and really useful to know how to display in LaTeX. There are two ways of displaying the symbol: compressed to fit onto one line (useful when printing long equations or proofs) or in […]

## Indenting a block of text in LaTeX

Posted: 15th August 2009 by Tim in LaTeX
Tags: , , , , ,

To indent a block of text, you can use the \addtolength{length_variable}{length} command. For this task, we need to add to the \leftskip value for the block of text. For example, to indent a block of text by 5mm we would do the following: {\addtolength{\leftskip}{5mm} …indented text here… }