You can see in my example above that the scrivomatic workflow shows you how to do this using the native referencing. You see the id-label !fig(map)
in the figure caption and the cross-reference #fig(map)
in the text. Download the scrivomatic project and you will see that there are replacements in the compiler to turn this short syntax into the Scrivener native cross references.
In fact there are tons of options for cross-referencing:
- Scrivener’s native system – I tend to use this for most Pandoc work, basic features only.
- Pandoc-crossref – a Pandoc filter: GitHub - lierdakil/pandoc-crossref: Pandoc filter for cross-references – I also have a sample Scrivener project for this, here is example numbering and cross-refs for equations: scrivomatic/Crossref.scriv.zip at master · iandol/scrivomatic · GitHub
– I don’t use pandoc-crossref myself but I do use the custom script I developed for the next solution: - Quarto – Quarto uses a customised pandoc-crossref filter in their setup. My Scrivener + Quarto project uses their system which uses
{#tbl-text}
syntax for the label and@tbl-test
for the cross-reference.
Note that I wrote a Scrivener runner (a post-processing script) that allows you to put crossrefs at the caption start and it will move them to the correct place. - Non-DOCX solution: Typst – this is a great new layout engine but its final destination is PDF. As you may have guessed I also have a Scrivener+Pandoc+Typst workflow that demonstrates how to use Typst’s cross-referencing system.
. The labels sit below the content to be referenced, I could move the using a post-processor like I do for Quarto, but I don’t mind this writing style personally. I include this more as an example to show you how flexible your options are once you embrace the Scrivener hybrid approach…
Note that although there are a bunch of option (choice is mostly good), the writing workflow is pretty similar, it is more the compile options that differs. It would be possible to abstract all the different styles and have a single Scrivener document with styles and the compiler would adapt to each solution.
For your usecase these are the questions I’d ask:
- Can Scrivener’s native solution work for you (i.e. you only have basic requirements).
- If NO then if you want maximum control use Pandoc + pandoc-crossref directly, if you want a lot of hand holding, then use Quarto. Both use a silimar syntax so you can switch between them.