Hello, world!
Thinking Machines
python or nvim or even cat.pip againpipimport!vim or python or lshello.qmd.qmd file to a webpage, a .html file.hello) but a different extension (.html rather than .qmd).quarto renderHello, world!
hello.qmd
For a demonstration of a line plot on a polar axis, see @fig-polar.
```{python}
#| label: fig-polar
#| fig-cap: "A line plot on a polar axis"
import numpy as np
import matplotlib.pyplot as plt
r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r
fig, ax = plt.subplots(
subplot_kw = {'projection': 'polar'}
)
ax.plot(theta, r);
ax.set_rticks([0.5, 1, 1.5, 2]);
ax.grid(True);
plt.show()
```basics.qmd extension, then:For a demonstration of a line plot on a polar axis, see Figure 1.

Figure 1: A line plot on a polar axis
sympy equations look great!
'| | 0 | 1 | 2 |\n|---:|:----|:----|:------|\n| 0 | One | Two | Three |\n| 1 | 1 | 2 | 3 |'
.qmd file, you may add a “header” of sorts..yaml.yaml file, we just enclose the .yaml code in a preceding and terminating line of a 3 dashes ---A YAML mapping uses the syntax name: value.
When the value of a key is another mapping, indentation is used to keep track of scope. For example, here the value of the author key is another mapping, setting name to the value Buchi Emecheta:
name key nested under author is indented two spaces, whereas the name key nested under affiliation, which itself is nested under author, is indented four spaces:A YAML sequence is a way to provide a key a set of ordered values. There are two syntaxes to specify a YAML sequence. When the values in the sequence are simple, separate them with commas inside square brackets:
The alternate syntax puts each value on its own line, and adds a dash prefix followed by a space:
This alternate syntax can also handle situations where the values are further mappings. For example, here the value of author is a sequence of length two, where each element is a mapping of name and affiliation:
Strings don’t require quotes, but you may need them if your string contains characters that have special meaning in YAML (e.g. #, :, etc.), or is something that would otherwise be interpreted as a number or boolean:
defaultYou’ll come across examples where the value of a Quarto option is default, like when you are specifying multiple formats:
When you make a mistake in setting an option there are a few possible outcomes:
You get an error message, and the error message clearly points out your mistake.
You get an error message, but it’s not clear from that message what or where your mistake is.
You don’t get an error message at all.
Some examples in this chapter will result in an error from quarto render—we’ve highlighted these examples with a red border (TODO: add an icon for PDF version), like this:
We’ve split the examples by the kind of mistake you make:
Forget the space after a colon when setting an option like code-fold?
Validation error:
Validation of YAML front matter failed.
(line 5, columns 5--18) Field "html" has value code-fold:true, which must instead be an object
✖ The value code-fold:true is a string.
ℹ The error happened in location format:html.
ℹ In YAML, key-value pairs in objects must be separated by a space.
ℹ Did you mean code-fold: true instead?Pluralize the lightbox option loop?
YAML validation errors and reports the problem:
Use an underscore instead of a hyphen in code-fold?
Even though code_fold isn’t a recognized option for html, you’ll get no error. But, you also won’t get any code folding.
Get code-fold right, but forget to nest html under format?
As a top-level option (e.g. not a format) html isn’t something Quarto knows about, but it passes validation. The result is no error, and no folded code.
Trying to add a table of contents like this?
Quarto returns the error:
ERROR: Validation of YAML front matter failed.
ERROR: (line 3, columns 6--8) Field "toc" has value yes, which must instead be `true` or `false`
✖ The value yes is a string.
ℹ The error happened in location toc.
ℹ Quarto uses YAML 1.2, which interprets booleans strictly.
ℹ Try using true instead.
ERROR: Render failed due to invalid YAMLquarto render makes many files all that support one webpage.embed-resources: true under html:quarto render your midterm..yaml block to the top with your title, name, possible a theme and almost certainly embed-resources: true.qmd that created this page.