In this minimal example:


Hahaha \hyperref[other]{2}

Compiling with pdflatex, it ends up fine:


However when I compile it with

make4ht minimal.tex "mathml"

The html version does not show the number correctly.

enter image description here

I would like to know, how can I adjust htlatex so that it correctly produces documents with \hyperref?


  • 1
    There's no anchor for that link: no \label{other} command anywhere. Once you add that, it works for me.
    – frabjous
    Jun 30, 2022 at 23:34

1 Answer 1


It seems like a bug in TeX4ht support for the \hyperref command. It uses the \ref command internally, so when the linked label is not found, it will print ?? to signalize the missing reference. As you don't have any other label in your document, you get this missing reference sign.

You can use the following config file to mimic the \hyperref behavior, which prints the text even when reference is missing:

  \expandafter\label@@hyperref\csname r@#1\endcsname{#1}%
      Hyper reference `#2' on page \thepage \space undefined%

compile using:

 make4ht -c config.cfg minimal.tex "mathml"

This is the result:

enter image description here

  • Thank you very much for your answer!
    – Socrates
    Jul 8, 2022 at 19:15

You must log in to answer this question.

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