bell notificationshomepageloginNewPostedit profile

Topic : Re: How do I insert programming code snippets within Scrivener? I'm trying out Scrivener, as I intend to write some technical material. I'm a Software Developer and what I intend to write is programming - selfpublishingguru.com

10% popularity

A quick Google reveals some possible solutions:

"set up your code snippets in a syntactic editor then copy and paste into a Scrivener document, rather than try to replicate that formatting in Scrivener. Each snippet could sit in its own document in the binder, so you could compile those in their prepared format, but then let the rest of the text follow your chosen compile settings."
Another commenter on the same link points out that, if you're using LaTeX for your final output, there are "packages for LaTeX that can do code highlighting within verbatim environments".
"Scrivener 3 has Styles. You can use the Code Block style which switches to a monospaced font suitable for code. When you compile the document, the exact font used can be chosen in the compile settings except for HTML and Epub export where it will use HTML Code tags."

The first option (or LaTeX) seems the better one in my opinion. As a commenter on the first link remarks, Scrivener is a writing program, not a layout program, so you'll likely need to rely on other tools that integrate.


Load Full (0)

Login to follow topic

More posts by @Rambettina586

0 Comments

Sorted by latest first Latest Oldest Best

Back to top