如何将 qedsymbol 放在数组环境的末尾?

如何将 qedsymbol 放在数组环境的末尾?

我想在非证明环境的末尾放置一个 qedsymbol,例如

\begin{theorem}
This is a funny equation
\[
\begin{array}{rcl}
x+y&=&z,\\
a+b&=&c.
\end{array}
\]
\end{theorem}

我想把符号放在

a+b=c

但不是整个方程式列表的右侧。

并且在证明环境中,我想将 qedsymbol 放在 a+b=c 行的右侧,而不是整个方程式列表的右侧。

\begin{proof}
So we have
\[
\begin{array}{rcl}
x_1+y^2&=&z^3,\\
a^2+b_2&=&c^6.
\end{array}
\]
\end{proof}

问题: 谁有好的办法把这两件事结合起来?

我的所有代码如下。

\documentclass[11pt,b5paper]{ctexbook}
\usepackage{amsmath,amsthm,amssymb,amsfonts,mathrsfs}
%%%change qedsymbol%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\qedsymbol}{\ensuremath\boxtimes}
%%%set theorems%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\theoremstyle{theorem}
\newtheorem{theorem}{定理}[section]
\newtheorem{lemma}[theorem]{引理}
\newtheorem{corollary}[theorem]{推论}
\newtheorem{proposition}[theorem]{命题}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{定义}
\newtheorem{remark}[theorem]{评注}
\newtheorem{example}[theorem]{示例}
\newtheorem{exercise}[theorem]{习题}
\newtheorem{thesis}[theorem]{论题}
\newtheorem{conjecture}[theorem]{猜想}
\newtheorem{convention}[theorem]{约定}
\newtheorem{problem}[theorem]{问题}
\newtheorem{axiom}[theorem]{公理}    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{theorem}
This is a funny equation
\[
\begin{array}{rcl}
x+y&=&z,\\
a+b&=&c.\qedhere
\end{array}
\]
\end{theorem}

\begin{proof}
So we have
\[
\begin{array}{rcl}
x_1+y^2&=&z^3,\\
a^2+b_2&=&c^6.\qedhere
\end{array}
\]
\end{proof}


\begin{proof}
So we have
\begin{align*}
x+y&=z,\\
a+b&=c.\qedhere
\end{align*}
\end{proof}

\end{document}

编译后的PDF示例也如下。

在此处输入图片描述

笔记:我定义的新命令\myqed只能在公式环境中起作用(只有一行公式),但在环境中不起作用align*。所以我还是没有解决问题。

答案1

我修复了你的代码:

\documentclass[11pt,b5paper]{ctexbook}
\usepackage{amsmath,amsthm,amssymb,amsfonts,mathrsfs}
%%%change qedsymbol%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\qedsymbol}{\ensuremath\boxtimes}
%%%set theorems%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\theoremstyle{theorem}
\newtheorem{theorem}{定理}[section]
\newtheorem{lemma}[theorem]{引理}
\newtheorem{corollary}[theorem]{推论}
\newtheorem{proposition}[theorem]{命题}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{定义}
\newtheorem{remark}[theorem]{评注}
\newtheorem{example}[theorem]{示例}
\newtheorem{exercise}[theorem]{习题}
\newtheorem{thesis}[theorem]{论题}
\newtheorem{conjecture}[theorem]{猜想}
\newtheorem{convention}[theorem]{约定}
\newtheorem{problem}[theorem]{问题}
\newtheorem{axiom}[theorem]{公理}    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{theorem}
This is a funny equation
\begin{align*}
x+y&=z,\\
a+b&=c.\qedhere
\end{align*}
\end{theorem}

\begin{proof}
So we have
\begin{align*}
x_1+y^2&=z^3,\\
a^2+b_2&=c^6.\qedhere
\end{align*}
\end{proof}


\begin{proof}
So we have
\begin{align*}
x+y&=z,\\
a+b&=c.\qedhere
\end{align*}
\end{proof}

\end{document}

在此处输入图片描述

如果数组环境是定理或证明环境中的最后一个对象,那么您应该执行以下操作:

\begin{theorem}
This is a funny equation
\[
\begin{array}[b]{...}
....
\end{array}\qedhere
\]
\end{theorem}

答案2

\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{thm}{Theorem}
\newenvironment{theorem}[1][]{\begin{thm}[#1]\pushQED{\qed}}{\popQED\end{thm}}
\begin{document}
\begin{theorem}
This is a funny equation
\begin{align*}
x+y&=z,\\
a+b&=c.\qedhere
\end{align*}
\end{theorem}

\begin{proof}
So we have
\begin{align*}
x+y&=z,\\
a+b&=c.\qedhere
\end{align*}
\end{proof}
\end{document}

在此处输入图片描述

相关内容