我希望我的 LaTeX 文档中有两种不同风格的定理,以区分原创和非原创作品。对于其中一种,我希望“定理”带有下划线,而对于另一种,我希望没有额外的文本修饰(正常情况下)。
我通常使用 amsthm 包来证明定理。
例如,我想要两个如下所示的不同定理。
\textbf{Theorem 2.2.} \textit{blah blah blah}
\underline{\textbf{Theorem 2.3.}} \textit{blah blah blah}
答案1
像这样?
\documentclass{article}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[amsmath,thmmarks]{ntheorem}
\makeatletter
\newtheoremstyle{myu}%
{\item[\hskip\labelsep \ \bf\underline{##1 \theorem@headerfont ##2.}]}%
\makeatother
\makeatletter
\newtheoremstyle{myn}%
{\item[\hskip\labelsep \ \bf ##1 \theorem@headerfont ##2.]}%
\makeatother
\theoremstyle{myn}
\newtheorem{theoremn}{Theorem} %<-- Normal Theorem Definition
\theoremstyle{myu}
\newtheorem{theoremu}[theoremn]{Theorem}%<-- Underlined Theorem Definition
\begin{document}
\section{Introduction}
Theorems can easily be defined
\begin{theoremn}
Let $f$ be a function whose derivative exists in every point, then $f$
is a continuous function.
\end{theoremn}
\begin{theoremu}
Let $f$ be a function whose derivative exists in every point, then $f$
is a continuous function.
\end{theoremu}
\begin{theoremn}
Let $f$ be a function whose derivative exists in every point, then $f$
is a continuous function.
\end{theoremn}
\begin{theoremu}
Let $f$ be a function whose derivative exists in every point, then $f$
is a continuous function.
%\noindent\underline{\makebox[3mm][l]{Jane Doe}}
\end{theoremu}
\begin{theoremu}
Let $f$ be a function whose derivative exists in every point, then $f$
is a continuous function.
\end{theoremu}
\end{document}