Tag Archives: LaTeX

Pretty Math on Wikipedia

In the days of MathJax, the math images on Wikipedia look inferior by a huge margin. The MathJax guys got us covered; they provide a userscript1 that dynamically injects MathJax into Wikipedia sites2. It may load a little longer, but I think this is worth the wait:

Without MathJax

With MathJax

1. Userscripts are pieces of Javascript your browser executes on top of any website. Firefox users use Greasemonkey, others see here.
2. Make sure to change the @include to http://*.wikipedia.org/wiki/* so the script works on all Wikipedias.

Quick Images with TikZ

How do you create high-quality technical images for documents, your website or posts on Stack Exchange? I have used tools in an ad-hoc manner for a while and have become frustrated lately. Once you have used TikZ1 with $$\LaTeX$$ most other tools feel inferior. The only problem is: TikZ is a $$\LaTeX$$ package and can not be used on its own. So how to convert TikZ to say PNG comfortably?

$$\TeX$$-guru Martin Scharrer comes to the rescue: he wrote the package standalone for exactly this use case. Based on his explanation on tex.SE I built a small bash script that does all the repetitive work for you. With one simple command, this

%p% \usetikzlibrary{arrows,automata,positioning}
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,auto]
\node[state,initial]    (q_0)                {$q_0$};
\node[state,accepting]  (q_1) [right of=q_0] {$q_1$};

\path[->] (q_0) edge [bend left]  node {$a$} (q_1)
(q_1) edge [bend left]  node {$b$} (q_0);
\end{tikzpicture}

becomes this in a matter of seconds:

Get tikz2png on GitHub and enjoy!

1. Check out the awesome gallery of examples and the comprehensive manual.

Spread Out List Items With LaTeX beamer

Everybody tells you that presentation slides should contain only as few pieces of information as possible. If you need more than one word or picture you better have at most three to five items. If you try to do exactly that using beamer for $$\LaTeX$$, this is what you get:

Aesthetics aside, item placement is just bad. You would want the items to fill the available space somewhat. In normal documents, package enumitem allows you to control such things both globally and per environment. It seems to conflict with beamer, though. I headed over to tex.SE and got good answers; Werner suggests to add this to the preamble:

\usepackage{etoolbox}
\makeatletter
\patchcmd{\@listI}{\itemsep3\p@}{\itemsep3em}{}{}
\makeatother

With this, your beamer slides do way better:

Note that you can adjust spacing by changing number and unit in \itemsep3em.

Gedit LaTeX Plugin

Wer auf puristisches Editieren von LaTeX-Dokumenten steht und trotzdem gerne diskrete Unterstützung hätte, sollte sich mal das Gedit LaTeX Plugin ansehen. Minimalinvasiv wird ein Dokumentbrowser, eine Symboltabelle und Syntaxvervollständigung sowie einige Makros zusätzlich zum ohnehin schon vorhandenen Syntaxhighlighting angeboten. Das Ganze ist trotz Betastatus schon recht benutzbar, finde ich.

Ein Überblick über einige Features des Gedit LaTeX Plugins