gusbrs / zref-clever

Clever LaTeX cross-references based on zref
LaTeX Project Public License v1.3c
11 stars 4 forks source link

Error in combination with `pseudo` #16

Closed mgkurtz closed 1 year ago

mgkurtz commented 1 year ago

This is the same as mlhetland/pseudo.sty#23 as I cannot say, which of both packages is responsible for that issue.

gusbrs commented 1 year ago

Mhm, surprising interaction. But considering tcolorbox has no code conditional or hooked to the loading of zref-clever (only to the presence of some of its commands) and, conversely, zref-clever has no code conditional or hooked to the loading of tcolorbox, this seems to stem from pseudo's \AtEndPreamble as you hinted yourself, and the code conditional on \@ifpackageloaded{tcolorbox} placed there. Light testing here suggests that the loading of \tcbuselibrary{hooks} is relevant (commenting it out makes the issue go away).

However, if that logic was really correct, the presence or the load order of zref-clever shouldn't matter. We may be dealing with some interaction from some dependency, loaded by either package. So I'll leave this open for the time being and follow the discussion at https://github.com/mlhetland/pseudo.sty/issues/23.

gusbrs commented 1 year ago

I think I caught the culprit. In the following lines from pseudo.sty:

https://github.com/mlhetland/pseudo.sty/blob/ac1ea073b64502616788c5155272693f51a6851a/pseudo.sty#L875-L891

The call to \@ifpackageloaded { tcolorbox } is missing the third argument (the false branch).

That given, what surprises me is why it does not affect tcolorbox (if zref-clever is absent). But the same problem can be reproduced with:

\documentclass{article}

\usepackage{pseudo}
\usepackage{siunitx}
\usepackage{tcolorbox}

\begin{document}

Hello world!!

\end{document}

I'll wait a little for confirmation from pseudo's maintainer. But, in the meantime, thanks for the report.