# How can I have a \newtheorem… environment refer to its thmnote?

I'm currently using \newtheoremstyle to produce the following output:

Question: How can I easily modify my MWE (see below) so that the a's in my QED boxes say "Name of Thing", "A Different Thing", etc. instead?

Here's what I'd like to have:

Here's my 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)
{}                 % Punctuation after thm head
{ }                % Space after thm head: \newline = linebreak
{\noindent{\underline{\thmnote{#3:}}}}

\theoremstyle{underlinenonum}
\newtheorem*{subcase}{subcase}
\let\mtendsubcase\endsubcase

\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}


Notice that I want to include "Name of Thing", "A Different Thing", etc. as an argument into the subcase theorem environment and have the QED box automatically pull from that argument.

Independently, I've tried using \fbox{\thmnote}}, etc., instead of fbox{a}, but each iteration yields an error. I've also tried Google and searching sXe, all to no avail.

Edit 1: As noted in the comments below, I do not want to manually type the static arguments into the QED boxes, because there will be a number of these environments used successively and I'd like each QED box to reflect its respective thmnote.

• Why not just replace \fbox{a} with \fbox{Name of Thing} ? – Hafid Boukhoulda Feb 24 at 6:30
• @HafidBoukhoulda - I will have a number of these theorems environments in succession, and their arguments/"Name of Thing" will not be constant. I'll edit my question to show that. – cstover Feb 24 at 6:32

Wrap the theorem-like environment in a new one where you can more easily absorb the name and use it as you wish.

I changed the syntax for subcase to have a mandatory argument, which is semantically sounder. And I removed the underlining: sorry, but I can't stand it.

\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)
{}                 % 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}


• As always, your amazingness never ceases to impress! – cstover Feb 25 at 0:13