1
\documentclass[10pt,landscape,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[utopia,sfscaled]{mathdesign}
\usepackage{amsmath}
\usepackage{upgreek}
\usepackage{bm}
\usepackage{multicol}
\setlength{\columnseprule}{0.5pt}
\usepackage[top=0mm,bottom=1mm,left=1mm,right=1mm]{geometry}
\usepackage{lipsum}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{microtype}

\let\bar\overline

\definecolor{myblue}{cmyk}{1,.72,0,.38}

\everymath\expandafter{\the\everymath \color{myblue}}
\everydisplay\expandafter{\the\everydisplay \color{myblue}}

\newcommand{\header}{
\begin{mdframed}[style=header]
\footnotesize
Math cheat sheet \\
Page~\thepage~of~3
\end{mdframed}
}

\makeatletter
\renewcommand{\section}{\@startsection{section}{1}{0mm}%
                            {.2ex}%
                            {.2ex}%x
                            {\sffamily\bfseries}}

\begin{document}
\small
\begin{multicols*}{4}
\header
\columnbreak
\subsection*{Ableitungen}
\begin{align*}
f(x)&=u(x)+v(x)&\rightarrow f^\prime(x)&=u^\prime(x)+v^\prime(x) \\
f(x)&=\lambda*u(x)&\rightarrow  f^\prime(x)&=\lambda*u^\prime(x) \\
f(x)&=u(x)*v(x)&\rightarrow f^\prime(x)&=u^\prime(x)*v(x)+u(x)*v^\prime(x) \\
f(x)&=u(v(x))&\rightarrow f^\prime(x)&=u^\prime(v(x))*v^\prime(x) \\
f(x)&=\frac{u(x)}{v(x)}&\rightarrow f^\prime(x)&=\frac{u^\prime(x)*v(x)+u(x)*v^\prime(x)}{[v(x)^2]}
\end{align*}
\end{multicols*}
\end{document}

1.Why does the tabular width go over the columnwidth of the whole page and how can I set it?

2.And also Texing it gives me this:

    ./cheatsheet.tex:107: Improper \halign inside $$'s.
    <recently read> \halign 

     l.107  \end{align*}

can someone pls help :) Thank you

Laura
  • 147
  • Welcome to TeX.SX! Which tabular do you mean? Your code doesn't include one. Note that tabular is a specific environment. Can you please edit your question (including its title), to be comprehensible? – Skillmon Jun 01 '18 at 23:20
  • You have an error in the last line by the way. The derivative should be \frac{u' v - u v' }{ v^2 } – Skillmon Jun 01 '18 at 23:28
  • Ah! sorry, my bad. In this case it is the \align – Laura Jun 01 '18 at 23:28
  • You have several options: Changing the font size could be one. In this case however just leaving out all the \rightarrow instructions results in fitting contents and remains easily legible. – Skillmon Jun 01 '18 at 23:30
  • Thank you! and do you know why I get that fault message? – Laura Jun 01 '18 at 23:32
  • Sorry, I have no clue. An empty align* environment results in the same error. – Skillmon Jun 01 '18 at 23:32
  • You can change the align* environment to \begin{equation*}\begin{aligned}...\end{aligned}\end{equation*}. It results in slightly different vertical spacing and you don't get an error. – Skillmon Jun 01 '18 at 23:34
  • I tried changing to tabular enviroment but it still didnt quiet fit in haha but using your code worked ! Thank you! – Laura Jun 01 '18 at 23:44
  • Btw. you could do something like this: \frac{\mathrm{d}}{\mathrm{d}x}\left( \frac{u}{v} \right) &= \frac{u'v - uv'}{v^2} with every line. That is way smaller and contains every bit of important information. Did you read my second comment (I just want to make sure you don't get bad grades because you used a wrong quotient rule)? – Skillmon Jun 01 '18 at 23:49
  • Yes I did Thank you so much!:) I'm trying to make this 'cheat sheet' for our math course in uni. I volunteered but now I'm stuggling quite a bit haha – Laura Jun 05 '18 at 20:51

2 Answers2

2

The error is due to

\everydisplay\expandafter{\the\everydisplay \color{myblue}}

which is not a supported construct.

The \halign primitive that underlies all LaTeX alignments has a special display-math behaviour if used as the first item in a $$ display math, \align depends on that behaviour, but if you insert a colour special at the start of the math list, it is inserted before the \halign primitive even though the align expands to

 $$\halign....
David Carlisle
  • 757,742
2

Using alignat* and replacing your construct, as pointed by @David Carlisle with a simple \everymath{color{myblue}} makes the code compile (almost) normally. B.t.w. you'll obtain almost the same colour using MidnightBlue (one of the colours defined by the svgnames option of xcolor:

\documentclass[10pt,landscape,a4paper, svgnames, x11names]{article}

\usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage[utopia,sfscaled]{mathdesign} \usepackage{amsmath} \usepackage{upgreek} \usepackage{bm} \usepackage{multicol} \setlength{\columnseprule}{0.5pt} \usepackage[top=0mm,bottom=1mm,left=1mm,right=1mm]{geometry} \usepackage{lipsum} \usepackage[framemethod=tikz]{mdframed} \usepackage{microtype} \let\bar\overline \definecolor{myblue}{cmyk}{1,.72,0,.38}

%\everymath\expandafter{\the\everymath \color{myblue}} %\everydisplay\expandafter{\the\everydisplay \color{myblue}}

\everymath{\color{MidnightBlue}} \newcommand{\header}{ \begin{mdframed}[style=header] \footnotesize Math cheat sheet \ Page~\thepage~of~3 \end{mdframed} }

\makeatletter \renewcommand{\section}{@startsection{section}{1}{0mm}% {.2ex}% {.2ex}%x {\sffamily\bfseries}} \makeatother \begin{document} \small \begin{multicols}{4} \header \columnbreak \subsection{Ableitungen}

\begin{alignat}{2} f(x)&=u(x)+v(x)&{}\rightarrow f'(x)&=u'(x)+v'(x) \ f(x)&=\lambdau(x)&{}\rightarrow f'(x)&=\lambdau'(x) \ f(x)&=u(x)v(x)&{}\rightarrow f'(x)&=u'(x)v(x)+u(x)v'(x) \ f(x)&=u(v(x))&{}\rightarrow f'(x)&=u'(v(x))v'(x) \ f(x)&=\frac{u(x)}{v(x)}&{}\rightarrow f'(x)&=\frac{u'(x)v(x)+u(x)v'(x)}{[v(x)^2]} \end{alignat} \end{multicols*}

\end{document}

enter image description here

Bernard
  • 271,350