LaTeX with cross-references.
Seems to work, but following links in PDF brings you to the top
of the section below the heading, sometimes meaning that the
number is not visible on screen. Also section headings could
perhaps have better layout with less empty space above and below.