<div dir="ltr"><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><div>Hello,</div></div></div><div><br></div><div>I've been trying to get tex4ebook working with indices containing accented characters.</div><div><br></div><div>My sample.tex file:</div><div><br></div><div><font face="monospace">%%%%%%%</font></div><div><font face="monospace">\documentclass{book}<br>\usepackage[noautomatic]{imakeidx}<br>\makeindex<br><br>\begin{document}<br>\chapter{Foo}<br>\section{Bar}<br>Lorem ipsum dolor\index{dolor} sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.<br><br>\chapter{Baz}<br>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\index{láboris} nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore\index{dolore|seealso{dolor}} eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br>\printindex<br>\end{document}<br></font></div><div><font face="monospace">%%%%%%%</font></div><div><br></div><div>(Note that if \index{láboris} is changed to \index{laboris} then this can be compiled with tex4book + xindy perfectly.)</div><div><br></div><div>My sample.cfg, using indexing4ht from <a href="https://github.com/michal-h21/helpers4ht">https://github.com/michal-h21/helpers4ht</a>:</div><div><br></div><div><font face="monospace">%%%%%%</font></div><div><font face="monospace">\RequirePackage{indexing4ht}<br>\Preamble{xhtml}<br>\begin{document}<br>\EndPreamble<br></font></div><div><font face="monospace">%%%%%%</font></div><div><br></div><div>I prefer using latexmk so my sample.mk4 contains</div><div><br></div><div><font face="monospace">%%%%%%%</font></div><div><font face="monospace">Make:latexmk {}<br></font></div><div><font face="monospace">%%%%%%%</font></div><div><br></div><div>and my latexmkrc to invoke xindy during tex4ebook:</div><div><br></div><div><font face="monospace">%%%%%%</font></div><div><font face="monospace">$makeindex = 'xindy -L english -C utf8 -M %R.xdy %O -o %D %S';<br></font></div><div><font face="monospace">%%%%%%</font></div><div><br></div><div>These files are in the attached tex4ebook-indexing.zip. When running tex4ebook with</div><div><br></div><div>tex4ebook -c sample.cfg -e sample.mk4 sample.tex</div><div><br></div><div>I get the errors</div><div><br></div><div><font face="monospace">----------</font></div><font face="monospace">[ERROR]   htlatex: Compilation errors in the htlatex run<br>[ERROR]   htlatex: Filename Line Message<br>[ERROR]   htlatex: ./sample.xref 26 Missing \endcsname inserted.<br>[ERROR]   htlatex: ./sample.xref 26 LaTeX Error: Missing \begin{document} in `sample.cfg'.<br>[ERROR]   htlatex: ./sample.xref 26 Extra \endcsname.<br>[ERROR]   htlatex: ./sample.xref 26 Missing \endcsname inserted.<br>[ERROR]   htlatex: ./sample.xref 26 Missing \endcsname inserted.<br>[ERROR]   htlatex: ./sample.xref 26 Extra \endcsname.</font></div><div dir="ltr"><font face="monospace">----------</font><br><div><br></div><div>Looking in sample.log I see:</div><div><br></div><div><font face="monospace">----------</font></div><div><font face="monospace">(./sample.xref<br>! Missing \endcsname inserted.<br><to be read again> <br>                   \let <br>l.26 ...name acp:c\endcsname {3}aboris}{idxkw3}{9}<br>                                                  %<br>The control sequence marked <to be read again> should<br>not appear between \csname and \endcsname.<br></font></div><div><font face="monospace">-----------</font></div><div><br></div><div><br></div><div>And the offending line in sample.xref looks like this:</div><div><br></div><div><font face="monospace">%%%%%%</font></div><div><font face="monospace">\:CrossWord{idxkwl\let \prOteCt \relax \let \prOteCt \relax \Protect \csname acp:c\endcsname {3}aboris}{idxkw3}{9}%</font></div><font face="monospace">%%%%%%</font></div><div dir="ltr"><br></div><div>The generated .epub looks just fine, and the index entry looks just fine too (with "láboris"). </div><div><br></div><div>My question is if the error about the .xref would cause any real problems to the .epub, and if it can be avoided?</div><div><br></div><div><br></div><div>(I do have another question regarding indexing4ht. There's a comment in <a href="http://indexing4ht.ht">indexing4ht.ht</a> that says </div><div><br></div><table class="gmail-highlight gmail-tab-size gmail-js-file-line-container" style="box-sizing:border-box;border-spacing:0px;border-collapse:collapse;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><td id="gmail-LC17" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible"><font face="monospace">% configure variable which is saved on every index call<br>% section mark is used by default, other possible values may be paragraphs, or<br>% links to individual index entries</font><br><font face="monospace">\NewConfigure{indexvalue}{1}<br>\Configure{indexvalue}{\getCurrentSectionNumber}<br>\NewConfigure{indexidentifier}{1}<br>\Configure{indexidentifier}{\CurSecHaddr}<br></font> <br></td></tr></tbody></table><div><br></div><div>Is it easy to override and use "links to individual index entries" instead, with a line or two of \Configure{indexvalue} and \Configure{indexidentifier} in one's own .cfg file? I've tried looking at the imakeidx.4ht at <a href="https://tex.stackexchange.com/a/350012">https://tex.stackexchange.com/a/350012</a> but could extract the minimal set of lines to copy.)</div><div><br></div><div>Thanks,</div><div>LianTze</div><div dir="ltr"><br></div></div></div></div></div></div>