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 have a couple of theorems, proofs of which are quite boring and longish. I would like to place theorem formulations in a usual place and stack up the proofs at the end of the chapter. How to do this?

In particular I would like to:

  • keep the original theorem numbering - the same number should be visible in both places, where the theorem is formulated originally, and at the end of the chapter,
  • if possible, copy the original formulation of the theorem right before the proof is given without having to write the text twice
share|improve this question
    
Do you care if there is a new proof environment generated that you use at a different location to where you define the theorem? Or is the intent that you specify the theorem & proof in one location of the chapter, and the proof printing is automatically postponed until the end of the chapter? –  Werner Feb 21 '12 at 21:20
    
@Werner I don't really care about how the proof & theorem are generated. I actually think having them in one place would be easier to manage. I think you might have a point here. –  julkiewicz Feb 21 '12 at 23:34

2 Answers 2

up vote 7 down vote accepted

Here's a MWE that demonstrates how the answers package can be used in this context. It preserves all of the numbering, as requested in your first bullet. Sadly I haven't managed to copy the original formulation of the theorem (your second bullet); perhaps someone else will be able to build from this though.

screenshot

\documentclass{article}

\usepackage{answers}
\usepackage{lipsum}

% open prooffile.tex
\Opensolutionfile{prooffile}
\Newassociation{myproof}{myProof}{prooffile}

% new theorem for demonstration
\newtheorem{mytheorem}{Theorem}

\begin{document}

\section{The theorems\ldots}
\begin{mytheorem}
\lipsum[1]
\begin{myproof}
This proves everything! 

\lipsum[2]
\end{myproof}
\end{mytheorem}

% close prooffile.tex
\Closesolutionfile{prooffile}

\clearpage
\section{The proofs!}
% can renew the environment to your liking
\renewenvironment{myProof}[1]{{\bfseries Proof of Theorem #1}}{}

\IfFileExists{prooffile.tex}{\input{prooffile.tex}}{}

\end{document}
share|improve this answer
    
Happily there is also \usepackage[nosolutionfiles]{answers}. I will test this today. –  julkiewicz Feb 22 '12 at 8:20
    
@julkiewicz yes indeed, a very useful option during construction! –  cmhughes Feb 22 '12 at 17:08

If you want to have the same theorem appear twice, with the same numbering, the thm-restate package does what you want. http://www.ctan.org/tex-archive/macros/latex/exptl/thmtools You essentially define a new command that produces the theorem, and choose one instance that chooses the number for it.

share|improve this answer
    
Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. –  Papiro Jun 10 '13 at 13:21

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.