Scrivener + Quarto: a technical/academic publishing workflow

I tried to post a new reply but it ended up here?

Could you share those ā€” Iā€™m just wanting comparability of output and results between the various attempts? (Or I can just construct suitable dummy entries. Plus hoffman2014, siegel2015, simmons2013?)

Thatā€™s helpful info re the crossrefs.

Not to worry, Iā€™m sure theyā€™ll release 1.3 soon. I can just wait for that. Iā€™ve added an issue for quarto-run Lua filters calling the system pandoc version.

1 Like

I was just providing a small variation of Ianā€™s original project to allow the inclusion of multiple bibliographies. The original project is listed in the initial post, here it is: GitHub - iandol/scrivomatic: A writing workflow using Scrivener's style system + Pandoc for outputā€¦

This time I started from Ianā€™s original template again and tried to diverge as little as possible from the original. Itā€™s the same template with a couple of new section types, styles, and minor changes to the ruby script.

@lyndondrake, hopefully, this time it will work better. :wink:
Many thanks again @nontroppo for sharing his Scrivener, Scrivomatic, and Quarto tools.

3 Likes

This is a really nice update, thanks for sharing this!!!

1 Like

Many thanks, Iā€™ll give that a go and switch to the new thread

1 Like

Something that I would like to ask, maybe to @nontroppo , is if I installed Quarto correctly. When invoked from the Mac Terminal it seems to work, so it should.

However: I let the .pkg install it. It installed a ā€œquartoā€ folder inside my main Applications folder. Inside it, two other folders, named ā€œbinā€ and ā€œshareā€. I guess I should simply leave them there, and not move, for example, the ā€œquartoā€ app into the /bin/ folder of my system.

Thank you for helping me dissolve some fog!

Paolo

Hi, Paolo (@ptram), if I may chime in, I could not quite get what you are saying: is it working or not? Does it work on the terminal with a dummy file? If so, does it also work from Scrivener? If not, what do you see in the Quarto.log?

The Quarto folders seem rightā€”no need to move them around.

Yes, Quarto is working fine. Typing the name in the Terminal recalls it. So, I assume the installation is fine as it is.

Paolo

Ouch, I had missed this part. So, the answer to the question Iā€™m wandering around is ā€“ no, you canā€™t directly use an .md file compiled by Scrivener to create a web site or book with Quarto.

Iā€™m trying with chunkedhtml in Pandoc, but I have yet to understand how to use the produced .html files with Quarto.

Paolo

I am working on a template to do just that. I will share it shortly.

Edit: also, see this: Scrivener + Quarto + Cite Tools: advanced bibliography for a technical/academic publishing workflow - #9 by bernardo_vasconcelos

Yes, while quarto installs into /Applications, it also adds a softlink to /usr/local/bin:

 ā–¶ļøŽ ls -al /usr/local/bin/q*
lrwxr-xr-x root wheel 31 B Fri May 19 08:36:27 2023  /usr/local/bin/quarto@ ā‡’ /Applications/quarto/bin/quarto

So no need to move it around, the terminal path will find it.

As Bernardo mentions he has some code to do this already. But I would just add that the output from the standard quarto templates may be perfectly sufficient for a book or website page, as it still includes a lot of functionality and navigation. There is overlap between using headings in a single document as chapters, or multiple documents as chapters in terms of structureā€¦

1 Like

In printed terms, the material I have to convert to a web site is a little less than 2,000 pages. Unless I can break it into an articulate web site made of several sections and pages, I doubt that it would be usable.

But, in more general terms, I wonder what the use of a single-page web site could be. In particular, if the source of the ā€œnarrativeā€ text is Scrivener, a tool dedicated to long writing.

Iā€™m for sure missing the point, but I really canā€™t see the use of Scrivener with Quarto as it is. Iā€™m sure it will develop further, but Iā€™m a bit lost at this point.

Paolo

The script is very interesting, and thank you very much for developing it!

But I have to say that it would be great if this feature was added natively to Quarto. It would make the procedure a lot smoother. Iā€™ll try to see if this has already been suggested in the dedicated forum.

Paolo

1 Like

As of now, the only workaround I see is to compile individual sections from Scrivener, and then let Quarto assemble a website or book from them.

With a big project, this would be a big task the first time. I guess it would be much easier with subsequent updates, when one has only to compile the modified/updated sections from Scrivener. The newly compiled .md files would replace the older ones, and put together with the ones that have not changed.

