On 13. feb. 2012 20:33, Ricardo wrote:
Following Richard advice, below posted source code of a small document.
With the current lyx configuration I can insert a child document with
the program listing input. The document is saved utf8. I can see accents
on the pdf output, but the breaklines of the listings package does not
seem to work and I do not why. A long line does not break at any place,
despite breaklines=true param is set.
Any help welcomed

I can use utf8 source code files and have breaklines work too. Of course, breaklines only works for real text. A line with no spaces will not break up.

To make utf8 content survive, put \usepackage{listingsutf8} in the document preamble. In the parameters for the included child document, set the "Include Type" to "Program Listing", and in "Listing parameters", set:
breaklines=true
inputencoding={utf8/latin1}

Or possibly utf8/latin9, if you use euro symbols in your program.

With this approach, it is not necessary to change the document encoding away from default.

Document:
http://www.aitel.hist.no/~helgehaf/sw/lyxdemo/listing.lyx
Included program code:
http://www.aitel.hist.no/~helgehaf/sw/lyxdemo/listing.c

Helge Hafting

Reply via email to