diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-01-30 12:09:26 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-01-30 12:09:26 +0100 |
| commit | 89eb8bae49edb71d9a9279a2210bb1ccaf4dd707 (patch) | |
| tree | 160b1a2ff41b5bba8a58f882df9d10c9eb036cf2 /tests | |
| parent | ac24075469f171fe83a976b9a97b9b1ea078a7e3 (diff) | |
New syntax 💎
- Everything everywhere!
- Blocks with curly braces: {}
- Templates with brackets: []
- Function templates with hashtag: `#[f]`
- Headings with equals sign: `= Introduction`
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/full/typ/coma.typ | 16 | ||||
| -rw-r--r-- | tests/lang/ref/bracket-call.png | bin | 22101 -> 22558 bytes | |||
| -rw-r--r-- | tests/lang/ref/headings.png | bin | 7985 -> 7415 bytes | |||
| -rw-r--r-- | tests/lang/typ/bracket-call.typ | 94 | ||||
| -rw-r--r-- | tests/lang/typ/comments.typ | 2 | ||||
| -rw-r--r-- | tests/lang/typ/emph-strong.typ | 2 | ||||
| -rw-r--r-- | tests/lang/typ/expressions.typ | 110 | ||||
| -rw-r--r-- | tests/lang/typ/headings.typ | 31 | ||||
| -rw-r--r-- | tests/lang/typ/if.typ | 3 | ||||
| -rw-r--r-- | tests/lang/typ/let.typ | 20 | ||||
| -rw-r--r-- | tests/lang/typ/raw.typ | 2 | ||||
| -rw-r--r-- | tests/lang/typ/values.typ | 2 | ||||
| -rw-r--r-- | tests/library/typ/font.typ | 46 | ||||
| -rw-r--r-- | tests/library/typ/hv.typ | 18 | ||||
| -rw-r--r-- | tests/library/typ/image.typ | 30 | ||||
| -rw-r--r-- | tests/library/typ/page.typ | 53 | ||||
| -rw-r--r-- | tests/library/typ/pagebreak.typ | 4 | ||||
| -rw-r--r-- | tests/library/typ/rgb.typ | 22 |
18 files changed, 223 insertions, 232 deletions
diff --git a/tests/full/typ/coma.typ b/tests/full/typ/coma.typ index b7863fce..32990997 100644 --- a/tests/full/typ/coma.typ +++ b/tests/full/typ/coma.typ @@ -1,23 +1,23 @@ -[page width: 450pt, height: 300pt, margins: 1cm] +#[page width: 450pt, height: 300pt, margins: 1cm] -[box][ +#[box][ *Technische Universität Berlin* \ *Fakultät II, Institut for Mathematik* \ Sekretariat MA \ Dr. Max Mustermann \ Ola Nordmann, John Doe ] -[align right | box][*WiSe 2019/2020* \ Woche 3] +#[align right | box][*WiSe 2019/2020* \ Woche 3] -[v 6mm] +#[v 6mm] -[align center][ - #### 3. Übungsblatt Computerorientierte Mathematik II [v 2mm] - *Abgabe: 03.05.2019* (bis 10:10 Uhr in MA 001) [v 2mm] +#[align center][ + ==== 3. Übungsblatt Computerorientierte Mathematik II #[v 2mm] + *Abgabe: 03.05.2019* (bis 10:10 Uhr in MA 001) #[v 2mm] *Alle Antworten sind zu beweisen.* ] -*1. Aufgabe* [align right][(1 + 1 + 2 Punkte)] +*1. Aufgabe* #[align right][(1 + 1 + 2 Punkte)] Ein _Binärbaum_ ist ein Wurzelbaum, in dem jeder Knoten ≤ 2 Kinder hat. Die Tiefe eines Knotens _v_ ist die Länge des eindeutigen Weges von der Wurzel diff --git a/tests/lang/ref/bracket-call.png b/tests/lang/ref/bracket-call.png Binary files differindex e8924484..fe7f2434 100644 --- a/tests/lang/ref/bracket-call.png +++ b/tests/lang/ref/bracket-call.png diff --git a/tests/lang/ref/headings.png b/tests/lang/ref/headings.png Binary files differindex c8d83165..b1ad3366 100644 --- a/tests/lang/ref/headings.png +++ b/tests/lang/ref/headings.png diff --git a/tests/lang/typ/bracket-call.typ b/tests/lang/typ/bracket-call.typ index 3d1fceb0..46757c45 100644 --- a/tests/lang/typ/bracket-call.typ +++ b/tests/lang/typ/bracket-call.typ @@ -1,25 +1,25 @@ // Basic call, whitespace insignificant. -[f], [ f ], [ +#[f], #[ f ], #[ f ] -[f bold] +#[f bold] -[f 1,] +#[f 1,] -[f a:2] +#[f a:2] -[f 1, a: (3, 4), 2, b: "5"] +#[f 1, a: (3, 4), 2, b: "5"] --- // Body and no body. -[f][[f]] +#[f][#[f]] // Lots of potential bodies. -[f][f][f] +#[f][f]#[f] // Multi-paragraph body. -[box][ +#[box][ First Second @@ -27,81 +27,81 @@ --- // Chained. -[f | f] +#[f | f] // Multi-chain. -[f|f|f] +#[f|f|f] // With body. -// Error: 1:6-1:7 expected identifier, found integer -[f | 1 | box][💕] +// Error: 1:7-1:8 expected identifier, found integer +#[f | 1 | box][💕] -// Error: 2:2-2:2 expected identifier -// Error: 1:3-1:3 expected identifier -[||f true] +// Error: 2:3-2:3 expected identifier +// Error: 1:4-1:4 expected identifier +#[||f true] -// Error: 1:6-1:6 expected identifier -[f 1|] +// Error: 1:7-1:7 expected identifier +#[f 1|] -// Error: 2:2-2:2 expected identifier -// Error: 1:3-1:3 expected identifier -[|][Nope] +// Error: 2:3-2:3 expected identifier +// Error: 1:4-1:4 expected identifier +#[|][Nope] -// Error: 2:5-2:5 expected closing paren -// Error: 1:8-1:9 expected expression, found closing paren -[f (|f )] +// Error: 2:6-2:6 expected closing paren +// Error: 1:9-1:10 expected expression, found closing paren +#[f (|f )] // With actual functions. -[box width: 1cm | image "res/rhino.png"] +#[box width: 1cm | image "res/rhino.png"] --- -// Error: 1:4-1:6 expected expression, found end of block comment -[f */] +// Error: 1:5-1:7 expected expression, found end of block comment +#[f */] -// Error: 1:7-1:8 expected expression, found colon -[f a:1:] +// Error: 1:8-1:9 expected expression, found colon +#[f a:1:] -// Error: 1:5-1:5 expected comma -[f 1 2] +// Error: 1:6-1:6 expected comma +#[f 1 2] -// Error: 2:4-2:5 expected identifier -// Error: 1:6-1:6 expected expression -[f 1:] +// Error: 2:5-2:6 expected identifier +// Error: 1:7-1:7 expected expression +#[f 1:] -// Error: 1:4-1:5 expected identifier -[f 1:2] +// Error: 1:5-1:6 expected identifier +#[f 1:2] -// Error: 1:4-1:7 expected identifier -[f (x):1] +// Error: 1:5-1:8 expected identifier +#[f (x):1] --- // Ref: false -// Error: 2:2-2:3 expected function, found string +// Error: 2:3-2:4 expected function, found string #let x = "string" -[x] +#[x] -// Error: 1:2-1:3 expected identifier, found invalid token -[# 1] +// Error: 1:3-1:4 expected identifier, found invalid token +#[# 1] // Error: 4:1-4:1 expected identifier // Error: 3:1-3:1 expected closing bracket -[ +#[ --- // Ref: false -// Error: 2:2-2:3 expected identifier, found closing paren +// Error: 2:3-2:4 expected identifier, found closing paren // Error: 3:1-3:1 expected closing bracket -[) +#[) --- // Error: 3:1-3:1 expected closing bracket -[f [*] +#[f [*] --- // Error: 3:1-3:1 expected closing bracket -[f][`a]` +#[f][`a]` --- // Error: 3:1-3:1 expected quote // Error: 2:1-2:1 expected closing bracket -[f "] +#[f "] diff --git a/tests/lang/typ/comments.typ b/tests/lang/typ/comments.typ index 5118a05e..880e8c2b 100644 --- a/tests/lang/typ/comments.typ +++ b/tests/lang/typ/comments.typ @@ -8,7 +8,7 @@ C/* */D // Works in headers. -[f /*1*/ a: "b" // +#[f /*1*/ a: "b" // , 1] // End should not appear without start. diff --git a/tests/lang/typ/emph-strong.typ b/tests/lang/typ/emph-strong.typ index dcd17337..2f77c7bb 100644 --- a/tests/lang/typ/emph-strong.typ +++ b/tests/lang/typ/emph-strong.typ @@ -5,7 +5,7 @@ _Emph_ and *strong*! Pa_rtl_y emphasized or str*ength*ened. // Scoped to body. -[box][*Sco_ped] to body. +#[box][*Sco_ped] to body. // Unterminated is fine. _The End diff --git a/tests/lang/typ/expressions.typ b/tests/lang/typ/expressions.typ index da6c6f4f..eee40085 100644 --- a/tests/lang/typ/expressions.typ +++ b/tests/lang/typ/expressions.typ @@ -7,75 +7,75 @@ #let error = +"" // Paren call. -[test f(1), "f(1)"] -[test type(1), "integer"] +#[test f(1), "f(1)"] +#[test type(1), "integer"] // Unary operations. -[test +1, 1] -[test -1, 1-2] -[test --1, 1] +#[test +1, 1] +#[test -1, 1-2] +#[test --1, 1] // Math operations. -[test "a" + "b", "ab"] -[test 1-4, 3*-1] -[test a * b, 8] -[test 12pt/.4, 30pt] -[test 1e+2-1e-2, 99.99] +#[test "a" + "b", "ab"] +#[test 1-4, 3*-1] +#[test a * b, 8] +#[test 12pt/.4, 30pt] +#[test 1e+2-1e-2, 99.99] // Associativity. -[test 1+2+3, 6] -[test 1/2*3, 1.5] +#[test 1+2+3, 6] +#[test 1/2*3, 1.5] // Precedence. -[test 1+2*-3, -5] +#[test 1+2*-3, -5] // Short-circuiting logical operators. -[test not "a" == "b", true] -[test not 7 < 4 and 10 == 10, true] -[test 3 < 2 or 4 < 5, true] -[test false and false or true, true] +#[test not "a" == "b", true] +#[test not 7 < 4 and 10 == 10, true] +#[test 3 < 2 or 4 < 5, true] +#[test false and false or true, true] // Right-hand side not even evaluated. -[test false and dont-care, false] -[test true or dont-care, true] +#[test false and dont-care, false] +#[test true or dont-care, true] // Equality and inequality. -[test "ab" == "a" + "b", true] -[test [*Hi*] == [*Hi*], true] -[test "a" != "a", false] -[test [*] != [_], true] -[test (1, 2, 3) == (1, 2) + (3,), true] -[test () == (1,), false] -[test (a: 1, b: 2) == (b: 2, a: 1), true] -[test (:) == (a: 1), false] -[test 1 == "hi", false] -[test 1 == 1.0, true] -[test 30% == 30% + 0cm, true] -[test 1in == 0% + 72pt, true] -[test 30% == 30% + 1cm, false] +#[test "ab" == "a" + "b", true] +#[test [*Hi*] == [*Hi*], true] +#[test "a" != "a", false] +#[test [*] != [_], true] +#[test (1, 2, 3) == (1, 2) + (3,), true] +#[test () == (1,), false] +#[test (a: 1, b: 2) == (b: 2, a: 1), true] +#[test (:) == (a: 1), false] +#[test 1 == "hi", false] +#[test 1 == 1.0, true] +#[test 30% == 30% + 0cm, true] +#[test 1in == 0% + 72pt, true] +#[test 30% == 30% + 1cm, false] // Comparisons. -[test 13 * 3 < 14 * 4, true] -[test 5 < 10, true] -[test 5 > 5, false] -[test 5 <= 5, true] -[test 5 <= 4, false] -[test 45deg < 1rad, true] +#[test 13 * 3 < 14 * 4, true] +#[test 5 < 10, true] +#[test 5 > 5, false] +#[test 5 <= 5, true] +#[test 5 <= 4, false] +#[test 45deg < 1rad, true] // Assignment. #let x = "some" #let y = "some" -[test (x = y = "") == none and x == none and y == "", true] +#[test (x = y = "") == none and x == none and y == "", true] // Modify-assign operators. #let x = 0 -{ x = 10 } [test x, 10] -{ x -= 5 } [test x, 5] -{ x += 1 } [test x, 6] -{ x *= x } [test x, 36] -{ x /= 2.0 } [test x, 18.0] -{ x = "some" } [test x, "some"] -{ x += "thing" } [test x, "something"] +{ x = 10 } #[test x, 10] +{ x -= 5 } #[test x, 5] +{ x += 1 } #[test x, 6] +{ x *= x } #[test x, 36] +{ x /= 2.0 } #[test x, 18.0] +{ x = "some" } #[test x, "some"] +{ x += "thing" } #[test x, "something"] // Error: 1:3-1:4 unknown variable { z = 1 } @@ -94,21 +94,21 @@ #let box = ""; { box = "hi" } // Parentheses. -[test (a), 2] -[test (2), 2] -[test (1+2)*3, 9] +#[test (a), 2] +#[test (2), 2] +#[test (1+2)*3, 9] // Error: 1:3-1:3 expected expression {-} -// Error: 1:10-1:10 expected expression -[test {1+}, 1] +// Error: 1:11-1:11 expected expression +#[test {1+}, 1] -// Error: 1:10-1:10 expected expression -[test {2*}, 2] +// Error: 1:11-1:11 expected expression +#[test {2*}, 2] -// Error: 1:7-1:16 cannot apply '-' to boolean -[test -not true, error] +// Error: 1:8-1:17 cannot apply '-' to boolean +#[test -not true, error] // Error: 1:2-1:8 cannot apply 'not' to array {not ()} diff --git a/tests/lang/typ/headings.typ b/tests/lang/typ/headings.typ index e63574ca..a1bb3753 100644 --- a/tests/lang/typ/headings.typ +++ b/tests/lang/typ/headings.typ @@ -1,48 +1,41 @@ // Test different numbers of hashtags. // Valid levels. -# One -### Three -###### Six += One +=== Three +====== Six // Too many hashtags. // Warning: 1:1-1:8 should not exceed depth 6 -####### Seven +======= Seven --- // Test heading vs. no heading. // Parsed as headings if at start of the context. -/**/ # Heading -{[## Heading]} -[box][### Heading] +/**/ = Heading +{[== Heading]} +#[box][=== Heading] // Not at the start of the context. -Text with # hashtag +Text = with=sign // Escaped. -\# No heading - -// Keyword. -// Error: 1:1-1:6 unexpected invalid token -#nope - -// Not parsed as a keyword, but neither as a heading. -Nr#1 +\= No heading --- // Heading continuation over linebreak. // Code blocks continue heading. -# This { += This { "continues" } // Function call continues heading. -# [box][ += #[box][ This, ] too // Without some kind of block, headings end at a line break. -# This += This not diff --git a/tests/lang/typ/if.typ b/tests/lang/typ/if.typ index ee466a8d..5fb46320 100644 --- a/tests/lang/typ/if.typ +++ b/tests/lang/typ/if.typ @@ -52,8 +52,7 @@ a#if x b#if (x)c a#if true [b] #else c // Lone else. -// Error: 2:1-2:6 unexpected keyword `#else` -// Error: 1:8-1:8 expected identifier +// Error: 1:1-1:6 unexpected keyword `#else` #else [] // Condition must be boolean. If it isn't, neither branch is evaluated. diff --git a/tests/lang/typ/let.typ b/tests/lang/typ/let.typ index b3eadeaa..52545b2f 100644 --- a/tests/lang/typ/let.typ +++ b/tests/lang/typ/let.typ @@ -1,10 +1,10 @@ // Automatically initialized with `none`. #let x -[test x, none] +#[test x, none] // Initialized with `1`. #let y = 1 -[test y, 1] +#[test y, 1] // Initialize with template, not terminated by semicolon in template. #let v = [Hello; there] @@ -15,10 +15,10 @@ 2, 3, ) -[test x, (1, 2, 3)] +#[test x, (1, 2, 3)] // Multiple bindings in one line. -#let x = "a"; #let y = "b"; [test x + y, "ab"] +#let x = "a"; #let y = "b"; #[test x + y, "ab"] // Invalid name. // Error: 1:6-1:7 expected identifier, found integer @@ -43,24 +43,24 @@ The Fi#let;rst // Terminated with just a line break. #let v = "a" -The Second [test v, "a"] +The Second #[test v, "a"] // Terminated with semicolon + line break. #let v = "a"; -The Third [test v, "a"] +The Third #[test v, "a"] // Terminated with just a semicolon. -The#let v = "a"; Fourth [test v, "a"] +The#let v = "a"; Fourth #[test v, "a"] // Terminated by semicolon even though we are in a paren group. // Error: 2:25-2:25 expected expression // Error: 1:25-1:25 expected closing paren -The#let array = (1, 2 + ;Fifth [test array, (1, 2)] +The#let array = (1, 2 + ;Fifth #[test array, (1, 2)] // Not terminated. // Error: 1:16-1:16 expected semicolon or line break -The#let v = "a"Sixth [test v, "a"] +The#let v = "a"Sixth #[test v, "a"] // Not terminated. // Error: 1:16-1:16 expected semicolon or line break -The#let v = "a" [test v, "a"] Seventh +The#let v = "a" #[test v, "a"] Seventh diff --git a/tests/lang/typ/raw.typ b/tests/lang/typ/raw.typ index 2c0890ba..a1f796b5 100644 --- a/tests/lang/typ/raw.typ +++ b/tests/lang/typ/raw.typ @@ -1,4 +1,4 @@ -[font 8pt] +#[font 8pt] // Typst syntax inside. `#let x = 1``[f 1]` diff --git a/tests/lang/typ/values.typ b/tests/lang/typ/values.typ index 55712c4d..53c2ea68 100644 --- a/tests/lang/typ/values.typ +++ b/tests/lang/typ/values.typ @@ -37,4 +37,4 @@ {"a\n[]\"\u{1F680}string"} \ // Templates. -{[*{"Hi"} [f 1]*]} +{[*{"Hi"} #[f 1]*]} diff --git a/tests/library/typ/font.typ b/tests/library/typ/font.typ index 4be98941..57761a8f 100644 --- a/tests/library/typ/font.typ +++ b/tests/library/typ/font.typ @@ -1,37 +1,37 @@ // Test configuring font properties. -[font "PT Sans", 10pt] +#[font "PT Sans", 10pt] // Set same font size in three different ways. -[font 20pt][A] -[font 200%][A] -[font 15pt + 50%][A] +#[font 20pt][A] +#[font 200%][A] +#[font 15pt + 50%][A] // Do nothing. -[font][Normal] +#[font][Normal] // Set style (is available). -[font style: italic][Italic] +#[font style: italic][Italic] // Set weight (is available). -[font weight: bold][Bold] +#[font weight: bold][Bold] // Set stretch (not available, matching closest). -[font stretch: ultra-condensed][Condensed] +#[font stretch: ultra-condensed][Condensed] -// Error: 1:7-1:12 unexpected argument -[font false] +// Error: 1:8-1:13 unexpected argument +#[font false] -// Error: 3:14-3:18 expected font style, found font weight -// Error: 2:28-2:34 expected font weight, found string -// Error: 1:43-1:44 expected font family or array of font families, found integer -[font style: bold, weight: "thin", serif: 0] +// Error: 3:15-3:19 expected font style, found font weight +// Error: 2:29-2:35 expected font weight, found string +// Error: 1:44-1:45 expected font family or array of font families, found integer +#[font style: bold, weight: "thin", serif: 0] -// Warning: 1:15-1:19 should be between 100 and 900 -[font weight: 2700] +// Warning: 1:16-1:20 should be between 100 and 900 +#[font weight: 2700] -// Error: 1:7-1:27 unexpected argument -[font something: "invalid"] +// Error: 1:8-1:28 unexpected argument +#[font something: "invalid"] --- // Test font fallback and class definitions. @@ -40,17 +40,17 @@ Emoji: 🏀 // CMU Serif + Noto Emoji. -[font "CMU Serif", "Noto Emoji"][ +#[font "CMU Serif", "Noto Emoji"][ Emoji: 🏀 ] // Class definitions. -[font serif: ("CMU Serif", "Latin Modern Math", "Noto Emoji")] -[font serif][ +#[font serif: ("CMU Serif", "Latin Modern Math", "Noto Emoji")] +#[font serif][ Math: ∫ α + β ➗ 3 ] // Class definition reused. -[font sans-serif: "Noto Emoji"] -[font sans-serif: ("Archivo", sans-serif)] +#[font sans-serif: "Noto Emoji"] +#[font sans-serif: ("Archivo", sans-serif)] New sans-serif. 🚀 diff --git a/tests/library/typ/hv.typ b/tests/library/typ/hv.typ index 36a6d242..67c04a12 100644 --- a/tests/library/typ/hv.typ +++ b/tests/library/typ/hv.typ @@ -1,22 +1,22 @@ // Ends paragraphs. -Tightly [v -5pt] packed +Tightly #[v -5pt] packed // Eating up soft spacing. -Inv [h 0pt] isible +Inv #[h 0pt] isible // Multiple spacings in a row. -Add [h 10pt] [h 10pt] up +Add #[h 10pt] #[h 10pt] up // Relative to font size. -Relative [h 100%] spacing +Relative #[h 100%] spacing // Missing spacing. -// Error: 1:11-1:11 missing argument: spacing -Totally [h] ignored +// Error: 1:12-1:12 missing argument: spacing +Totally #[h] ignored // Swapped axes. -[page main-dir: rtl, cross-dir: ttb, height: 80pt][ - 1 [h 1cm] 2 +#[page main-dir: rtl, cross-dir: ttb, height: 80pt][ + 1 #[h 1cm] 2 - 3 [v 1cm] 4 [v -1cm] 5 + 3 #[v 1cm] 4 #[v -1cm] 5 ] diff --git a/tests/library/typ/image.typ b/tests/library/typ/image.typ index 2e7b1eb5..a1e886dd 100644 --- a/tests/library/typ/image.typ +++ b/tests/library/typ/image.typ @@ -1,39 +1,39 @@ // Test loading different image formats. // Load an RGBA PNG image. -[image "res/rhino.png"] -[pagebreak] +#[image "res/rhino.png"] +#[pagebreak] // Load an RGB JPEG image. -[image "res/tiger.jpg"] +#[image "res/tiger.jpg"] -// Error: 1:8-1:29 failed to load image -[image "path/does/not/exist"] +// Error: 1:9-1:30 failed to load image +#[image "path/does/not/exist"] -// Error: 1:8-1:29 failed to load image -[image "typ/image-error.typ"] +// Error: 1:9-1:30 failed to load image +#[image "typ/image-error.typ"] --- // Test configuring the size and fitting behaviour of images. // Fit to width of page. -[image "res/rhino.png"] +#[image "res/rhino.png"] // Fit to height of page. -[page height: 40pt][ - [image "res/rhino.png"] +#[page height: 40pt][ + #[image "res/rhino.png"] ] // Set width explicitly. -[image "res/rhino.png", width: 50pt] +#[image "res/rhino.png", width: 50pt] // Set height explicitly. -[image "res/rhino.png", height: 50pt] +#[image "res/rhino.png", height: 50pt] // Set width and height explicitly and force stretching. -[image "res/rhino.png", width: 25pt, height: 50pt] +#[image "res/rhino.png", width: 25pt, height: 50pt] // Make sure the bounding-box of the image is correct. -[align bottom, right][ - [image "res/tiger.jpg", width: 60pt] +#[align bottom, right][ + #[image "res/tiger.jpg", width: 60pt] ] diff --git a/tests/library/typ/page.typ b/tests/library/typ/page.typ index 9eeddc93..97100ae9 100644 --- a/tests/library/typ/page.typ +++ b/tests/library/typ/page.typ @@ -1,54 +1,53 @@ // Test configuring page sizes and margins. // Set width and height. -[page width: 120pt, height: 120pt] -[page width: 40pt][High] -[page height: 40pt][Wide] +#[page width: 120pt, height: 120pt] +#[page width: 40pt][High] +#[page height: 40pt][Wide] // Set all margins at once. -[page margins: 30pt][ - [align top, left][TL] - [align bottom, right][BR] +#[page margins: 30pt][ + #[align top, left][TL] + #[align bottom, right][BR] ] // Set individual margins. -[page height: 40pt] -[page left: 0pt | align left][Left] -[page right: 0pt | align right][Right] -[page top: 0pt | align top][Top] -[page bottom: 0pt | align bottom][Bottom] +#[page height: 40pt] +#[page left: 0pt | align left][Left] +#[page right: 0pt | align right][Right] +#[page top: 0pt | align top][Top] +#[page bottom: 0pt | align bottom][Bottom] // Ensure that specific margins override general margins. -[page margins: 0pt, left: 20pt][Overriden] +#[page margins: 0pt, left: 20pt][Overriden] -// Error: 1:7-1:18 unknown variable -[page nonexistant] +// Error: 1:8-1:19 unknown variable +#[page nonexistant] -// Error: 1:17-1:20 aligned axis -[page main-dir: ltr] +// Error: 1:18-1:21 aligned axis +#[page main-dir: ltr] // Flipped predefined paper. -[page "a11", flip: true][Flipped A11] +#[page "a11", flip: true][Flipped A11] // Flipped custom page size. -[page width: 40pt, height: 120pt] -[page flip: true] +#[page width: 40pt, height: 120pt] +#[page flip: true] Wide // Test changing the layouting directions of pages. - -[page height: 50pt, main-dir: btt, cross-dir: rtl] +#[page height: 50pt, main-dir: btt, cross-dir: rtl] Right to left! --- // Test a combination of pages with bodies and normal content. -[page height: 50pt] +#[page height: 50pt] -[page][First] -[page][Second] -[pagebreak] +#[page][First] +#[page][Second] +#[pagebreak] Fourth -[page][] +#[page][] Sixth -[page][Seventh and last] +#[page][Seventh and last] diff --git a/tests/library/typ/pagebreak.typ b/tests/library/typ/pagebreak.typ index 2f539ce0..08dd9c7b 100644 --- a/tests/library/typ/pagebreak.typ +++ b/tests/library/typ/pagebreak.typ @@ -1,3 +1,3 @@ First of two -[pagebreak] -[page height: 40pt] +#[pagebreak] +#[page height: 40pt] diff --git a/tests/library/typ/rgb.typ b/tests/library/typ/rgb.typ index f778b2d1..e7b40518 100644 --- a/tests/library/typ/rgb.typ +++ b/tests/library/typ/rgb.typ @@ -1,17 +1,17 @@ // Check the output. -[rgb 0.0, 0.3, 0.7] +#[rgb 0.0, 0.3, 0.7] // Alpha channel. -[rgb 1.0, 0.0, 0.0, 0.5] +#[rgb 1.0, 0.0, 0.0, 0.5] -// Warning: 2:6-2:9 should be between 0.0 and 1.0 -// Warning: 1:11-1:15 should be between 0.0 and 1.0 -[rgb -30, 15.5, 0.5] +// Warning: 2:7-2:10 should be between 0.0 and 1.0 +// Warning: 1:12-1:16 should be between 0.0 and 1.0 +#[rgb -30, 15.5, 0.5] -// Error: 1:6-1:10 missing argument: blue component -[rgb 0, 1] +// Error: 1:7-1:11 missing argument: blue component +#[rgb 0, 1] -// Error: 3:5-3:5 missing argument: red component -// Error: 2:5-2:5 missing argument: green component -// Error: 1:5-1:5 missing argument: blue component -[rgb] +// Error: 3:6-3:6 missing argument: red component +// Error: 2:6-2:6 missing argument: green component +// Error: 1:6-1:6 missing argument: blue component +#[rgb] |
