Goal : add a picture and title on top of the table of contents, in the left frame, using make4ht.
Problem : I used htlatex a while ago and at this time, I have found a preamble which was able to do this (Thanks to @Michal.h21 if I recall correctly) but now repeating the process, I get a trouble with the encoding (I ask for utf-8 using french characters but the file remain in ascii) and also I have not separated frames for chapter/section, .... Using make4ht, no trouble with the encoding and the separated frames, but as I do not know how to handle preambles, I was not able to "mix" with the preamble for htlatex and get a) correct encoding b) 2 frames with the frame in the right being different at each chapter/section c) the frame on the left having a picture above a title above the table of content. What I would like is shown on the right hand of the picture below.
Is there a way (which I have not found yet on internet) to add a picture and a title (and anything else) above the tableofcontents in the left frame, using make4ht ?
Thanks
What I've used :
for Test.tex
\documentclass[10pt, twoside, a4paper, openany]{book} \ifdefined\HCode \def\pgfsysdriver{pgfsys-dvisvgm4ht.def} \fi %% ---------------------------------------- \begin{document} \tableofcontents \chapter{Première Année} \section{Exemplarité 1} \subsection{Bancale} \subsection{Modulable} \section{Exemplarité 2} \subsection{Calculable} \subsection{Promulgable} \chapter{Deuxième Année} \section{Test 1} \section{Test 2} \end{document} for pream.cfg :
\Preamble{mathml,ext=xhtml,charset=''utf-8'',3,frames} \begin{document} \Css{body{ margin:1em auto; max-width:95\%; padding:0 .62em; }} \Configure{TITLE}{\HCode{<title>}\special{t4ht@[}}{\special{t4ht@]} Année 2025 \HCode{</title>\Hnewline}} \EndPreamble for pream_htlatex.cfg
\edef\hash{\string#} \Preamble{mathml,ext=html,charset = "UTF-8", 4,frames} \Configure{HTML}{\HCode{<html lang = "fr"> \Hnewline}}{\HCode{\Hnewline</html>}} \Css{ body{ margin:1em auto; max-width:None; padding:0 .62em; } } \Configure{TITLE}{\HCode{<title>}\special{t4ht@[}}{\special{t4ht@]}Année 2025\HCode{</title>\Hnewline}} \Configure{@HEAD}{\HCode{<link rel="profile" href="http://gmpg.org/xfn/11" />\Hnewline}} \Configure{@HEAD}{\HCode{<link rel="shortcut icon" href="logo.png" />\Hnewline}} \makeatletter \let\Title\@empty \let\Author\@empty \let\Date\@empty \def\title#1{\gdef\@title{#1} \immediate\write\@auxout{\string\gdef\string\Title{#1}}} \def\author#1{\gdef\@author{#1} \immediate\write\@auxout{\string\gdef\string\Author{#1}}} \def\date#1{\gdef\@date{#1} \immediate\write\@auxout{\string\gdef\string\Date{#1}}} \Configure{BODY} {\Tg<a id="title"/>% \HorFrames{*,3*}\Frame[ marginwidth="20" name="f1"]{s1}\Frame[ marginwidth="20" name="f2"]{s2} \NoFrames \PushStack\eBody{} \SubConfig \HPage[p1]{hello}\Link{}{s1}\EndLink \bgroup \Tg<img src="logo.png"> \Tg<h1>Année 20525 \Tg</h1> \Configure{Link}{a}{target="f2" href=}{name=}{} \tableofcontents \egroup \EndHPage{p1} \Tg<br /> \HPage[p2]{text2222}\Link{}{s2}\EndLink } { \EndHPage{p2}} \def\SubConfig{% \Configure{BODY} {\PushStack\eBody{x}\Tg<body>} {\PopStack\eBody\temp \ifx \temp\empty \EndFrames \else\Tg</body>\fi} \Configure{DOCTYPE} {\HCode{<!DOCTYPE html> \Hnewline}} } \def\pgfsysdriver{pgfsys-tex4ht.def} \renewcommand{\mathcal}[1]{#1} \begin{document} \EndPreamble and the command lines where
htlatex Test.tex "pream_htlatex.cfg, xhtml, html5" and
make4ht Second_Test.tex "3,frames" -c pream.cfg 
