![alignat 环境中的列表被推到右侧](https://linux22.com/image/315818/alignat%20%E7%8E%AF%E5%A2%83%E4%B8%AD%E7%9A%84%E5%88%97%E8%A1%A8%E8%A2%AB%E6%8E%A8%E5%88%B0%E5%8F%B3%E4%BE%A7.png)
如何让此列表水平居中?
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\begin{document}
\noindent {\bf Example} \vskip1.25mm
\noindent \hspace*{1em}
\begin{minipage}{5.75in}
Verify the following evaluations of the sine and cosine functions.
\begin{alignat*}{6}
{\mathrm{i.})} \ &\sin(120^{\circ}) = \frac{\sqrt{3}}{2}
\qquad \quad
&{\mathrm{ii.})} \ &\sin(135^{\circ}) = \frac{\sqrt{2}}{2}
\qquad \quad
&{\mathrm{iii.})} \ &\sin(150^{\circ}) = \frac{1}{2} \\
{\mathrm{iv.})} \ &\cos(120^{\circ}) = -\frac{1}{2}
\qquad \quad
&{\mathrm{v.})} \ &\cos(135^{\circ}) = -\frac{\sqrt{2}}{2}
\qquad \quad
&{\mathrm{vi.})} \ &\cos(150^{\circ}) = -\frac{\sqrt{3}}{2}
\end{alignat*}
\end{minipage}
\end{document}
答案1
删除使用minipage
, as align
- 及其朋友相对于文本块的中心:
\documentclass{amsart}
\usepackage{showframe}% Just for this example
\begin{document}
\noindent \textbf{Example}
\noindent
Verify the following evaluations of the sine and cosine functions.
\begin{alignat*}{6}
\textrm{i.)~} & \sin(120^{\circ}) = \frac{\sqrt{3}}{2} \qquad \quad
& \textrm{ii.)~} & \sin(135^{\circ}) = \frac{\sqrt{2}}{2} \qquad \quad
& \textrm{iii.)~} & \sin(150^{\circ}) = \frac{1}{2} \\
\textrm{iv.)~} & \cos(120^{\circ}) = -\frac{1}{2} \qquad \quad
& \textrm{v.)~} & \cos(135^{\circ}) = -\frac{\sqrt{2}}{2} \qquad \quad
& \textrm{vi.)~} & \cos(150^{\circ}) = -\frac{\sqrt{3}}{2}
\end{alignat*}
\end{document}
答案2
并不是真正居中,但编号是随着任务自动进行的package
,并且代码也更简单:
\documentclass{amsart}
\usepackage[showframe]{geometry}
\usepackage{tasks}
\settasks{counter-format=(tsk[a]), label-offset = 0.5em, label-align=right, column-sep=3em, before-skip=1.5ex}
\begin{document}
\noindent \textbf{Example}\bigskip
\noindent
Verify the following evaluations of the sine and cosine functions.
\begin{tasks}[counter-format=tsk[r].),label-width=2em](3)
\task $\sin(120^{\circ}) = \frac{\sqrt{3}}{2}$
\task $ \sin(135^{\circ}) = \frac{\sqrt{2}}{2}$
\task $ \sin(150^{\circ}) = \frac{1}{2}$
\task $ \cos(120^{\circ}) = -\frac{1}{2}$
\task $\cos(135^{\circ}) = -\frac{\sqrt{2}}{2}$
\task $ \cos(150^{\circ}) = -\frac{\sqrt{3}}{2} $
\end{tasks}
\end{document}