Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
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

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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