Running Latex using Docker

A simple way to compile your latex files without installing a latex-distribution is the usage of a docker-container. Thanks to https://github.com/blang/latex-docker it is easier than ever.

Within your directory with your article.tex invoke:

docker run --rm -i --user="$(id -u):$(id -g)" --net=none -v "$PWD":/data blang/latex xelatex article.tex

The current directory is mounted into the container and thus the latex executable within the container can access the source files (xelatex article.tex) and the results are placed in the current directory too.

Advertisements

Latex: Alignment of a fixed-width column in the tabular-environment

Based on the post even fixed-width columns can be aligned.

\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german]{babel}
\usepackage{array}
\begin{document}
% Centered fixed-width column
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
% Right-aligned fixed-width column
\newcolumntype{R}[1]{>{\rtab\arraybackslash}m{#1}}

\begin{tabular}{C{2cm}R{2cm}}
\hline
Ein etwas langer Text, der sicherlich umbrochen wird & a\\
\hline
oder kurz & b\\
\hline
\end{tabular}
\end{document}

[Quicktip] Changing font and font-size in g-brief

You want to change the font and font-size of latex “g-brief” (usage: business letters)?
Here you go

% change size
\documentclass[german,a4paper,10pt]{g-brief}
% change font
\renewcommand{\familydefault}{\sfdefault}
\usepackage{helvet}

Sources:
http://www.wer-weiss-was.de/theme155/article2405641.html
http://www.mrunix.de/forums/showthread.php?t=51401

[solved] Missing “cv.cls”

In the last days i wanted to update my old latex-based CV. But what happened? The file “cv.cls” was not found. Somehow my configuration changed – the reason may be the upgrade to Kubuntu 9.10…

Here a short list of steps to get it fixed:

  • download http://wiki.lyx.org/uploads/Examples/CV/cv.cls
  • copy/move the downloaded file to a sub directory of “/usr/share/texmf-texlive/tex/latex” (perhaps you have to alter the directory access permissions or run “sudo cp“)
  • reconfigure the latex distribution by executing “sudo texconfig rehash

Update: Steps for MikTex 2.9.x (Windows distribution for TeX)