From ec487298f7bbb3c606779482b851ad1d00abf337 Mon Sep 17 00:00:00 2001 From: Andrew Voynov Date: Mon, 3 Mar 2025 00:30:24 +0300 Subject: [PATCH] Fix set rule example --- docs/tutorial/2-formatting.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/tutorial/2-formatting.md b/docs/tutorial/2-formatting.md index fabb544f4..4bea444db 100644 --- a/docs/tutorial/2-formatting.md +++ b/docs/tutorial/2-formatting.md @@ -11,14 +11,14 @@ your report using Typst's styling system. ## Set rules As we have seen in the previous chapter, Typst has functions that _insert_ -content (e.g. the [`image`] function) and others that _manipulate_ content that -they received as arguments (e.g. the [`align`] function). The first impulse you +content (e.g., the [`image`] function) and others that _manipulate_ content that +they received as arguments (e.g., the [`align`] function). The first impulse you might have when you want, for example, to justify the report, could be to look for a function that does that and wrap the complete document in it. ```example += Background #par(justify: true)[ - = Background In the case of glaciers, fluid dynamics principles can be used to understand how the movement @@ -34,12 +34,12 @@ Wait, shouldn't all arguments of a function be specified within parentheses? Why is there a second set of square brackets with content _after_ the parentheses? The answer is that, as passing content to a function is such a common thing to do in Typst, there is special syntax for it: Instead of putting the content -inside of the argument list, you can write it in square brackets directly after -the normal arguments, saving on punctuation. +inside the argument list, you can write it in square brackets directly after the +normal arguments, saving on punctuation. As seen above, that works. The [`par`] function justifies all paragraphs within -it. However, wrapping the document in countless functions and applying styles -selectively and in-situ can quickly become cumbersome. +it. However, wrapping the document in countless functions can quickly become +cumbersome. Fortunately, Typst has a more elegant solution. With _set rules,_ you can apply style properties to all occurrences of some kind of content. You write a set @@ -61,7 +61,6 @@ water). ```
- Want to know in more technical terms what is happening here? Set rules can be conceptualized as setting default values