3

I keep getting an error upon compilation, but cannot find an error, even with a tiny reproducible example (below). I am exporting from Emacs org-mode to LaTeX and then PDF, I am receiving the well known error message:

(\end occurred inside a group at level 1)

simple group (level 1) entered at line 1061 ({)

bottom level

The issue is that line 1061 is stated as the problem, regardless of the length of my org-file and the actual .tex file. I can reproduce the error with the following part of code, down to which I have narrowed the problem. The intermediary .tex file being only 56 lines long and the error message persisting as above!

I cannot find any errors (at least regarding syntax!). Here it is in directly from the LaTeX source that is compiled:

\begin{document}

\maketitle \tableofcontents

\begin{algorithm}[H] \KwIn{input} \Repeat{something} { scroll to bottom of page; } \caption{a caption} \end{algorithm} \end{document}

And here it is in the org file (no errors are produced from org mode to .tex file, only at the compilation stage, exporting to PDF):

#+latex_header: \usepackage[linesnumbered,ruled,lined,end]{algorithm2e}
#+begin_src latex 
  \begin{algorithm}[H]
    \KwIn{input}
    \Repeat{something} {
        scroll to bottom of page\;
    }
    \Return{something else}
    \caption{a caption}
  \end{algorithm}
#+end_src

I have tried removing all the options specified in the #+latex-header, but that didn't make a difference - same error message pointing to line 1061.

The PDF output actually looks ok (Emacs at least doesn't halt the export procedure), which I apologise for if you have read this far - but the error messages are bugging me.

Could this be a bug in the {algorithm2e} package? How can I get to the root of this?

Edit 1:

I just found a mailing list where somebody mentions the error (only last week) and the next update of TexLive on Debian should fix it. I am not on Debian though... will a fix still work for me using TeX on OSX?

n1k31t4
  • 143
  • Can you repeat it with just the {algorithm} environment you have (inserted in a MWE)? It sounds like you have an extra \end{stuff} in your exported document. – Sean Allred Mar 17 '16 at 15:12
  • First of all as Sean mentions, please post a full example such that users can test this. I just had one in a manuscript where the author had forgotten a { in the text. – daleif Mar 17 '16 at 15:16
  • There is no end option to algorithm2e. – egreg Mar 17 '16 at 15:19
  • I've made a smaller example that produces the same error message (on my system at least). @egreg - could you please explain a little more? I am new to LaTeX. What should I change? – n1k31t4 Mar 17 '16 at 15:21
  • 2
    @DexterMorgan Please, make it into a compilable example. Not everybody uses Org mode. I don't, for instance. – egreg Mar 17 '16 at 15:22
  • I have included everything from the .tex file that produces the error upon compilation. I am afraid I do not know what else is necessary to make it compatible for anyone. Also @egreg - I removed the end option and tried out all the other ones in the documentation (longend, noend and shortend), but the same error occurs. – n1k31t4 Mar 17 '16 at 15:28
  • As the message you linked to says the cause is a simple brace to much before \setboolean in line 1061. If it will be fixed depends on if someone reported it to the author and if the author did something. – Ulrike Fischer Mar 17 '16 at 16:04
  • 1
    I'm not sure what you mean by "included everything from the tex" the tex you show has no \documentclass line at the start so will generate errors if anyone tries to test it. – David Carlisle Mar 17 '16 at 16:08
  • Please run M-x org-export-as-latex and post that file for the non org-mode users. Your problem (here) is almost certainly with the .tex file, not the way Org exports and relies on LaTeX to produce a PDF. – jon Mar 17 '16 at 18:08
  • I filed a bug report on December 15, 2015: https://lists.lirmm.fr/wws/arc/algorithm2e-discussion/2015-12/msg00000.html – egreg Mar 18 '16 at 15:16
  • 4
    I'm voting to close this question as off-topic because this is a bug in a package already reported. – Romain Picot Apr 21 '16 at 08:08
  • @egreg Any workaround? Or is this safe to ignore? That link doesn't seem to work any more. – cfr May 17 '17 at 23:20
  • @cfr No, there's no workaround, I'm afraid, except making a local copy of the file and amending it. The error is often not a problem, but of course it makes TeX work inside a group, which can be bad for some documents. – egreg May 17 '17 at 23:26

0 Answers0