1

I'm struggling to find any search results for how to control the output width of paragraphs in pandoc, when I put the following text in...

 Lorem ipsum dolor sit amet, consectetur adipiscing elit.Curabitur semper enim non erat malesuada hendrerit. Praesent sit amet sagittis nisi. Duis aliquet quis purus quis iaculis.
Cras quam est, tempor eu aliquet quis, efficitur ut libero. Mauris pretium mi quam, eu pellentesque lectus interdum non. Praesent enim ligula, aliquam condimentum consequat et, elementum eu diam. Nam tempus, tortor tincidunt gravida convallis, dui libero porttitor sapien, a facilisis erat purus id justo. Etiam sagittis fringilla sagittis.

Nullam eu pellentesque massa. Duis vel nisl ultricies, scelerisque libero vel, viverra quam. Nam eget congue risus, ac scelerisque lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nam fermentum urna in hendrerit vulputate. Mauris nisi nisi, pretium et ante et, feugiat vestibulum justo. Nullam rhoncus magna eget ultricies porttitor. Nulla vestibulum neque nec feugiat ornare. Donec eget dolor sit amet erat fringilla bibendum in ut leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. 

pandoc automatically formats it to the following...

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur
semper enim non erat malesuada hendrerit. Praesent sit amet sagittis
nisi. Duis aliquet quis purus quis iaculis. Cras quam est, tempor eu
aliquet quis, efficitur ut libero. Mauris pretium mi quam, eu
pellentesque lectus interdum non. Praesent enim ligula, aliquam
condimentum consequat et, elementum eu diam. Nam tempus, tortor
tincidunt gravida convallis, dui libero porttitor sapien, a facilisis
erat purus id justo. Etiam sagittis fringilla sagittis.

Nullam eu pellentesque massa. Duis vel nisl ultricies, scelerisque
libero vel, viverra quam. Nam eget congue risus, ac scelerisque lacus.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam fermentum
urna in hendrerit vulputate. Mauris nisi nisi, pretium et ante et,
feugiat vestibulum justo. Nullam rhoncus magna eget ultricies porttitor.
Nulla vestibulum neque nec feugiat ornare. Donec eget dolor sit amet
erat fringilla bibendum in ut leo. Class aptent taciti sociosqu ad
litora torquent per conubia nostra, per inceptos himenaeos.

How would I get the paragraph width closer to the former?

1 Answer 1

1

Pandoc has two options to control this, --wrap and --columns. To completely disable line-wrapping, write

pandoc --wrap=none ...

It's also possible to use the same wrapping that was used in the input via --wrap=preserve.

If you do want long lines to be wrapped, but would like up to 100 chars in a line instead of the default of 72 chars, then invoke pandoc with

pandoc --columns=100
1
  • Thank you very much for this, I didn't really know what to search for. Mar 6 at 0:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.