texlive[51194] Master/texmf-dist: proof-at-the-end (22may19)

commits+karl at tug.org commits+karl at tug.org
Wed May 22 23:24:20 CEST 2019


Revision: 51194
          http://tug.org/svn/texlive?view=revision&revision=51194
Author:   karl
Date:     2019-05-22 23:24:20 +0200 (Wed, 22 May 2019)
Log Message:
-----------
proof-at-the-end (22may19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/proof-at-the-end/README.md
    trunk/Master/texmf-dist/doc/latex/proof-at-the-end/proof-at-the-end.pdf
    trunk/Master/texmf-dist/doc/latex/proof-at-the-end/proof-at-the-end_demo.pdf
    trunk/Master/texmf-dist/source/latex/proof-at-the-end/proof-at-the-end.dtx
    trunk/Master/texmf-dist/source/latex/proof-at-the-end/proof-at-the-end.ins
    trunk/Master/texmf-dist/tex/latex/proof-at-the-end/proof-at-the-end.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/proof-at-the-end/proof-at-the-end_demo.tex

Modified: trunk/Master/texmf-dist/doc/latex/proof-at-the-end/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/proof-at-the-end/README.md	2019-05-22 21:24:04 UTC (rev 51193)
+++ trunk/Master/texmf-dist/doc/latex/proof-at-the-end/README.md	2019-05-22 21:24:20 UTC (rev 51194)
@@ -21,7 +21,7 @@
 
 Disclaimer: This package is still in beta and not considered as stable.
 
-This package is licensed under LPPL v1.3.
+This package is licensed under LPPL v1.3, and the last version of this package on CTAN is 2019/05/21.
 
 ## Demo ##
 
@@ -44,7 +44,16 @@
 wget ${repopratend}/master/proof-at-the-end.sty
 wget ${repopratend}/master/xparse.sty
 ```
+If you have an old distribution of LaTeX (before 2018 basically, which is the case of Overleaf), you may also need a [more recent expl3](https://tex.stackexchange.com/questions/489646/expl3-and-recent-xparse-on-overleaf-no-expl3-loader-detected/489649?noredirect=1#comment1236409_489649). It is also very easy to install, just download the zip file [http://mirrors.ctan.org/install/macros/latex/contrib/l3kernel.tds.zip](http://mirrors.ctan.org/install/macros/latex/contrib/l3kernel.tds.zip), unzip, and copy the content of the directory `tex/latex/l3kernel/` into your project. On linux it's a matter of two commands in your project:
 
+```bash
+wget http://mirrors.ctan.org/install/macros/latex/contrib/l3kernel.tds.zip
+unzip -d . -j l3kernel.tds.zip 'tex/latex/l3kernel/*'
+rm l3kernel.tds.zip
+```
+
+If you don't want to pollute your main project with all these files, you may be interested to put them in a subfolder and update the environment variable `TEXINPUTS` or, if you use latexmk or overleaf, you can write instead a `latexmkrc` file as explained [here](https://www.overleaf.com/learn/latex/Questions/I_have_a_lot_of_.cls,_.sty,_.bst_files,_and_I_want_to_put_them_in_a_folder_to_keep_my_project_uncluttered._But_my_project_is_not_finding_them_to_compile_correctly). 
+
 That's all!
 
 ### Use in your project ###
@@ -175,12 +184,13 @@
   \begin{theoremEnd}[normal,#2]{thm}[#1]%
     #3%
   \end{theoremEnd}%
-}
+}{}
+% Do not forget the second parameter or you might get Missing \begin{document} error
 \NewDocumentEnvironment{proofE}{O{}+b}{%
   \begin{proofEnd}[#1]%
     #2%
   \end{proofEnd}%
-}
+}{}
 ```
 That you could use like that:
 
@@ -218,8 +228,10 @@
 - `end`: put the proof in appendix
 - `all end`: put both the theorem and the proof in appendix
 - `debug`: make sure the proof is written in the main text as well. Practical when you write the proof to be able to use synctex (if you use synctex with the proof in appendix, your will be unfortunately moved to a temporary file that this library is using... so **make sure you don't modify the files named like `prattheenddefaultcategory.tex` or all your changes will be lost at the next compilation**!).
-- `one big link`: if you prefer to have a single big link instead of two links (one for the proof one for the page)
+- `one big link`: if you prefer to have a single big link instead of two links (one for the proof, one for the page)
 - `one big link translated=Your translation`: to change/translate the text of the link easily
+- `text link section`: put a link looking like "See proof in section XX."
+- `text link section full proof`: put a link looking like "See full proof in section XX."
 - `text proof translated=Your translation`: to change/translate the text of the proof at the end easily
 - `global custom defaults`: empty style that you can modify to change the configuration (globally)
 - `local custom defaults`: empty style that you can modify to change the configuration (locally). Practical to set a category for a single section.
@@ -237,7 +249,7 @@
 \end{proofEnd}
 ```
 
-and give in the section where you would like to display the proofs the code this category name to `\printProofs`:
+and give this category name to `\printProofs` in the section where you would like to display the proofs:
 
 ```latex
 \printProofs[mylongproofs]
@@ -248,7 +260,7 @@
 You can also move some text in the appendix by using:
 
 ```latex
-\textEnd{You text that should go in appendix}
+\textEnd{Your text that should go in appendix}
 ```
     
 You can also give it a category as explained above, or configure it to be displayed in both the main text and at the end of the file with:
@@ -313,7 +325,7 @@
 
 ### Write a sketch of proof in the main text ###
 
-You can include a sketch of proof in the main text by simply adding a proof in between `theoremEnd` and `proofEnd`. An alias option `see full proof` can also be used to change the link into "See full proof on page X":
+You can include a sketch of proof in the main text by simply adding a proof in between `theoremEnd` and `proofEnd`. An alias option `see full proof` can also be used to change the link into "See full proof on page X.":
 
 ```latex
 \begin{theoremEnd}[see full proof]{thm}
@@ -339,7 +351,7 @@
 - `opt all end`/`no opt all end`: put the theorem and proof only in appendix. You may prefer the alias `all end`, that also makes sure that the proof is indeed displayed in appendix.
 - `text link`: text of the link to the proof, defaults to
 
-  `{See \hyperref[proof:prAtEnd\pratendcountercurrent]{proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}}`
+  `{See \hyperref[proof:prAtEnd\pratendcountercurrent]{proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}.}`
 - `text proof`: text displayed in place of "Proof" in the appendix. Defaults to `{Proof of \string\autoref{thm:prAtEnd\pratendcountercurrent}}`
 - `restate command`: name of a unique macro (without backslash) that will be defined as an alias to restate the theorem wherever you want
 - `restated before`: if the theorems has been stated before (with `\theoremProofEndRestateBefore`), then we just need to put the restate command in place of the theorem, and enable this option
@@ -354,10 +366,12 @@
 - `debug`: make sure the proof is written in the main text as well (alias of `proof here, no opt all end`), it is quite practical to use when you write a proof to be able to use synctex features to move between the pdf and the file.
 - `no link to theorem`: Remove the link from the proof to the theorem, alias of `text proof={\proofname}`
 - `stared` (or `no number`): when you use the stared version of a theorem you don't have any number, so autoref fails to write a nice link to the theorem. This option changes the text of "Proof", by keeping the link but writting only `Proof`. Equivalent to `text proof={\string\mbox{\string\hyperref[thm:prAtEnd\pratendcountercurrent]{\proofname}}}`
-- `see full proof`: useful when you want to write in the main text only a sketch of proof, this alias writes a link `See full proof on page X`. Equivalent to `text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{full proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}}`
-- `one big link`: instead of two links, one for page, one for proof, put just one link around everything. It can also accept an optional argument which will be the text of the link, like `one big link=Go to the proof`. The default value is `See proof on page~\pageref*{proof:prAtEnd\pratendcountercurrent}`.
+- `see full proof`: useful when you want to write in the main text only a sketch of proof, this alias writes a link `See full proof on page X.`. Equivalent to `text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{full proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}.}`
+- `one big link`: instead of two links, one for page, one for proof, put just one link around everything. It can also accept an optional argument which will be the text of the link, like `one big link=Go to the proof`. The default value is `See proof on page~\pageref*{proof:prAtEnd\pratendcountercurrent.}`.
 - `one big link translated`: This is like `one big link`, but automatically add the page at the end (and a big link around). Practical to quickly define a translation like `one big link translated=Voir preuve page`. See also `text proof translated`.
-- `default text link`: default text for the link to the proof, equivalent of `text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}}`
+- `text link section`: Put a link to the proof looking like "See proof in section X". Defaults to `text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{proof} in \autoref{proofsection:prAtEnd\pratendcountercurrent}.}`
+- `text link section full proof`: Put a link to the proof looking like "See full proof in section X". Defaults to `text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{full proof} in \autoref{proofsection:prAtEnd\pratendcountercurrent}.}`
+- `default text link`: default text for the link to the proof, equivalent of `text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}.}`
 - `default text proof`: default text for the proof in appendix, equivalent of `text proof={Proof of \string\autoref{thm:prAtEnd\pratendcountercurrent}}`
 - `text proof translated`: like `default text proof`, but takes one argument and use it instead of `Proof of`. Example: `text proof translated={Preuve du}`
 - `bare defaults`: default style that is loaded before anything else that configure by default a link to the proof, put the proof in appendix, use the category `defaultcategory`. It is an alias of `end, link to proof, no restate,category=defaultcategory, default text link,default text proof,restate command=pratenddummymacro`.

Modified: trunk/Master/texmf-dist/doc/latex/proof-at-the-end/proof-at-the-end.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/proof-at-the-end/proof-at-the-end_demo.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex/proof-at-the-end/proof-at-the-end_demo.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/proof-at-the-end/proof-at-the-end_demo.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/proof-at-the-end/proof-at-the-end_demo.tex	2019-05-22 21:24:20 UTC (rev 51194)
@@ -0,0 +1,283 @@
+\documentclass{article}
+
+\usepackage{amssymb, amsthm, amsmath}
+\usepackage{hyperref}
+% Load the package (put the proof-at-the-end.sty file in the working directory)
+\usepackage{proof-at-the-end} % with default options...
+% Or by putting in the 'conf' option the default configuration you want:
+%\usepackage[conf={normal, one big link}]{proof-at-the-end}
+%\usepackage[conf={normal, one big link=Goto proof}]{proof-at-the-end}
+%\usepackage[conf={one big link translated=Aller à la preuve page}]{proof-at-the-end}
+%\usepackage[conf={text link section}]{proof-at-the-end}
+
+%%% If you want to use options with macros, you cannot
+% use directly the package options, so just modify
+% the global custom defaults like that:
+% \pgfkeys{/prAtEnd/global custom defaults/.style={
+%     text link={\hyperref[proof:prAtEnd\pratendcountercurrent]{See proof on page~\pageref*{proof:prAtEnd\pratendcountercurrent}}}
+%   }
+% }
+%%% You can also easily modify the gloabl/locals defaults in other parts of the code using:
+% \pgfkeys{/prAtEnd/local custom defaults/.style={
+%     category=greattheorem
+%   }
+% }
+%%% Or create new styles to apply:
+% \pgfkeys{/prAtEnd/great category/.style={
+%     category=greattheorem
+%   }
+% }
+
+%% Define your theorem/lemma/... environments the way you want:
+% Theorems
+\newtheorem{thm}{Theorem}[section]
+\newtheorem*{thm*}{Theorem}
+\providecommand*\thmautorefname{Theorem}
+% Lemmata
+\newtheorem{lemma}[thm]{Lemma}
+\newtheorem*{lemma*}{Lemma}
+\providecommand*\lemmaautorefname{Lemma}
+
+%% If you want you can define shortcuts:
+\usepackage{xparse}
+% And to define new shortcuts:
+\NewDocumentEnvironment{mynormalthm}{O{}O{}+b}{%
+  \begin{theoremEnd}[normal,#2]{thm}[#1]%
+    #3%
+  \end{theoremEnd}%
+}{}
+
+\begin{document}
+
+\section{Demo of proof-at-the-end}
+
+NB: This file is just a demo of proof-at-the-end.  You can find the documentation, sources, and example of proof-at-the-end at \url{https://github.com/leo-colisson/proof-at-the-end}. Note that this file is getting a bit big but it should contain more or less everything that is possible in this lib as it's also used to ``test'' the library.
+
+% And use \theoremProofEnd[<package options>]{theorem environment name}[Title]{Theorem}{Optional proof}
+\begin{theoremEnd}{thm}[Yes I can have a title]
+  \label{thm:ilikelabels}
+  Simplicity is luxury, I am a default theorem.
+\end{theoremEnd}
+\begin{proofEnd}
+  Let's be simple.  
+\end{proofEnd}
+
+And I can refer to my theorems using classic labels, like in \autoref{thm:ilikelabels}.
+
+\begin{theoremEnd}[text link section]{thm}[Changing link]
+  It is possible to change the link.
+\end{theoremEnd}
+\begin{proofEnd}
+  Here I'm using ``text link section''.
+\end{proofEnd}
+
+\begin{theoremEnd}[category=greattheorem, end]{thm}[Different categories]
+  You can also create several categories, and put the proofs in different sections.
+  \[2\Delta = \Delta + \Delta\]
+\end{theoremEnd}
+\begin{proofEnd}
+  See, I am in another section! And I refer to \autoref{thm:ilikelabels} even in the proof.
+\end{proofEnd}
+
+\begin{theoremEnd}[restate]{thm}[I am restatable]
+  I am a restatable theorem, go in Appendix you will see ;-)
+\end{theoremEnd}
+\begin{proofEnd}
+  I am a proof of a restatable theorem.  
+\end{proofEnd}
+
+
+\begin{theoremEnd}[normal]{thm}
+  You can easily turn it back into a normal theorem!
+\end{theoremEnd}
+\begin{proofEnd}
+  And keep the proof with you!  
+\end{proofEnd}
+
+You can also put comments that appear only in the appendix.
+
+\textEnd{See, I am a simple comments with math $\delta = b^2-ac$ and references \autoref{thm:mytheoremattheend}.}
+
+\begin{textAtEnd}
+  You can also use the environment syntax.
+\end{textAtEnd}
+
+\textEnd[both]{Or that appears in both and with references \autoref{thm:mytheoremattheend}!}
+
+\begin{theoremEnd}[proof here]{thm}
+  And you can duplicate the proof, here AND in appendix ;)  
+\end{theoremEnd}
+\begin{proofEnd}
+  I am a proof that is everywhere, practical if you want to use synctex while you write the proof ;)
+\end{proofEnd}
+
+\begin{theoremEnd}{lemma}
+  You can mix it with lemmas... Or any other theorem-like environment easily!  
+\end{theoremEnd}
+\begin{proofEnd}
+  See, I'm the proof of a lemma!  
+\end{proofEnd}
+
+And also you can put both the theorem and the proof at the end, like for \autoref{thm:mytheoremattheend}!
+
+\begin{theoremEnd}[all end]{thm}
+  \label{thm:mytheoremattheend}
+  $\delta = b^2-4ac$
+  You can also put theorems only at the end.  
+\end{theoremEnd}
+\begin{proofEnd}
+  See, I'm the proof of a lemma that is only at the end!
+\end{proofEnd}
+
+
+You can also remove the link to the theorem:
+\begin{theoremEnd}[no link to theorem, restate]{thm}
+  I don't like links in proofs.  
+\end{theoremEnd}
+\begin{proofEnd}
+  Yes, I like being lost, but not too lost, so I prefer to restate as well!
+\end{proofEnd}
+
+Or keep the link, but remove the reference (practical for stared versions):
+\begin{theoremEnd}[stared]{thm*}
+  I don't like numbers.
+\end{theoremEnd}
+\begin{proofEnd}
+  Yes, I hate numbers, but I like links.
+\end{proofEnd}
+
+
+\pgfkeys{/prAtEnd/french/.style={
+    one big link translated={Voir preuve page},
+    text proof translated={Preuve du}
+  }
+}
+\begin{theoremEnd}[french]{thm}%% See how "french" is defined just above
+  Change the text/languages of the link: Il est même possible de changer la langue du texte du lien!  
+\end{theoremEnd}
+\begin{proofEnd}
+  Si c'est pas beau ;)
+\end{proofEnd}
+
+And of course it is easy to define custom shortcuts, using in prelude:
+\begin{verbatim}
+\NewDocumentEnvironment{frenchthm}{O{}+b}{%
+  \begin{theoremEnd}[french]{thm}[#1]%
+    #2%
+  \end{theoremEnd}%
+}{}
+\end{verbatim}
+
+\begin{mynormalthm}[My own environment]
+  You can then create your own environment from other styles using
+\end{mynormalthm}
+\begin{proofEnd}
+  That's quicker :D
+\end{proofEnd}
+
+\begin{mynormalthm}[My own environment][end]
+  You can use options also with your custom environments.
+\end{mynormalthm}
+\begin{proofEnd}
+  That's quicker with the proof at the end :D
+\end{proofEnd}
+
+\begin{mynormalthm}[][end]
+  And you can remove the title and have options.
+\end{mynormalthm}
+\begin{proofEnd}
+  Just leave empty title.
+\end{proofEnd}
+
+\begin{mynormalthm}[My second own environment][all end]
+  My normal theorem is moved at the end!
+\end{mynormalthm}
+\begin{proofEnd}
+  Custom environments are practical no ;)
+\end{proofEnd}
+
+\begin{theoremEnd}[]{thm}[Yes I can have no proof]
+  Proof is useless. You can do do it. And see, I can include other environments inside me ;)\\
+  \begin{tabular}{ c c } 
+    A & B \\ 
+    C & D \\ 
+  \end{tabular}
+\end{theoremEnd}
+
+
+\begin{theoremEnd}[restate command=mymanualrestate]{thm}[Manual restate]
+  A theorem can be manually restated  
+\end{theoremEnd}
+\begin{proofEnd}
+  Use restate command for that! (see \autoref{sec:manualrestate} for an example)
+\end{proofEnd}
+
+\begin{theoremEnd}[see full proof]{thm}
+  I can also write a sketch of proof, and put the full proof in appendix.
+\end{theoremEnd}
+\begin{proof}
+  Hint: look at the alias options.
+\end{proof}
+\begin{proofEnd}
+  You just use ``see full proof'' as an option
+\end{proofEnd}
+
+It should also deal with protected commands: $\mathtt{mathtt}$:
+\begin{theoremEnd}[end]{thm}[Title $\Delta$ et $\mathtt{Gad}$]
+  You can use commands that should be protected $\mathtt{See}$!
+\end{theoremEnd}
+
+\begin{theoremEnd}[end]{thm}[Deal with paragraphs]
+  You can have a theorem
+
+  with several paragraphs.
+\end{theoremEnd}
+\begin{proofEnd}
+  And I also like to have big proofs.
+  
+  With several paragraphs.
+\end{proofEnd}
+
+\section{Section with restate before theorem}\label{sec:restatebefore}
+
+\begin{theoremEndRestateBefore}{thm}[Title]{laterrestatable}
+  \label{thm:laterrestatable}
+  This theorem has been introduced in \autoref{sec:restatebefore} before the real definition, but the real definition is in \autoref{sec:restateafter}, more precisely here: \autoref{thm:laterrestatable}.
+\end{theoremEndRestateBefore}
+
+
+\begin{theoremEnd}{thm}
+  And this is a normal theorem  
+\end{theoremEnd}
+\begin{proofEnd}
+  With a normal proof  
+\end{proofEnd}
+
+
+\section{Section with late theorems}\label{sec:restateafter}
+\begin{theoremEnd}[restated before]{thm}
+  laterrestatable
+\end{theoremEnd}
+\begin{proofEnd}
+  To state a theorem before the initial definition, use theoremEndRestateBefore environment where you first want to state the theorem, with a unique name in the second mandatory argument, and when you want to insert the theorem for the second time, use the usual theoremProofEnd command with the same unique name as before in place of the theorem definition and the ``restated before'' option.  
+\end{proofEnd}
+
+\section{Section with standard proofs}
+% \verbatiminput{defaultcategory}
+\printProofs
+
+\section{Section with important proofs only}
+\printProofs[greattheorem]
+
+\section{Section with manual restate}\label{sec:manualrestate}
+
+I like to manually restate theorems:
+\mymanualrestate*
+
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:


Property changes on: trunk/Master/texmf-dist/doc/latex/proof-at-the-end/proof-at-the-end_demo.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex/proof-at-the-end/proof-at-the-end.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/proof-at-the-end/proof-at-the-end.dtx	2019-05-22 21:24:04 UTC (rev 51193)
+++ trunk/Master/texmf-dist/source/latex/proof-at-the-end/proof-at-the-end.dtx	2019-05-22 21:24:20 UTC (rev 51194)
@@ -1,12 +1,12 @@
 %\iffalse
 % proof-at-the-end.dtx generated using makedtx version 1.2 (c) Nicola Talbot
 % Command line args:
+%   -doc "../doc/proof-at-the-end_doc.tex"
 %   -author "Léo Colisson"
+%   -dir "/tmp/pat/proof-at-the-end/"
 %   -src "proof-at-the-end\.sty=>proof-at-the-end.sty"
-%   -doc "../doc/proof-at-the-end_doc.tex"
-%   -dir "/home/leo/Documents/Work_in_progress_Git/proof-at-the-end/"
 %   proof-at-the-end
-% Created on 2019/5/7 12:29
+% Created on 2019/5/22 12:52
 %\fi
 %\iffalse
 %<*package>
@@ -193,7 +193,8 @@
 %
 %Disclaimer: This package is still in beta and not considered as stable.
 %
-%This package is licensed under LPPL v1.3.
+%This package is licensed under LPPL v1.3, and the last version of this
+%package on CTAN is 2019/05/21.
 %
 %\hypertarget{demo}{%
 %\section{Demo}\label{demo}}
@@ -234,6 +235,30 @@
 %\end{Highlighting}
 %\end{Shaded}
 %
+%If you have an old distribution of LaTeX (before 2018 basically, which
+%is the case of Overleaf), you may also need a
+%\href{https://tex.stackexchange.com/questions/489646/expl3-and-recent-xparse-on-overleaf-no-expl3-loader-detected/489649?noredirect=1\#comment1236409_489649}{more
+%recent expl3}. It is also very easy to install, just download the zip
+%file
+%\url{http://mirrors.ctan.org/install/macros/latex/contrib/l3kernel.tds.zip},
+%unzip, and copy the content of the directory
+%\texttt{tex/latex/l3kernel/} into your project. On linux it's a matter
+%of two commands in your project:
+%
+%\begin{Shaded}
+%\begin{Highlighting}[]
+%\FunctionTok{wget}\NormalTok{ http://mirrors.ctan.org/install/macros/latex/contrib/l3kernel.tds.zip}
+%\FunctionTok{unzip}\NormalTok{ -d . -j l3kernel.tds.zip }\StringTok{'tex/latex/l3kernel/*'}
+%\FunctionTok{rm}\NormalTok{ l3kernel.tds.zip}
+%\end{Highlighting}
+%\end{Shaded}
+%
+%If you don't want to pollute your main project with all these files, you
+%may be interested to put them in a subfolder and update the environment
+%variable \texttt{TEXINPUTS} or, if you use latexmk or overleaf, you can
+%write instead a \texttt{latexmkrc} file as explained
+%\href{https://www.overleaf.com/learn/latex/Questions/I_have_a_lot_of_.cls,_.sty,_.bst_files,_and_I_want_to_put_them_in_a_folder_to_keep_my_project_uncluttered._But_my_project_is_not_finding_them_to_compile_correctly}{here}.
+%
 %That's all!
 %
 %\hypertarget{use-in-your-project}{%
@@ -412,12 +437,13 @@
 %  \KeywordTok{\textbackslash{}begin}\NormalTok{\{}\ExtensionTok{theoremEnd}\NormalTok{\}[normal,#2]\{thm\}[#1]}\CommentTok{%}
 %\NormalTok{    #3}\CommentTok{%}
 %  \KeywordTok{\textbackslash{}end}\NormalTok{\{}\ExtensionTok{theoremEnd}\NormalTok{\}}\CommentTok{%}
-%\NormalTok{\}}
+%\NormalTok{\}\{\}}
+%\CommentTok{% Do not forget the second parameter or you might get Missing \textbackslash{}begin\{document\} error}
 %\FunctionTok{\textbackslash{}NewDocumentEnvironment}\NormalTok{\{proofE\}\{O\{\}+b\}\{}\CommentTok{%}
 %  \KeywordTok{\textbackslash{}begin}\NormalTok{\{}\ExtensionTok{proofEnd}\NormalTok{\}[#1]}\CommentTok{%}
 %\NormalTok{    #2}\CommentTok{%}
 %  \KeywordTok{\textbackslash{}end}\NormalTok{\{}\ExtensionTok{proofEnd}\NormalTok{\}}\CommentTok{%}
-%\NormalTok{\}}
+%\NormalTok{\}\{\}}
 %\end{Highlighting}
 %\end{Shaded}
 %
@@ -482,11 +508,17 @@
 %  lost at the next compilation}!).
 %\item
 %  \texttt{one\ big\ link}: if you prefer to have a single big link
-%  instead of two links (one for the proof one for the page)
+%  instead of two links (one for the proof, one for the page)
 %\item
 %  \texttt{one\ big\ link\ translated=Your\ translation}: to
 %  change/translate the text of the link easily
 %\item
+%  \texttt{text\ link\ section}: put a link looking like ``See proof in
+%  section XX.''
+%\item
+%  \texttt{text\ link\ section\ full\ proof}: put a link looking like
+%  ``See full proof in section XX.''
+%\item
 %  \texttt{text\ proof\ translated=Your\ translation}: to
 %  change/translate the text of the proof at the end easily
 %\item
@@ -519,8 +551,8 @@
 %\end{Highlighting}
 %\end{Shaded}
 %
-%and give in the section where you would like to display the proofs the
-%code this category name to \texttt{\textbackslash{}printProofs}:
+%and give this category name to \texttt{\textbackslash{}printProofs} in
+%the section where you would like to display the proofs:
 %
 %\begin{Shaded}
 %\begin{Highlighting}[]
@@ -535,7 +567,7 @@
 %
 %\begin{Shaded}
 %\begin{Highlighting}[]
-%\FunctionTok{\textbackslash{}textEnd}\NormalTok{\{You text that should go in appendix\}}
+%\FunctionTok{\textbackslash{}textEnd}\NormalTok{\{Your text that should go in appendix\}}
 %\end{Highlighting}
 %\end{Shaded}
 %
@@ -633,7 +665,7 @@
 %You can include a sketch of proof in the main text by simply adding a
 %proof in between \texttt{theoremEnd} and \texttt{proofEnd}. An alias
 %option \texttt{see\ full\ proof} can also be used to change the link
-%into ``See full proof on page X'':
+%into ``See full proof on page X.'':
 %
 %\begin{Shaded}
 %\begin{Highlighting}[]
@@ -679,7 +711,7 @@
 %\item
 %  \texttt{text\ link}: text of the link to the proof, defaults to
 %
-%  \texttt{\{See\ \textbackslash{}hyperref{[}proof:prAtEnd\textbackslash{}pratendcountercurrent{]}\{proof\}\ on\ page\textasciitilde{}\textbackslash{}pageref\{proof:prAtEnd\textbackslash{}pratendcountercurrent\}\}}
+%  \texttt{\{See\ \textbackslash{}hyperref{[}proof:prAtEnd\textbackslash{}pratendcountercurrent{]}\{proof\}\ on\ page\textasciitilde{}\textbackslash{}pageref\{proof:prAtEnd\textbackslash{}pratendcountercurrent\}.\}}
 %\item
 %  \texttt{text\ proof}: text displayed in place of ``Proof'' in the
 %  appendix. Defaults to
@@ -738,14 +770,14 @@
 %\item
 %  \texttt{see\ full\ proof}: useful when you want to write in the main
 %  text only a sketch of proof, this alias writes a link
-%  \texttt{See\ full\ proof\ on\ page\ X}. Equivalent to
-%  \texttt{text\ link=\{See\ \textbackslash{}hyperref{[}proof:prAtEnd\textbackslash{}pratendcountercurrent{]}\{full\ proof\}\ on\ page\textasciitilde{}\textbackslash{}pageref\{proof:prAtEnd\textbackslash{}pratendcountercurrent\}\}}
+%  \texttt{See\ full\ proof\ on\ page\ X.}. Equivalent to
+%  \texttt{text\ link=\{See\ \textbackslash{}hyperref{[}proof:prAtEnd\textbackslash{}pratendcountercurrent{]}\{full\ proof\}\ on\ page\textasciitilde{}\textbackslash{}pageref\{proof:prAtEnd\textbackslash{}pratendcountercurrent\}.\}}
 %\item
 %  \texttt{one\ big\ link}: instead of two links, one for page, one for
 %  proof, put just one link around everything. It can also accept an
 %  optional argument which will be the text of the link, like
 %  \texttt{one\ big\ link=Go\ to\ the\ proof}. The default value is
-%  \texttt{See\ proof\ on\ page\textasciitilde{}\textbackslash{}pageref*\{proof:prAtEnd\textbackslash{}pratendcountercurrent\}}.
+%  \texttt{See\ proof\ on\ page\textasciitilde{}\textbackslash{}pageref*\{proof:prAtEnd\textbackslash{}pratendcountercurrent.\}}.
 %\item
 %  \texttt{one\ big\ link\ translated}: This is like
 %  \texttt{one\ big\ link}, but automatically add the page at the end
@@ -753,9 +785,17 @@
 %  like \texttt{one\ big\ link\ translated=Voir\ preuve\ page}. See also
 %  \texttt{text\ proof\ translated}.
 %\item
+%  \texttt{text\ link\ section}: Put a link to the proof looking like
+%  ``See proof in section X''. Defaults to
+%  \texttt{text\ link=\{See\ \textbackslash{}hyperref{[}proof:prAtEnd\textbackslash{}pratendcountercurrent{]}\{proof\}\ in\ \textbackslash{}autoref\{proofsection:prAtEnd\textbackslash{}pratendcountercurrent\}.\}}
+%\item
+%  \texttt{text\ link\ section\ full\ proof}: Put a link to the proof
+%  looking like ``See full proof in section X''. Defaults to
+%  \texttt{text\ link=\{See\ \textbackslash{}hyperref{[}proof:prAtEnd\textbackslash{}pratendcountercurrent{]}\{full\ proof\}\ in\ \textbackslash{}autoref\{proofsection:prAtEnd\textbackslash{}pratendcountercurrent\}.\}}
+%\item
 %  \texttt{default\ text\ link}: default text for the link to the proof,
 %  equivalent of
-%  \texttt{text\ link=\{See\ \textbackslash{}hyperref{[}proof:prAtEnd\textbackslash{}pratendcountercurrent{]}\{proof\}\ on\ page\textasciitilde{}\textbackslash{}pageref\{proof:prAtEnd\textbackslash{}pratendcountercurrent\}\}}
+%  \texttt{text\ link=\{See\ \textbackslash{}hyperref{[}proof:prAtEnd\textbackslash{}pratendcountercurrent{]}\{proof\}\ on\ page\textasciitilde{}\textbackslash{}pageref\{proof:prAtEnd\textbackslash{}pratendcountercurrent\}.\}}
 %\item
 %  \texttt{default\ text\ proof}: default text for the proof in appendix,
 %  equivalent of
@@ -818,7 +858,7 @@
 %    \end{macrocode}
 %\fi
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{proof-at-the-end}[2019/05/06 A package to move proofs in appendix]
+\ProvidesPackage{proof-at-the-end}[2019/05/21 A package to move proofs in appendix]
  
 \RequirePackage{etoolbox}
 \RequirePackage{hyperref}
@@ -846,7 +886,10 @@
 % \ProcessOptions\relax
 
 \newwrite\appendwrite
-\newcommand*\appendtofile[2]{%
+
+% The first argument is the file name
+% The second argument is the text to write
+\NewDocumentCommand\appendtofile{m+m}{%
   \begingroup
   \IfFileExists{#1}%
   {\CatchFileDef{\filecontent}{#1}{\catcode`\\=12 \endlinechar=`^^J\catcode\endlinechar=12\relax}}% keep existing end-of-lines
@@ -856,6 +899,7 @@
   \immediate\closeout\appendwrite
   \endgroup
 }
+
 %% This functions takes one input: the category (without .tex),
 %% If it's the first time we write in this
 %% category file, it "blanks" it.
@@ -863,7 +907,7 @@
 \newcommand*\eraseIfNeeded[1]{%
   % A macro 'pratendmacrocat{category}' is created to check
   % if it's the first time we write in this category file.
-  \edef\macroname{pratendmacrocat#1}%
+  \protected at edef\macroname{pratendmacrocat#1}%
   \ifcsdef{\macroname}{% The macro exists, nothing to do
   }{ % The macro does not exists, create it, and empty the file
     \global\expandafter\def\csname \macroname\endcsname{true}%
@@ -908,7 +952,7 @@
   %% to make sure the proof for normal theorems are changed
   text proof/.code={\def\pratendtextproof{#1}},
   %% Custom restate command
-  restate command/.code={\edef\pratendcustomrestate{#1}},
+  restate command/.code={\protected at edef\pratendcustomrestate{#1}},
   %% (Re)stated before
   %% If the theorems has been stated before, then we just need to put the restate command in
   %% place of the argument, and we set this value to true:
@@ -956,19 +1000,25 @@
     stared
   },
   see full proof/.style={
-    text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{full proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}}
+    text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{full proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}.}
   },
   one big link/.style={
     text link={\hyperref[proof:prAtEnd\pratendcountercurrent] {#1}}
   },
   one big link/.default={%
-    See proof on page~\pageref*{proof:prAtEnd\pratendcountercurrent}
+    See proof on page~\pageref*{proof:prAtEnd\pratendcountercurrent}.
   },
   one big link translated/.style={
-    one big link={#1~\pageref*{proof:prAtEnd\pratendcountercurrent}}
+    one big link={#1~\pageref*{proof:prAtEnd\pratendcountercurrent}.}
   },
+  text link section/.style={%
+      text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{proof} in \autoref{proofsection:prAtEnd\pratendcountercurrent}.}
+  },
+  text link section full proof/.style={%
+      text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{full proof} in \autoref{proofsection:prAtEnd\pratendcountercurrent}.}
+  },
   default text link/.style={
-    text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}},
+    text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}.},
   },
   text proof translated/.style={
     text proof={#1 \string\autoref{thm:prAtEnd\pratendcountercurrent}},
@@ -1021,13 +1071,13 @@
 
 \NewDocumentEnvironment{theoremEndRestateBefore}{mO{}m+b}{
   \stepcounter{counterAllProofEnd}%
-  \edef\currcounterval{\roman{counterAllProofEnd}}
-  \edef\temprest{\noexpand\begin{restatable*}[#2]{#1}{prAtEndRestate\currcounterval}\noexpand\label{thm:prAtEnd\currcounterval}}%
-  \global\expandafter\edef\csname #3\endcsname{\currcounterval}%
+  \protected at edef\currcounterval{\roman{counterAllProofEnd}}
+  \protected at edef\temprest{\noexpand\begin{restatable*}[#2]{#1}{prAtEndRestate\currcounterval}\noexpand\label{thm:prAtEnd\currcounterval}}%
+  \expandafter\protected at xdef\csname #3\endcsname{\currcounterval}%
   \temprest%
     #4%
   \end{restatable*}%
-}
+}{}
 
 \NewDocumentEnvironment{theoremEnd}{O{}mO{}+b}{
   % The first facultative argument will be the options: type of proof you want, the file to which you want to write...
@@ -1042,8 +1092,9 @@
     #1
   }%
   \stepcounter{counterAllProofEnd}%
-  %% Pre-expand the restatable environment
-  \edef\temprest{\noexpand\begin{restatable}[#3]{#2}{prAtEndRestate\roman{counterAllProofEnd}}}%
+  %% Pre-expand the restatable environment. Need protected
+  %% otherwise can't have $\mathtt{G}$ in the title 
+  \protected at edef\temprest{\noexpand\begin{restatable}[#3]{#2}{prAtEndRestate\roman{counterAllProofEnd}}}%
   %% Create the file if it's the first time
   \eraseIfNeeded{\category}%
   %% If the theorem must be written here:
@@ -1050,7 +1101,7 @@
   \unless\ifallattheend%
     %% Restate the theorem if it was stated before:
     \ifrestatedbefore%
-      \global\edef\pratendcountercurrent{\csname #4\endcsname} % Store the current (alpha value of the) counter
+      \protected at xdef\pratendcountercurrent{\csname #4\endcsname} % Store the current (alpha value of the) counter
       \csname prAtEndRestate\pratendcountercurrent\endcsname % Restate the theorem
     \fi%
     %%  Otherwise just state the theorem in a restatable environment
@@ -1061,10 +1112,10 @@
       \end{restatable}%
       %% Store the current (alpha value of the) counter
       %% in \pratendcountercurrent
-      \global\edef\pratendcountercurrent{\roman{counterAllProofEnd}} %
+      \protected at xdef\pratendcountercurrent{\roman{counterAllProofEnd}} %
     \fi%
     %% Create a custom alias to restate the theorem
-    \global\expandafter\edef\csname \pratendcustomrestate\endcsname{\noexpand\csname prAtEndRestate\pratendcountercurrent\endcsname}%
+    \expandafter\protected at xdef\csname \pratendcustomrestate\endcsname{\noexpand\csname prAtEndRestate\pratendcountercurrent\endcsname}%
     %% Restate the theorem if needed in appendix
     \ifrestatethm
       \appendtofile{\prefixPrAtEndFiles\category.tex}{\string\prAtEndRestate\pratendcountercurrent*}
@@ -1075,12 +1126,12 @@
   \ifallattheend%
     %% Store the current (alpha value of the) counter
     %% in \pratendcountercurrent
-    \global\edef\pratendcountercurrent{\roman{counterAllProofEnd}}
+    \protected at xdef\pratendcountercurrent{\roman{counterAllProofEnd}}
     %% Create a custom alias to restate the theorem
-    \global\expandafter\edef\csname \pratendcustomrestate\endcsname{\noexpand\csname prAtEndRestate\pratendcountercurrent\endcsname}%
+    \expandafter\protected at xdef\csname \pratendcustomrestate\endcsname{\noexpand\csname prAtEndRestate\pratendcountercurrent\endcsname}%
     \appendtofile{\prefixPrAtEndFiles\category.tex}{\string\begin{restatable}[#3]{#2}{prAtEndRestate\pratendcountercurrent}\string\label{thm:prAtEnd\pratendcountercurrent}\detokenize{#4}\string\end{restatable}}%
   \fi%
-}
+}{}
 
 \NewDocumentEnvironment{proofEnd}{O{}+b}{
   \pgfkeys{%
@@ -1104,9 +1155,9 @@
   \fi%
   %% Write the proof at the end
   \ifproofend%
-    \appendtofile{\prefixPrAtEndFiles\category.tex}{\string\begin{proof}[\pratendtextproof]\string\phantomsection\string\label{proof:prAtEnd\pratendcountercurrent}\detokenize{#2}\string\end{proof}}%
+    \appendtofile{\prefixPrAtEndFiles\category.tex}{\string\label{proofsection:prAtEnd\pratendcountercurrent}\string\begin{proof}[\pratendtextproof]\string\phantomsection\string\label{proof:prAtEnd\pratendcountercurrent}\detokenize{#2}\string\end{proof}}%
   \fi%
-}
+}{}
 
 
 %%%%% Text in appendix

Modified: trunk/Master/texmf-dist/source/latex/proof-at-the-end/proof-at-the-end.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/proof-at-the-end/proof-at-the-end.ins	2019-05-22 21:24:04 UTC (rev 51193)
+++ trunk/Master/texmf-dist/source/latex/proof-at-the-end/proof-at-the-end.ins	2019-05-22 21:24:20 UTC (rev 51194)
@@ -1,4 +1,4 @@
-% proof-at-the-end.ins generated using makedtx version 1.2 2019/5/7 12:29
+% proof-at-the-end.ins generated using makedtx version 1.2 2019/5/22 12:52
 \input docstrip
 
 \preamble

Modified: trunk/Master/texmf-dist/tex/latex/proof-at-the-end/proof-at-the-end.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/proof-at-the-end/proof-at-the-end.sty	2019-05-22 21:24:04 UTC (rev 51193)
+++ trunk/Master/texmf-dist/tex/latex/proof-at-the-end/proof-at-the-end.sty	2019-05-22 21:24:20 UTC (rev 51194)
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{proof-at-the-end}[2019/05/06 A package to move proofs in appendix]
+\ProvidesPackage{proof-at-the-end}[2019/05/21 A package to move proofs in appendix]
 
 \RequirePackage{etoolbox}
 \RequirePackage{hyperref}
@@ -65,7 +65,8 @@
 
 
 \newwrite\appendwrite
-\newcommand*\appendtofile[2]{%
+
+\NewDocumentCommand\appendtofile{m+m}{%
   \begingroup
   \IfFileExists{#1}%
   {\CatchFileDef{\filecontent}{#1}{\catcode`\\=12 \endlinechar=`^^J\catcode\endlinechar=12\relax}}% keep existing end-of-lines
@@ -75,6 +76,7 @@
   \immediate\closeout\appendwrite
   \endgroup
 }
+
 %% This functions takes one input: the category (without .tex),
 %% If it's the first time we write in this
 %% category file, it "blanks" it.
@@ -82,7 +84,7 @@
 \newcommand*\eraseIfNeeded[1]{%
   % A macro 'pratendmacrocat{category}' is created to check
   % if it's the first time we write in this category file.
-  \edef\macroname{pratendmacrocat#1}%
+  \protected at edef\macroname{pratendmacrocat#1}%
   \ifcsdef{\macroname}{% The macro exists, nothing to do
   }{ % The macro does not exists, create it, and empty the file
     \global\expandafter\def\csname \macroname\endcsname{true}%
@@ -127,7 +129,7 @@
   %% to make sure the proof for normal theorems are changed
   text proof/.code={\def\pratendtextproof{#1}},
   %% Custom restate command
-  restate command/.code={\edef\pratendcustomrestate{#1}},
+  restate command/.code={\protected at edef\pratendcustomrestate{#1}},
   %% (Re)stated before
   %% If the theorems has been stated before, then we just need to put the restate command in
   %% place of the argument, and we set this value to true:
@@ -175,19 +177,25 @@
     stared
   },
   see full proof/.style={
-    text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{full proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}}
+    text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{full proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}.}
   },
   one big link/.style={
     text link={\hyperref[proof:prAtEnd\pratendcountercurrent] {#1}}
   },
   one big link/.default={%
-    See proof on page~\pageref*{proof:prAtEnd\pratendcountercurrent}
+    See proof on page~\pageref*{proof:prAtEnd\pratendcountercurrent}.
   },
   one big link translated/.style={
-    one big link={#1~\pageref*{proof:prAtEnd\pratendcountercurrent}}
+    one big link={#1~\pageref*{proof:prAtEnd\pratendcountercurrent}.}
   },
+  text link section/.style={%
+      text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{proof} in \autoref{proofsection:prAtEnd\pratendcountercurrent}.}
+  },
+  text link section full proof/.style={%
+      text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{full proof} in \autoref{proofsection:prAtEnd\pratendcountercurrent}.}
+  },
   default text link/.style={
-    text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}},
+    text link={See \hyperref[proof:prAtEnd\pratendcountercurrent]{proof} on page~\pageref{proof:prAtEnd\pratendcountercurrent}.},
   },
   text proof translated/.style={
     text proof={#1 \string\autoref{thm:prAtEnd\pratendcountercurrent}},
@@ -240,13 +248,13 @@
 
 \NewDocumentEnvironment{theoremEndRestateBefore}{mO{}m+b}{
   \stepcounter{counterAllProofEnd}%
-  \edef\currcounterval{\roman{counterAllProofEnd}}
-  \edef\temprest{\noexpand\begin{restatable*}[#2]{#1}{prAtEndRestate\currcounterval}\noexpand\label{thm:prAtEnd\currcounterval}}%
-  \global\expandafter\edef\csname #3\endcsname{\currcounterval}%
+  \protected at edef\currcounterval{\roman{counterAllProofEnd}}
+  \protected at edef\temprest{\noexpand\begin{restatable*}[#2]{#1}{prAtEndRestate\currcounterval}\noexpand\label{thm:prAtEnd\currcounterval}}%
+  \expandafter\protected at xdef\csname #3\endcsname{\currcounterval}%
   \temprest%
     #4%
   \end{restatable*}%
-}
+}{}
 
 \NewDocumentEnvironment{theoremEnd}{O{}mO{}+b}{
   % The first facultative argument will be the options: type of proof you want, the file to which you want to write...
@@ -261,8 +269,9 @@
     #1
   }%
   \stepcounter{counterAllProofEnd}%
-  %% Pre-expand the restatable environment
-  \edef\temprest{\noexpand\begin{restatable}[#3]{#2}{prAtEndRestate\roman{counterAllProofEnd}}}%
+  %% Pre-expand the restatable environment. Need protected
+  %% otherwise can't have $\mathtt{G}$ in the title
+  \protected at edef\temprest{\noexpand\begin{restatable}[#3]{#2}{prAtEndRestate\roman{counterAllProofEnd}}}%
   %% Create the file if it's the first time
   \eraseIfNeeded{\category}%
   %% If the theorem must be written here:
@@ -269,7 +278,7 @@
   \unless\ifallattheend%
     %% Restate the theorem if it was stated before:
     \ifrestatedbefore%
-      \global\edef\pratendcountercurrent{\csname #4\endcsname} % Store the current (alpha value of the) counter
+      \protected at xdef\pratendcountercurrent{\csname #4\endcsname} % Store the current (alpha value of the) counter
       \csname prAtEndRestate\pratendcountercurrent\endcsname % Restate the theorem
     \fi%
     %%  Otherwise just state the theorem in a restatable environment
@@ -280,10 +289,10 @@
       \end{restatable}%
       %% Store the current (alpha value of the) counter
       %% in \pratendcountercurrent
-      \global\edef\pratendcountercurrent{\roman{counterAllProofEnd}} %
+      \protected at xdef\pratendcountercurrent{\roman{counterAllProofEnd}} %
     \fi%
     %% Create a custom alias to restate the theorem
-    \global\expandafter\edef\csname \pratendcustomrestate\endcsname{\noexpand\csname prAtEndRestate\pratendcountercurrent\endcsname}%
+    \expandafter\protected at xdef\csname \pratendcustomrestate\endcsname{\noexpand\csname prAtEndRestate\pratendcountercurrent\endcsname}%
     %% Restate the theorem if needed in appendix
     \ifrestatethm
       \appendtofile{\prefixPrAtEndFiles\category.tex}{\string\prAtEndRestate\pratendcountercurrent*}
@@ -294,12 +303,12 @@
   \ifallattheend%
     %% Store the current (alpha value of the) counter
     %% in \pratendcountercurrent
-    \global\edef\pratendcountercurrent{\roman{counterAllProofEnd}}
+    \protected at xdef\pratendcountercurrent{\roman{counterAllProofEnd}}
     %% Create a custom alias to restate the theorem
-    \global\expandafter\edef\csname \pratendcustomrestate\endcsname{\noexpand\csname prAtEndRestate\pratendcountercurrent\endcsname}%
+    \expandafter\protected at xdef\csname \pratendcustomrestate\endcsname{\noexpand\csname prAtEndRestate\pratendcountercurrent\endcsname}%
     \appendtofile{\prefixPrAtEndFiles\category.tex}{\string\begin{restatable}[#3]{#2}{prAtEndRestate\pratendcountercurrent}\string\label{thm:prAtEnd\pratendcountercurrent}\detokenize{#4}\string\end{restatable}}%
   \fi%
-}
+}{}
 
 \NewDocumentEnvironment{proofEnd}{O{}+b}{
   \pgfkeys{%
@@ -323,9 +332,9 @@
   \fi%
   %% Write the proof at the end
   \ifproofend%
-    \appendtofile{\prefixPrAtEndFiles\category.tex}{\string\begin{proof}[\pratendtextproof]\string\phantomsection\string\label{proof:prAtEnd\pratendcountercurrent}\detokenize{#2}\string\end{proof}}%
+    \appendtofile{\prefixPrAtEndFiles\category.tex}{\string\label{proofsection:prAtEnd\pratendcountercurrent}\string\begin{proof}[\pratendtextproof]\string\phantomsection\string\label{proof:prAtEnd\pratendcountercurrent}\detokenize{#2}\string\end{proof}}%
   \fi%
-}
+}{}
 
 %%%%% Text in appendix
 



More information about the tex-live-commits mailing list