Thank you Micha for reminding me to this new question.

I followed the first steps for tex4ebook this weekend for the first time and got close to the finish. I follow a discussion here some years after the origin, and tried using tex4ebook. I think a last step seems not to work.

The last run of tex4ebook gives a problem with the encoding of german special characters, like ä, ü, ä, ß in the \index{Abhängigkeiten}.

In the .ind file you find this: Which says that xindy worked fine.

  \item \idxkeyword{Abhängigkeiten}, \idxlocator{173}
  \item \idxkeyword{Absolutisten}, \idxlocator{127}

The ! message show the following lines:

 Missing \endcsname inserted.
<to be read again>
l.9   \item \idxkeyword{Abhngigkeiten}
                                       , \idxlocator{173}

Obviously the character ä is omitted and give the problem.

My tex files is big, but the relevant code seems to be:

\usepackage[some options to set the page]{geometry}
... and some others which might be irrelevant here

Maybe some of you can say how to handle this last problem to get my first epub?

I really follow the advice oe Micha for tex4ebook, used the source codes presented here.

Thank you, Thomkrates

  • You should add a link to the question to which you refer.
    – dexteritas
    Commented Mar 12, 2023 at 11:20
  • Welcome to TeX.SX! Please extend your code to a minimal working example (MWE).
    – dexteritas
    Commented Mar 12, 2023 at 11:20
  • a full example would help but \usepackage[ansinew]{inputenc} makes everything harder, you can not post such code on this site as this site uses utf-8. the conversion is likely to be easier if you saved your file in utf-8 and deleted that line Commented Mar 12, 2023 at 11:56
  • @David Carlisle thank you. I tried to put a small example to produce the problem, but the problem shows itself in the small example. Since my texeditor is utf8 encoded (Texstudio), but out of traditional reason I used ansinew in inputenc. All was well up to this point trying an epub with tex4ebook. I found, when I use \usepackage[utf8]{inputenc} I got an error "Invalid UTF-8 byte ..." concerning the special german character. But in the source is Ü Ä Ö ß used etc. and I do not know, if I should make something like \"a to mask that. Or whatever the problem is. I do not understand the problem.
    – Thomkrates
    Commented Mar 12, 2023 at 14:17
  • I am not sure what you mean by "Since my texeditor is utf8 encoded (Texstudio), but out of traditional reason I used ansinew in inputenc" If the file is utf-8 encoded but you declare it as ansinew latex can not work at all, either generating normal pdf or ebook. The Ü Ä Ö ß you posted above are UTF-8, but the act of posting to this page will convert to that encoding. The question is what enoding is used in your file, I do not know texstudio but I am sure it will give an option to save as utf-8. Commented Mar 12, 2023 at 14:23

1 Answer 1


In the comments the answer is hidden. Here in short:

I installed notepad++ editor and converted my sourcename.tex (which had been in ansinew encoding) all in utf8 encoding. And additionally changed the ansinew encoding of the sourcename.tex in \usepackage[utf8]{ìnputenc} which solved the problem here addressed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .