1

I was trying to prepare a cheat sheet using the template posted by xport (Preparing cheat sheets)

However when I try to use "\begin{split}" I get an error

\begin{split} on input line...ended by \end{minipage}

However, if I use eqnarray it works fine. I wonder why "split" option does not work.

Below is my code,

\documentclass[table,cmyk]{article}
\usepackage[a4paper,margin=1cm,landscape]{geometry}
\usepackage{longtable,array,calc}
\usepackage{xcolor}
\usepackage{amsmath}
\makeatletter
\newcommand\ratio[2]{\strip@pt\dimexpr#1pt/#2\relax}
\newcolumntype{A}[2]
{
    >{\begin{minipage}[t]{#2\linewidth-2\tabcolsep-#1\arrayrulewidth}%
    \vspace{\tabcolsep}}%
    c%
    <{\vspace{\tabcolsep}\end{minipage}}%   
}
\makeatother

\pagestyle{empty}

\arrayrulewidth=1pt
\tabcolsep=10pt
\arrayrulecolor{red}

\usepackage{lipsum}
\begin{document}
\begin{longtable}
{
|A{1.5}{\ratio{30}{100}}% 30%
|A{1}{\ratio{30}{100}}% 30%
|A{1.5}{\ratio{40}{100}}% 40%
|%
}\hline
%Cell 1,1


\begin{equation} \label{eq1}
\begin{split}
A  & = \frac{\pi r^2}{2} \\
& = \frac{1}{2} \pi r^2
\end{split}
\end{equation}


The fundamental theorem of calculus,
\[
\int_a^b f(x)\,\textrm{d}x=F(b)-F(a)
\]
where \[\frac{\textrm{d}F(x)}{\textrm{d}x}=f(x)\]
&
%Cell 1,2
\LaTeX\ will make you confident! 
&
%Cell 1,3
\lipsum[1]
\tabularnewline\hline
%Cell 2,1
The fundamental theorem of calculus,
\[
\int_a^b f(x)\,\textrm{d}x=F(b)-F(a)
\]
where \[\frac{\textrm{d}F(x)}{\textrm{d}x}=f(x)\]
&
%Cell 2,2
\LaTeX\ will make you confident!
&
%Cell 2,3
\lipsum[2]
\tabularnewline\hline
\end{longtable}
\end{document}
2

If you lose the & symbols, it works. If you replace equation with gather you get a new error message (illegal \par detected). I suspect that longtable is parsing the contents of environments, but not macros or {...} blocks.

{\begin{equation} \label{eq1}
\begin{split}
A &= \frac{\pi r^2}{2} \\
 &= \frac{1}{2} \pi r^2
\end{split}
\end{equation}}

also works.

  • If I remove "&" symbols then I cannot align the equation however using one more "{}" blocks as you suggested solved my problem even though I am not totally sure why it solved the problem. Thanks.. – sbilmis Oct 6 '15 at 5:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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