ScrivQ | A template to control Quarto, export multiple files, manage bibliography and easily create cross-references

Thank you Bernardo and Ian, for all your efforts to make Scrivener a great front-end for a solid editorial system!

The new version of ScrivQ is something that even we humanists can handle without too much fear. Can’t wait to put it to test with a real project!

Paolo

2 Likes

Thank you so much for this. It looks amazing. I look forward to exploring it after I finish the book I’m writing with Scrivener+Pandoc+Pandoc-crossref. I think I already said in a previous post that while I really like my current setup, I worry that pandoc-crossref’s compatibility with Pandoc depends on one (amazing!) guy. The fact that Quarto is being maintained by a team makes me really glad to have it as an alternative. And now that you’ve done the work to show how to use Scrivener as a front-end, well, that enables me to rest easy!

One thing I like about my setup is that the pandoc-crossref citation keys look like this ([@eq:EMC2]), where the name of the respective equation file in the binder is “eq:EMC2”. I like that because then I usually know which equation is being referenced. But when all the crossref keys are “scrivlink”, I might often need to click through to see which equation I had referenced.

I achieve my system by having all new equation documents named “eq:equation”, and then I change the ‘equation’ part to a unique identifier. Then I have a macro on my machine that changes “@eq” to “([@])”. Then I drag the equation document from the binder to the right of the “@” symbol. So I end up with "([@eq:EMC2]), and then pandoc-crossref does the rest upon compile. (This doesn’t work for chapters/sections tho, because those are handled in much the way you handle them in ScrivQ. For chapter/section cross-refs, I have a macro that changes “@se” to “[@sec:<$linkID>]”, and then I highlight “<$linkID>” and drag the respective section folder onto the highlighted part.)

Not sure if you could implement something like I have for equations in ScrivQ. Anyways, thanks again!

1 Like

Thanks, @ptram and @jpkell for the feedback!

@ptram, let us know how it goes.

@jpkell, you just reminded me that I forgot to place a note on the opaqueness, a downside, of using a single standard identifier; and presenting this, admittedly questionable, alternative to avoid it. That is, by creating a replacement rule in the Compile configurations that allows us to write, for example, scrivlink:that-table-about-that-thing and erase the :that-table-about-that-thing part and let nature run its course in ScrivQ.

About the longevity of the cross-reference system within Pandoc: I wouldn’t worry about it. Pandoc has been around for a while and Quarto is being supported by the folks from R Studio, which also is also nothing new.

1 Like

About the longevity of the cross-reference system within Pandoc: I wouldn’t worry about it. Pandoc has been around for a while and Quarto is being supported by the folks from R Studio, which also is also nothing new.

Thanks. What I meant was that I worry about pandoc-crossref failing to work at some point, given that it is created and maintained by just one person.

@bernardo_vasconcelos PS. I too am a philosopher. I don’t work in ancient, but I did study with Terry Irwin in grad school.

1 Like

@jpkell, in what area do you work?
I often check Irwin’s renderings of Aristotle’s Greek as they usually are very enlightening.
On cross-ref, what I mean is that there is clearly a group of people taking care of this now thanks to Quarto.

@ptram, that is music to my ears! Thanks.

@cavalierex, on your earlier point about Kaobook, yes, I have used and enjoyed it. However, I found that I could get a better result (with way fewer bugs to iron out) by simply using Quarto’s standard template. But it is beautiful nevertheless.

Be it as it may, it would be very easy to include these integrations into ScrivQ. In fact, I prepared a version in which all of Pandoc template and template-partials are in the project and being exported along with the other files during Compile. This means that you can edit any/all of the Pandoc templates that will be used in the TeX → PDF conversion from within Scrivener. Adding the Kaobook configurations, for example, would be very easy.

@lyndondrake, could you refresh my memory on our earlier discussion on CSL files? Was there something you were trying to achieve with it, but could not? CSL files are not easy to edit at all in the beginning, but once understand how it works, they are manageable.

@bernardo_vasconcelos I work in bioethics and phil of econ (with a focus on climate change).

On cross-ref: Ok yes, that’s exactly why I’m very glad to hear about Quarto and to know you’ve made it work with Scrivener. I’ll use my setup until I can’t, and then I can change to ScrivQ. THANKS!

1 Like

Question: How does one set docx as the output?

There you go.

There seems to be a small issue with some of the callouts in DOCX output, but, other than this, it works perfectly in PDF, HTML and DOCX.

1 Like

Thanks much. But how does one toggle between different outputs? There are so many metadata options. And I supposed to untick all of the ones associated with PDF and HTML, for example?

You could simply move PDF and HTML from the formats folder back to the Templates folder :wink:

