JesseStraat / reptheorem

LaTeX Project Public License v1.3c
1 stars 0 forks source link

Theorems are not repeated #1

Closed emalizia closed 1 month ago

emalizia commented 1 month ago

Hi,

I don't know if I didn't get how to use the package, but apparently it does not seem to work. This is a minimal working example to replicate the problem; the last theorem label, the one with the underscore, even throws an error during compilation when the fourth \reptheorem is issued at the end. Notice that also in the package documentation (the user's manual) the package does not seem to work, and theorems are not repeated.

%%% Begin of the MWE
\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{lmodern}

\usepackage{amsmath,amsthm}

\usepackage{reptheorem}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{construction}[theorem]{Construction}

\begin{document}

\begin{makethm}{theorem}{thmOne}[First Theorem]
This is a first theorem.
\end{makethm}

\begin{makethm}{theorem}{thm2}[Second Theorem]
This is a second theorem.
\end{makethm}

\begin{makethm}{theorem}{thm:third}[Third Theorem]
This is a third theorem.
\end{makethm}

\begin{makethm}{theorem}{thm_fourth}[Fourth Theorem]
This is a fourth theorem.
\end{makethm}

\repthm{theorem}{thmOne}

\repthm{theorem}{thm2}

\repthm{theorem}{thm:third}

% \repthm{theorem}{thm_fourth}

\end{document}
%%% End of the MWE
JesseStraat commented 1 month ago

Hi emalizia,

This should fix the MWE.

%%% Begin of the MWE
\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{lmodern}

\usepackage{amsmath,amsthm}

\usepackage{reptheorem}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{construction}[theorem]{Construction}

\begin{document}

\begin{makethm}{theorem}{thmOne}[First Theorem]
This is a first theorem.
\end{makethm}

\begin{makethm}{theorem}{thm2}[Second Theorem]
This is a second theorem.
\end{makethm}

\begin{makethm}{theorem}{thm:third}[Third Theorem]
This is a third theorem.
\end{makethm}

\begin{makethm}{theorem}{thm_fourth}[Fourth Theorem]
This is a fourth theorem.
\end{makethm}

\repthm{thmOne}

\repthm{thm2}

\repthm{thm:third}

\repthm{thm_fourth}

\end{document}
%%% End of the MWE

Notice that \repthm no longer takes a first argument. This was removed in v1.1 since it was deemed unnecessary.

That fixed the issue for me.

As for the documentation, it is (as of very recently) a known issue. The documentation that was uploaded to CTAN is somehow different from the one on GitHub, and it was only compiled once (as opposed to the required twice to produce the aux files). And the version on GitHub is somehow outdated. Terribly sorry about that. It will surely be fixed in the next update. As a "hotfix", I have attached the CORRECT documentation.

reptheorem.pdf

emalizia commented 1 month ago

Hi Jesse,

Thanks a lot for your help. The suggestion fixes the problem for me as well.

emalizia commented 1 month ago

Just one additional thing that can be spotted via the same MWE. It is something that I've noticed already in the output of the package thmtools restatable theorems, and it happens for your package as well. In the output of the MWE above, for the initial sequence of theorem declarations, there is a bigger vertical space between the theorems compared to the vertical space between the repeated theorems in the second part of the document. I don't know exactly why this happens. As I told you, it is something that `thmtools' does too, I found that the problem was reported (on tex.stackexchange.com, if I rememebr well), but my limited knowledge about LaTeX internals didn't allow me to fix it.

Thanks again for your help.

JesseStraat commented 1 month ago

Hi @emalizia, would you mind creating a separate issue for the problem? I'll make sure to look into it.

emalizia commented 1 month ago

Will do