LaTeX workshop

Taha Ahmed @solarchemist
May 15, 2014

Uppsala university

@teknatdr's PhD Days May 15-16

URL for slides: goo.gl/5zhk55

PhD Day May 15-16

The CTAN lion

CTAN lion drawing by Duane Bibby

What is TeX?

Its basic principle is that structures in the document
are marked and transformed into typeset output.

If the marks

  • describe the look of the document, it is called optical markup,
  • describe document structures, it is called logical markup.

TeX provides both forms of markup.

The components of TeX

The Components of TeX

  • The TeX kernel has been frozen since 1982
  • LaTeX - created by Leslie Lamport in the early 90's
  • Other tools can be added to provide indexing, bibliography, and many other tasks

Introduction to LaTeX

Data flow in the LaTeX system

  • Current version of LaTeX is LaTeX2e
  • LaTeX3 is under development

You write

  • the tex file

and supply

  • bib-file
  • images
  • data

LaTeX workflow

Input file structure

The preamble (setting up the document):

\documentclass{...}
\usepackage{...}

Body of the text:

\begin{document}

At the end of the document:

\end{document}

Minimal example of a tex-file

\documentclass{article}

\begin{document}
Small is beautiful.
\end{document}

Some characters are reserved

Certain characters are reserved for use by TeX/LaTeX and if you want to use them as-is in your document, you need to first escape them.

Reserved characters by LaTeX:

  • # $ % ^ & _ { } ~ \

To print these characters, add a prefix backslash:

  • \# \$ \% \^ \& \_ \{ \} \~ \textbackslash

Use LaTeX on your computer or in the cloud

TeX distributions

  • TeXLive, MiKTeX, MacTeX

Use your macro package of choice or convenience:

  • LaTeX, XeTeX, LuaTeX, or even plain TeX

There are several online LaTeX editors/compilers

Finding packages

Finding documentation and getting help

Tutorials

Resources (LaTeX and related)

One source document, many output formats

LaTeX has powerful packages for scientific writers

  • TikZ/PGF, pgfplots
  • datatool
  • siunitx
  • chemmacros, chemstyle, chemfig, mhchem
  • biblatex
  • cleveref
  • … among many, many others

Slides

Beamer

Posters

a0poster
beamerposter

PDF tools

MS Windows

  • pdfimages
  • pdftotext
  • pstoedit
  • pdftk
  • pdfsam
  • eps2pdf (Windows, GUI)

GNU Linux

  • epstopdf (Linux, CLI)
  • ps2pdf
  • pdf2ps
  • pdftops
  • pdf2svg