It looks like tex4ht headings start at <h2>
for the title. The following tex:
\documentclass{article}
\title{Testing headings}
\author{Alex Watson}
\date{\today}
\begin{document}
\maketitle
\section{Top level section}
\subsection{Next level section}
\end{document}
processed with make4ht -uf html5 ht-headings.tex
produces the following HTML:
<!DOCTYPE html>
<html lang='en-US' xml:lang='en-US'>
<head><title>Testing headings</title>
<meta charset='utf-8' />
<meta name='generator' content='TeX4ht (http://www.tug.org/tex4ht/)' />
<meta name='viewport' content='width=device-width,initial-scale=1' />
<link rel='stylesheet' type='text/css' href='ht-headings.css' />
<meta name='src' content='ht-headings.tex' />
</head><body>
<div class='maketitle'>
<h2 class='titleHead'>Testing headings</h2>
<div class='author'><span class='cmr-12'>Alex Watson</span></div><br />
<div class='date'><span class='cmr-12'>September 19, 2020</span></div>
</div>
<h3 class='sectionHead'><span class='titlemark'>1 </span> <a id='x1-10001'></a>Top level section</h3>
<!-- l. 13 --><p class='noindent'>
</p>
<h4 class='subsectionHead'><span class='titlemark'>1.1 </span> <a id='x1-20001.1'></a>Next level section</h4>
</body>
</html>
The headings start with h2
for the title, then h3
for section, etc.
I would have expected the title to be h1
.
Maybe more significantly, if using class book
and some \chapter
macros, the title is still h2
but then the chapters are also h2
!
Is there an easy way to move the heading levels 'up one', to use h1
for title, h2
for the next level of sectioning, etc? (And is this a reasonable thing to want?)
A solution that works with different classes (and maybe even when splitting into multiple html files!) would be ideal, but I realise that might be asking a bit much.