When using French guillemets with TeX4HT, the resulting symbols are not followed/preceded by non-breaking spaces like they should, resulting in wrong line-breaking in HTML.
I tried resetting \og and \fg with a babel.4ht file, but I can't get anything working. The only solution I've found so far is the following:
I defined new \Og and \Fg commands with:
\ifluatex
\newcommand{\Og}{\og}
\newcommand{\Fg}{\fg{}}
\else
\newcommand{\Og}{\HCode{« }}
\newcommand{\Fg}{\HCode{ »}}
\fi
together with a sed hack to remove the spaces before :
sed -i "s@ * *@\ @g" $HTML
I'd like to get rid of this and do it properly in a .4ht file. How could I do this?
Edit:
The \Og/\Fg hack is actually acceptable for me, but not the sed one, so I'm modifying the title of this question: How can I remove spaces before the command?
\removeleadingspacesfrom thestringstringspackage allows to remove leading spaces indeed. However, it doesn't remove the spaces from the string before the\Fgcall… – ℝaphink Feb 25 at 13:03