ntheorem Endmark On Line 单独运行无法正确刷新

ntheorem Endmark On Line 单独运行无法正确刷新

ntheorem似乎可以成功处理所有可能的终点标记位置,除了单独放置在一条线上的情况。

我注意到列表后面的问题,所以我将其包含在 MWE 中。

另外,我对 LaTeX 还比较陌生,所以我无法想出填充该行并将结束标记推到下一个的常规文本。

梅威瑟:

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{newtxtext}
\usepackage{newtxmath} % requires amsmath
\usepackage[document]{ragged2e}
\usepackage[amsmath, thmmarks]{ntheorem}
\usepackage[inline]{enumitem}

\newlist{examplelist}{enumerate}{1}
\setlist[examplelist]{label=(\alph*), nosep, wide, labelwidth=!, labelindent=0pt}

\theoremstyle{plain}
\theoremheaderfont{\sffamily\fontseries{bc}\selectfont\normalsize}
\theorembodyfont{\normalfont}
\theoremseparator{}
\theorempreskip{\topsep}
\theorempostskip{\topsep}
\theoremindent0pt
\theoremnumbering{arabic}
\theoremsymbol{$\blacksquare$}
\newtheorem{example}{EXAMPLE}

\begin{document}

\begin{example}

\begin{examplelist}
\item First item would go here.
\item But if there's lots of text in the next item that fills the last line in the theorem, ntheorem correctly places the endmark on the subsequent line, but it's not flush right.
\end{examplelist}

\end{example}

\end{document}

MWE 输出

AMS 风格规定:

如果 QED 框位于整行文本、显示或列表之后,则可能会落在单独的行上。(第 32 页,2017 年 10 月)

这是我在 SE 上的第一个问题。它为我解决了很多问题,提供了很大的帮助。

答案1

好吧,我只有一个解决方法:

\begin{examplelist}
\NoEndMark % <==========================================================
\item First item would go here.
\item But if there's lots of text in the next item that fills the last 
line in the theorem, ntheorem correctly places the endmark on the 
subsequent line, but it's not flush right. 

\hfill \exampleSymbol % <===============================================
\end{examplelist}

我以前\NoEndMark没有自动结束标记。然后——重要的-- 我添加了一个空白行并用 手动添加了所需的结束标记\hfill \exampleSymbol

这不是自动解决方案,但是您会在行尾而不是行首获得结束标记。

附完整代码

\documentclass{book}

\usepackage[T1]{fontenc}
\usepackage{newtxtext}
\usepackage{newtxmath} % requires amsmath

%\usepackage[document]{ragged2e}
\usepackage[amsmath, thmmarks]{ntheorem}
\usepackage[inline]{enumitem}

\newlist{examplelist}{enumerate}{1}
\setlist[examplelist]{label=(\alph*), nosep, wide, labelwidth=!, labelindent=0pt}

\theoremstyle{plain}
\theoremheaderfont{\sffamily\fontseries{bc}\selectfont\normalsize}
\theorembodyfont{\normalfont}
\theoremseparator{}
\theorempreskip{\topsep}
\theorempostskip{\topsep}
\theoremindent0pt
\theoremnumbering{arabic}
\theoremsymbol{$\blacksquare$}
\newtheorem{example}{EXAMPLE}

\begin{document}

\begin{example}

\begin{examplelist}
\NoEndMark % <==========================================================
\item First item would go here.
\item But if there's lots of text in the next item that fills the last 
line in the theorem, ntheorem correctly places the endmark on the 
subsequent line, but it's not flush right. 

\hfill \exampleSymbol % <===============================================
\end{examplelist}

\end{example}

\end{document}

您将获得结果:

在此处输入图片描述

答案2

在列表后添加一个\strut,以创建一个新的空白行,似乎有效。另请注意,文档中的示例都将定理结束符号定义为类似于\theoremsymbol{\ensuremath{_\blacksquare}}

如果您重新定义\qedsymbol,我建议,您可以在任何行的末尾插入一个右齐的证明结束符号\hfill\qedsymbol

在这个例子中,我使用了我个人最喜欢的变体,\QED来自 STIX 字体(它出现在 DEK 的一些版本中)计算机编程艺术)。

\documentclass{book}
\usepackage[paperwidth = 10cm]{geometry} % An appropriate width for a MWE
                                         % on TeX.SX.  Delete this.
\usepackage{amsmath}
\usepackage[amsmath, thmmarks]{ntheorem}
\usepackage{unicode-math}
\usepackage[inline]{enumitem}
%\usepackage{stix}

\defaultfontfeatures{ Scale = MatchLowercase, Ligatures = TeX }
\setmainfont{TeX Gyre Termes}[Scale = 1.0, Ligatures = Common]
\setsansfont{TeX Gyre Heros}[Ligatures = Common]
\setmathfont{TeX Gyre Termes Math}
\setmathfont[range=\QED, Scale=MatchUppercase]{XITS Math}

% The “tombstone” QED symbol introduced by Paul Halmos, and used in some
% editions of DEK’s The Art of Computer Programming:
\renewcommand\qedsymbol{\ensuremath{\QED}}

\newlist{examplelist}{enumerate}{1}
\setlist[examplelist]{label=(\alph*), nosep, wide, labelwidth=!, labelindent=0pt}

\theoremstyle{plain}
\theoremheaderfont{\normalfont\sffamily\bfseries\selectfont}
\theorembodyfont{\normalfont}
\theoremseparator{}
\theorempreskip{\topsep}
\theorempostskip{\topsep}
\theoremindent 0pt
\theoremnumbering{arabic}
\theoremsymbol{\ensuremath{_\qedsymbol}}
\newtheorem{example}{EXAMPLE}

\begin{document}

\begin{example}

\begin{examplelist}
\item First item would go here.
\item Clear the line:
\end{examplelist}
\strut

\end{example}
\end{document}

定理示例

如果您必须或更愿意使用 PDFLaTeX,那么只要您删除所有unicode-math行并加载,该示例也将有效stix

相关内容