Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

\begin{multicols}{3}
\[
    e^x \rightarrow f'(x)e^{f(x)}
\]
\[
    ln(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)?

share|improve this question
    
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

1 Answer 1

up vote 4 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.