我怎样才能做到这一点?
当我将\qedhere
正方形放入cases环境中时,正方形位于边距之间的某个位置。它不是正方形在通常的proof环境中出现的位置,即右边距。
\documentclass{amsart}
\usepackage{amssymb, amsmath, amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem*{ut}{Theorem}
\begin{document}
\begin{proof}
$$
X(m,n)=
\begin{cases}
x(n),\\
x(n-1)\\
x(n-1)\qedhere
\end{cases}
$$
\end{proof}
\begin{ut}The sky is blue.\end{ut}
\begin{proof}Duh.\end{proof}
\end{document}
答案1
虐待gathered
:
\documentclass{amsart}
\usepackage{amssymb, amsmath, amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem*{ut}{Theorem}
\begin{document}
\begin{proof}
\[
\begin{gathered}[b]
X(m,n)=
\begin{cases}
x(n),\\
x(n-1)\\
x(n-1)
\end{cases}
\\
\end{gathered}
\qedhere
\]
\end{proof}
\begin{ut}The sky is blue.\end{ut}
\begin{proof}Duh.\end{proof}
\end{document}
我认为这不是正确的地方,因为基线应该由X(m,n)。
答案2
您可以将盒子放在\qedhere
外面cases
并抬起。或者,参见跟进以避免必须针对每个不同的环境重新计算加薪金额cases
。
\documentclass{amsart}
\usepackage{amssymb, amsmath, amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem*{ut}{Theorem}
\begin{document}
\begin{proof}
\[
\raisebox{1.2\baselineskip}{$\displaystyle
X(m,n)=
\begin{cases}
x(n),\\
x(n-1)\\
x(n-1)
\end{cases}$}
\qedhere
\]
\end{proof}
\begin{ut}The sky is blue.\end{ut}
\begin{proof}Duh.\end{proof}
\end{document}
跟进:
如果您不想每次都计算移位,您可以使用包stackengine
来\abovebaseline[-\dp\strutbox]{...}
代替\raisebox{shift length}{...}
。
答案3
按照 @egreg 关于 位置的建议qed symbol
,几乎无需执行任何操作:只需替换$$ … $$
为\[ … \]
。还有一个更具启发性的例子来说明为什么后者更可取:
\documentclass{amsart}
\usepackage{amssymb, amsmath, amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem*{ut}{Theorem}
\begin{document}
\begin{proof}[Proof 1]
\[
X(m,n)=
\begin{cases}
x(n), \\ x(n-1)\\ x(n-1)
\end{cases}
\qedhere
\]
\end{proof}
\vskip4ex
\begin{proof}[Proof 2]
$$
X(m,n)=
\begin{cases}
x(n), \\ x(n-1) \\ x(n-1)
\end{cases}
\qedhere
$$
\begin{ut}The sky is blue.\end{ut}
\begin{proof}Duh.\end{proof}
\end{proof}
\end{document}