Hi Nasser,

But on chapter one, I have few sections and a local TOC for
> the chapter that links to them, i.e. on same page.
>

Well, this is why this change is a bad idea in the first place. This
configuration is used when the TOC is printed, so any change later in the
document cannot influence it.

This configuration seems to work, but it starts to get messy:

\Preamble{xhtml}

\Configure{TocLink}{\Link[\LikeRef{cutfile \LikeRef{fileidcut #1}(L
}]{}{#3} #4\EndLink}

\catcode`\:=11
\Configure{TocAt}
   {\let\sv:atoc\a:tableofcontents
\let\sv:btoc\b:tableofcontents
\let\sv:ctoc\c:tableofcontents
\let\sv:dtoc\d:tableofcontents
\let\sv:etoc\e:tableofcontents
%
    \Configure{tableofcontents}
       {\IgnorePar\EndP\HCode{<div class="\sec:typ TOCS">}\IgnorePar}
       {}{\IgnorePar\HCode{</div>}\ShowPar}{\HCode{<br />}}{}%
    \ifvmode \IgnorePar\fi \EndP
\Configure{TocLink}{\Link{##2}{##3}##4\ifvmode\IgnorePar\fi\EndLink}
   }
   {\let\a:tableofcontents\sv:atoc
\let\b:tableofcontents\sv:btoc
\let\c:tableofcontents\sv:ctoc
\let\d:tableofcontents\sv:dtoc
\let\e:tableofcontents\sv:etoc
\par\ShowPar}
\catcode`\:=12
\begin{document}
\EndPreamble

Best regards,
Michal

Reply via email to