# [tex4ht] Is this a bug in cutAt for tex4ht?

Nasser M. Abbasi nma at 12000.org
Mon Jun 13 15:33:09 CEST 2016

On 6/13/2016 7:09 AM, Michal Hoftich wrote:
> Hi Nasser,
>
> I think you should use \PauseCutAt{section} in this case, as pausing
> cut at chapter doesn't prevent cutting sections. You also need to use
> \TocAt{chapter,section,subsection} instead of
> \TocAt{section,subsection}. I don't really understand this issue,
> but local TOCs are obviously confused by cutting.
>
> Best,
> Michal
>

Thanks Michal for the hint.

You are right, the problem was the \TocAt{}. I changed
the \TocAt{section,subsection} to \TocAt{chapter,section} and
the error went away!

The strange thing, is that \TocAt{section,subsection}  works,
and it does make a TOC at each section which shows subsections
only as expcted, but it works only if there is
NO \PauseCutAt{section}. So this problem kicks
in only when \PauseCutAt{section} is there and the \TocAt{}
is "wrong".

Below is the updated version which works. I do not understand why
this fixed it, but at least now it works. I'll add this to my tex4ht
cheat sheet to remember it :)

--------------------------------------------
\documentclass[11pt]{book}%
%compile with make4ht foo "htm,3"
\begin{document}

\ifdefined\HCode
\Configure{tableofcontents*}{chapter,section}
\else
\tableofcontents
\fi

%This tells tex4ht to put TOC at each chapter which
%shows sections only. Do not use \TocAt{section,subsection}
%will cause an error if \PauseCutAt is also used. If \PauseCutAt
%is not used, then \TocAt{section,subsection}  works.
\ifdefined\HCode
\TocAt{chapter,section}
\fi

\ifdefined\HCode
\PauseCutAt{section} % do not SPLIT this chapter's sections
\fi
\chapter{A}
etc....
\section{A section}
etc....
\subsection{A subsection}
etc....

\ifdefined\HCode
\ContCutAt{section}  %start splitting next Chapters
\fi
\chapter{B}
etc....
\section{B section}
etc....
\subsection{B subsection}
etc....

\end{document}
---------------------------

Thank you,
--Nasser



More information about the tex4ht mailing list