Obsidian & Quarto setup, current status and questions

Hi,

I am a new user and I have been trying to integrate Obsidian with quarto.

quarto is a datascience extension of markdown that renders documents with code into many many publishable formats

Here is a 20 sec youtube video of my current setup:

Quarto in Obsidian

These are the steps I took:

  1. set up a template with the templater plugin so all files I make in the root of the Obsidian fault have a YAML file header that quarto expects. this is the YAMl I use:
---
title: "Untitled"
format: pdf
---
  1. Set up the “execute code” plugin so I can run r/python/etc interactively in Obsidian
  2. Set up the “shell commands” plugin to run the following command:
cp {{file_path:absolute}}  tmp/{{file_name}}.rmd  
quarto render tmp/{{file_name}}.rmd --to pdf --output-dir 
../quarto/ 
rm tmp/{{file_name}}.rmd 

in a tmp folder the file is rendered, then te output is stored in the quarto folder and the files I made in the process of rendering are deleted.

  1. set up the commander plugin so I have a neat blue (quarto’s color) button that runs the script to render the file I am looking at right now into pdf.

Things I still have to fing a solution for:

  1. write a script that changes Obsidian style markdown into quarto style markdown to handle internal links and possibly .bib references, and call-outs (which are coded differently)

  2. make Obsidian highlight r code even if I start a code block with ```{r} instead of ```r

  3. make separate shell scripts to render to other output formats (beamer presentations etc)

any tips on plugins that would help me solve some of these?

4 Likes

Nice workaround to render from .md with code included!

Seems like you’ve already got most of the pieces of this workflow in place. Regarding presentations, here are some details about how I work with Reveal.js presentations in Obsidian using Quarto. It’s quite similar to what you are doing.

Are you’re familiar with @echej’s work (qmd-as-md plugin maintainer)?

He has shared a lot of relevant stuff, like a lua filter that can convert Obsidian callouts into Quarto callouts:

If you just want to convert the wikilinks into markdown links, there’s several plugins that support that, like Links. You could use this in conjunction with Commander for a seamless workflow.

As for citations, these are natively supported through pandoc citekeys, so you shouldn’t need to create a script for this - unless I am misunderstanding what you meant by .bib references.

Regarding the “execute code” plugin, isn’t that a bit redundant when using Quarto, since big selling point of Quarto is exactly it’s ability to execute code when you render or preview documents? Perhaps you can clarify your workflow a bit in this regard.

2 Likes

I did try the qmd as md plugin, but the qmd files still weren’t fully featured (i.e internal links and tags not registering I think?). Since this is stille a Obsidian centric workflow I’d prefer to work in Obsidian primarily, only opting into quarto when I need/decide to generate output. Ill see if I can include the lua filter in my workflow and set up a second button to co-op your render too reveal workflow.

WRT citations, I am currently using the “citations” plugin, which means if I cite a paper using their [] citation format its a link tot he note page for that citation, while if I render I obviously want to render the pandoc citekey citation and generate a ref list. I guess I could add this to the lua filter and just build the filter out to accommodate?

WRT the execute code plugin, I was thinking of going even further. I am thinking of forking it and adding an “environment” pane, which would track and display all user generated variables and objects that are generated in chunks that are evaluated. During the writing/coding process I like to be able to run chucks to evaluate their correct and iteratively debug, way faster then rendering out to debug.

I think my dream is to have Obsidian basically contain a kind of “RStudio light” so I can freely do statistical thinking/note taking. I would only step out of Obsidian and into RStudio or VScode when I decide an idea becomes a scientific paper, that needs full on IDE/version control/high level data security

2 Likes

Looking at your reveal.js solution I am really digging the use of “quarto preview” and a fixed port, that could be a great alternative tot he code executer route I am now following!

I guess both would also be an option, but it wouldn’t be easy in my workflow where I am working in a .md, which kind of prevents processing with quarto preview… gotta figure out whether I can somehow create a tmp .qmd to mirror a specific .md and trigger the mirroring and preview with a commander button.

Gotta say I am i awe of the flexibility build into Obsidian, wish there was an easy way to bundle all my tweaks and selected/required extension into a single setup so I could share the final setup easily.

1 Like

Hi @Feralflora, @Michelnivard,

Could you please share an update about your approach to developing, updating, and sharing your (academic) work Obsidian and Quarto?

Obsidian has been great for me, but sharing progress updates and outputs my research project is difficult at the moment.

I’m now figuring out how to use the Git-plugin to generate automatic progress updates for ‘project-components’ (i.e. proposal, DMP, chapters, etc.) like release notes in software development. And Quarto seems perfect for sharing outputs and updates in a unified format.

1 Like

Hi @Opi,

I haven’t really made any changes to my Quarto workflow since I posted here. I’m probably going to try out @Michelnivard’s solution for executing code from regular markdown files by making a temporary intermediary .qmd file.

I agree that Quarto is perfect for sharing research in a reproducible manner. In addition, I’m looking into using Typst as the typesetting engine in Quarto, which also has a number of templates available.

Some find the limitations of working with Quarto in Obsidian to be too limiting, and rather opt for working with Quarto files in VS Code, coupled with the Foam PKM system / extension for VS Code instead. You could check that out too.