It would obviously be great if Scrivener could compile to separate .md files, split at a certain hierarchy level. Or if Quarto could understand pagebreak commands as instructions to split the source document into separate .html pages. Iā€™m even surprised it doesnā€™t to it already.

Paolo

1 Like

I suppose because the tools for navigating are similar. Here is a standard Scrivener>Quarto document:

The TOC floats to the left, and both top-level chapters and sub-chapters are all available to navigate through. A browser can easily handle cross-linking within a long document. You can link from any chapter to any other. Why must a long document be physically split into different files? You may say sharing chapter links are easier? But Quarto allows easy copying of any chapter links:

Screenshot 2023-06-06 at 20.32.56

Splitting to different files adds complexity, for example search which is trivial within-document becomes more technically complex across documents (however Quarto handles this too!) Quarto does do some nice things for their multi-file outputs, like put document TOC on the left and within-doc TOC on the right, which someone may prefer (I donā€™t, as a reader I care about content, not navigating file structures!)

So the reason I think Quarto doesnā€™t do this is more to do with the fact that this is more a workstyle preference of the author (if you are writing markdown in a plain text editor maybe you prefer a folder of files, not an issue with Scrivener), than it is a limitation of the output for the reader.

Still, the more options the better and as Pandoc does now support chunked HTML the job for Quarto or an extension developer should be much easier. You should open an issue on the Quarto github and see where it goes! :+1: Bernardo already has core code to do this for Scrivener so this will be a second route for those who prefer juggling multiple file projects.

1 Like

@nontroppo or any one that can help, my apologies, Iā€™m new to this, I have downloaded the Quarto.scriv folder/project and I have installed quarto (Iā€™m in a win 11 x64, Scrivener: 3.1.5.1, quarto quarto-1.3.433-win) what would be the next steps to compile such a nice looking pdf as the sample output ? Thank you in advance

Congratulations on completion of the PhD - a fantastic achievement

Hi @eriikals ā€” my usual tests are to download the latest project template linked in the first post (currently V1.04), import that template into the New Project dialog, create a new project from the template and just compile. BUT that is on macOS. The script that performs the modifications that enable Scrivener output to successfully compile with Quarto require a Ruby interpreter, which you will need to install on Windows (it is built-in on macOS). The paths it sets up are also for macOS, and that may need to change for Windows machines. The ideal would be to write a cross-platform script, but I donā€™t have time and donā€™t have Windows available to test even if I didā€¦ I can answer questions for Windows users who try to get it to work and the errors are obvious.

Parts of that document also runs R code for dynamic figure and table. generation. Instructions are part of a Note in the project:

NOTE: ā€¦ In addition, for the sample content, if you donā€™t have R installed, you must remove the [Stimulus Plotting] section from the compile list as they use R. R can easily be installed via homebrew:

brew install homebrew/cask/r
brew install xquartz

Then run R from the terminal and install the tidyverse and kableExtra packages, this should cover the dependencies:

install.packages("tidyverse")
install.packages("kableExtra")

Finally, you must edit the Metadata paths and fonts to those available on your system for the compile to succeed. The script replaces ${USERHOME} with your home folder path, but it is up to you to set up the rest of the path. I use my pandoc folder to store my bibliography, cal and templates files, so for example my CSL file is stored at ${USERHOME}/.local/share/pandoc/csl/apa.csl

For the bibliography you need to replace the in-text citations like [@siegel2015] with your own, or export my Core.json to a location specified by the Metadata bibliography key. The CSL file is also available and you can export it from apa.csl and point to it using the csl metadata key.

If you want to use the same fonts I specify, you can install them from homebrew in the terminal (https://brew.sh):

brew tap homebrew/cask-fonts
brew install font-alegreya font-alegreya-sans

Overall ruby is essential, R is optional if you remove some sections, and you will need to edit the metadata to select files on your system and change fonts or install the ones I use. With the bits in place and hopefully no errors from Windows for the script you should just be able to compile, the script automates the modification and runs Quarto for youā€¦ Each piece can be run outside Scrivener for testing (you can scrivener-compile without running the script; then run the script manually)ā€¦

I really appreciate the information @nontroppo , just one more question, which files/paths (where are they) that need to be modified ?
I can install ruby, and R, and I can find and modify the files you mention, but my question would be how do I link that compile dialog actions to what is needed, or where should I make such modifications: ${USERHOME}, point to the ruby or R binaries ?

Thank you !