LyXSubfigure error when content is program listing

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
grevillea
Posts: 3
Joined: Tue Jun 11, 2013 10:07 am

Subfigure error when content is program listing

Post by grevillea »

I want to use sub figures which have program code listing as content. However, I get the LaTeX error

Code: Select all

Paragraph ended before \lst@next was complete.
The same problem does not occur if the content of the figure is plain text or an image graphic, so it would appear to be some interaction between subfigure and program listing.

Attached is a small working example to demonstrate the bug.
Attachments
subfigurebug.lyx
Small working example of the bug
(2.04 KiB) Downloaded 295 times
Last edited by cgnieder on Fri Jul 26, 2013 10:16 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

tom
Posts: 73
Joined: Thu Apr 18, 2013 4:02 am

Subfigure error when content is program listing

Post by tom »

Hi!

See this similar question and answer on tex.SX. It explains why you can't use listings directly inside subfloat.
Post Reply