I used hyperref together with expex before and all was fine. Not sure when and what broke, but I don't get hyperlinks anymore, nor any idea where to look for the source of this grief. I'm compiling with lualatex, but pdflatex gives exactly the same result. Here's a MNWE:

\gathertags %for forward refs
Forward reference: (\getref{test}).\pagebreak

The ex:
\ex<test>Does the expex get a hyperlink?\xe

Backward reference: (\getref{test}).

Any suggestions are appreciated!

1 Answer 1


I can't see any documented changes that would have affected this but I think you can do something like the following to add a hyperref anchor at \ex and make a link in the reference.

enter image description here

   \ifcase\ep@textanchor                          % numleft
      \or                                         % normal
   \llap{\hbox to\leftskip{\unhbox\numbox \hss}}%


%oops \def\@printref#1{\hyperlink{expex.expecrefname}{\old@printref{#1}}}


This is a test of hyperref with expex.\footnote{The former should make hyperlinks for the latter's labels.}
Does the expex get a hyperlink?

This must be a hyperlink, but it isn't: (\getref{test}).
  • Thank you, that's great! Two 'but's though: I get a warning that " (pdf backend): unreferenced destination with name 'expex.expecrefname'", and the link does not send me to the anchor (checked over a \pagebreak). And it doesn't pick up forward reference at all (prints the tag name instead of label). Do you think this can be helped? Commented Jul 8, 2016 at 12:08
  • @IvanKapitonov expex doesn't seem to support forward references at all, it does not use the aux file and just seems to use a macro, so even without hyperref if you move the getref before the \ex then it fails as far as I can see, but i don't know the package at all. I just did the link type in your example there are probably more expex links that need to be made hyperref aware, but probably should be done by someone who knows what the package is doing. Commented Jul 8, 2016 at 12:13
  • Oh boy, I'm sorry, I was sure that my \gathertags is "somewhere in the preamble file" -- fixed the code in the question. That's a macro that "turns" forward reference "on" -- you're right, it doesn't use the .aux, but rather creates a -tags.tex file for that. Now I can see that if I have a link on the previous page, and a link on the page that follows the example, the first link sends me to the last one. It could be a hint to the anchor problem -- but unfortunately I've no idea what in your code is the anchor.. Commented Jul 8, 2016 at 12:25
  • Oh I'm missing a \ !!! expexrefname was supposed to have a backslash in so \hyperlink{expex.expecrefname}{ links to the anchor made here \hypertarget{expex.\@optionaltag}{}%` I'll fix... Commented Jul 8, 2016 at 13:17
  • @IvanKapitonov try now Commented Jul 8, 2016 at 13:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .