3 Creating your first Quarto document
3.1 Setting up your Quarto project
- Create a new directory for your project.
- Launch VSCode
- Open the command palette (Ctrl-shift-P) and begin typing
Quarto: Create Project - Select “Book Project”
- Choose the Project directory you created in step 1.
This creates:
- a simple
_quarto.ymlfile (effectively your premable) - a few chapters (
*.qmd) - a
references.bib(a simple bibtex file)
You may find it useful to create a figures and chapters folder to keep your top level directory tidy.
In this demo we use “Book Project” as the starting point. Alternatively, you may choose a “Default Project” (which has fewer default files) or any of the other templates.
You can visit the repo for this book to see the final structure of the project: Getting Started With Quarto
3.2 Rendering your project
3.2.1 Rendering from VSCode
You can render your project by:
- Open a .qmd file (e.g.
index.qmd) in VSCode. - Open the command palette (Ctrl-shift-P) and begin typing
Quarto: Render Project - Select what to render:
All formats | HTML | PDF
Alternatively, you can launch a live preview which automatically updates as you edit your content. Launch Quarto: Preview or Ctrl-Shift-K
3.2.2 Rendering from the command line
You can either use the Terminal in VSCode (or just have a terminal open) and render the document from a terminal using:
quarto renderAlternatively, you can launch a live preview which automatically updates as you edit your content.
quarto preview3.2.3 Quick preview
For a quick preview of simple markdown code, the Markdown All in One VSCode extension, will show an instant preview of any single markdown document. You can run this Preview from the VSCode command palette of Ctrl-Shift-V
Please note the quick preview is just a simple markdown display preview (it won’t know about references, figures, code) and doesn’t rebuild your whole project, but can be useful for quick previews to check things look roughly right.
Congratulations, you’ve built your first Quarto project! In the following chapters we will learn how to add content.