I'm trying to get a theorem-derived environment to indent the entire block of text. What I have is

\NewDocumentEnvironment{aside}{m o}
    {\asides \label{#1} \addtheocontentsline[]{#1}{Aside}}
    {\asides[#2] \label{#1} \addtheocontentsline[#2]{#1}{Aside}}

where you type \begin{aside}{label}[Title] and it puts it into the TOC based on a discussion here: AMS theorems in table of contents

The whole {aside} block should indent. However, what's happening is that only the header indents and nothing else. (When I try to adjust the indent in the {aside} environment style, the same thing happens}.

  • You have put \end{adjustwidth} in the begin code for the aside environment, ie. before the body starts. This means that in the body the normal indentation is restored, just as you observe. I think the \end{adjustwidth} must be put in the end code, i.e. just before \endasides. I haven't tested it, though. Nov 25 '16 at 23:28
  • If I swap the } with the \endadjustwidth (} \end{adjustwidth} {\endasides}), I end up with the error Extra \endgroup. \end{adjustwidth
    – Necarion
    Nov 26 '16 at 21:32
  • That's not what I meant. ...\ignorespaces} {\end{adjustwidth}\endasides} instead. Nov 26 '16 at 22:34

You're placing wrongly \end{adjustwidth}.



% guess
    #3 \protect\ref{#2}%
    \IfValueT{#1}{ (#1)}%

%\theoremstyle{aside} % no idea what this should be








I had to guess a definition for \addtheocontentsline.

enter image description here


Here is how one could do it very easily with the ntheorem package:



The package defines a customisable \listtheorems command, analog of \listoffigures, except the heading has to be defined.

  • I actually want the aside entries to go in the main ToC rather than in a custom secondary list.
    – Necarion
    Nov 26 '16 at 21:34

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.