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
---
Set up the âexecute codeâ plugin so I can run r/python/etc interactively in Obsidian
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.
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:
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)
make Obsidian highlight r code even if I start a code block with ```{r} instead of ```r
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?
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:
This also contains a CSS snippet that makes the Obsidian callouts look the same as the Quarto callouts.
It also contains a lua filter that can remove the non-supported wikilink formatting.
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.
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
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.
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.
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.
I had a similar issue trying to render images in a manuscript that lives in a sub-folder of the parent-project. Below fixed the issue for me.
Create _quarto.yml root of project. It does not need to contain any metadata. (I only use this to experiment with parent-project-level-profiles and links to the project repository on GitHub.
:::{#fig-transition-flower-circular-agriculture}

This text is a caption for the figure
:::
Thank you for replying and pointers to Foam and Typst.
When writing, I found working with Quarto files in Obsidian easier than VS Code with Foam.
VS Code with ojs code blocks has been great for pulling in data to generate and preview tables. Compiling and previewing work (e.g. graphs > section > manuscript) with VS Code was also incredibly simple, but it did take me a lot of time to understand and fix all inclusion and yaml errors.
How has you experience with Typst been? Iâve not tried it yet. Learning to work with GitHub, Git, SSH, GPG, VS Code, Quarto, ojs, and mermaid was distracting and challenging enough for now :')
Yeah, thatâs the good thing, you can work with the same files across different programs and utilize their strengths.
Very good, mostly. Compilation is very fast, it is powerful but yet easy to learn. Iâm implementing it as the pdf-engine I use in Pandoc and Quarto. Provides nice support for callouts using the âgentle-cuesâ package and this filter. I had some challenges with getting the citations to work correctly, though. Still working that out.
Good to hear that itâs fast and great that callouts work in pdf too. Iâll focus Typst instead of LaTex and see if I can get the citations working correctly. Is one citation style not working, or are all styles rendered incorrectly?
For those who have problem with images in subfolders (useful when I want to be able to compile single chapter in subfolder and the my whole thesis at the same time) and compile to latex/pdf only (my workaround doesnt work for docx or html): add the alternative graphic paths in _quarto.yml , in my case it was \graphicspath{{figures}{chapters/figures}{../figures}{chapters}{..}}, also I use H option to force figures to stay in given places
pdf:
link-citations: false
number-sections: true
reference-section-title: "References"
pdf-engine: xelatex
fontsize: 12pt
include-in-header:
text: |
%% \usepackage{makeidx}
%% \makeindex
\usepackage{microtype}
\usepackage{epigraph}
\usepackage{indentfirst}
\setlength{\parindent}{2em}
%%\usepackage[british]{babel}
%%
%% Code related to fonts and how the output looks
%%
\usepackage{mathpazo}
\usepackage[T1]{fontenc}
\usepackage[sups,osf]{fbb} % osf (or tosf) for text, not math
\usepackage[scaled=.95]{cabin} % sans serif
\usepackage[varqu,varl]{inconsolata} % sans serif typewriter
%%
%% Code related to figures in document
%%
\usepackage{float}
\graphicspath{{figures}{chapters/figures}{../figures}{chapters}{..}}
\let\origfigure\figure
\let\endorigfigure\endfigure
\renewenvironment{figure}[1][2] {
\expandafter\origfigure\expandafter[H]
} {
\endorigfigure
}
I tried to get this workflow working this morning, and ended up building a little extension that others might find useful. Still waiting to be approved for the official list, but should be able to install it manually - if anybody tests it, let me know if it works!