tex4ht.env declares search pathes for font files (.htf, .4hf) and uses an exclamation symbol to denote subfolders. E.g.
i/tex4ht/ht-fonts/unicode/!
It seems that the binary tex4ht.exe has problems to find the fonts if there are exactly one subfolder down.
As an example create a minimal hello world latex document:
\documentclass{article} \begin{document} Hallo Welt \end{document}
and then run
htlatex mtest "html" " -cunihtf"
The tex4ht run will end with an "illegal storage address" error
tex4ht.c (2012-07-25-19:36 Windows MiKTeX) tex4ht mtest -i/tex4ht/ht-fonts/ -cunihtf -ewin32/tex4ht.env (D:/MiKTeX2.9/tex4ht/base/win32/tex4ht.env) (D:/MiKTeX2.9/fonts/tfm/public/cm/cmr10.tfm) (D:/MiKTeX2.9/tex4ht/ht-fonts/alias/lm/lm-rep-cmrm/cmr.htf) Searching `lm-rep-cmrm.htf' for `cmr10.htf' (D:/MiKTeX2.9/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) --- error --- Illegal storage address
Now move (or copy) the file ..\MiKTeX2.9\tex4ht\ht-fonts\unicode\charset\unicode.4hf
one folder up to ..\MiKTeX2.9\tex4ht\ht-fonts\unicode\unicode.4hf
or one folder down to ..\MiKTeX2.9\tex4ht\ht-fonts\unicode\charset\uni\unicode.4hf
then tex4ht finds the file and compiles successfully:
tex4ht.c (2012-07-25-19:36 Windows MiKTeX) tex4ht mtest -i/tex4ht/ht-fonts/ -cunihtf -ewin32/tex4ht.env (D:/MiKTeX2.9/tex4ht/base/win32/tex4ht.env) (D:/MiKTeX2.9/tex4ht/ht-fonts/unicode/charset/uni/unicode.4hf) <--- there (D:/MiKTeX2.9/fonts/tfm/public/cm/cmr10.tfm) (D:/MiKTeX2.9/tex4ht/ht-fonts/alias/lm/lm-rep-cmrm/cmr.htf) Searching `lm-rep-cmrm.htf' for `cmr10.htf' (D:/MiKTeX2.9/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) [1 file mtest.html file mtest.css file mtest.tmp ] Execute script `mtest.lg'
Adding the "charset" folder to the search path either in tex4ht.env or in the htlatex call works too:
htlatex mtest "html" "unicode/charset -cunihtf"
TeXLive uses the same locations to store the files but there everything compiles fine.
Thanks, this has been resolved in the next tex4ht version which will be released in May.
Unfortunately the problem seems still to persist. A simple file with umlauts compiled using
make4ht test "xhtml,charset=utf-8" " -cunihtf -utf8"
shows question marks instead of German umlauts.
My current workaround was to copy the file
unicode.4hf
from
C:\Program Files\MiKTeX 2.9\tex4ht\ht-fonts\unicode\charset
to
C:\Program Files\MiKTeX 2.9\tex4ht\ht-fonts\unicode\charset\uni
which solved the problem.
Here the MWE test.tex:
Output:
A text with some „�������“.
Last edit: Mike 2016-08-04
I can confirm that the problem persists.
Remark: there exists a second unicode.4ht in
/tex4ht/ht-fonts/iso8859/1/charset/uni/unicode.4hf
. In my tests this is currently found but it leads to 8-bit encoded umlauts and so to the question marks in Mike's report. If one remove this unicode.4hf or moves it up one folder then one get againIllegal storage address
error from the original bug report. If both unicode.4hf are in/charset/uni/
the correct one inunicode/charset/uni
is found and everything is fine.BTW: As mentioned by Michal Hoftich on Stack Exchange if using
make4ht
with the-u
option it callstex4ht
with the-cmozhtf
option. Then tex4ht is actually supposed to look forunicode.4hf
inht-fonts/mozilla/charset/
directory but fails to find it there too. So it is a general problem.The file tex4ht.ini (in directory miktex/config) contains wrong path definitions. I think it is safe to remove this file.
texmf.cnf from texlive contains similar settings:
~~~~
T4HTINPUTS = .;$TEXMF/tex4ht//
%% t4ht utility, sharing files with TeX4ht
TEX4HTFONTSET=alias,iso8859,unicode
TEX4HTINPUTS = .;$TEXMF/tex4ht/base//;$TEXMF/tex4ht/ht-fonts/{$TEX4HTFONTSET}//
~~~~
so imho they can't be completly wrong.
Maybe TL TEX4HTINPUTS is a fallback, if tex4ht.env does not exist or if it does not contain a <xxx> section (where xxx is the -c switch value).
Hm. I did run some tests, and really looks as if the search path in tex4ht.ini are sometimes used as fallback and so lead to the wrong unicode.4ht. But I can't understand why some combinations of file locations and .env entries fails. There is no obvious pattern
E.g. this combination of location and env-entry fails
but this all works
So it is not a simple "! doesn't search subfolders".