Skip to content

LaTeX

Cheatsheet

How to typeset := correctly

\documentclass{standalone}
\usepackage{mathtools}
\begin{document}
\( b := 10 \) \emph{versus} \( b \coloneqq 10 \).
\end{document}

How to make set complement

\overline{L}

Use PSTRicks instead of tikz for automata

\usepackage{pstricks,pst-node,pst-tree}

When using together with Pandoc, make sure to compile it using pandoc --pdf-engine=xelatex ....

Lightning symbol

\usepackage{stmaryrd}

$\lightning$

Can then be used in math-mode.

Write something on top of equal sign

$\stackrel{sometext}{=}$

If def is not available in math-mode, then use \text{sometext}.

Insert checkmark arrow

\usepackage{amssymb}

\checkmark

Specify correct hyphenation

\hyphenation{Transitions-tabelle}

Add margin to block of text

\usepackage{scrextend}

...

\begin{addmargin}[1em]{2em}% 1em left, 2em right
...
\end{addmargin}

Fancy headers

  \usepackage{fancyhdr}
  \pagestyle{fancy}

Typeset BNF

See: https://github.com/Zeta611/simplebnf/

Typeset Type Systems

See: http://www.logicmatters.net/resources/ndexamples/proofsty.html


Last update: November 23, 2020