maranget / hevea

Hevea is a fast latex to html translator
http://hevea.inria.fr
Other
97 stars 12 forks source link

Spaces not eaten after \label or \index following \item #43

Open cspiel opened 3 years ago

cspiel commented 3 years ago

HeVeA leaves space-eating mode (at least) after macros \label and \index. Here is a sufficiently minimum-buggy example:

\documentclass{article}

\usepackage{imakeidx}

\makeindex

\begin{document}
\noindent \textbackslash label

\begin{itemize}
\item    Foo
\item\label{it:bar}Bar
\item    \label{it:baz}Baz
\item\label{it:bazoo}    Bazoo
\item    \label{it:bazooka}    Bazooka
\end{itemize}

\noindent \textbackslash index

\begin{itemize}
\item    Snafoo
\item\index{snabar}Snabar
\item    \index{snabaz}Snabaz
\item\index{snabazoo}    Snabazoo
\item    \index{snabazooka}    Snabazooka
\end{itemize}

\noindent \textbackslash label \& \textbackslash index

\begin{itemize}
\item    Snarffoo
\item\label{it:snarfbar}\index{snarfbar}Snarfbar
\item    \label{it:snarfbaz}\index{snarfbaz}Snarfbaz
\item\label{it:snarfbazoo}    \index{snarfbazoo}Snarfbazoo
\item\label{it:snarfbazooka}\index{snarfbazooka}    Snarfbazooka
\item    \label{it:huzzaburra}    \index{huzzaburra}    Huzzaburra
\end{itemize}
\end{document}

The problem shows up for those \items where there is white-space between the non-text-generating macro and the actual text of the item. TeX/LaTeX consistently eats up all whitespace after \item whether interrupted by a macro or not.

Exemplary output of the first block:

<ul class="itemize">
<li class="li-itemize">Foo</li>
<li class="li-itemize"><a id="it:bar"></a>Bar</li>
<li class="li-itemize"><a id="it:baz"></a>Baz</li>
<li class="li-itemize"><a id="it:bazoo"></a> Bazoo</li>
<li class="li-itemize"><a id="it:bazooka"></a> Bazooka</li>
</ul>