-
-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible regression in the fall 2020 LaTeX release - interaction between xwatermark.sty and atbegshi #411
Comments
Running your test says: (latexbug) This test file uses third-party file(s)
(latexbug)
(latexbug) ==============
(latexbug) xwatermark.sty
(latexbug) test.xwm
(latexbug) hyperref.sty -> LaTeX Team
(latexbug) https://github.com/latex3/hyperref/issues
(latexbug) ============== and indeed You can try to patch over \documentclass{article}
% catoptions patch (no guarantee that will work):
% must be applied before loading catoptions
\def\FIXcatoptions\endgroup#1\begingroup{#1}
\AddToHook{package/after/catoptions}
{\gleftaddtocs\document{\FIXcatoptions}}
\usepackage{xwatermark}
\begin{document}
test
\end{document} |
that happens because xwatermark changes a lot if internal LaTeX macros through overwriting them or replacing them in a way that was never meant to be supported. It therefore now clobbers parts that handle this kind of warning. If you load these packages before xwatermark then the warnings go away (because at that point they are correctly handled). Of course, that doesn't solve the problem that xwartermark is overwriting internals in an now incompatible way.As @PhelypeOleinik said the author has been informed that his packages will break months back. |
Thank you all. AFAICT the issue is not in LaTeX itself, so I'm closing it. However, do you think it would be possible to "identify" packages not compatible with the current LaTeX macros so that they do not end up in standard distributions (telixve, miktex, etc.)? |
Sometimes we can identify, and notify the maintainer (it happens quite often). But there are cases when the maintainer is not responsive for whatever reason, or that we didn't identify the incompatibility (it's TeX, after all, the possibilities for incompatibility are endless :-) That said, no, we can't do much about those packages as long as they have a maintainer (if they don't, then we can ask CTAN to take over and fix them, which happens often too), let alone take it out of distributions (that would be rather bad, actually). The good option really is for the maintainer to fix the package. |
@gamboz For a feasible workaround and/or an up-to-date solution you might want to get rid of package |
most likely no package is needed given that LaTeX now has the hooks shipout/background and shipout/foreground which are precisely for adding something onto each or just the next page (using |
@FrankMittelbach thank you for pointing out the new hooks. It solved my problem in less than 10 lines :) \documentclass{article}
\usepackage{xcolor}
\usepackage{graphicx}
\newcommand{\watermark}{%
\fontfamily{ucr}\fontseries{m}\fontsize{40}{1}\selectfont%
\color{gray}%
\put(560,-120){%
\rotatebox{-90}{Some watermark 123}
}
}
\AddToHook{shipout/background}{\watermark}
\begin{document}
hi
\newpage
pg.2
\end{document} |
welcome, and one more advice ... since the fall release 2020 picture coordinates can be dimensions (in which case no \unitlength is used so something like .5\paperheight can be usefully employed |
This fix works great with the recent version of LaTeX but causes problems when compiling with an older version (which alas happens when compiling at work where LaTeX is not updated as frequently). I suggest to protect it with a version check like that TeX.SX answer. \makeatletter % if not in a package
\newcommand*\@iflatexlater{\@ifl@t@r\fmtversion}
\@iflatexlater{2020/10/01}{%
\def\FIXcatoptions\endgroup#1\begingroup{#1}
\AddToHook{package/after/catoptions}
{\gleftaddtocs\document{\FIXcatoptions}}%
}{}
\makeatother % if not in a package |
Brief outline of the bug
Compiling the MWE below gives error with texlive 2020 installed today, but not with texlive 2020 installed around September 29th.
Since the xwatermark.sty file is the same, I think the issue may be related to the hooks in atbegshi / atbegshi-ltx.
For completeness, I do receive a warning about
(and the same for atveryend).
Minimal example showing the bug
Log and PDF file
Obtained with
pdflatex mwe
(and type "r" when prompted)mwe.log
mwe.pdf
The text was updated successfully, but these errors were encountered: