Fri Oct 28 07:50:56 2022, original submission:
Reference and screen shots at
https://tex.stackexchange.com/questions/663305/tex4ht-does-not-handle-listing-correctly-when-using-smaller-font-size
tex4ht destroys code alignment when using basicstyle=\small (with or without font family being given) compare to when not using basicstyle. This only happens in the HTML. The pdf is correct. Here is a MWE
--------------------------
\documentclass[12pt]{article}
\usepackage{listings}
\begin{document}
\begin{lstlisting}[language={},keepspaces=true,basicstyle=\small]
local case_one_gamma_entry := module()
option object;
export pole_location := 0;
export pole_order := 0;
export sqrt_r := 0;
export alpha_plus := 0;
export alpha_minus := 0;
export b := 0;
end module;
\end{lstlisting}
\begin{lstlisting}[language={},keepspaces=true]
local case_one_gamma_entry := module()
option object;
export pole_location := 0;
export pole_order := 0;
export sqrt_r := 0;
export alpha_plus := 0;
export alpha_minus := 0;
export b := 0;
end module;
\end{lstlisting}
\end{document}
----------------------
compiled with
make4ht -ulm default -a warning foo2.tex "mathjax,htm"
This is the HTML
<screen shot at link>
No problem in PDF.
I like to user smaller font size in the HTML. Is there a way to make tex4ht not change the source code when using smaller font size? I also tried basicstyle=\ttfamily\small but no effect.
TL 2022.
>which tex4ht
/usr/local/texlive/2022/bin/x86_64-linux/tex4ht
>make4ht --version
make4ht version v0.3l
|