在枚举语句末尾的证明环境中 LaTeX 中 \qed 符号的输出
我的目标是将 \qed
符号放在 \begin{enumerate}
块中最后一个 \item
语句的同一行中enumitem 已放置。 在我开发的证明中,我得到了三个不同的结果:
- 使用 amsmath,
\qed
符号被放置在下一行。 - 使用
\usepackage[standard]{ntheorem}
,结果是相同的(下一行中的\qed
)。 - 对于
\usepackage[amsthm,thmmarks]{ntheorem}
,它会在\qed
符号必须出现的位置(即,在结束语句\item
的同一行)
我发现了一个奇怪且不容易的解决方案,在任何一个之后编写 \vspace{-1.5\baselineskip}
\end{enumerate}
语句或将 \hspace{1cm} \qedhere
添加到数学公式的最后一行。
我做错了什么?
示例:
\documentclass[a4paper,11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{amssymb} % Conjunto de símbolos matemáticos
\usepackage{amsthm} % Formato para enunciados y demostraciones
\usepackage{enumitem}
%
\usepackage[amsthm,thmmarks]{ntheorem}
%\usepackage[standard]{ntheorem}
%
\renewcommand\qedsymbol{$\blacksquare$}
%
\begin{document}
\chapter*{Preface}
Lorem ipsum dolor sit amet, consectetur adipiscing elit
\begin{proof}
\begin{enumerate}
\item item 1
\item item 2
\item item 3
\end{enumerate}
\end{proof}
\end{document}
结果为:
My aim is to place the \qed
symbol in the same line in which the last \item
statement within a \begin{enumerate}
block with enumitem is placed.
In the proofs I've developed I got three different results:
- Using amsmath, the
\qed
symol is placed in a next line. - Using
\usepackage[standard]{ntheorem}
, the result is the same (\qed
in the next line). - With
\usepackage[amsthm,thmmarks]{ntheorem}
, it appears the text "None" in the place in which the\qed
symbol must appear (that is, in the same line in which ends the statement\item
)
I've found a strange and not easy solution writing \vspace{-1.5\baselineskip}
after any one of the \end{enumerate}
statements or adding \hspace{1cm} \qedhere
into the last line of a math formula.
What I'm doing wrong?
Example:
\documentclass[a4paper,11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{amssymb} % Conjunto de símbolos matemáticos
\usepackage{amsthm} % Formato para enunciados y demostraciones
\usepackage{enumitem}
%
\usepackage[amsthm,thmmarks]{ntheorem}
%\usepackage[standard]{ntheorem}
%
\renewcommand\qedsymbol{$\blacksquare$}
%
\begin{document}
\chapter*{Preface}
Lorem ipsum dolor sit amet, consectetur adipiscing elit
\begin{proof}
\begin{enumerate}
\item item 1
\item item 2
\item item 3
\end{enumerate}
\end{proof}
\end{document}
Result is:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
永远不要忽略错误消息。您的代码无法编译。日志文件中的错误消息将告诉您,当您在加载
amsthm
后尝试加载ntheorem
包时,普通定理样式已被定义。发生错误后,Latex 只能恢复足够的语法来检查文档的其余部分,不一定会产生合理的输出。只要存在错误,查看结果就没有意义。正如您从示例中看到的,输出没有意义。Never ignore error messages. Your code does not compile. The error message in the log file will tell you that the plain theorem style is already defined when you try to load the
ntheorem
package after you've already loadedamsthm
. After an error, latex only recovers enough to syntax check the rest of the document, not necessarily producing sensible output. There is no point in looking at the result as long as you've errors. As you can see from your example, the output just does not make sense.