Skip to content

Latex

Installing packages from CTAN

  1. Download {package_name}.tds.zip from the CTAN website.
  2. Unzip the archive inside the /usr/local/share/texmf directory (tested on Ubuntu 16.04).
  3. Run sudo texhash.

Allow tables to stretch past \textwidth

\addtolength{\leftskip}{-0.03\textwidth}
\addtolength{\rightskip}{-0.03\textwidth}
\begin{tabular}{m{0.5\textwidth} | m{0.5\textwidth}}
...
\end{tabular}

Some useful packages

fontspec

Allows us to use custom true type and otf fonts in our documents. Only available when using xelatex.

\usepackage{fontspec}

\newfontfamily\FontAwesomeProRegular{FontAwesome5Pro-Regular-400.otf}[Path = fonts/]
\newfontfamily\FontAwesomeProLight{FontAwesome5Pro-Light-300.otf}[Path = fonts/]
\newcommand{\falServer}{{\FontAwesomeProLight}}
\newcommand{\falTextAlt}{{\FontAwesomeProLight}}
\newcommand{\falDatabase}{{\FontAwesomeProLight}}
\newcommand{\falCodeBranch}{{\FontAwesomeProLight}}
\newcommand{\falFileChartLine}{{\FontAwesomeProLight}}

markdown

https://www.ctan.org/pkg/markdown

\documentclass{article}
\usepackage{markdown}
\markdownSetup{
  renderers = {
    link     = {#1},        % Render a link as the link label.
    emphasis = {\emph{#1}}, % Render emphasis using `\emph`.
  }
}
\begin{document}
\begin{markdown}
  _Hello,_ [Stack Exchange](http://tex.stackexchange.com)!
\end{markdown}
\end{document}

See also: https://tex.stackexchange.com/a/334851/66387

lstlisting

Insert code

\begin{lstlisting}[caption={Demo}]
import os
print(os.listdir())
\end{lstlisting}

Installation

sudo apt-get install texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-extra-utils
sudo apt install lmodern
# Microsoft fonts
sudo apt install msttcorefonts ttf-mscorefonts-installer
#
sudo apt-get install xzdec
sudo tlmgr init-usertree
sudo tlmgr update --all

Bibliography

bibliography_stack

LaTeX packages

  • biblatex - Defines macros for citing inside .tex documents. BibLaTeX is the succesor format of BibTeX. Can work with .bib files processed with biber or BibTeX.
  • natbib - .bib files need to be processed with BibTeX.

Processing program

Processes .bib files into something a .tex file can understand.

  • biber - Supports unicode. Can use more features for the .bib input format.
  • BibTeX

Database file

Packages

Minipage

% \begin{minipage}[vertical centering][height]{width}
\begin{minipage}[c][7in]{1.0\textwidth}
  \centering
  \includegraphics[width=1.0\textwidth,height=4in,keepaspectratio]{static/elaspic_training_set/validation/test_performance_core.pdf}
  \caption{...}
\end{minipage}

Templates

Posters