URL:
  <https://puszcza.gnu.org.ua/bugs/?667>

                 Summary: tex4ht does not create local TOC when using starred
version of sectioning with an explicit \addcontentsline
                 Project: tex4ht
            Submitted by: nma123
            Submitted on: Sun Jan 11 00:04:39 2026
                Category: None
                Priority: 5 - Normal
                Severity: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

reference and screen shots at 

https://tex.stackexchange.com/questions/758140/tex4ht-does-not-create-local-toc-when-using-starred-version-of-sectioning-with-a

setup: I wanted to make all my sections and subsections without numbers
showing on the left side of each entry. So I changed to using the star version
and with manually entering each section or subsection into the main toc.

But now I find that only the main TOC is created, but local toc at top of each
section is missing. This happens with splitting or no splitting.

Removing the star version of sectioning, the local TOC shows up again as
expected.

Here is a MWE

-------------------------
\documentclass[12pt]{article}    
\begin{document}
\ifdefined\HCode
\Configure{tableofcontents*}{section}
\TocAt{section,subsection}
\else
\tableofcontents
\fi

\section*{section 1}
\addcontentsline{toc}{section}{section 1}%
text

\subsection*{subsection 1}
\addcontentsline{toc}{subsection}{subsection 1}%
text

\subsection*{subsection 2}
\addcontentsline{toc}{subsection}{subsection 2}%
text
\end{document}
---------------------------

Compiled with

make4ht -ulm default -a debug  C.tex 'mathjax,htm'

Gives this

enter image description here

Now see what happens when I change back to normal sectioning (i.e. no star)

---------------------------
\documentclass[12pt]{article}
\begin{document}
\ifdefined\HCode
\Configure{tableofcontents*}{section}
\TocAt{section,subsection}
\else
\tableofcontents
\fi

\section{section 1}
text

\subsection{subsection 1}
text

\subsection{subsection 2}
text
\end{document}
---------------------

Compiled using same command gives

enter image description here

I expected local TOC to show up in both cases.




    _______________________________________________________

Reply to this item at: <https://puszcza.gnu.org.ua/bugs/?667>

_______________________________________________
Message sent via/by Puszcza <https://puszcza.gnu.org.ua/>

Reply via email to