I have been reading with mounting despair about the inability to stuff simple diagrams such as flowcharts into Scrivener files.
Is this true?
I see that there is this forum section on markdown and latex and so before I go down a long, long rabbit hole can anyone tell me if you can use wither mermaid or latex to draw diagrams in scrivener?
Or perhaps I should say, will it produce the diagram as output.
You may notice that Iβve never used either mermaid or latex in scrivener hence I donβt really know how to ask the right question - forgive me, please.
And if there is a better way of creating a book with diagrams in it, do let me know - Iβm targeting ePub, and pdf as a minimum.
If you are going to be using markdown as an intermediate for compilation (and you really should for anything like this), then the answer is this is no problem. There are many pandoc filters that convert text descriptions of figures into rendered images for you. For example:
Another possibility is the pandoc system https://quarto.org which enables dynamic plotting for both mermaid and graphviz, alongside all the beautiful plots R or Python can generate:
These use intermediate tools to generate images, but LaTeX itself has another set of possible packages like tikz for this. It really depends on what you want to use exactly?
I create the flowcharts and/or other diagrams in another tool, e.g. Omnigraffle, PowerPoint, etc. I canβt think how you would use LaTeX for this, nor do I know Mermaid. Sorry.
I insert these figures into the document as PNG files. I keep the source in subfolders under Research to keep everything together. Then compile into whatever format wanted. Works a champ. Not using Markdown, but do often use the template provided by Scrivener for making LaTeX TEX files.
(Sometimes insert links to these PNG files, but Iβd rather be able to see the figures as I write, so that not often what I do).
This is why there are loads of tools like PlantUML, Mermaid, GraphViz etc. The other big advantage is your figures are stored as text with your document directly. For scientists, the idea of βliterateβ manuscripts is becoming more popular, where you embed the data and code that generates a figure, and this is rendered at compile rather than making figures manually. Changes to data automagically reflect in new figures, without any necessity to manually redo your figures!
These tools can express much more complex charts, with many different shapes. Many of these tools originated from computer scientists, and therefore focus on their domain problems (complex database designs, object oriented hierarchies). The other main patterns are things like gantt charts, you can see examples for e.g. GraphViz here:
Scrivener itself cannot render LaTeX, but you can pass raw LaTeX (or any other markup) through to the post-processing tool of your choice.
So yes, if you want to use LaTeX to generate your charts, Scrivener can accommodate that. (See also the recent thread on LaTeX equations, as the workflow would be similar.)
The general idea is that you keep the descriptor text in-document, and the compiler will auto-generate the graphics files for you. But to visualise them you could indeed have a temporary rendering you keep in the Binder. Marked 2 should be able to run these tools and show the rendering live while you write in Scrivener too.
I get that idea as does, I think, most Scrivener users. Just not how it works. @kewms told you that this works letting LaTeX do the compiling. So do it. Do not see the issue. Good luck.
Wow, I hadnβt expected so much activity in so little time. Thank you all for your contributions -
So the answer is yes, I will probably use graphiz or mermaid since these are more familiar to me.
Since I wish to generate different formats including fluid formats I believe it is better to express the diagrams (which are simple) in text that later goes through a processor, rather than putting an image file into the text which is not only bigger, but is not text, which makes a difference in the output - for instance if you want to highlight some text within a diagram in a pdf youβd have to put it through an OCR if you are using an image, and then resizing and so on becomes an issue. I think.
Thank you all for your rapid and fulsome contributions and pointers to processors.