# How to get htlatex to use a custom filename for per section html files?

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?

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

\documentclass{article}
\begin{document}

\section{Some section}

here goes the text

\section{Another section}

another text

\end{document}


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