# Nested custom theorems using amsthm

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

-
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
Theorem environments are not supposed to nested, at least with amsthm; you can try ntheorem. –  egreg Jan 3 '12 at 22:53
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

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.