I would like to be able to add some proofs of my document in appendix. I like the solution "New Version" given here, but I would like in addition to have:

  1. A text below the theorem that write something like "Please, find the proof of this theorem in appendix".
  2. Add a link from this text to the proof
  3. Add another link from the proof title to the theorem
  4. If possible recall the theorem just above the proof

For example it would looks like, in pseudo-generated-code:

Theorem 1.1
  1 = 1
Please find the \hyperlink{th1.1}{proof of this theorem} in appendix.
[... lot's of stuff ...]

Theorem 1.1
  1 = 1
Proof of \autoref{th1.1}

I tried to change by myself the code of the above answer, but I'm not familiar enough with tex syntax, and I'm getting stuck on point 3 with link that point nowhere (I suspect bugs with the expandafter, but I don't know how to debug my code).

Thank you for your help !

  • Rather than posting code snippets please post a full minimal working example. In particular, it should compile. This makes it much easier to help you -- and, in this instance, would hopefully make your \expandafter comment more meaningful since this command does not appear in the code you posted.
    – user30471
    Commented Nov 2, 2016 at 12:25
  • Actually I didn't write many thing, and most of it must be wrong, so someone that would like to answer could base it's answer on the linked code. If needed I can copy/paste it, but I'm not sure it's a good idea.
    – tobiasBora
    Commented Nov 2, 2016 at 12:35
  • You should be able to use \label{...} and \autoref{...} to do what you want.
    – user30471
    Commented Nov 2, 2016 at 12:40
  • For the 4th point, you should use the restatable environment from thmtools. Cf tex.stackexchange.com/a/51288/34551
    – Clément
    Commented Nov 2, 2016 at 12:58
  • After playing a bit with LaTeX, I found a solution for 1,2,3. However, I didn't found a solution for point 4 because I don't see how I could automatiquely turn the \begin{theorem} into \begin{restatable}[]{theorem}{}... If you know how to do, I'm interested !
    – tobiasBora
    Commented Nov 2, 2016 at 17:48

1 Answer 1


I found a first solution, that seems to work for points 1,2,3, but not for 4 : I don't know how to change the environment of theorem (\begin{theorem} must be transform in \begin{restatable}[]{theorem}{} EDIT : it seems that adding an option restate=foo is enough, but I don't know how I could add such an option... I tried to set \xdef\pat@restate{foo} but it doesn't work... Any idea ?).


% We define an addition for the theorem-like environments; when
% \newtheorem{thm}{Theorem} is declared, the macro \thm expands
% to {...}{...}{...}{Theorem} and with \@fourthoffour we access
% to it; then we make available \@currentlabel (the theorem number)
% also outside the environment.

\newcommand\fixstatement[2][\proofname\space of]{%
  \ifcsname thmt@original@#2\endcsname
    % the theorem has been declared with \declaretheorem
        \@fourthoffour\csname thmt@original@#2\endcsname\space\@currentlabel}%
    % the theorem has been declared with \newtheorem
        \@fourthoffour\csname #1\endcsname\space\@currentlabel}%

% We allocate a block of 1000 token registers; in this way \prooftoks
% is 1000 and we can access the following registers of the block by
% \prooftoks+n (0<n<1000); we'll use a dedicated counter for it
% that is stepped at every proof

% We gather the contents of the proof as argument to \proofatend
% and then we store
% "\begin{proof}[Proof of <theoremname> <theoremnumber>]#1\end{proof}"
% in the next token register of the allocated block
  You can find \hyperlink{proofatend:\pat@uniqlabel}{the proof} at the end of the paper.
  % [\textbf{thm_fix:\pat@uniqlabel}]\hyperlink{thm_fix:\pat@uniqlabel}{Ahah}\\
    % \noexpand\begin{proof}[\pat@proofof\space\pat@label]%

% \printproofs simply loops over the used token registers of the
% block, freeing their contents

% Here starts the example, with two theorem declarations
\fixstatement[Demonstration of]{lem}

It's quite clear. \Blindtext
Obvious from lemma. \Blindtext



You must log in to answer this question.

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