Code folding in PDF output? #4121
Replies: 7 comments 11 replies
-
|
The PDF format standard itself is static, and doesn't support interactive features. You can still control whether code is hidden with |
Beta Was this translation helpful? Give feedback.
-
|
There are a few pointers on the knitr side of things; this one in particular seems to work well However I do not understand the behaviour of |
Beta Was this translation helpful? Give feedback.
-
|
Although baptiste's solution works very fine, you can avoid setting |
Beta Was this translation helpful? Give feedback.
-
|
This did not work for me. I had to add use include-in-header:
text: |
\usepackage{fvextra}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{
commandchars=\\\{\},
breaklines, breaknonspaceingroup, breakanywhere
}instead. See also the dedicated pandoc latex section in the |
Beta Was this translation helpful? Give feedback.
-
|
How to do this for Python? |
Beta Was this translation helpful? Give feedback.
-
|
Typst does this automatically, you can use |
Beta Was this translation helpful? Give feedback.
-
|
I had a lot of headaches with this and couldn't find an adequate solution, so posting the one that worked for me in case others end up here: |
Beta Was this translation helpful? Give feedback.





Uh oh!
There was an error while loading. Please reload this page.
-
I just tried Quarto with a Jupyter notebook. The code folding feature seems to work exclusively for HTML output. Unfortunately, this feature is missing from where it would seem really necessary, i.e. fixed-width documents like PDF. And this in a project promising "elegantly formatted output", "high-quality articles", and "beautiful publications" (all taken from Quarto's homepage).
Beta Was this translation helpful? Give feedback.
All reactions