hyperref
hyperref copied to clipboard
Dimen `\XeTeXLinkMargin` defined for all engines but apparently only needed for XeTeX
Looking at some log file I noticed a dimen register was allocated with name \XeTeXLinkMargin.
I looked into hyperref.sty and found this:
\newdimen\XeTeXLinkMargin
\setlength{\XeTeXLinkMargin}{2pt}
\ifxetex
\font\XeTeXLink@font=pzdr at 1sp\relax
...
\else
\newcommand*{\XeTeXLinkBox}[1]{%
\begingroup
\leavevmode
\sbox\z@{#1}%
\copy\z@
\endgroup
}%
\fi
which seems to indicate it is is needed only for XeTeX engine. I did not find other references in the code and the documentation 7.7 \XeTeXLinkBox mentions it as XeTeX-specific thing.
Is there some reason to allocate it always?
I don't know if it's the original reason but if you only conditionally allocate then all box logging shows different box numbers for any later allocated boxes in xetex which complicates testing engine neutral code
Well it is only needed for xetex, but defining it for the other engines too makes it easier for the users: they don't have to test for the engine but can simply add the box and set the dimen.