\qedhere 证明描述中的警告

\qedhere 证明描述中的警告

当我设计我的iff 证明如下,我收到此警告:

\qedhere 命令在这里可能无法正常工作

有没有办法修复这个警告,因为结果看起来不错,或者用另一种方式完成这种格式化?[编辑:我想让 qed-square 与第二个“Wohoo”处于相同的高度。]

看起来不错

这是一个小型的工作示例,可确保上述风格:

\documentclass[a4paper]{report}

\usepackage{mathtools}
\usepackage{csquotes}
\usepackage{amsthm}
\usepackage{enumitem}
\setdescription{font=\normalfont\itshape}

\begin{document}
\begin{proof}$ $\par
\begin{description}[topsep=0pt]
    \item[\enquote{$\Rightarrow$}] This is one direction of the proof. It might include some formulas. Something along the lines of $a^2+b^2=c^2$. Wohoo.

    \item[\enquote{$\Leftarrow$}] This is the other direction of the proof. It might include some formulas. Something along the lines of $a^2+b^2=c^2$. Wohoo.$\hfill\qedhere$
\end{description}
\end{proof}
Some follow up text. And more of it. And more of it. Let's make it two lines of follow up text for some reason.

\end{document}

谢谢!

答案1

您误用了\qedhere。应该只是这样,而不是$\hfill\qedhere$

\documentclass[a4paper]{report}

\usepackage{mathtools}
\usepackage{csquotes}
\usepackage{amsthm}
\usepackage{enumitem}
\setdescription{font=\normalfont\itshape}

\begin{document}
\begin{proof}\mbox{}
\begin{itemize}[topsep=0pt]
\item[\enquote{$\Rightarrow$}] This is one direction of the proof.
It might include some formulas. Something along the lines
of $a^2+b^2=c^2$. Wohoo.

\item[\enquote{$\Leftarrow$}] This is the other direction of the proof.
It might include some formulas. Something along the lines of $a^2+b^2=c^2$.
Wohoo.\qedhere
\end{itemize}
\end{proof}

Some follow up text. And more of it. And more of it. Let's make it two
lines of follow up text for some reason.

\end{document}

在此处输入图片描述

顺便说一句,不要$ $\par输入 ,而要输入\mbox{}。我用itemize,因为箭头周围的斜体引号太糟糕了。

我发现使用简单的段落而不是逐项证明是更好的风格。

\documentclass[a4paper]{report}

\usepackage{mathtools}
\usepackage{csquotes}
\usepackage{amsthm}
\usepackage{enumitem}

\begin{document}
\begin{proof}
\enquote{$\Rightarrow$} This is one direction of the proof.
It might include some formulas. Something along the lines
of $a^2+b^2=c^2$. Wohoo.

\enquote{$\Leftarrow$} This is the other direction of the proof.
It might include some formulas. Something along the lines of $a^2+b^2=c^2$.
Wohoo.
\end{proof}

Some follow up text. And more of it. And more of it. Let's make it two
lines of follow up text for some reason.

\end{document}

在此处输入图片描述

在我看来,同样清晰,甚至更好。

答案2

只需放置\qedhereproof环境之后:

\documentclass[a4paper]{report}

\usepackage{mathtools}
\usepackage{csquotes}
\usepackage{amsthm}
\usepackage{enumitem}
\setdescription{font=\normalfont\itshape}

\begin{document}
\begin{proof}$ $\par
\begin{description}[topsep=0pt]
    \item[\enquote{$\Rightarrow$}] This is one direction of the proof. It might include some formulas. Something along the lines of $a^2+b^2=c^2$. Wohoo.

    \item[\enquote{$\Leftarrow$}] This is the other direction of the proof. It might include some formulas. Something along the lines of $a^2+b^2=c^2$. Wohoo.
\end{description}
\end{proof}
$\hfill\qedhere$
Some follow up text. And more of it. And more of it. Let’s make it two lines of follow up text for some reason.

\end{document}

如果你不想\qed每次使用proof环境时都放置它,你可以在序言中重新定义它:

\let\Oldproof\proof
\renewenvironment{proof}{\begin{Oldproof}}{\end{Oldproof}$\hfill\qed$}

答案3

另外,一定要使用\[...\]而不是$$...$$。我发现过这样一种情况,即使amsthm在 之后正确加载了包amsmath,仍然会出现可能无法正常工作的警告\qedhere(它看起来很好),而更改 display math 命令会删除它,原因我不知道。

相关内容