12

The algorithm2e package seems to be not compatible with LuaLaTeX. For example, compiling the following code produces an error.

\documentclass{article}

\usepackage{fontspec}
\usepackage{algorithm2e}

\begin{document}
foo
\end{document}

Output of lualatex:

...
! String contains an invalid utf-8 sequence.
l.778 \renewcommand{\@algocf@procname}{Proc
                                       �dure}%
? 
! Emergency stop.

Has someone an idea how to fix that? I have a lot of algorithms typeset and do not want to switch to another package just because of LuaLaTeX.

closed as off-topic by Werner, Mensch, Paul Gaborit, user13907, Jesse Nov 25 '15 at 1:37

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    @Andy: converting to utf8 will help with lualatex but then you will probably get wrong fix names with pdflatex + an 8bit-option of inputenc. Using non-ascii chars in a sty is simply a bad idea. – Ulrike Fischer Nov 14 '11 at 17:33
  • 1
    My version use procédure which is ok for french. A sty should be pure ascii and it doesn't matter how you save it as the result will be the same. ascii chars are encoded identically in utf8, ansinew, latin1 etc. – Ulrike Fischer Nov 14 '11 at 18:06
  • 4
    I'm voting to close this question as off-topic because this problem cannot be reproduced anymore. – Werner Nov 25 '15 at 1:03
  • 1
    @Werner please don't do that. The problem has appeared again. – Trylks Mar 8 '16 at 19:48
  • 2
    Why was this question closed? I am also getting same error with lulatex, using TL 2015. How could an error from using a package in TL be off topic? – Nasser Apr 17 '16 at 2:52
10

algorithm2e.sty contains (at least) two non-ascii chars (é in procédure), but the file is 8bit encoded so it is not a valid utf8 file. You (or the author) should replace the é by \'e.

  • @Peter: Unfortunately there are several other usages of é in that file, so I would try to use search-and-replace. Please don't forget to post a email to the author and mentioning this. It should be fixed for the next release. – Martin Scharrer Nov 14 '11 at 16:03
  • 3
    Yeah, that did the trick. Substituting all accents solved the problem. I will send an e-mail to the author. Hopefully it will be fixed in the next release. Thanks for all your help! – Peter Nov 14 '11 at 16:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.