如何讓 \newtheorem... 環境引用其 thmnote?

如何讓 \newtheorem... 環境引用其 thmnote?

我目前正在使用\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}

在此輸入影像描述

相關內容