Skip to content

Commit

Permalink
Fix some typos (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
knuesel authored Jun 6, 2024
1 parent 923f7a4 commit 5a52b64
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/Tutorials/karl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ Some elements do not support marks. As a rule of thumb, you can add marks only t
Karl notices that the marks are unnaturally large, this is because the shape of marks are transformed by default. So the marks are three times as big. This can be resolved by setting the `transform-shape: false` styling parameter. He also wants the mark to be filled and to have a different shape. As done earlier, the `fill` styling parameter can be used to fill marks and a different shape can be obtained by referring to the table of currently [supported marks](../basics/marks).

## Repeating Things: For-Loops
Karl's next aim is to add little ticks on the axes at positions $-1$, $-1/2$, $1/2$, and $1$. For this, it would be nice to use some kind of "loop", especially since he wishes to od the same thing at each of these positions. Thankfully Typst [has built in loops](https://typst.app/docs/reference/scripting/#loops).
Karl's next aim is to add little ticks on the axes at positions $-1$, $-1/2$, $1/2$, and $1$. For this, it would be nice to use some kind of "loop", especially since he wishes to do the same thing at each of these positions. Thankfully Typst [has built in loops](https://typst.app/docs/reference/scripting/#loops).

Karl can then use the following code:
```typc {26-31} example
Expand Down Expand Up @@ -423,4 +423,4 @@ for y in (-1, -0.5, 0.5, 1) {
## Adding Text
Karl is, by now, quite satisfied with the picture. However, the most important parts, namely the labels, are still missing!

CeTZ has the `content` draw function which allows you to place any content onto the canvas at a specified position.
CeTZ has the `content` draw function which allows you to place any content onto the canvas at a specified position.
4 changes: 2 additions & 2 deletions docs/basics/coordinate-systems.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ line("p2.south-east", ((), "-|", "yline.end")) // Short form
```

## Interpolation
Use this to linearly interpolate between two coordinates `a` and `b` with a given distance `number`. If `number` is a <Type>number</Type> the position will be at the absolute distance away from `a` towards `b`, a <Type>ratio</Type> can be given instead to be the relative distance between `a` and `b`. An <Type>angle</Type> can also be given for the general meaning: "First consider the line from `a` to `b`. Then rotate this line by `angle` around point `a`. Then the two endpoints of this lien will be `a` and some point `c`. Use the point `c` for the subsequent computation."
Use this to linearly interpolate between two coordinates `a` and `b` with a given distance `number`. If `number` is a <Type>number</Type> the position will be at the absolute distance away from `a` towards `b`, a <Type>ratio</Type> can be given instead to be the relative distance between `a` and `b`. An <Type>angle</Type> can also be given for the general meaning: "First consider the line from `a` to `b`. Then rotate this line by `angle` around point `a`. Then the two endpoints of this line will be `a` and some point `c`. Use the point `c` for the subsequent computation."

<Parameter name="a" types="coordinate">
The coordinate to interpolate from.
Expand Down Expand Up @@ -358,4 +358,4 @@ The example below shows how to use this system to create an offset from an ancho
circle((0, 0), name: "c")
fill(red)
circle((v => cetz.vector.add(v, (0, -1)), "c.west"), radius: 0.3)
```
```
4 changes: 2 additions & 2 deletions docs/basics/marks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 5
import Parameter from "@site/src/components/Parameter"
import Type from "@site/src/components/Type"

Marks are arrow tips that can be added to the end of path based elements that support the `mark` style key, or can be directly drawn by using the `mark` draw function. Marks are specified by giving their names (or shorthand) as strings and have several options to customise them. You can give an array of names to have multiple marks, dictionaries can be used in the array for per mark styling.
Marks are arrow tips that can be added to the end of path based elements that support the `mark` style key, or can be directly drawn by using the `mark` draw function. Marks are specified by giving their names (or shorthand) as strings and have several options to customise them. You can give an array of names to have multiple marks, and dictionaries can be used in the array for per mark styling.

```typ render
#set page(margin: 0cm)
Expand Down Expand Up @@ -133,4 +133,4 @@ Which mark to shorten the path to when multiple marks are given. `auto` will sho

<Parameter name="transform-shape" types="bool" default_value="true">
When `false` marks will not be stretched/affected by the current transformation, marks will be placed after the path is transformed.
</Parameter>
</Parameter>
6 changes: 3 additions & 3 deletions docs/basics/styling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ rect((-1, -1), (1, 1))
set-style(stroke: blue, fill: red)
circle((0,0))
// Draws a green line despite the global stroke is blue
// Draws a green line despite the global stroke being blue
line((), (1,1), stroke: green)
```

When using a dictionary for a style, it is important to onte that they update each other instead of overriding the entire option like a non-dictionary value would. For example, if the stroke is set to `(paint: red, thickness: 5pt)` and you pass `(paint: blue)`, the stroke would become `(paint: blue, thickness: 5pt)`.
When using a dictionary for a style, it is important to note that they update each other instead of overriding the entire option like a non-dictionary value would. For example, if the stroke is set to `(paint: red, thickness: 5pt)` and you pass `(paint: blue)`, the stroke would become `(paint: blue, thickness: 5pt)`.

```typc example
// Sets the stroke to red with a thickness of 5pt
Expand Down Expand Up @@ -67,4 +67,4 @@ set-style(
rect((0,0), (1,1))
circle((2.5, 0.5))
rect((4, 0), (5, 1), stroke: (thickness: 1pt))
```
```

0 comments on commit 5a52b64

Please sign in to comment.