我希望 QED 符号在证明末尾低 1 行

我希望 QED 符号在证明末尾低 1 行

正如我的标题所说,我希望我的 qed 符号比证明的最后一行低一行。默认情况下,它在同一行上,并向右对齐。

我怎样才能实现这个目标?

编辑:请参阅下面的代码作为示例:

\documentclass[11pt,a4paper]{article}
\usepackage[margin=3cm]{geometry}
\usepackage[english]{babel}
\usepackage{amsmath, amsthm}
\begin{document}

\begin{proof}
    Hello there good chap! I'll put in another line here just to be sure its clear what I mean.
\end{proof}



\end{document}

答案1

在你的序言中添加以下几行:

\usepackage{etoolbox}
\patchcmd{\endproof}
  {\popQED}
  {\par\popQED}
  {}
  {}

通过这种方式,我们修补proof环境(其结束部分)以在打印 qed 符号之前\endproof发出。\par

完成 MWE:

\documentclass[11pt,a4paper]{article}
\usepackage[margin=3cm]{geometry}
\usepackage[english]{babel}
\usepackage{amsmath, amsthm}

\usepackage{etoolbox}
\patchcmd{\endproof}
  {\popQED}
  {\par\popQED}
  {}
  {}

\begin{document}

\begin{proof}
    Hello there good chap! I'll put in another line here just to be sure its clear what I mean.
\end{proof}

\end{document} 

输出:

在此处输入图片描述

答案2

不要这样做。大多数情况下,墓碑会不知从何而来。

\documentclass[a4paper]{article}
\usepackage{amsthm}

% lower the symbol and make it zero width
\renewcommand{\qedsymbol}{\raisebox{-\baselineskip}{\llap{\openbox}}}

\begin{document}

\begin{proof}
This is a proof that this setting is \emph{really bad}
\end{proof}

\end{document}

在此处输入图片描述

答案3

\par\nobreak在设置“QED 段落”之前发出一个似乎足够了(没有经过彻底测试) :

在此处输入图片描述

\documentclass{article}
\usepackage{amsthm,amsmath,xpatch}
\newtheorem{theorem}{Theorem}

% \xpatchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\xpatchcmd{\qed}{\leavevmode}{\par\nobreak\leavevmode}{}{}

\begin{document}
\begin{proof}
\begin{equation}
  f(x) = ax^2 + bx + c
\end{equation}
\end{proof}

\begin{proof}
\begin{equation}
  f(x) = ax^2 + bx + c
\end{equation}
Some more text.
\end{proof}
\end{document}

相关内容