anriseth / baposter

Automatically exported from code.google.com/p/baposter
GNU General Public License v3.0
14 stars 2 forks source link

Error in using lstlistings or verbatim environment #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
* What steps will reproduce the problem?

Place a \begin{verbatim}...\end{verbatim} or
\begin{lstlistings}...\end{lstlistings} inside a box

* What is the expected output? What do you see instead?

Expected output is that the verbatim or lstlistings code would be formatted
as it would in an article style document. Actual output is something like:

! Paragraph ended before \verbatim@ was complete. 

or 

! Paragraph ended before \lst@next was complete.

Oddly, using \lstinline$$ seems to be OK.

* What version of the product are you using? On what operating system?

Ubuntu Jackalope; latest version of baposter.cls

* Please provide any additional information below.

Example file which exhibits the problem is attached.

BTW Thanks for making this style public, it really is a fantastic piece of
work and very useful.

Original issue reported on code.google.com by mount.sarah on 27 May 2009 at 5:34

Attachments:

GoogleCodeExporter commented 8 years ago
I ran into this problem as well. A workaround (for the listings package only) 
is to
follow the instructions in section 5.1 "Listings inside arguments" of the 
listings
package documentation: escape the spaces and place a ^^J 'line feed' at the end 
of
each line.

So something like this works:

\begin{lstlisting}^^J
int x = 5;^^J
while (x > 4)^^J
\ \ x--;^^J
\end{lstlisting}

It's not ideal but the output looks fine.

Original comment by nmgas...@gmail.com on 31 Jul 2009 at 7:03

GoogleCodeExporter commented 8 years ago
The fancyverb package might help you. Especially first saving a verbatim 
snippet and then using it makes it robust within arguments.

If more feedback is posted here, I will add it to the FAQ

Original comment by brian.amberg@gmail.com on 5 Jul 2010 at 7:21

GoogleCodeExporter commented 8 years ago
This works as well : 
declare a \newsavebox\mybox before \begin{document}

declare 
\begin{lrbox}{\mybox}
\begin{lstlisting}
...
\end{lstlisting}
\end{lrbox}
just inside your \begin{document}

and place
\usebox\mybox \\
where you want it within a \headerbox

Hope this helps for next time

Sam Bayliss
PhD Candidate : Circuits and Systems Group, Imperial College London

Original comment by samuel.b...@gmail.com on 9 Mar 2011 at 7:42

GoogleCodeExporter commented 8 years ago
The latest version of baposter now has a posterbox environment instead of the 
old \headerbox command. As the box contents are now no longer arguments to a 
LaTeX macro, you can freely use verbatim inside a box.

So this issue is fixed.

Original comment by reinhold...@gmail.com on 10 Oct 2011 at 2:50

GoogleCodeExporter commented 8 years ago
Fixed.

Original comment by brian.amberg@gmail.com on 10 Oct 2011 at 6:13

GoogleCodeExporter commented 8 years ago
Issue 27 has been merged into this issue.

Original comment by brian.amberg@gmail.com on 17 Dec 2011 at 7:09