Dear Community
I’m wondering how to set the width of console output in a scrbook compiled to PDF using Quarto. Here’s how this looks like:
I was able to get code in code chunks to wrap using the LaTeX package fvextra
but no luck with console output. I’ve tried using the listings
package as explained here by adding it to my _quarto.yml
:
pdf:
documentclass: scrbook
classoption: [paper=6in:9in,pagesize=pdftex,headinclude=on,footinclude=on,12pt]
pandoc_args: --listings
include-in-header:
text: |
\usepackage{fvextra}
\usepackage{listings}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,commandchars=\\\{\}}
\areaset[0.50in]{4.5in}{8in}
\lstset{
breaklines=true
}
fig-pos: 'H'
but this doesn’t work (see the lines pandoc_args: --listings
and \usepackage{listings}
; with only pandoc_args
I get an error, and then lstset{breaklines=true}
).
I’ve tried looking online and tried some other things liking setting R.options = list("width"=60)
in a chunk header, but no luck.
So what would be the way to achieve this? Many thanks.