I have a large latex document which I compile to pdf and html, today via latex2html. I'm investigating switching from latex2html to htlatex, as it is "real" latex, and runs much faster.

So far, htlatex works very well, but when I ask it to generate one html file per section with the "3" directive, the html files are named foose1.html, foose2.html, etc.

I change this document frequently, often adding or removing sections, and many other people outside my organization link directly to the per-section files. I would like to not break their links. Today, with latex2html, I can name the per-section files based on the names of the sections, which I can keep unique and constant across changes to the document.

Is there a way to tell htlatex to use a custom naming scheme for these html files?

1 Answer 1


There is sec-filename option, which does exactly what you want. The following sample file:


\section{Some section}

here goes the text

\section{Another section}

another text


can be compiled with this command:

make4ht filename.tex "3,sec-filename"

(make4ht is replacement for htlatex with lots of additional features)

The following files are created by tex4ht:

  • sample.html
  • Somesection.html
  • Anothersection.html

You can read about other possible options here.

You must log in to answer this question.

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