3

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}
3
  • 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, 2012 at 22:40
  • 1
    Theorem environments are not supposed to nested, at least with amsthm; you can try ntheorem.
    – egreg
    Jan 3, 2012 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, 2012 at 1:09

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .