[tex4ht] Is it possible to fix tex4ht links so so it ends at top of page?

Michal Hoftich michal.h21 at gmail.com
Fri Sep 20 09:59:03 CEST 2024


Hi Nasser,

> When I am at a top page, say index.htm and then when I click on
> > link to another page on same site also produced by tex4ht
> > such as
> >
> >       indexpart2.htm
> >
> > The new page opens not at the very top showing the navigation
> > bars that tex4ht adds automatically, but opens the new page at
> > little lower level, now showing the navigation bars, ending up
> > at something like
> >
> >             indexpart2.htm#x4829-4828000II
>

Toc links always point directly to the section titles. As there are
usually  multiple sections on each page, you couldn't link to individual
sections otherwise.

If you have TOC that links only to chapters that are alway on a separate
page, you can try this configuration:

%%%%%%%%%%%%%%%%%%%%%%%%%
\Preamble{xhtml}

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

\begin{document}
\EndPreamble
%%%%%%%%%%%%%%%%%%%%%%%%%

Best regards,
Michal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex4ht/attachments/20240920/fa720455/attachment.htm>


More information about the tex4ht mailing list.