[Tex/LaTex] Simpler alternative to hyperref

hyperrefpdf

I've been trying to get a hyperlinked table of contents working with a preexisting large book project. I've tried hyperref, and have had problems getting it to work right. In case it's of interest, I'll append a brief description of the problems, but the long and the short of it is that I'm getting the impression of hyperref as a big, complex, fragile package that includes a lot of unrelated functionality such as PDF titling, and I don't want to use it. Is there any alternative that will allow me to do something more low-level and just generate the hyperlinks I want? All I want is something like this:

\target{about-socrates}Socrates was sentenced to execution by drinking hemlock.
...
We recall that \href{about-socrates}{Socrates} drank hemlock.

That's all I need. I don't need it to do any styling of links for me (colors, boxes, etc.) — I can handle that myself. I only need it to work with PDF output, not DVI, HTML, etc. I don't need it to automatically generate hyperlinks in the TOC; I think I can do that myself as well.

Description of the problems with hyperref (probably irrelevant)

I get a cryptic error message if I invoke hyperref after all other packages (! Package hyperref Error: This should not happen! (hyperref) Missing version of 'hpdftex.def'.), and although this error goes away if I invoke it before other packages, then some of the page numbers it links to are wrong. Unfortunately I have not had any luck getting a MWE to demonstrate either problem.

Best Answer

You can use the navigator package.

Nav­i­ga­tor im­ple­ments PDF fea­tures for all for­mats (with some lim­i­ta­tions in ConTEXt) with PDFTEX, LuaTEX and X∃TEX (i.e. xd­vipdfmx). Fea­tures in­clude:

  • Cus­tomiz­able out­lines (i.e. book­marks);
  • An­chors;
  • Links and ac­tions (e.g. JavaScript or user-de­fined PDF ac­tions);
  • File em­bed­ding (not in ConTEXt);
  • Doc­u­ment in­for­ma­tion and PDF viewer's dis­play (not in ConTEXt); and
  • Com­mands to cre­ate and use raw PDF ob­jects

Nav­i­ga­tor re­quires texapi and yax, both ver­sion at least 1.03.

Using navigator, the code snippet you included above would look like

\anchor{about-socrates}Socrates was sentenced to execution by drinking hemlock.
...
We recall that \jumplink{about-socrates}{Socrates} drank hemlock.