My proof redefinition command does not work on some cases and I cannot see the pattern nor the reason. These are the more reduced MN(N)E I could get. They were reproduced on Overleaf.
MWE 1:
\documentclass{article}
\usepackage{amssymb,amsmath,amsthm}
\begin{document}
\begin{proof}
I'm a froop
\end{proof}
\end{document}
MNWE 1:
\documentclass{article}
\usepackage{amssymb,amsmath,amsthm}
\renewenvironment{proof}[1][\proofname]{\leavevmode\par
\pushQED{\qed}%
\normalfont \topsep6\p@@plus6\p@\relax
\trivlist
\item[\hskip\labelsep
\itshape
#1@addpunct{.}]\mbox{}\par\nobreak\ignorespaces
}{%
\popQED\endtrivlist@endpefalse
}
\begin{document}
\begin{proof}
I'm a froop
\end{proof}
\end{document}
That would seem to indicate that my redefinition is not working. However, by adding the preamble in a separate file things seem to work fine.
The following is the main file.
\documentclass{article}
\usepackage{Preamble}
\begin{document}
\begin{proof}
I'm a froop
\end{proof}
\end{document}
MWE 2 (Preamble):
\ProvidesPackage{Preamble}
\usepackage{amssymb,amsmath,amsthm}
\renewenvironment{proof}[1][\proofname]{\leavevmode\par
\pushQED{\qed}%
\normalfont \topsep6\p@@plus6\p@\relax
\trivlist
\item[\hskip\labelsep
\itshape
#1@addpunct{.}]\mbox{}\par\nobreak\ignorespaces
}{%
\popQED\endtrivlist@endpefalse
}
\makeatletter
\makeatother
MNEW 2 (Preamble):
\ProvidesPackage{Preamble}
\usepackage{amssymb,amsmath,amsthm}
\makeatletter
\makeatother
\renewenvironment{proof}[1][\proofname]{\leavevmode\par
\pushQED{\qed}%
\normalfont \topsep6\p@@plus6\p@\relax
\trivlist
\item[\hskip\labelsep
\itshape
#1@addpunct{.}]\mbox{}\par\nobreak\ignorespaces
}{%
\popQED\endtrivlist@endpefalse
}
The point of knowing what's happening is to know where I can or cannot place my redefinition on the preamble.
\makeatletter ... \makeatotheraround the\renewenvironment(that is to say\makeatletterneeds to go before the entire redefinition block and\makeatotherafter the block, putting the two commands directly after each other has basically no effect). If you put the redefinition into a.styfile that you then load with\usepackagethe\makeatletter ... \makeatotheris implicit. (Generally\makeatletter/\makeatothershould be avoided when writing.styfiles.) – moewe Oct 15 '21 at 17:56\makeatletter ... \makeatotherintended to represent another definition, that's why there where outside. I now understand (https://tex.stackexchange.com/questions/62583/is-it-really-bad-to-use-makeatletter-and-makeatother-in-a-package-or-class-fil) the problem is that I shouldn't use the\makeatothercommand on.styfiles (and if I do I should re-start it for other definitions and packages with\makeatletter). Is that correct? Thank you for your comment and the reference. – Gilgamesh Oct 15 '21 at 18:12\makeatletter ... \makeatotherin.styfiles and in MNEW 2 the\makeatotheris exactly the problem. A related issue is discussed in https://tex.stackexchange.com/q/62583/35864. In your examples there is absolutely no reason for\makeatletteror\makeatotherin the.styfile, so you can just drop them. – moewe Oct 15 '21 at 18:19