我想在与包含它的包发生冲突的类中实现 \qedhere

我想在与包含它的包发生冲突的类中实现 \qedhere

我正在提交一篇需要 LMS 类文件的论文:

https://www.lms.ac.uk/sites/lms.ac.uk/files/Publications/lmsclass.tar_.gz

我需要使用\qedhere来在几个地方定位证明结束的墓碑,但是不能,因为 amsthm.sty 和 ntheorem.sty 都与使用类文件的请求方式不兼容(ntheorem.sty 不会直接抛出错误,但我还没有找到一种方法来使定理正确显示,并且该类使用它自己的定理环境定义系统。)

我可以将任何东西放入我的文档本身,而不修改类,这样我就可以成功使用 \qedhere 吗?

答案1

这将允许您使用proof环境amsthm而不改变类定义的类定理结构,但也许文字编辑不会高兴。

\documentclass{lms}

%Include your preferred graphics and mathematics packages here,
%using the command \usepackage{}

\usepackage{etoolbox}

\makeatletter
\AtEndPreamble{%
  \let\proof\relax
  \let\endproof\relax
  \let\old@thm\@thm
  \let\old@xthm\@xthm
  \let\old@ythm\@ythm
  \let\old@begintheorem\@begintheorem
  \usepackage{amsthm}%
  \let\@thm\old@thm
  \let\@xthm\old@xthm
  \let\@ythm\old@ythm
  \let\@begintheorem\old@begintheorem
}
\makeatother

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}

\newnumbered{assertion}{Assertion}    % 1st argument is your name for it
\newnumbered{conjecture}{Conjecture}  % 2nd argument is what is printed


% TOP MATTER

\title[Using]
  {Using the LMS class file} % This is the full title of the paper

\author{F. Irst, Second Author and T. Hird}

\dedication{A dedication can be included here}

\classno{11B83 (primary), 11J71, 37A45, 60G10 (secondary).}

\extraline{Acknowledgements of grants and financial support should
be included here; more general \textsl{Acknowledgements} are better
placed either immediately before the bibliography (see
page~\pageref{ackref}) or at the end of the introduction. Since
author names should not carry footnote marks, instead refer to `The
first author', etc. No `keywords' should be supplied.}

\begin{document}
\maketitle

\begin{abstract}
This is a combined guide and sample \texttt{.tex} file for authors
choosing to prepare their papers for the journals of the London
Mathematical Society with the LMS \LaTeXe\ class file. Papers
written in \texttt{article.cls} or \texttt{amsart.cls} are easily
converted to \texttt{lms.cls}, and this can reduce the time to
publication. The LMS class is compatible with commonly used
mathematical packages such as \texttt{amsmath}.

An \emph{abstract} written in English is
required and should preferably have fewer than 200 words.
Please do not include citations, footnotes or references
to numbered equations, figures, tables or theorems in your
abstract. Avoid complicated formulae or displayed equations, if
possible.
\end{abstract}

\section{Introduction}
\label{intro}

Some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text

\begin{theorem}
Abc
\end{theorem}

\begin{proof}
Abc
\[1=1\qedhere\]
\end{proof}

\end{document}

在此处输入图片描述

相关内容