Closed kbauer closed 6 years ago
It seems to me that the best behavior here would be for equation numbers in repeated environments to reuse the numbering of the main text: the content of a repeated theorem should be exactly the same in the appendix as in the main text, equation numbers included. Do you agree?
I am not certain how to implement a general fix, but if this is just about equations, it should be easy: just set the equation counter at the beginning of each repeated environment to its value in the main text (this might be what you suggested in your first option).
Do we need to care about other counters than equation counters? What can reasonably be within a theorem environment that can be \label
ed?
Personally, I cannot think of anything other than equations.
The big issue though is how to do the numbering; It would make sense to repeat the numbers of the main text, but it would also interrupt the assumtion that numbering is strictly ordered throughout the document, which helps when trying to look up an equation in a printed document. This might even be an enforced requirement from publishers.
I added a third version of how it might be handled.
Personally I find (3) to be the most powerful, leaving the choice to the user.
Solution (2) would be my personal preferrence, but
\newlabel
. I have tried implementing a generic solution to this problem, in commit 811a8de. A new package option, repeqn, can be set to same
to have the behavior (1), or to independent
to have the behavior (3). I think this is usable, see the added test cases. I have not implemented behavior (2), which could theoretically be added as another option. Can you please test and see if this fits your needs?
If so, I will release a new version with all the recent improvements. Thanks a lot for your help in making apxproof better!
I want to release a new version before the end of the week if possible. Let me know if the solution to this issue is satisfactory.
Hi, I would really like to have the same equation number in the repeated environment but I don't see a commit for the merged version in issue #16 ?
I am having also another issue: Pdflatex complains that the label of the equation in the repeated environment is multiply defined. Not a big issue but somewhat annoying.
Sorry my latexing is not good enough for coding a suggestion. A quick and dirty solution could be to give a different number and label to the repeated equation so that one would have the option of which equation to point to.
Hi Giovanni,
These features are added to the https://github.com/PierreSenellart/apxproof/tree/develop branch, not yet deployed to the master branch (I intend to do it very shortly). The issue you have about repeated equation labels should also be fixed there. Can you grab apxproof.sty
from the develop branch and test with that version?
I am getting an error
! Undefined control sequence. \hyper@@link ->\let \Hy@reserved@a \relax \@ifnextchar [{\hyper@link@ }{\hyp... l.144 \end{prprep}
? ! Undefined control sequence. \@thm ...makecurrent {#2}\let \Hy@dth@currentHref \@currentHref \def \@tempa... l.144 \end{prprep}
? ) Runaway argument? {\@oparg {\@begintheorem {Proposition}{\csname theproposition\endcsname \ETC. ! File ended while scanning use of \@tempc.
Have you tried removing the .aux file before recompiling? Can you provide a full example that shows the issue? You can send it to pierre@senellart.com if you do not want to post it publicly.
Hi Pierre, yes I removed all files but the biblio stuff.
Let me finish dinner and I'll send you a shorer version without figures.
You have mail
The compilation issue was due to the load of hyperref
after the \newtheoremrep
is used. It is not a good idea to load hyperref
so late, because it prevents that package from redefining behavior of counters. That being said, I have fixed the issue in commit 6b19888, so that documents should compile smoothly even with this loading order. Can you please test? Again, use the latest apxproof.sty
from the develop branch.
Another remark on your document: it is neither needed nor expected to use \newtheorem
commands for theorem, proposition, lemma, etc. if there is also a \newtheoremerep
command for them. \newtheoremrep
does define two different theorem environments, with and without repetitions. It does not seem to hurt, though.
Hi, it compiles and all warnings are gone. Great!
I don't follow your comments 1) I don't load the hyperref package, are you referring to bookmark? 2) if I remove the newtheorem commands I get errors "no counter theorem defined" etc
I am using Mixtex, maybe ths is important?
Giovanni:
\newtheorem{theorem}{Theorem}
\newtheorem{proposition}{Proposition}
\newtheorem{lemma}{Lemma}
\usepackage[bibliography = common]{apxproof}
\newtheoremrep{thm}[theorem]{Theorem}
\newtheoremrep{lmm}[lemma]{Lemma}
\newtheoremrep{prp}[proposition]{Proposition}[]
with:
\usepackage[bibliography = common]{apxproof}
\newtheoremrep{theorem}{Theorem}
\newtheoremrep{lemma}{Lemma}
\newtheoremrep{proposition}{Proposition}
and use theoremrep
, lemmarep
, propositionrep
instead of thmrep
, lmmrep
, prprep
.
Cool, I see what you mean.
It seems the issue is fixed now. Thanks for your hard work.
Closing the issue, and releasing in a few minutes a new version of apxproof (1.1.0) integrating these changes among other things.
Related to issue https://github.com/PierreSenellart/apxproof/issues/16
It may be preferable, to have references point to the repeated version of an equation inside a
foobarrep
environment in the appendix.This can be done by either:
\label{NAME}
and\label@in@display{NAME}
to update\r@NAME
instead of writing a\newlabel
to the aux file, or doing nothing (current implementation, if bugfix from pull request https://github.com/PierreSenellart/apxproof/pull/17 applied).\label{NAME}
and\label@in@display{NAME}
to produce a labelNAME-apx
or similar, that explicitly points to the appendix version; With[appendix=inline]
, this extra label would have to point to the main-text version. Downside: LaTeX editors would not be aware of theNAME-apx
label.Example: