Skip to content

No hyperlink created when using \hyperlink and \phantom with xelatex #16

Closed

Description

@xduugu

I noticed this issue when trying to use the acro package. Creating links to the acronyms list works with pdflatex, but not with xelatex.

Clemens Niederberger posted a MWE, which shows that the issue is in the hyperref package.

% arara: xelatex
% arara: xelatex
\documentclass{article}
\usepackage{hyperref}

\begin{document}

\hypertarget{name}{text}
\clearpage
\hyperlink{name}{\phantom{text}}text

\end{document}

Activity

  1. agrahn commented on May 30, 2017

    @agrahn

    This is a (x)dvipdfmx peculiarity which can hardly be fixed on the TeX-level. The pdf:bann and pdf:eann specials for creating line-breakable PDF annotations require typeset glyphs in between to compute a non-zero annotation rectangle.

  2. xduugu commented on Jun 7, 2017

    @xduugu
    Author

    I worked around this issue by using a different package for acronyms. If it is not fixable, feel free to close this issue.

  3. u-fischer commented on Sep 30, 2017

    @u-fischer
    Member

    hyperref provides a command \XeTeXLinkBox which can be used to get a link box with xelatex (it inserts small space glyphs):

    \documentclass{article}
    \usepackage{hyperref}
    
    \begin{document}
    
    \hypertarget{name}{text}
    \clearpage
    \hyperlink{name}{\XeTeXLinkBox{\phantom{text}}}text
    
    \end{document}
    
  4. davidcarlisle commented on Oct 1, 2018

    @davidcarlisle
    Member

    @u-fischer do you think it would be possible to detect the need for \XeTeXLinkBox automatically? Or I wonder if a feature request could be made for (x)dvipdfm(x) to give a bit more help in the case the glyph based size heuristic returns no sensible values.

  5. u-fischer commented on Oct 1, 2018

    @u-fischer
    Member

    @davidcarlisle I don't really see how xetex should be able to check if the box contains glyphs or not, at least not on the macro level. Imho the problem should be solved in xdvipdfmx.

  6. u-fischer commented on Sep 16, 2019

    @u-fischer
    Member

    I did send a bug report to the dvipdfmx mailing list and close here.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions