# Strange layout with multicol

I'm using multicol to lay out a series of equations in columns, here's the code:

\begin{multicols}{3}
$e^{f(x)} \rightarrow f'(x)e^{f(x)}$
$ln(f(x)) \rightarrow \frac{f'(x)}{f(x)}$
$sin(x) \rightarrow cos(x)$
$cos(x) \rightarrow -sin(x)$
$tan(x) \rightarrow sec^{2}(x)$
$cosec(x) \rightarrow -cosec(x)cot(x)$
$sec(x) \rightarrow sec(x)tan(x)$
$cot(x) \rightarrow -cosec^2(x)$
\end{multicols}


This works, though the spacing is a little strange:

Am I doing something silly? Is the spacing meant to be this weird? Can't I just have three equally sized columns (or maybe two full and one overflow column)?

-
Are you tied to multicol? Because a tabular would work just as well. –  Werner Dec 27 '12 at 7:57
No, I'm not tied to multicol, if you can give me a good tabular example I'll accept an answer with it :) –  Todd Davies Dec 27 '12 at 7:58

Easiest alignment is achieved using amsmath's align* environment:

\documentclass{article}
\makeatletter
\def\sec{\mathop{\operator@font sec}\nolimits}
\def\cosec{\mathop{\operator@font cosec}\nolimits}
\def\cot{\mathop{\operator@font cot}\nolimits}
\makeatother
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\begin{align*}
e^x &\rightarrow f'(x)e^{f(x)} & \cos(x) &\rightarrow -\sin(x) & \sec(x) &\rightarrow \sec(x)\tan(x) \\[\jot]
\ln(x) &\rightarrow \frac{f'(x)}{f(x)} & \tan(x) &\rightarrow \sec^{2}(x) & \cot(x) &\rightarrow -\cosec^2(x) \\[\jot]
\sin(x) &\rightarrow \cos(x) & \cosec(x) &\rightarrow -\cosec(x)\cot(x)
\end{align*}
\end{document}


Since the kernel (nor amsmath) does not define \cosec, \sec and \cot, I've duplicated the definitions from the other known transcendental functions. For an understanding of the alignment usage (&) within the align environments, consider reading Herbert's mathmode document (section 25 align environments, p 43).

-