Alternatively, you could duplicate the ScrivQ PDF compile format and change this:

1 Like

Thanks! The duplicate format option is perfect. That’s how my I have a my ScrivPandoc setup set up :grin:

1 Like

Bernardo, does the ScrivTrio template includes the editable templates included wit the previous version of ScrivQ?

Paolo

Paolo @ptram, if you download the latest one, it does include them.

1 Like

As usual, I’m a bit slow with these things. But how do you ask ScrivQ to split the project at a particular hierarchy level, to let Quarto create multiple pages?

EDIT: Probably found. It’s not the hierarchy level, but a deliberate choice through the Section + Break Before section format.

Paolo

Please allow me another question: does ScrivQ expect the original Scrivener documents to be written in markdown, or one can use rich text instead.

For example, rich text paragraphs separated by a carriage return, with no added blank line, are rendered as if there was no paragraph end.

This, unless I check the “Convert rich text to markdown” option in the Compile dialog. Should this be checked, if the original Scrivener docs are in rich text?

Paolo

I admit I’m totally lost. I think that ScrivQ is totally ignored, and Scrivener just compiles to a single HTML file or generates a PDF file with its internal features.

I’ve tried by checking some of the options in the ScrivQ front matter (for example, changing pagesize in the PDF group), but nothing changes.

I’ve also tried by assigning different section types (Section - break before) to the section where I wanted a new page, but nothing changed. Still, I got a unique HTML page.

Is there something else to do, after having created a new project from the ScrivQ template, and having populated the Manuscript section of some documents?

Paolo

Scrivener hanged when trying to compile, and now it always hangs when trying to compile even the simplest document.

If I restart the Mac, the default compile formats work fine on other documents, but the one that I created based on the ScrivQ template continues to hang even with the default formats.

I assigned the default Section format to all the documents in the project. No item in the Files folder is checked for inclusion in compile.

Maybe there is some dirty cache? Where could I see to find it?

EDIT: I’ve created a new project, starting from the Generic non-fiction template. I imported the styles from the ScrivQ-based project, and then dragged the manuscript into the new project.

The compile commands are working fine. So, I guess there is something I scrambled in the ScrivQ template in my project. But everything is unchecked, so I can’t guess what it is. Maybe there is a way to reset a template?

EDIT 2: I’ve created a new, empty project from the ScrivQ template, and after having imported the styles I’ve dragged there the old manuscript. This should serve as a template reset. Alas, still any attempt of compiling hangs Scrivener.

EDIT 3: After letting compiling rung for some long minutes, this time it could end. Subsequent attempts to compile to web were very fast, but resulted in the following error:

--> Running Command: quarto render "/Users/paolot/Documents/Programmazione/Markdown/out files/Pa5X v1.2.0 User Manual English in Markdown.qmd"
e[91mERROR: YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key (_extensions/bcdavasconcelos/citetools/_extension.yml, 20:7)
20: e[34mformat:e[91m
         ~~e[39m
waiting for the process to end

No file was created, apart for the intermediate .qmd and .yml files, plus an _extensions folder. Trying to render them with Visual Studio Code reported the same error.

Paolo

Hi Paolo,

  • you’ll see that the project uses Styles everywhere, so it does use rich text;
  • links have to be written in markdown style for them to appear in the compiled document [text](link);
  • DO NOT check the Convert rich text to markdown option as this would cause many errors.
  • Documents of the Section Type Standalone File will become a new file.

Page breaks are for PDF and DOCX outputs. This has nothing to do with ScrivQ. If you create a Quarto document and render it to HTML, you’ll see that page breaks have no effect.

Are you picking the desired format in the Compile panel?

  • Bear in mind that, you MUST compile to Multimarkdown, but the output will be of the chosen kind (PDF, DOCX, HTML, or all of them).
  • The dry-run option will only create the files, but will not run Quarto.

Which ScrivQ are you using? Have you tried the latest one from Github?

Hi Bernardo, thank you for your answer.

The ScrivQ template I’m using is dated 29th or August, so it should be the latest one (the ‘Trio’ version).

When compiling, I choose Markdown > ScrivQ HTML or PDF.

I’ve now tried with the Standalone File section type where I want a document to be a separate HTML file, but it seems I still get a single HTML file. But since I see there are other documents missing, maybe I must experiment a bit more to understand how it works.

I deactivated the Convert rich text to markdown option, but then there is no longer paragraph break. I didn’t end paragraphs with a double carriage return, but went on writing as in an ordinary word processor, with a single carriage return at the end of the paragraph. Is this the wrong way?

Going to bed. I’ll continue trying tomorrow.

Paolo