2

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: the output

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)?

2
  • Are you tied to multicol? Because a tabular would work just as well.
    – Werner
    Dec 27, 2012 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 :) Dec 27, 2012 at 7:58

1 Answer 1

4

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

enter image description here

\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).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .