TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to write some theorems down like this:

        $A := \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$\\
        $B := \begin{pmatrix} 2 & 2 \\ 3 & 4 \end{pmatrix}$\\
        $n \in \mathbb{N}$

        $\sqrt{2} \notin \mathbb{Q}$

        [... the proof ...]


It should look like this:

**Theorem 123**
        $A := \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$\\
        $B := \begin{pmatrix} 2 & 2 \\ 3 & 4 \end{pmatrix}$\\
        $n \in \mathbb{N}$

    **Claim**: √2 ∉ Q

    **Proof**: directly

        [... the proof ...]
        [.. the end]                 ■

(Theorem 123, Preconditions, Claim and Proof should be bold)

Logic behind the environment:

  • the theorems should automatically get a number that starts by one and counts up by one for each theorem
  • inside of the theorem environment, only the preconditions, claim and proof environments are allowed
  • inside of the theorem environment, the claim and proof environment are required to be exactly once.
  • the content of proof and the content of preconditions should have the same intendation.

What I've found so far:

I thought \newenvironment might be what I am searching for:


but I could not figure out how to mark internal environments as required.

The amsthm package seem to have environments for proof (source), but I can't see a possibility to nest the different environments and make them look like I want them to look

ntheorem seems to offer a lot of possibilities. I have created 4 new theorem environments:


I have used the latex code from above and got this: enter image description here

This one has no intendation of the inner environments, the inner environments are numbered although they shouldn't be numbered and no tombstone is at the end

share|improve this question
up vote 6 down vote accepted

I used the thmtools package as a front-end for amsthm in order to define a new Proof environment; the other two environments were created using \newenvironment. The Proof, claim and precondition environments use adjustwidth from the changepage package to increase the left margin. Of course, feel free to make the necessary adjustments according to your needs:

\usepackage[nopar]{lipsum}% just to generate some text






\item $A := \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$
\item $B := \begin{pmatrix} 2 & 2 \\ 3 & 4 \end{pmatrix}$
\item $n \in \mathbb{N}$


enter image description here

share|improve this answer

Your Answer


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.