TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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




Output of lualatex:

! String contains an invalid utf-8 sequence.
l.778 \renewcommand{\@algocf@procname}{Proc
! 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.

share|improve this question

closed as off-topic by Werner, Kurt, Paul Gaborit, Papiro, 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.

The Package is not in UTF-8 format. If you open it and save it back in UTF-8 format it works (for me). To try, please copy algorithm2e.sty in the same directory, open it with an editor that can save it back in UTF-8. – Andy Nov 14 '11 at 15:56
@Andy. That works too. Thanks for your tip! – Peter Nov 14 '11 at 16:38
@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
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
I'm voting to close this question as off-topic because this problem cannot be reproduced anymore. – Werner Nov 25 '15 at 1:03

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.

share|improve this answer
@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
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.