I’m new to Scrivener, followed the initial concepts tutorial and had no issues, I’m actually pretty excited to use Scrivener and get things going!
I’m looking to use it to write e-books of a technical nature (e.g. coding, tooltip boxes… etc).
In particular, I’ve been looking around for guides on how to format tooltips (e.g. Info boxes, warning boxes, tip boxes, did you know boxes) with an icon on the left and a different background colour for the whole box. I’ve looked at Chapter 22 of the User Manual as I saw mentions of that potentially having the answer, but still am unsure of exactly where to start. I haven’t used LaTeX before, so it could be something super obvious that I’m missing?
Are there any good tutorials online or articles on how to do this cleanly? I’d like to set it up once and then be able to reuse it for every e-book to come
If you want it to be flexible, then I really do think you will benefit from using Pandoc and its custom containers which support custom output to HTML / DOCX / EPUB / LaTeX / Others without any fussing.
With Scrivener, you use custom paragraph styles, and these get converted into fenced divs at compile, then Pandoc converts them into format-specific output. For the output format you need e.g a modified CSS style or in LaTeX a customised template.
My Pandoc templates include support for HTML info/todo/warning boxes, here is the CSS template:
An example below (excuse the typo, I don’t have much time), where scrivener styles automagically become info/warning boxes in HTML and DOCX. This is all automatic from compile, I have not tweaked anything. For LaTeX, it could also be done automatically, but would need a very simple pandoc filter to turn these into environments.
I have posted a couple of explanations for how I go about doing this in the user manual (and of course, the project file itself is a practical demonstration):
How I Make Callout Boxes in the User Manual: these are general notes on how to go about generating LaTeX—if that’s not your target format they may only be interesting in theory. Anything can be put around the styled text, including specific Pandoc markdown, raw HTML, even raw DOCX XML if you have the skills for it (though there are probably easier ways to get into a word processor as styles themselves can transfer, and word processors tend to have box features for styles).
Using Textual Markers: the problem being addressed in this thread was how to get complex formatting (lists in this case) into a box. It was aimed at ePub output, and has a sample project to play with.