[tex-eplain] Contents hyperlinks

Rodolfo Medina rodolfo.medina at gmail.com
Wed Aug 3 15:42:56 CEST 2016

Rodolfo Medina <rodolfo.medina at gmail.com> writes:

> In eplain.pdf, I read:
>  There is currently no special support for hyperlinks in the table of
>  contents, but implementing them with the \hldest and \hlstart ... \hlend
>  commands should be possible.
> Could anyone please suggest a way to do that?

I haven't tested it, but the following stuff:

\def\hyperlink#1#2{\hbox{\hlstart{name}{}{#1} #2\hlend}}
% #1 the subchapter number, #2 the subchapter title and #3 the <LABEL> for
% \hyperlink (the same inside \target):
  \rightskip=30pt plus 1fil
  \indent\hbox to15pt{#1\hss}%
  \ignorespaces #2\unskip % the title #2 may have spurious spaces
  \nobreak \tocleaders 
% write entry into TOC table:
    \let\folio\relax % prevent expansion of `\folio` during `\edef`
% (\target{<LABEL>} somewhere is needed of course, and \newwrite\cont)

should create a hyperlinked TOC entry working with both pdfTeX and Knuth's
plain TeX and dvips -> ps2pdf.  From Heiko Oberdiek's macro, see:


, in turn from TeXbook exerc.21.10.



More information about the tex-eplain mailing list