Pluto or notebooks in VSCode using Quarto for interactive lecture notes?

TL;DR: Pluto or notebooks in VSCode using Quarto?

Hello, all

Next year, I’ll be in a position where I’ll be able to use Julia in a classroom. I’m trying to come with a set of interactive class notes that students can use to follow along during class and to study on their own. To make these notes interactive, I’ve been looking into ways to write them in a notebook style so they can run chunks of code along the way.

I have little experience with Jupyter notebooks. Mostly, I have come to them as a user and never used them to create interactive notes. To achieve my goal, I decided to give Quarto in VS Code a try. I have some experience with rmarkdown, but I’ve hit a roadblock.

Before I continue and suffer a bit in Python hell with all the environment problems I know I’ll face, I’d like to know people’s opinions on using notebooks in VSCode through Quarto and Pluto.

I tried my hand at Pluto yesterday. I like the minimalistic approach to its design; I think it’s less distracting. But my experience with Markdown wasn’t the best. I need to write equations and for that I need symbols that I know how to type in Latex, but the immediate commands I know did not work in Pluto. Plus, I am still not sure if I can add footnotes and citations in Pluto. I think the answer is no, since that is not part of what Pluto is for. Correct?

On the other hand, can I get an interactive notebook where students can run the cells on their own using a the .qmd file? I’d imagine that if I convert the .qmd file into a .ipynb, students can run it using VSCode. Right?

All feedback on experiences with both Pluto and (Quarto-powered) notebooks in VSCode are more than welcome.

Thank you.

1 Like

My experience with Quarto has been quite positive. You can treat it as if it were RMarkdown but allowing for Julia or Python or R code execution. To me the fact that the Julia and Python code execution is carried out through Jupyter is incidental in that I regard the .qmd file as the source, not the .ipynb file. If you want to use .ipynb for interactive execution that can be done using quarto convert as you indicate but I prefer to edit the .qmd not the .ipynb because of the problems with out-of-order execution, etc. in Jupyter. Also, to date it doesn’t seem that the YAML markup, and code-chunk options or cross-referencing/bibliography facilities in Quarto show up natively in Jupyter.

I tend to use quarto preview, quarto render and quarto publish much more than I use quarto convert explicitly (it is implicit in all the other commands I mentioned). Much as I love Pluto notebooks, I would go with Quarto for course materials for the cross-references, bibliography, equation markup and figure/table styling.

9 Likes

Thanks for your comment, @dmbates.

Consider using Weave and .jmd files within VSCode. Similar to Quarto, but you can just select code within code fences and hit shift-enter to send it to a Julia repl.

When you want a full document output just run weave on it.

1 Like

The Quarto extension for VS Code provides the capability of executing code blocks in the Julia REPL. In fact it provides handy buttons for “Execute chunk”, “Execute next chunk”, and “Execute Above”, as well as a “Render/Preview” button. Overall I think it is well integrated with the Julia VS Code extension.

7 Likes

Hi, no, footnotes and citations up to now are not available in pluto. However it has MathJax support, so LaTeX is really decent. And it has reactivity, which you may like or not. I find
it well suited for students.

The other point is installation: Pluto notebooks come with their own environment, all packages used “install themselves” automatically with the exact same versions as used (could be faster though sometimes). Students just need to install Julia and Pluto.

I am impressed though with the rendering quality of quarto, so for a more bookish output I would explore it more.

2 Likes

Thanks for your points. Now that you brought up, using Pluto for the first time is definitely less bound to friction. I’ll keep that in mind.

Thanks for the info on the vscode extension for quarto. I think quarto being as well supported as it is pushes it ahead of Weave.jl which is good but somewhat limited in it’s output formats and such. I like that weave doesn’t require python / Jupyter but I think I’m switching to quarto anyway :wink:

2 Likes

The fact that quarto requires Jupyter is indeed the one small thing I also dislike there (due to the dependency on Python), but maybe they find a way for a native Julia support one day. And – maybe the other way around – a Pluto export from quarto would also be very neat.

At the moment, I enjoy and work with both Pluto and Quarto. In general, Pluto works really well for data analysis and dashboard-like notebooks. It is possible to get footnotes and citations with Pluto but if you want more formatting control or cross-referencing capability, you have to implement it yourself in HTML within a notebook or use something like PlutoReports.jl. The main challenges I’ve found with Pluto notebooks is stitching them together to create a compendium. As mentioned in another post, Pluto now manages packages for you, so each notebook environment is stored as annotated comments in the .jl file, and therefore you need to run each notebook in isolation, which is good but also slow. The best solution I’ve found for combining Pluto notebooks is with PlutoStaticHTML.jl, but using this to turn a bunch of Pluto notebooks into a book-style website doesn’t seem so streamlined. This is where I think Quarto has the advantage. If you are trying to create a book or website that feels like a book, Quarto in VSCode will be the better option. Quarto would also be a good option to write a research paper with code, but I think the show your work project is a more elegant approach and supports Julia. You could also checkout the Books.jl package.

3 Likes