michal-h21 / make4ht

Build system for tex4ht
131 stars 15 forks source link

Encoding when converting to docbook #138

Open hcf-n opened 8 months ago

hcf-n commented 8 months ago

When i convert documents with characters like é, ä, ü, and several others, to docbook with make4ht i get the following errors.

[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: test.tex
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename Line    Message
[ERROR]   htlatex: ./test.tex   4    Undefined control sequence.
[ERROR]   htlatex: ./test.tex   4    Undefined control sequence.

This has not been a problem before, but after i updated today with Tex Live Utility I got the errors. I havn't updated for quite a while.

michal-h21 commented 8 months ago

I see. This seems to be caused by this change. It didn't cause problems for other output formats, so it went unnoticed. Try this configuration file, which provides the original Unicode configuration for accents:

\Preamble{xhtml}
\catcode`\:=11
      \Configure{accents}
        {\ifmmode \expandafter\mathord\fi
         {\leavevmode
\if !#1!\ht:special{t4ht@+&\#x#2;}%
\else \expandafter \ifx\csname U#2#1\endcsname\relax
    \ht:special{t4ht@+&{35}x#2;}%
\else
    \ht:special{t4ht@+&{35}x\csname U#2#1\endcsname;}%
\fi \fi x%
%
         \ht:special{t4ht@[}x\ht:special{t4ht@]}}}
        {\ifmmode \expandafter\mathord\fi
          {#3}}
\catcode`\:=12
\begin{document}
\EndPreamble