2

I am having trouble nesting custom theorem environments in such a way that the inner environment does not inherit the characteristics (e.g. HEADFONT, etc.) of the outer environment.

Possibly the reason is that I hacked a numbered paragraph environment where the numbering is in parentheses. The parentheses seem to persist in the inner environment.

EXAMPLE:

\documentclass{article}

\usepackage{amsthm}

\theoremstyle{definition}
\newtheorem{defn}{Definition}[section]

\newtheoremstyle{parag}
  {\topsep}   % ABOVESPACE
  {\topsep}   % BELOWSPACE
  {}    % BODYFONT
  {}       % INDENT (empty value is the same as 0pt)
  {\bfseries(} % HEADFONT
  {)}         % HEADPUNCT
  { } % HEADSPACE
  {}          % CUSTOM-HEAD-SPEC
\theoremstyle{parag}
\newtheorem{pp}[defn]{}    


\begin{document}
\section{Products}

\begin{defn}
    A definition outside the numbered paragraph.
\end{defn}

\begin{pp}
    This is a numbered paragraph
    \begin{defn}
        A definition inside a paragraph has leading open parentheses
    \end{defn}
\end{pp}

\end{document}
  • 1
    Why exactly do you want to nest theorems? If the offending opening parenthesis was gone, what would notify a reader that theorem 1.3 is an "inner" environment? – lockstep Jan 3 '12 at 22:40
  • 1
    Theorem environments are not supposed to nested, at least with amsthm; you can try ntheorem. – egreg Jan 3 '12 at 22:53
  • 2
    I would strongly encourage you to define pp in another way (doing it by hand is not difficult, and you can ask here on TeX.SE if you have problems;).) Basically, you shouldn't need much more than \newcounter, \arabic and \refstepcounter. – mbork Jan 4 '12 at 1:09
3

You'll just have to re-define the theorem styles yourself. amsthm.sty bypasses its own user interface for the three pre-defined styles plain, definition and remark, so it won't explicitly clear many of the variables.

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.