LaTeX

“LaTeX, which is pronounced «Lah-tech» or «Lay-tech», is a document preparation system for high-quality typesetting. It is most often used for medium-to-large technical or scientific documents but it can be used for almost any form of publishing.”

What is the difference between TeX and LaTeX?

Get LaTeX

Source

Manually Package Management

On *nix systems tlmgr can be used to install and update packages from the command line.

Install Package

If you're on macOS and have opted for the smaller BasicTeX instead of the full install you won't have access to the \author or \affil commands provided by the authblk package. You'll need to install it manually.

The CTAN page for authblk states “The pack­age is part of the preprint bun­dle.”.

To get access to authblk we need to install the preprint bundle via: sudo tlmgr install preprint

Update Packages

Executing sudo tlmgr update –list will display which packages need to be updated.

Executing sudo tlmgr update –all will actually update them.

Compiling Tex to PDF

MacOS, Linux and Windows

cd Into the directory containing your .tex and .bib files and run:

  1. pdflatex whitepaper.tex

To build your Bibliography run:

  1. pdflatex whitepaper.tex

  2. bibtex whitepaper.aux

  3. pdflatex whitepaper.tex

To build your Glossary run:

  1. pdflatex whitepaper.tex

  2. makeglossaries whitepaper

  3. pdflatex whitepaper.tex

Shit You Might Encounter While Compiling

  • When using the glossaries package the \printglossaries command wont print your Glossary if you've suppressed page numbers with \pagenumbering{gobble}

Editors

  • gummi “Simple LaTeX editor” [Linux & Windows]

Referencing

From September 2017, Abertay adopted the Cite Them Right version of Harvard

When referencing a website the references page entry should look like:

  National Literacy Trust (2011) Policy. Available at: http://www.literacytrust.org.uk/policy
  (Accessed: 7 January 2011).

The in-text citation should look like:

  (National Literacy Trust, 2011)

The natbib package can be used to achieve this referencing style. The following should be in your preamble:

  \usepackage{natbib}
  \setcitestyle{aysep={,}}

The following should be placed wherever you want your References page rendered:

  \bibliographystyle{agsm}
  \bibliography{bibfile}

The following entry in your .bib file will produce the correct reference page entry:

  @misc{nlt_2011,
  title={Policy},
  author={{N}ational {L}iteracy {T}rust},
  year={2011},
  Howpublished={Available at: \url{www.literacytrust.org.uk/policy}},
  Note={(Accessed: February 22nd, 2017)}
  }

Credit to Rory for putting in most of the leg work on this.

Formatting

Tilde

\newcommand\customtilderaise.17ex_hbox_scriptstyle_mathtt_sim}

Usage: Cost \customtilde \$10,000

Source

Page Breaks

In situations like a chapter start it is advisable to end the previous chapter with a \clearpage to flush out all floats, but in other situations this might result fairly empty pages with only floats on them which may or may not be desired.

A second difference is \clearpage actually always starts a new “page” while \newpage really only ends the current column.

Source

Templates

  • Template for 4th year dissertation proposal (two-column) – Two column proposal template

  • Template for 4th year dissertation (one column, 1.5 line spaced with special documentation pages and title page) – Dissertation Template with Bibliography and LoT and LoF

Syntax Highlighting

  \usepackage{listings}
  \usepackage{color}

  \definecolor{codegreen}{rgb}{0,0.6,0}
  \definecolor{codegray}{rgb}{0.5,0.5,0.5}
  \definecolor{codepurple}{rgb}{0.58,0,0.82}
  \definecolor{backcolour}{rgb}{0.95,0.95,0.92}

  \lstdefinestyle{mystyle}{
      backgroundcolor=\color{backcolour},   
      commentstyle=\color{codegreen},
      keywordstyle=\color{magenta},
      numberstyle=\tiny\color{codegray},
      stringstyle=\color{codepurple},
      basicstyle=\footnotesize,
      breakatwhitespace=false,         
      breaklines=true,                 
      captionpos=b,                    
      keepspaces=true,                 
      numbers=left,                    
      numbersep=5pt,                  
      showspaces=false,                
      showstringspaces=false,
      showtabs=false,                  
      tabsize=2
  }

Then use

  \begin{lstlisting}[language=Python,style=MyStyle]
      Radge code
  \end{lstlisting}

Packages

textcomp

Enables support for Text Companion fonts such as legal, currency and mathematical symbols.

  \usepackage{textcomp}

  A\textrightarrow B
  10\textcelsius
  Sony\texttrademark

Resources

Last updated