在横向多列中设置表格/对齐宽度

在横向多列中设置表格/对齐宽度
\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.为什么表格宽度会超出整个页面的列宽,如何设置?

2.此外,Texing 还给了我以下信息:

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

     l.107  \end{align*}

有人可以帮忙吗:)谢谢

答案1

使用alignat*并替换您的构造,正如@David Carlisle 所指出的那样,使用一个简单的\everymath{color{myblue}}构造可以使代码(几乎)正常编译。顺便说一句,您将使用(由选项MidnightBlue定义的颜色之一)获得几乎相同的颜色:svgnamesxcolor

\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)&=\lambda*u(x)&{}\rightarrow f'(x)&=\lambda*u'(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} 

在此处输入图片描述

答案2

该错误是由于

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

这不是一个受支持的结构。

所有 LaTeX 对齐所依据的基\halign元如果用作$$显示数学中的第一个项目,则具有特殊的显示数学行为,\align取决于该行为,但如果在数学列表的开头插入颜色特殊,则它会插入到基\halign元之前,即使对齐扩展到

 $$\halign....

相关内容