Set rules
Set rules can be conceptualized as setting default values for some of the parameters of a function for all future uses of that function.
#set text(
font: "New Computer Modern"
)
= Background
In the case of glaciers, fluid
dynamics principles can be used
to understand how the movement
and behaviour of the ice is
influenced by factors such as
temperature, pressure, and the
presence of other fluids (such as
water).
When writing a rule, you choose the function depending on what type of element you want to style. Here is a list of some functions that are commonly used in set rules:
- text to set font family, size, color, and other properties of text
- page to set the page size, margins, headers, enable columns, and footers
- par to justify paragraphs, set line spacing, and more
- heading to set the appearance of headings and enable numbering
- document to set the metadata contained in the PDF output, such as title and author
#set page(
paper: "a6",
margin: (x: 1.8cm, y: 1.5cm),
)
#set text(
font: "New Computer Modern",
size: 10pt
)
#set par(
justify: true,
leading: 0.52em,
)
Show rules
With show rules, you can deeply customize the look of a type of element. The most basic form of show rule is a show-set rule. Such a rule is written as the show keyword followed by a selector, a colon and then a set rule. The most basic form of selector is an element function. This lets the set rule only apply to the selected element. In the example below, headings become dark blue while all other text stays black.
#show heading: set text(navy)
= This is navy-blue
But this stays black.
You can also select arbitrary text. You could even use this to render --- as
an em-dash for example.
#show "ArtosFlow": name => box[
#box(image(
"logo.svg",
height: 0.7em,
))
#name
]
This report is embedded in the
ArtosFlow project. ArtosFlow is a
project of the Artos Institute.