\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[left=2.50cm, right=2.54cm, top=2.54cm, bottom=2.54cm]{geometry}
\usepackage{amsthm}
\usepackage{xpatch}%To add . to Def with swapnumber below.
\xpatchcmd\swappedhead{~}{.~}{}{}
%To import frontmatter and mainmatter to the article class
\makeatletter
\newif\if@mainmatter \@mainmattertrue
\newcommand\mainmatter{%
\cleardoublepage
\@mainmattertrue
\pagenumbering{arabic}}
\makeatother
\swapnumbers
\newtheorem{Definition}[equation]{{\large \normalfont\rmfamily\scshape Definition}}
\renewcommand{\theequation}{%
\thesection.%
\ifnum\value{subsection}>0 \arabic{subsection}.\fi
\arabic{equation}%
}
\theoremstyle{remark}
\begin{document}
\section{The unwanted parentheses enclosing \guillemotleft of the drift of u\guillemotright}
\begin{Definition}[of the drift of $u$]
\[\textnormal{Here is the defining sentence.}\]
\end{Definition}
\end{document}
答案1
这里我省略了所有细节。您不需要\swapnumbers
修补\swappednumbers
,因为您修复了定理样式中的格式。
\documentclass{article}
\usepackage{amsthm}
\newtheoremstyle{frode}
{}
{}
{\itshape}
{}
{}
{.}
{0.5em}
{\thmnumber{#2. }\thmname{\textsc{#1}}\thmnote{ (#3)}}
\newtheoremstyle{frodenoparentheses}
{}
{}
{\normalfont}
{}
{}
{.}
{0.5em}
{\thmnumber{#2. }\thmname{\textsc{#1}}\thmnote{ #3}}
\theoremstyle{frode}
\newtheorem{Theorem}[equation]{Theorem}
\theoremstyle{frodenoparentheses}
\newtheorem{Definition}[equation]{Definition}
\begin{document}
\section{Test}
\begin{Theorem}
This is a theorem.
\end{Theorem}
\begin{Theorem}[Somebody]
This is a theorem with a note.
\end{Theorem}
\begin{Definition}
This is a definition.
\end{Definition}
\begin{Definition}[of the drift of $u$]
This is a definition with a note.
\end{Definition}
\end{document}
调整以适合您的测试。但是,请不要使用\large
。
答案2
使用是amsthm
绝对必要的吗?如果不是,您可以简单地从 重新定义定理构建宏latex.ltx
。
(我还从 MWE 中删除了许多不必要的东西。)
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\makeatletter
\def\@begintheorem#1#2{\trivlist
\item[\hskip \labelsep{\bfseries #2\ #1}]\itshape}
\def\@opargbegintheorem#1#2#3{\trivlist
\item[\hskip \labelsep{\bfseries #2\ #1\ #3}]\itshape}
\makeatother
\newtheorem{Definition}[equation]{Definition}
\renewcommand{\theequation}{%
\thesection.%
\ifnum\value{subsection}>0 \arabic{subsection}.\fi
\arabic{equation}%
}
\begin{document}
\section{No unwanted parentheses}
\begin{Definition}[of the drift of $u$]
\[\textnormal{Here is the defining sentence.}\]
\end{Definition}
\end{document}
如果您希望使用amsthm
,软件包手册第 10 页对此进行了解释。您需要创建一个新的定理样式(以下内容引自该手册)。
\newtheoremstyle{noparens}%
{}{}%
{\itshape}{}%
{\bfseries}{.}%
{ }%
{\thmname{#1}\thmnumber{ #2}\thmnote{ #3}}
并将其用于你的定理;你需要根据你的具体情况适当调整定理头格式的字体命令。