pandoc doesn't text-wrap code blocks when converting to pdf

skud

I'm using pandoc with xelatex engine to convert markdown to pdf. I'm running pandoc like this:

pandoc -s 'backbone-fundamentals'.md -o 'backbone-fundamentals'.pdf \
    --title-prefix 'Developing Backbone.js Applications' \
    --normalize \
    --smart \
    --toc \
    --latex-engine=`which xelatex`

If a code line is longer than the pdf document width it just gets cutoff. Is there anyway to have pandoc text wrap long code lines?

A. Donda

Not having the text wrapped is (part of) the point of code blocks. As far as I know, the only way to wrap the code is manually. For most languages, not exceeding a certain line length is considered good style anyway.

If your lines are length-limited but still too long for your LaTeX-generated pdf, consider reducing the font size for code blocks. For this you need to change the LaTeX template used by pandoc. A look at this answer to "How to set font size for all verbatims in Beamer presentation?" should get you started.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

fenced code blocks when converting R Markdown to pdf

From Java

Add proper syntax name to code blocks when converting from HTML to Markdown with Pandoc

From Dev

PDF doesn't wrap text lines automatically & respect line position

From Dev

TextBlock text doesn't wrap when placed inside a ViewBox

From Dev

pandoc "cannot parse yaml header" when converting md to pdf

From Dev

pandoc "cannot parse yaml header" when converting md to pdf

From Dev

CSS Text doesn't wrap?

From Dev

code doesn't work properly when converting to function

From Dev

"word-wrap:break-word" doesn't work when generating PDF with SpraedPDFBundle

From Dev

GDB debugger doesn't work in Code::blocks

From Dev

Code Blocks output doesn't execute linux

From Dev

Code Blocks output doesn't execute linux

From Dev

<a> doesn't wrap span, and appears as text

From Dev

Text doesn't wrap, breaks layout instead

From Dev

when using UIWebview and dropdown, ios7 picker doesn't wrap the text.

From Dev

Left-align text when converting from md to pdf

From Dev

Set encoding when converting text file to pdf using itext

From Dev

Red areas around text when converting a pdf to png with pdfbox

From Dev

Pandoc: no line wrapping when converting to HTML

From Dev

WPF append text blocks UI thread heavily but WinForms doesn't?

From Dev

Intellij IDEA inline documentation doesn't highlight {@code } blocks as monospace

From Java

Text in a flex container doesn't wrap in IE11

From Dev

TextView inside TableLayout and TableRow doesn't wrap text

From Dev

CSS div with full width but doesn't wrap text

From Dev

Text doesn't wrap in IE 11 flex layout

From Dev

Text doesn't wrap in evenly distributed, even width flexbox

From Dev

Paragraph text doesn't wrap around to next line

From Dev

CSS border won't display when printing or converting to PDF

From Dev

Pandoc Markdown: ignore text in PDF (but include in HTML)

Related Related

  1. 1

    fenced code blocks when converting R Markdown to pdf

  2. 2

    Add proper syntax name to code blocks when converting from HTML to Markdown with Pandoc

  3. 3

    PDF doesn't wrap text lines automatically & respect line position

  4. 4

    TextBlock text doesn't wrap when placed inside a ViewBox

  5. 5

    pandoc "cannot parse yaml header" when converting md to pdf

  6. 6

    pandoc "cannot parse yaml header" when converting md to pdf

  7. 7

    CSS Text doesn't wrap?

  8. 8

    code doesn't work properly when converting to function

  9. 9

    "word-wrap:break-word" doesn't work when generating PDF with SpraedPDFBundle

  10. 10

    GDB debugger doesn't work in Code::blocks

  11. 11

    Code Blocks output doesn't execute linux

  12. 12

    Code Blocks output doesn't execute linux

  13. 13

    <a> doesn't wrap span, and appears as text

  14. 14

    Text doesn't wrap, breaks layout instead

  15. 15

    when using UIWebview and dropdown, ios7 picker doesn't wrap the text.

  16. 16

    Left-align text when converting from md to pdf

  17. 17

    Set encoding when converting text file to pdf using itext

  18. 18

    Red areas around text when converting a pdf to png with pdfbox

  19. 19

    Pandoc: no line wrapping when converting to HTML

  20. 20

    WPF append text blocks UI thread heavily but WinForms doesn't?

  21. 21

    Intellij IDEA inline documentation doesn't highlight {@code } blocks as monospace

  22. 22

    Text in a flex container doesn't wrap in IE11

  23. 23

    TextView inside TableLayout and TableRow doesn't wrap text

  24. 24

    CSS div with full width but doesn't wrap text

  25. 25

    Text doesn't wrap in IE 11 flex layout

  26. 26

    Text doesn't wrap in evenly distributed, even width flexbox

  27. 27

    Paragraph text doesn't wrap around to next line

  28. 28

    CSS border won't display when printing or converting to PDF

  29. 29

    Pandoc Markdown: ignore text in PDF (but include in HTML)

HotTag

Archive