1

The style file for J.UCS, jucs2e.sty, conflicts with hyperref. Here is a MWE:

\documentclass{article}
\usepackage{hyperref}
\usepackage{jucs2e}
\begin{document}
\end{document}

I get this error:

! Use of \global doesn't match its definition.
l.15 \global\let
                \hyper@last\relax

Apparently this happens because jucs2e.sty redefines \global:

\def\global\@namedef##1##2{}

Is there a fix?

(Removing the definition above seems to work but I wonder whether it'll break things in the future.)

1
  • 2
    remove the last definition (the redefinition of \enddocument) and hope for the best. And better load hyperref after this sty to give it a chance. Aug 6, 2020 at 14:17

1 Answer 1

2

That is a very nasty bug in the style. I believe it was intended to redefine \@namedef and the \global remained there. The (anyway rather questionable) redefinition of \enddocument should be patched.

\documentclass{article}
\usepackage{hyperref}
\usepackage{jucs2e}

\usepackage{xpatch}
\xpatchcmd{\enddocument}{\def\global}{\gdef}{}{}

\begin{document}
Hello.
\end{document}
2
  • So just change that line to \def\@namedef##1##2{}?
    – lhf
    Aug 6, 2020 at 14:25
  • 1
    @lhf Basically yes. But the redefinition of \enddocument e.g. ignores completely the \AtEndDocument hook on which some packages might rely. This style file is bound to create problems. In fact, I think the comment by @UlrikeFischer to the question is the better solution (particularly the "hope for the best" bit :-)).
    – campa
    Aug 6, 2020 at 14:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .