[tex4ht] Is it possible to fix tex4ht links so so it ends at top of page?
Michal Hoftich
michal.h21 at gmail.com
Wed Sep 25 12:24:01 CEST 2024
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex4ht/attachments/20240925/461237bd/attachment.htm>
More information about the tex4ht
mailing list.