# Thoughts for academic Markdown in a future version of Scrivener

**URL:** <https://forum.literatureandlatte.com/t/thoughts-for-academic-markdown-in-a-future-version-of-scrivener/142436>\
**Category:** Markdown & LaTeX\
**Tags:** compile, text-editing, markup\
**Created:** [August 26, 2024, 3:09pm UTC](https://forum.literatureandlatte.com/t/thoughts-for-academic-markdown-in-a-future-version-of-scrivener/142436 "2024-08-26T15:09:48Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![nontroppo](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/nontroppo/32/15746_2.png) [@nontroppo](https://forum.literatureandlatte.com/u/nontroppo)\
**Post date:** [August 27, 2024, 9:21am UTC](https://forum.literatureandlatte.com/t/thoughts-for-academic-markdown-in-a-future-version-of-scrivener/142436/11 "2024-08-27T09:21:01Z")

</div>

> [@cavalierex](#):
>
> But why oh why does this need to be so hacky? Quarto really should allow specification of absolute paths for some things (through the YAML file). Maybe they’ll add it one day.

I asked one of the Quarto dev’s a couple of years ago and they were very clear that this was by design. They are inspired by virtual environments / project folder type workflows. I understand the logic, you can `git` a single folder and have all the required files as a repository in one place, versioned. This is very developer-focussed, coming from data scientists where R and Quarto were born. Pandoc is less opinionated, where there is a Pandoc data folder yet you can reference files there or anywhere else. Symlinks should hopefully paper over the differences but it is a bit of extra setup, and the other problem is Scrivener does not “respect” the project folder without some workarounds and tricks (the `-mmd` suffix trick; and I don’t know how this will change in future versions, it could break). My wish for this:

1. Overwriting or not the target folder as a compile setting.
2. Add “compile” file exports. This would more easily manage accessory files like CSL styles etc. that could be stored in the Binder and exported explicitly at compile time. We can do this manually with a post-processor script but a bit of structuring would be great.

> [@I want to write in Markdown, Is it possible?](https://forum.literatureandlatte.com/t/i-want-to-write-in-markdown-is-it-possible/137631/18):
>
> I will definitely have to revisit your ScrivQ template again sometime. I checked it out when you first published it, but it’s been awhile now.

I should have been clearer, ScrivQ is from @bernardo_vasconcelos — my sample project is without any cool name. Have a look at both as they do demonstrate a working Scrivener project design for Quarto…

> [@I want to write in Markdown, Is it possible?](https://forum.literatureandlatte.com/t/i-want-to-write-in-markdown-is-it-possible/137631/19):
>
> Frustration at getting the YAML settings to compile correctly (I was not using your template, but rather had a Scrivener page in the frontmatter section where I wrote the YAML); and

Right, YAML is a bit fussy in that it uses significant whitespace (as spaces), the keys need to be lowercase, and quotes must be straightened. I turn off a lot of the smart corrections and visualise whitespace:

 ![image](https://forum.literatureandlatte.com/uploads/default/original/3X/1/6/16527e3220d5de26c9519b1c4755a761ba07c6c9.jpeg)

but you could also just copy-paste to an editor.

> [@I want to write in Markdown, Is it possible?](https://forum.literatureandlatte.com/t/i-want-to-write-in-markdown-is-it-possible/137631/19):
>
> Being able to run the post-processor within a virtual environment. The Scrivener Bash script option is not a full terminal, and it wasn’t able to load a virtual environment. I needed the `conda` virtual environment so that I could execute the R and Python code in the manuscript.

That is exactly what my `scrivomatic`, `quarto-run.rb` and `typst-run.rb` scripts do ([GitHub - iandol/scrivomatic: A writing workflow using Scrivener's style system + Pandoc for output…](https://github.com/iandol/scrivomatic)), they setup the path and env variables as needed. I use Ruby for this but really any language can do this. The post-processor adds paths and enables other tools as needed.

> [@I want to write in Markdown, Is it possible?](https://forum.literatureandlatte.com/t/i-want-to-write-in-markdown-is-it-possible/137631/19):
>
> Maybe my mistake is trying to go the whole way from start-to-finish in Scrivener

Well, several of us do start-to-finish without issues, given the caveat that you use a post-processing script. You don’t need to as you said, you can run an automation[1] to do this outside of Scrivener (e.g. a file watcher daemon can check if a file changes then run a workflow involving the final parts.

Here though is my bigger problem, my major issue with using Quarto + Scrivener: cross-reference are often incompatible with Scrivener styles.

> [@Scrivener + Quarto: a technical/academic publishing workflow](https://forum.literatureandlatte.com/t/scrivener-quarto-a-technical-academic-publishing-workflow/129769/3):
>
> @Edmund — Pandoc doesn’t [yet] support figure/table/equation/theorem cross-references natively. Nevertheless Quarto utilises [Pandoc’s existing image attributes extension](https://pandoc.org/MANUAL.html#extension-link_attributes) and uses the #id tag (see HTML for the origin) to support cross referencing. There are two methods of linking / [figure blocks](https://pandoc.org/MANUAL.html#extension-implicit_figures) in markdown; [inline](https://pandoc.org/MANUAL.html#inline-links) links: ![Caption](foo.jpg){#id .class width=30 height=20px} And [reference links](https://pandoc.org/MANUAL.html#reference-links), which is the format Scrivener’s compiler generates: ![Caption][ref] … [ref]: foo.jpg {#id .class wid…

So this is one of the main things my `quarto-run.rb` script handles, allows me to put cross-ref labels where I want them in the Scrivener editor, then moves them after Scrivener has compiled to MD to where Quarto expects them. I would love if Scrivener 4 gave us a couple more options how to deal with this, this is the biggest pain point IMO…

* * *

[1] The reason I love [pandocomatic](https://github.com/htdebeer/pandocomatic) is because it supports pre and post scripts all in the same YAML that specifies the document, a single recipe (the one true ring 😆) for automatic output that could then SFTP the docs, restructure folders and just about anything else. But there are many ways to skin this automation…

---

_[View the full topic](https://forum.literatureandlatte.com/t/thoughts-for-academic-markdown-in-a-future-version-of-scrivener/142436)._
