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?
{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{in the text. – daleif Mar 17 '16 at 15:16endoption toalgorithm2e. – egreg Mar 17 '16 at 15:19endoption and tried out all the other ones in the documentation (longend,noendandshortend), but the same error occurs. – n1k31t4 Mar 17 '16 at 15:28\setbooleanin 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\documentclassline at the start so will generate errors if anyone tries to test it. – David Carlisle Mar 17 '16 at 16:08M-x org-export-as-latexand post that file for the nonorg-modeusers. Your problem (here) is almost certainly with the.texfile, not the way Org exports and relies on LaTeX to produce a PDF. – jon Mar 17 '16 at 18:08