killercup / trpl-ebook

UNMAINTAINED
http://killercup.github.io/trpl-ebook/
478 stars 56 forks source link

Verbatim lines too long in PDF #3

Closed killercup closed 9 years ago

killercup commented 9 years ago

E.g. in 3.3.2 A Rust library

killercup commented 9 years ago

Pandoc uses fancyvbr which does not seem to feature any line breaking options.

If we were to switch to listings (just add --listings), we'd lose highlighting (as listings brings its own and does not support Rust).

killercup commented 9 years ago

Switching to --listings is not as easy as it seems:

! Undefined control sequence.
\lst@arg ->’
              static
l.12029 ...etimes]{\lstinline!’static! lifetime}

pandoc: Error producing PDF from TeX source
killercup commented 9 years ago

Another highlighting option is https://github.com/gpoore/minted which uses pygments.

killercup commented 9 years ago

So, the listings error posted above is actually a problem with the source itself and is fixed by rust-lang/rust#25432

killercup commented 9 years ago

So, the author of minted apparently wrote an extension to fancyvbr to allow line breaks. It's "documented" in the minted docs and in this answer on TeX-StackOverflow but I couldn't get it to work.