[tex-live] pdfstartlink/pdfendlink and boxing level problems

Ulrike Fischer news3 at nililand.de
Wed Nov 28 12:31:25 CET 2018

After some discussion in the latex team I have two questions about
\pdfstartlink/\pdfendlink in pdftex (\pdfextension startlink/endlink
in luatex) and boxing levels.

Currently the commands give a fatal error if used in different
boxing levels:

    attr {/Border[0 0 1]}
        } Linktext}  

! pdfTeX error (ext4): \pdfendlink ended up in different nesting
level than \pdfstartlink.
!  ==> Fatal error occurred, no output PDF file produced!

This doesn't happen very often in documents, but if the galley is
split and reboxed it is possible that long links end in different
levels. One example involving two column mode and top floats has
been discussed on the latex2e github:

Is the fatal error really sensible here? Couldn't the engines close
the last annotation with some more or less sensible coordinate and
continue with a warning? A pdf with a wrong link area seems better
than no pdf at all (and would release the format and packages from
the need to carefully keep track of boxing levels when splitting and
reassembling stuff).

2. The engines interrupts linking if the boxing level of
intermediate text is less than the boxing level at the start of the

    attr {/Border[0 0 1]}
        } Linktext}}
  not linked
  \hbox{still not linked}
\hbox{\hbox{more Linktext\pdfendlink}}


This allows to some extend to exclude e.g. header and footer from
link areas. But doesn't work e.g. with fancyhdr which adds an
additional box level to the footer. xetex/xdvidfpmx has here a quite
useful special \special{pdf:nolink} which can be used to suppress
the unwanted link area:

\cfoot{some longer text that should not be linked}
  %\cfoot{\special{pdf:nolink}some longer text that should not be

xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx
\href{xxxxx}{link link link link }

Would it be possible to add to pdftex/luatex something similar?

Ulrike Fischer 

More information about the tex-live mailing list