Skip to content

Dimen \XeTeXLinkMargin defined for all engines but apparently only needed for XeTeX #240

Closed

Description

@jfbu

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?

Activity

  1. davidcarlisle commented on May 24, 2022

    @davidcarlisle
    Member

    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

  2. u-fischer commented on May 24, 2022

    @u-fischer
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions