In one section I wrote some numbered hypothesis, for which I created a theorem environment as follows:
\newtheorem{ipotesi}{Ipotesi}%[section]
\renewcommand{\theipotesi}{A\arabic{ipotesi}}
In another section, far away from the one where I put firstly my hypothesis, I would like to rewrite them using again the same environment, with the same number of course and possibly a cross reference that points exactly to the first ones.
Here I found something but I am not able to apply it to my case
From what I deduced, I should write something like this, but it does not work.
\makeatletter
\newcommand{\neutralize}[1]{\expandafter\let\csname c@#1\endcsname\count@}
\makeatother
\newtheorem{hp}{Ipotesi}
\newenvironment{hpbis}[1]
{\renewcommand{\thehp}{\ref{#1}}%
\neutralize{hp}\phantomsection
\begin{hp}}
{\end{hp}}
I managed to solve the problem using \addtocounter{ipotesi}{-x}
where x
is the number of hypothesys I wrote in between the sections. However, this does not fully satisfies me..
Can anyone please explain me what does the code written by @egreg and also how could I manage do make this working more properly?