0

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.

\begin{theindex}
  \providecommand*\lettergroupDefault[1]{}
  \providecommand*\lettergroup[1]{%
      \par\textbf{#1}\par
      \nopagebreak
  }
  \lettergroup{A}
  \item \idxkeyword{Abhängigkeiten}, \idxlocator{173}
  \item \idxkeyword{Absolutisten}, \idxlocator{127}

The ! message show the following lines:

 Missing \endcsname inserted.
<to be read again>
                   \let
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:

\documentclass[11pt]{report}
\usepackage[some options to set the page]{geometry}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage[ngermen]{babel}
... 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 Mar 12 '23 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 – David Carlisle Mar 12 '23 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 Mar 12 '23 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. – David Carlisle Mar 12 '23 at 14:23
  • @DavidCarlisle Yes, I found notepad++ which I needed to install, with this the coding is easily shown for every loaded file, and in addition an easy converting tool is with it. My original tex source has been ansi and I converted it now into utf8 und saved it as this. But now tex4ebook does not work as far as before and I get an error: "! File ended while scanning use of :CrsWrd. \par l.1479 \load:ref{\jobname.xref}" Now I am at the beginning and do not know how this comes about. – Thomkrates Mar 12 '23 at 15:35
  • The last 2 lines of source.xref are: ":CrossWord{sec253}{x255-254000253}{478}% :CrossWord" This seems the end of compling and the above error message of a runaway argument. I have no idea what the problem is, since earlier (with ansi source.tex) is worked much more far. – Thomkrates Mar 12 '23 at 15:56
  • sorry I have given what hints I can, unless you provide an example I don't see how we can help. But first check your encoding setup with something simpler. \documentclass{article} \usepackage[T1]{fontenc} \begin{document} Ü Ä Ö ß \end{document} is a complete document and should give you a complete ebook that says Ü Ä Ö ß if that fails fix that first before using some non standard index setup copied from somewhere. – David Carlisle Mar 12 '23 at 17:04
  • @David Carlisle The minimal file that you suggested worked well with pdflatex and tex4ekook and gave a correct epub document with german Ü A Ö ß ... The problem is the indexing. The problem in this question, concerning the character encoding is solved with the above converting with notepad++ in utf8. So I better close this question and raise a separate one with the indexing and tex4ebook. Thank you. – Thomkrates Mar 12 '23 at 17:52
  • It is better to have everything in utf8. I wouldn't use inputenc today. For the current method of indexing, see this page: https://www.kodymirus.cz/tex4ht-doc/Howto.html#indexing – michal.h21 Mar 12 '23 at 18:51

1 Answers1

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.