There is a nice post addressing this issue from stackoverflow. Below is a copy:
That cannot work, because fragile material has to written into an external temporary file and then read back by beamer. The tabs get lost here. Use it this way:
publid delegate void Foo(object o);
Again, something relative with fragile command. What we need here to fix the problem is just
We need to be a bit more careful about typesetting in section/caption.
I was trying to include a pseudo code under algorithm2e style in a poster created using beamerposter, as listed below.
Then I received some weird error messages:
./WenxiangChen-CS560-poster.tex:215: Argument of \@caption has an extra }.<inserted text>
I found that this something relative to the fragile command. I forced the command in \caption to be robust by prefixing it with
protect. Now the compilation goes smoothly. 🙂