我找不到一个看似简单的问题的解决方案。
我需要列出方程式及其工作原理,并将它们保存在数组或表格中以使 = 居中(如果有更好的方法,请告诉我们)。
\documentclass[10pt,a4paper]{article}
\usepackage{array, enumitem}
\begin{document}
\begin{enumerate}[label=\textbf{(\alph*)}]
\item $\begin{array}{r@{\;}l}
3t=&\frac{7k}{13}-17\\[6pt]
3t+17=&\frac{7k}{13}\\[6pt]
39t+221=&7k\\[6pt]
k=&\frac{39t+221}{7}\\[24pt]
\end{array}$
\item $\begin{array}{r@{ }l}
7k=&\frac{4k}{3t}-11t\\[6pt]
7k-\frac{4k}{3t}=&-11t\\[6pt]
k(7-\frac{4}{3t})=&-11t\\[6pt]
k=&\frac{-11t}{7-\frac{4}{3t}}\\[6pt]
k=&\frac{-11t}{\frac{21t}{3t}-\frac{4}{3t}}\\[6pt]
k=&\frac{-11t}{\frac{21t-4}{3t}}\\[6pt]
k=&\frac{-11\times3t^2}{21t-4}\\[6pt]
k=&\frac{-33t^2}{21t-4}\\[24pt]
\end{array}$
\end{enumerate}
\end{document}
遗憾的是,列表的标签不会像普通文本一样停留在顶部,而是会出现在中间某处。我一直使用的一种解决方法是在每个项目的开头写一行文字,但现在是时候找到更好的解决方案了。当我逐项列出表格和图表时,如何让标签保持在顶部?
答案1
\documentclass[a4paper]{article}
\usepackage{amsmath} % <--- added
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\textbf{(\alph*)},
itemsep=\baselineskip] % <--- added
\item $\begin{aligned}[t] % <--- added [t], changed to aligned
3t & = \frac{7k}{13}-17 \\
13(3t) & = 13\left(\frac{7k}{13}-17\right)
39t & = 7k-221\\
39t-221 & = 7k\\
7k & = 39t-221
\end{aligned}$
\item $\begin{aligned}[t] % <--- added [t], changed to
7k & = \frac{4k}{3t}-11t\\
7k-\frac{4k}{3t} & = -11t\\
k(7-\frac{4}{3t}) & = -11t\\
k & = \frac{-11t}{7-\frac{4}{3t}}\\
k & = \frac{-11t}{\frac{21t}{3t}-\frac{4}{3t}}\\
k & = \frac{-11t}{\frac{21t-4}{3t}}\\
k & = \frac{-11\times3t^2}{21t-4}\\
k & = \frac{-33t^2}{21t-4}
\end{aligned}$
\end{enumerate}
\end{document}
答案2
我建议使用这种变体,让方程式位于可用空间的中心,并且行之间有一些垂直填充:
\documentclass[10pt,a4paper]{article}
\usepackage{array, amsmath, enumitem, eqparbox}
\begin{document}
\begin{enumerate}[label=\textbf{(\alph*)},itemsep = 10pt]
\item \hfill\eqmakebox[LEq]{$\begin{aligned}[t]
3t & =\frac{7k}{13}-17\\[0.6ex]
3t-17 & =\frac{7k}{13}\\[0.6ex]
39t+221 & =7k \\[0.6ex]
k & =\frac{39t+221}{7}
\end{aligned}$} \hfill\null
\item \hfill \eqmakebox[LEq]{$\begin{aligned}[t]
7k & =\frac{4k}{3t}-11t \\[0.6ex]
7k-\frac{4k}{3t}&=-11t \\[0.6ex]
k\Bigl(7-\frac{4}{3t}\Bigr) & =-11t \\[0.6ex]
k & =\frac{-11t}{7-\cfrac{4}{3t}}\\[0.6ex]
k & =\frac{-11t}{\cfrac{21t}{3t}-\cfrac{4}{3t}} \\[0.6ex]
k & =\frac{-11t}{\cfrac{21t-4}{3t}}\\[0.6ex]
k & =\frac{-11 × 3t²}{21t-4}\\[0.6ex]
k & =\frac{-33t²}{21t-4}
\end{aligned}$} \hfill\null
\end{enumerate}
\end{document}