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

I have a LaTeX document using the algorithm2e package. It used to work before I upgraded to texlive (it's the Debian version 2012.20120516-1 -- some snapshot from 2012, if I understand correctly).

The problem is that now it seems that I can't use underscores in captions of algorithms, functions, and so on...




This is ``A''


When I try to process the above document with pdflatex, I see this error:

Runaway argument?
method\_A@\endcsname ##1{\FuncSty {\algocf@captname method\_A@(}\ArgSty \ETC.
! Paragraph ended before \algocf@captname was complete.
<to be read again> 


What does this error mean, and is there anything I can do to fix it?

share|improve this question

migrated from stackoverflow.com Jun 6 '12 at 18:31

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

The procedure environment supplied by algorithm2e has a strict requirement in terms of its caption. From the algorithm2e documentation:

...the syntax of the \caption command is restricted as follow: you MUST put a name followed by 2 braces like this “Name()”. You can put arguments inside the braces and text after. If no argument is given, the braces will be removed in the title.

As such, you're required to use something like:

enter image description here

\usepackage{algorithm2e}% http://ctan.org/pkg/algorithm2e

This is ``A''

share|improve this answer
Thanks! It is a bit strange (particularly because C function names may have underscores -- and usually do), but I can rework the document to not use those. – Jay Jun 6 '12 at 18:56
@Jay: Sure. Of course, a completely different question would be to change the caption to meet your needs. Using procedure or function forces a certain requirement and also output. Asking follow-up questions like this are more than welcome! Please use the "Ask Question" link for your new question; there you can link to this question to provide the background. – Werner Jun 6 '12 at 18:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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