TeX - LaTeX Asked by ronno on February 19, 2021
The MWE below results in the error:
Undefined control sequence. hypersetup
It’s minimized from a CV that definitely compiled fine a month ago (with the warnings discussed in What does "You have requested package `foo', but the package provides `foo'." mean?). I’ve tried in up-to-date setups of both MiKTeX and TeX Live. I suspect some package that was updated in the meantime is causing an incompatibility, but having a hard time tracking down which one. I’m hoping someone can identify it, so that I can revert to an older version, or suggest a workaround.
documentclass{moderncv}
moderncvstyle{banking}
moderncvcolor{black}
name{John}{Doe}
hypersetup{}
begin{document}
makecvtitle
Lorem ipsum
end{document}
Changing the documentclass to article (and replacing the moderncv specific lines with usepackage{hyperref}) makes it compile fine. If I include
usepackage{hyperref}
I get an Option clash for package hyperref.
error, presumably because moderncv
is loading hyperref
.
There is an easy workaround: simply move comand hypersetup
behind begin{document}
like this:
documentclass{moderncv}
moderncvstyle{banking}
moderncvcolor{black}
name{John}{Doe}
%hypersetup{} % <========================================= move it down
begin{document}
hypersetup{} % <=======================================================
makecvtitle
Lorem ipsum
end{document}
The reason is that class moderncv
, current version 2.0, loads hyperref
with AtEndPreamble
. That means that hyperref
is called after your complete preamble. That means that your call is to early, at that moment hyperref
is not loaded and therefore hypersetup
is an unknown command, resulting the error message you got.
With the moved command hypersetup
after begin{document}
package hyperref
is already called and hypersetup
is a valid command ...
Answered by Mensch on February 19, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP