![我怎样才能让 \newtheorem... 环境引用其 thmnote?](https://linux22.com/image/391148/%E6%88%91%E6%80%8E%E6%A0%B7%E6%89%8D%E8%83%BD%E8%AE%A9%20%5Cnewtheorem...%20%E7%8E%AF%E5%A2%83%E5%BC%95%E7%94%A8%E5%85%B6%20thmnote%EF%BC%9F.png)
我目前正在使用\newtheoremstyle
来产生以下输出:
问题:我如何才能轻松修改我的 MWE(见下文),以便A我的 QED 框中写的是“事物名称”、“不同事物”等等?
以下是我想要的:
这是我的 MWE:
\documentclass[12pt]{article}
\usepackage{amsthm}
\newtheoremstyle{underlinenonum}% name
{-1.5mm} % Space above, empty = `usual value'
{} % Space below
{} % Body font
{\parindent} % Indent amount (empty = no indent, \parindent = para indent)
{} % Thm head font
{} % Punctuation after thm head
{ } % Space after thm head: \newline = linebreak
{\noindent{\underline{\thmnote{#3:}}}}
\theoremstyle{underlinenonum}
\newtheorem*{subcase}{subcase}
\let\mtendsubcase\endsubcase
\renewcommand{\endsubcase}{\renewcommand\qedsymbol{\tiny\fbox{a}}\qed\mtendsubcase}
\begin{document}
\begin{subcase}[Name of Thing] This is a thing I would like to say.\end{subcase}
\begin{subcase}[A Different Thing] This is a \textit{different} thing I would like to say, and I need a QED to automatically reflect \textit{its} argument.\end{subcase}
\end{document}
请注意,我想将“事物名称”、“不同事物”等作为参数纳入subcase
定理环境,并让 QED 框自动从该参数中提取。
我也曾尝试使用\fbox{\thmnote}}
等代替 ,fbox{a}
但每次迭代都会产生错误。我也尝试过谷歌和搜索 sXe,但无济于事。
编辑1:正如以下评论所述,我不要想要手动将静态参数输入 QED 框中,因为将会连续使用多个这样的环境,并且我希望每个 QED 框都能反映其各自的thmnote
。
答案1
将类似定理的环境包装在一个新的环境中,您可以更轻松地吸收名称并根据需要使用它。
我修改了语法,使其subcase
具有强制参数,这在语义上更合理。我还删除了下划线:抱歉,但我无法忍受。
\documentclass[12pt]{article}
\usepackage{amsthm}
\newtheoremstyle{underlinenonum}% name
{-1.5mm} % Space above, empty = `usual value'
{} % Space below
{} % Body font
{\parindent} % Indent amount (empty = no indent, \parindent = para indent)
{} % Thm head font
{} % Punctuation after thm head
{ } % Space after thm head: \newline = linebreak
{\noindent\textbf{\thmnote{#3:}}}
\theoremstyle{underlinenonum}
\newtheorem*{subcaseinner}{subcase}
\newenvironment{subcase}[1]
{%
\renewcommand\qedsymbol{\subcaseqed{#1}}%
\subcaseinner[#1]%
}
{\qed\endsubcaseinner}
\newcommand{\subcaseqed}[1]{\fbox{\tiny #1}}
\begin{document}
\begin{subcase}{Name of Thing}
This is a thing I would like to say.
\end{subcase}
\begin{subcase}{A Different Thing}
This is a \textit{different} thing I would like to say, and I need
a QED to automatically reflect \textit{its} argument.
\end{subcase}
\end{document}