I want to create a list of theorems grouped into different sections as shown below. I am happy with the output, but for other reasons that don't bear going into, I want to know if there is a way to use ntheorem's \theoremprework or \theorempostwork commands to achieve the same effect without having to define an inner environment, and then a wrapper environment.





\section{title of section 1}

\begin{theorem}[title of theorem 1.1]
text of theorem 1.1

\begin{theorem}[title of theorem 1.2]
text of theorem 1.2

\section{title of section 2}

\begin{theorem}[title of theorem 2.1]
text of theorem 2.1

\begin{theorem}[title of theorem 2.2]
text of theorem 2.2


You can, but my solution replaces the theoreminner environment and all the stuff that goes with it by redefining the theoremstyles. The idea is, roughly, to capture the title of the theorem (optional )parameter ##3 in a TeX command (\titlethm). So replace in your preamble the definitions of theorem and theoreminner with this code (say you're using plain style):

{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\ (##3)\theorem@separator]\def\titlethm{##3}}%

\theorempostwork{ \addcontentsline{toc}{subsection}{\protect\numberline {\thetheorem}\titlethm}}%

I did not modify the definition in case there is no optional argument because I have no idea whether you would like to have something written in the table of contents or not.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.