asciidoctor / asciidoctor-fopub

A portable DocBook-to-PDF build command that wraps DocBook XSL and Apache FOP
MIT License
113 stars 37 forks source link

Code block with long lines overflows #28

Open DavidGamba opened 10 years ago

DavidGamba commented 10 years ago

I want to have long code lines wrapping around:

This is my text in asciidoc:

Check that the following block is not overflowing the page.                                                                                                                             

----                                                                                                                                                                                    
Some.seriously.long.line.in.here.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc                                                                
----

And here is how it gets rendered in xml:

<simpara>Check that the following block is not overflowing the page.</simpara>                                                                                                          
<screen>Some.seriously.long.line.in.here.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc.lalalalala.foo.bar.lalalalala.etc</screen>

And here is my pdf:

block-overflow

I haven't been able to figure this one out because I don't know how to refer to the screen block. I tried setting stuff for <xsl:attribute name="screen"> without luck.

DavidGamba commented 10 years ago

Found this answer in stack overflow. I will try some of the things posted there.

http://stackoverflow.com/a/4533760

cpkio commented 8 years ago

the SCREEN tags in DOCBOOK-XSL actually boils down to <xsl:attribute-set name="verbatim.properties">

you can play with <xsl:attribute name="wrap-option">wrap</xsl:attribute>, this should help