This is tex4ht issue only.
I use \begin{titlepage}...\end{titlepage}
in some documents. After I started using p {text-align:justify; }
in my configuration for tex4ht, I noticed now all the titles are shifted to the left also.
Title should remain centered on the page ofcourse. I have not been able to figure how to correct this. Here is a MWE and command used.
\documentclass[12pt]{book}
\begin{document}
\ifdefined\HCode
\Css{p{text-align:justify;}}
\fi
\frontmatter
\begin{titlepage}
\begin{center}
\textbf{My most important book}\par
\vspace{1.75in}
\today
\end{center}
\end{titlepage}
\newpage\null\thispagestyle{empty}\newpage
\mainmatter
This is my text
\end{document}
Compiled to pdf gives
Title is centered as expected. But
make4ht -ulm default -a debug foo.tex "htm,svg,nostyle"
Gives
You see, the title was treated as paragraph and shifted to left. If I remove \Css{p{text-align:justify;}}
and recompile, this is the result
Next, I looked at the HTML generated to see if adding some CSS will fix this. Here is the HTML generated
<!DOCTYPE html>
<html lang='en-US' xml:lang='en-US'>
<head><title></title>
<meta charset='utf-8' />
<meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' />
<meta content='width=device-width,initial-scale=1' name='viewport' />
<link href='foo.css' rel='stylesheet' type='text/css' />
<meta content='foo.tex' name='src' />
</head><body>
<!-- l. 8 --><p class='indent'>
</p><!-- l. 9 --><p class='indent'>
</p><!-- l. 9 --><p class='indent'>
</p>
<div class='center'>
<!-- l. 10 --><p class='noindent'>
</p><!-- l. 12 --><p class='noindent'><span class='ec-lmbx-12'>My most important book</span>
</p><!-- l. 15 --><p class='noindent'>September 29, 2023</p></div>
<!-- l. 18 --><p class='indent'>
</p><!-- l. 18 --><p class='indent'>
</p><!-- l. 22 --><p class='indent'> This is my text
</p>
</body>
</html>
It says the title should be in <div class='center'>
but for reason, once I added p{text-align:justify;}
it no longer works. My CSS skills are limited to fix this.
How can one use p{text-align:justify;}
but still keep title page centered?
Notice this only affects titlepage
environment. If I use normal title with command \maketittle
then the title remains centered no problem there.
TL 2023