nbconvert: Breaking lines in verbatim output in latex export

For Latex, the output is formatted using the Verbatim environment, which doesn’t insert line breaks. If you printed a very long line, or a long text, this is somewhat annoying. I didn’t see a way to make Verbatim insert line-breaks. There is the spverbatim package that does it though. Would it be possible to change the verbatim package? Or would there be another way to solve this issue? I think inserting line breaks in output is reasonable - after all, they are broken in the notebook.

Or do you think it would be better to use a filter to enter newlines before passing the text to latex? The filter doesn’t know how wide the area will be, though.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 26 (18 by maintainers)

Most upvoted comments

@mpacer this is not about code, it’s about raw text iirc. If you print a really long string, it will be wrapped in the cell in the notebook and html conversion, but just run over in the latex.