如何在 \tabu 环境中拆分方程式?

如何在 \tabu 环境中拆分方程式?

我正在写一篇数学论文,我想在表格中包含一些工作内容。我的表格是在环境中创建的tabu,我想按如下方式拆分方程式:

[variable]=[intermediate step] =[final answer]

除了两个=符号对齐之外。我该怎么做?split似乎在环境中不起作用tabu

以下是 MWE:

\documentclass[british, 11pt, reqno]{amsart}

\usepackage[utf8]{inputenc}

\usepackage{geometry}
\geometry{a4paper}
\geometry{margin=2cm}

\usepackage{graphicx}

\usepackage{booktabs}
\usepackage{tabu}

\begin{document}

\begin{tabu} to \textwidth{X[c] X[c]}
\toprule
Column 1 & Column 2\\
\midrule
0 & $0=0$\\
\bottomrule
\end{tabu}

\end{document}

我的完整序言也在这里,以防我添加的任何包或选项可能会造成干扰:

\documentclass[british, 11pt, reqno]{amsart}

\usepackage[utf8]{inputenc}

\usepackage{graphicx}

\usepackage{booktabs}   % These are miscellaneous packages...
\usepackage{array}
\usepackage{paralist}
\usepackage{verbatim}
\usepackage{subfig}

\usepackage{fancyhdr}   % These are for footers...
\usepackage{lastpage}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{\vspace{5pt}\thepage~of \pageref{LastPage}}\rfoot{}

% These are extra stuff I use in my math, and my bibliography...
\usepackage{babel}   % To use british as the bibliography language mapping for APA
\usepackage{csquotes}   % To use babel
\usepackage{amsmath, amssymb}   % for some of my math symbols
\usepackage{tikz}   % For my diagrams
\usetikzlibrary{positioning}
\usepackage{float}   % For diagram positioning
\usepackage{tabu}   % For tables
\usepackage{longtable}   % For breaking tables over pages
\usepackage{setspace}   % For setting line spacing
\onehalfspacing
\setcounter{tocdepth}{5}   % For setting table of contents numbering depth
\setcounter{secnumdepth}{5}   % For numbering subsubsections
\usepackage[backend=biber, style=apa]{biblatex}   % For my bibliography
\DeclareLanguageMapping{british}{british-apa}
\addbibresource{Biblio.bib}

答案1

您可以使用aligned

\documentclass{article}
\usepackage{amsmath}
\usepackage{tabu,booktabs}

\begin{document}

\noindent
\begin{tabu} to \textwidth{X[c] X[c]}
\toprule
Column 1 & Column 2\\
\midrule
0 & $\begin{aligned}[t] x &= a \\ &=b\end{aligned}$ \\
\bottomrule
\end{tabu}

\end{document}

在此处输入图片描述

答案2

因为显示数学和表格等重新定义了&和之类的东西\\,所以最好在禁忌之外的保存箱中创建和存储显示数学。

设置\belowdisplayskip=0pt会导致 \dp\strutbox 在底部基线以下出现间隙,但设置会导致在顶部基线以上\abovedisplayskip=0pt出现间隙。\baselineskip

\documentclass[british, 11pt, reqno]{amsart}

\usepackage[utf8]{inputenc}

\usepackage{geometry}
\geometry{a4paper}
\geometry{margin=2cm}

\usepackage{graphicx}

\usepackage{booktabs}
\usepackage{tabu}

\usepackage{mathtools}
\newsavebox{\mybox}

\begin{document}

\savebox{\mybox}{\begin{minipage}{\dimexpr 0.5\textwidth-3\tabcolsep}%
\abovedisplayskip=\dimexpr \ht\strutbox-\baselineskip\relax
\belowdisplayskip=0pt
\begin{align*}
x &= a \rule{1pt}{\ht\strutbox} \\
&= b \rule[-\dp\strutbox]{1pt}{\dp\strutbox}
\end{align*}\end{minipage}}%
\noindent\rlap{\fboxsep=0pt\fbox{{\usebox{\mybox}}}}\rule{\textwidth}{0.5pt}% test centering
\bigskip

\noindent\begin{tabu} to \textwidth{X[c] X[c]}
\toprule
Column 1 & Column 2\\
\midrule
0 & \usebox{\mybox}\\
\bottomrule
\end{tabu}

\end{document}

演示

相关内容