diff --git a/tests/typ/code/block.typ b/tests/typ/code/block.typ index ac289abf0..a54df4619 100644 --- a/tests/typ/code/block.typ +++ b/tests/typ/code/block.typ @@ -6,20 +6,20 @@ // Evaluates to join of none, [My ] and the two loop bodies. { - let parts = ("my fri", "end.") - [Hello, ] - for s in parts [{s}] + let parts = ("my fri", "end.") + [Hello, ] + for s in parts [{s}] } // Evaluates to join of the templates and strings. { - [How] - if true { - " are" - } - [ ] - if false [Nope] - [you] + "?" + [How] + if true { + " are" + } + [ ] + if false [Nope] + [you] + "?" } --- @@ -37,24 +37,24 @@ // Evaluated to int. #test({ - let x = 1 - let y = 2 - x + y + let x = 1 + let y = 2 + x + y }, 3) // String is joined with trailing none, evaluates to string. #test({ - type("") - none + type("") + none }, "string") --- // Some things can't be joined. { - [A] - // Error: 5-6 cannot join template with integer - 1 - [B] + [A] + // Error: 3-4 cannot join template with integer + 1 + [B] } --- @@ -65,8 +65,8 @@ --- // Block in expression does create a scope. #let a = { - let b = 1 - b + let b = 1 + b } #test(a, 1) @@ -77,8 +77,8 @@ --- // Double block creates a scope. {{ - import b from "target.typ" - test(b, 1) + import b from "target.typ" + test(b, 1) }} // Error: 2-3 unknown variable @@ -87,17 +87,17 @@ --- // Multiple nested scopes. { - let a = "a1" + let a = "a1" + { + let a = "a2" { - let a = "a2" - { - test(a, "a2") - let a = "a3" - test(a, "a3") - } - test(a, "a2") + test(a, "a2") + let a = "a3" + test(a, "a3") } - test(a, "a1") + test(a, "a2") + } + test(a, "a1") } --- @@ -117,13 +117,13 @@ // Should output `3`. { - // Error: 9-12 expected identifier, found string - for "v" + // Error: 7-10 expected identifier, found string + for "v" - // Error: 10 expected keyword `in` - for v let z = 1 + 2 + // Error: 8 expected keyword `in` + for v let z = 1 + 2 - z + z } --- diff --git a/tests/typ/code/call.typ b/tests/typ/code/call.typ index 28ce860c3..118382e4a 100644 --- a/tests/typ/code/call.typ +++ b/tests/typ/code/call.typ @@ -25,8 +25,8 @@ // Test multiple wide calls in separate expressions inside a template. [ - #font!(fill: eastern) - First - #font!(fill: forest) - Second + #font!(fill: eastern) - First + #font!(fill: forest) - Second ] // Test wide call in heading. @@ -59,12 +59,12 @@ C // Callee expressions. { - // Wrapped in parens. - test((type)("hi"), "string") + // Wrapped in parens. + test((type)("hi"), "string") - // Call the return value of a function. - let adder(dx) = x => x + dx - test(adder(2)(5), 7) + // Call the return value of a function. + let adder(dx) = x => x + dx + test(adder(2)(5), 7) } --- diff --git a/tests/typ/code/closure.typ b/tests/typ/code/closure.typ index 75241f326..dcd355865 100644 --- a/tests/typ/code/closure.typ +++ b/tests/typ/code/closure.typ @@ -13,73 +13,73 @@ --- // Basic closure without captures. { - let adder = (x, y) => x + y - test(adder(2, 3), 5) + let adder = (x, y) => x + y + test(adder(2, 3), 5) } --- // Pass closure as argument and return closure. // Also uses shorthand syntax for a single argument. { - let chain = (f, g) => (x) => f(g(x)) - let f = x => x + 1 - let g = x => 2 * x - let h = chain(f, g) - test(h(2), 5) + let chain = (f, g) => (x) => f(g(x)) + let f = x => x + 1 + let g = x => 2 * x + let h = chain(f, g) + test(h(2), 5) } --- // Capture environment. { - let mark = "?" - let greet = { - let hi = "Hi" - name => { - hi + ", " + name + mark - } + let mark = "?" + let greet = { + let hi = "Hi" + name => { + hi + ", " + name + mark } + } - test(greet("Typst"), "Hi, Typst?") + test(greet("Typst"), "Hi, Typst?") - mark = "!" - test(greet("Typst"), "Hi, Typst!") + mark = "!" + test(greet("Typst"), "Hi, Typst!") } --- // Redefined variable. { - let x = 1 - let f() = { - let x = x + 2 - x - } - test(f(), 3) + let x = 1 + let f() = { + let x = x + 2 + x + } + test(f(), 3) } --- // Don't leak environment. { - // Error: 18-19 unknown variable - let func() = x - let x = "hi" - func() + // Error: 16-17 unknown variable + let func() = x + let x = "hi" + func() } --- // Too few arguments. { - let types(x, y) = "[" + type(x) + ", " + type(y) + "]" - test(types(14%, 12pt), "[relative, length]") + let types(x, y) = "[" + type(x) + ", " + type(y) + "]" + test(types(14%, 12pt), "[relative, length]") - // Error: 16-22 missing argument: y - test(types("nope"), "[string, none]") + // Error: 14-20 missing argument: y + test(types("nope"), "[string, none]") } --- // Too many arguments. { - let f(x) = x + 1 + let f(x) = x + 1 - // Error: 10-15 unexpected argument - f(1, "two", () => x) + // Error: 8-13 unexpected argument + f(1, "two", () => x) } diff --git a/tests/typ/code/for.typ b/tests/typ/code/for.typ index 62cb0bb53..0785be71a 100644 --- a/tests/typ/code/for.typ +++ b/tests/typ/code/for.typ @@ -10,22 +10,22 @@ // Dictionary is not traversed in insertion order. // Should output `Age: 2. Name: Typst.`. #for k, v in (Name: "Typst", Age: 2) [ - {k}: {v}. + {k}: {v}. ] // Block body. // Should output `[1st, 2nd, 3rd, 4th, 5th]`. { - "[" - for v in (1, 2, 3, 4, 5) { - if v > 1 [, ] - [#v] - if v == 1 [st] - if v == 2 [nd] - if v == 3 [rd] - if v >= 4 [th] - } - "]" + "[" + for v in (1, 2, 3, 4, 5) { + if v > 1 [, ] + [#v] + if v == 1 [st] + if v == 2 [nd] + if v == 3 [rd] + if v >= 4 [th] + } + "]" } // Template body. @@ -37,23 +37,23 @@ // Values of array. #for v in (1, 2, 3) { - out += (v,) + out += (v,) } // Indices and values of array. #for i, v in ("1", "2", "3") { - test(repr(i + 1), v) + test(repr(i + 1), v) } // Values of dictionary. #for v in (a: 4, b: 5) { - out += (v,) + out += (v,) } // Keys and values of dictionary. #for k, v in (a: 6, b: 7) { - out += (k,) - out += (v,) + out += (k,) + out += (v,) } #test(out, (1, 2, 3, 4, 5, "a", 6, "b", 7)) @@ -61,9 +61,9 @@ // Chars of string. #let first = true #let joined = for c in "abc" { - if not first { ", " } - first = false - c + if not first { ", " } + first = false + c } #test(joined, "a, b, c") @@ -81,7 +81,7 @@ // Keys and values of strings. // Error: 6-10 mismatched pattern #for k, v in "hi" { - dont-care + dont-care } --- diff --git a/tests/typ/code/if.typ b/tests/typ/code/if.typ index db8b059e8..174e69785 100644 --- a/tests/typ/code/if.typ +++ b/tests/typ/code/if.typ @@ -3,46 +3,46 @@ --- // Test condition evaluation. #if 1 < 2 [ - One. + One. ] #if true == false [ - {Bad}, but we {dont-care}! + {Bad}, but we {dont-care}! ] --- // Braced condition. #if {true} [ - One. + One. ] // Template in condition. #if [] != none [ - Two. + Two. ] // Multi-line condition with parens. #if ( - 1 + 1 - == 1 + 1 + 1 + == 1 ) [ - Nope. + Nope. ] #else { - "Three." + "Three." } // Multiline. #if false [ - Bad. + Bad. ] #else { - let point = "." - "Four" + point + let point = "." + "Four" + point } // Template can be argument or body depending on whitespace. { - if "template" == type[b] [Fi] else [Nope] - if "template" == type [Nope] else [ve.] + if "template" == type[b] [Fi] else [Nope] + if "template" == type [Nope] else [ve.] } --- @@ -50,21 +50,21 @@ // Ref: false { - let x = 1 - let y = 2 - let z + let x = 1 + let y = 2 + let z - // Returns if branch. - z = if x < y { "ok" } - test(z, "ok") + // Returns if branch. + z = if x < y { "ok" } + test(z, "ok") - // Returns else branch. - z = if x > y { "bad" } else { "ok" } - test(z, "ok") + // Returns else branch. + z = if x > y { "bad" } else { "ok" } + test(z, "ok") - // Missing else evaluates to none. - z = if x > y { "bad" } - test(z, none) + // Missing else evaluates to none. + z = if x > y { "bad" } + test(z, none) } --- diff --git a/tests/typ/code/import.typ b/tests/typ/code/import.typ index 93d4d168d..26a3404c7 100644 --- a/tests/typ/code/import.typ +++ b/tests/typ/code/import.typ @@ -17,8 +17,8 @@ // Code mode { - import b from "target.typ" - test(b, 1) + import b from "target.typ" + test(b, 1) } #test(b, 1) diff --git a/tests/typ/code/include.typ b/tests/typ/code/include.typ index 0d1abc083..8a9d0a300 100644 --- a/tests/typ/code/include.typ +++ b/tests/typ/code/include.typ @@ -14,8 +14,8 @@ --- { - // Error: 21-43 file not found - let x = include "importable/chap3.typ" + // Error: 19-41 file not found + let x = include "importable/chap3.typ" } --- diff --git a/tests/typ/code/ops-assoc.typ b/tests/typ/code/ops-assoc.typ index 19c56951e..ec128c61b 100644 --- a/tests/typ/code/ops-assoc.typ +++ b/tests/typ/code/ops-assoc.typ @@ -10,9 +10,9 @@ --- // Assignment is right-associative. { - let x = 1 - let y = 2 - x = y = "ok" - test(x, none) - test(y, "ok") + let x = 1 + let y = 2 + x = y = "ok" + test(x, none) + test(y, "ok") } diff --git a/tests/typ/code/ops.typ b/tests/typ/code/ops.typ index d8e873083..ca328e753 100644 --- a/tests/typ/code/ops.typ +++ b/tests/typ/code/ops.typ @@ -11,15 +11,15 @@ // Test plus and minus. #for v in (1, 3.14, 12pt, 45deg, 90%, 13% + 10pt, 6.3fr) { - // Test plus. - test(+v, v) + // Test plus. + test(+v, v) - // Test minus. - test(-v, -1 * v) - test(--v, v) + // Test minus. + test(-v, -1 * v) + test(--v, v) - // Test combination. - test(-++ --v, -v) + // Test combination. + test(-++ --v, -v) } #test(-(4 + 2), 6-12) @@ -50,24 +50,24 @@ // Mathematical identities. #let nums = (1, 3.14, 12pt, 45deg, 90%, 13% + 10pt) #for v in nums { - // Test plus and minus. - test(v + v - v, v) - test(v - v - v, -v) + // Test plus and minus. + test(v + v - v, v) + test(v - v - v, -v) - // Test plus/minus and multiplication. - test(v - v, 0 * v) - test(v + v, 2 * v) + // Test plus/minus and multiplication. + test(v - v, 0 * v) + test(v + v, 2 * v) - // Integer addition does not give a float. - if type(v) != "integer" { - test(v + v, 2.0 * v) - } + // Integer addition does not give a float. + if type(v) != "integer" { + test(v + v, 2.0 * v) + } - // Linears cannot be divided by themselves. - if type(v) != "linear" { - test(v / v, 1.0) - test(v / v == 1, true) - } + // Linears cannot be divided by themselves. + if type(v) != "linear" { + test(v / v, 1.0) + test(v / v == 1, true) + } } // Make sure length, relative and linear @@ -76,15 +76,15 @@ // - divided by floats. #let dims = (10pt, 30%, 50% + 3cm) #for a in dims { - for b in dims { - test(type(a + b), type(a - b)) - } + for b in dims { + test(type(a + b), type(a - b)) + } - for b in (7, 3.14) { - test(type(a * b), type(a)) - test(type(b * a), type(a)) - test(type(a / b), type(a)) - } + for b in (7, 3.14) { + test(type(a * b), type(a)) + test(type(b * a), type(a)) + test(type(a / b), type(a)) + } } --- diff --git a/tests/typ/code/while.typ b/tests/typ/code/while.typ index 2f0984d21..ccb679681 100644 --- a/tests/typ/code/while.typ +++ b/tests/typ/code/while.typ @@ -4,19 +4,19 @@ // Should output `2 4 6 8 10`. #let i = 0 #while i < 10 [ - { i += 2 } - #i + { i += 2 } + #i ] // Should output `Hi`. #let iter = true #while iter { - iter = false - "Hi." + iter = false + "Hi." } #while false { - dont-care + dont-care } --- @@ -36,8 +36,8 @@ --- // Make sure that we terminate and don't complain multiple times. #while true { - // Error: 5-9 unknown variable - nope + // Error: 3-7 unknown variable + nope } --- diff --git a/tests/typ/coma.typ b/tests/typ/coma.typ index 161ac832d..fdf6ab544 100644 --- a/tests/typ/coma.typ +++ b/tests/typ/coma.typ @@ -14,12 +14,12 @@ // the only argument to a function is a template, the parentheses can be omitted // (i.e. `f[a]` is the same as `f([a])`). #box[ - // Backslash adds a forced line break. - #university \ - #faculty \ - Sekretariat MA \ - Dr. Max Mustermann \ - Ola Nordmann, John Doe + // Backslash adds a forced line break. + #university \ + #faculty \ + Sekretariat MA \ + Dr. Max Mustermann \ + Ola Nordmann, John Doe ] #align(right, box[*WiSe 2019/2020* \ Woche 3]) @@ -29,10 +29,10 @@ // If the last argument to a function is a template, we can also place it behind // the parentheses. #align(center)[ - // Markdown-like syntax for headings. - ==== 3. Übungsblatt Computerorientierte Mathematik II #v(4mm) - *Abgabe: 03.05.2019* (bis 10:10 Uhr in MA 001) #v(4mm) - *Alle Antworten sind zu beweisen.* + // Markdown-like syntax for headings. + ==== 3. Übungsblatt Computerorientierte Mathematik II #v(4mm) + *Abgabe: 03.05.2019* (bis 10:10 Uhr in MA 001) #v(4mm) + *Alle Antworten sind zu beweisen.* ] *1. Aufgabe* #align(right)[(1 + 1 + 2 Punkte)] diff --git a/tests/typ/insert/circle.typ b/tests/typ/insert/circle.typ index 8d76f4ef5..41e0c40dd 100644 --- a/tests/typ/insert/circle.typ +++ b/tests/typ/insert/circle.typ @@ -5,22 +5,22 @@ Auto-sized circle. \ #circle(fill: rgb("eb5278"))[ - #align!(center, center) - But, soft! + #align!(center, center) + But, soft! ] Center-aligned rect in auto-sized circle. #circle(fill: forest)[ - #align!(center, center) - #rect!(fill: conifer) - #pad!(5pt) - But, soft! + #align!(center, center) + #rect!(fill: conifer) + #pad!(5pt) + But, soft! ] 100%-width rect in auto-sized circle. \ #circle(fill: forest)[ - #rect!(width: 100%, fill: conifer) - But, soft! what light through yonder window breaks? + #rect!(width: 100%, fill: conifer) + But, soft! what light through yonder window breaks? ] Expanded by height. @@ -29,11 +29,11 @@ Expanded by height. --- // Test relative sizing. #rect(width: 100%, height: 50pt, fill: rgb("aaa"))[ - #align!(center, center) - #font!(fill: white) - #circle(radius: 10pt, fill: eastern)[A] - #circle(height: 60%, fill: eastern)[B] - #circle(width: 20% + 20pt, fill: eastern)[C] + #align!(center, center) + #font!(fill: white) + #circle(radius: 10pt, fill: eastern)[A] + #circle(height: 60%, fill: eastern)[B] + #circle(width: 20% + 20pt, fill: eastern)[C] ] --- diff --git a/tests/typ/insert/ellipse.typ b/tests/typ/insert/ellipse.typ index 29f9b556d..5044219d3 100644 --- a/tests/typ/insert/ellipse.typ +++ b/tests/typ/insert/ellipse.typ @@ -3,13 +3,13 @@ --- 100% rect in 100% ellipse in fixed rect. \ #rect(width: 3cm, height: 2cm, fill: rgb("2a631a"))[ - #ellipse!(width: 100%, height: 100%, fill: forest) - #rect!(width: 100%, height: 100%, fill: conifer) - #align!(center, center) - Stuff inside an ellipse! + #ellipse!(width: 100%, height: 100%, fill: forest) + #rect!(width: 100%, height: 100%, fill: conifer) + #align!(center, center) + Stuff inside an ellipse! ] Auto-sized ellipse. \ #ellipse(fill: conifer)[ - But, soft! what light through yonder window breaks? + But, soft! what light through yonder window breaks? ] diff --git a/tests/typ/insert/square.typ b/tests/typ/insert/square.typ index 7d65b5290..dd20ca62d 100644 --- a/tests/typ/insert/square.typ +++ b/tests/typ/insert/square.typ @@ -3,24 +3,24 @@ --- Auto-sized square. \ #square(fill: eastern)[ - #align!(center) - #pad!(5pt) - #font!(fill: white, weight: bold) - Typst + #align!(center) + #pad!(5pt) + #font!(fill: white, weight: bold) + Typst ] --- // Test height overflow. #page!(width: 75pt, height: 100pt) #square(fill: conifer)[ - But, soft! what light through yonder window breaks? + But, soft! what light through yonder window breaks? ] --- // Test width overflow. #page!(width: 100pt, height: 75pt) #square(fill: conifer)[ - But, soft! what light through yonder window breaks? + But, soft! what light through yonder window breaks? ] --- diff --git a/tests/typ/layout/grid-1.typ b/tests/typ/layout/grid-1.typ index fb8a76786..1b66bab41 100644 --- a/tests/typ/layout/grid-1.typ +++ b/tests/typ/layout/grid-1.typ @@ -5,52 +5,52 @@ #page!(width: 100pt, height: 140pt) #grid( - columns: (auto, 1fr, 3fr, 0.25cm, 3%, 2mm + 10%), - rect(0.5cm, rgb("2a631a")), - rect(100%, forest), - rect(100%, conifer), - rect(100%, rgb("ff0000")), - rect(100%, rgb("00ff00")), - rect(80%, rgb("00faf0")), - rect(1cm, rgb("00ff00")), - rect(0.5cm, rgb("2a631a")), - rect(100%, forest), - rect(100%, conifer), - rect(100%, rgb("ff0000")), - rect(100%, rgb("00ff00")), + columns: (auto, 1fr, 3fr, 0.25cm, 3%, 2mm + 10%), + rect(0.5cm, rgb("2a631a")), + rect(100%, forest), + rect(100%, conifer), + rect(100%, rgb("ff0000")), + rect(100%, rgb("00ff00")), + rect(80%, rgb("00faf0")), + rect(1cm, rgb("00ff00")), + rect(0.5cm, rgb("2a631a")), + rect(100%, forest), + rect(100%, conifer), + rect(100%, rgb("ff0000")), + rect(100%, rgb("00ff00")), ) #grid() --- #grid( - columns: (auto, auto, 40%), - gutter-columns: (1fr,), - gutter-rows: (1fr,), - rect(fill: eastern)[dddaa aaa aaa], - rect(fill: conifer)[ccc], - rect(width: 100%, fill: rgb("dddddd"))[aaa], + columns: (auto, auto, 40%), + gutter-columns: (1fr,), + gutter-rows: (1fr,), + rect(fill: eastern)[dddaa aaa aaa], + rect(fill: conifer)[ccc], + rect(width: 100%, fill: rgb("dddddd"))[aaa], ) --- #page!(height: 3cm, width: 2cm) #grid( - columns: (1fr, 1cm, 1fr, 1fr), - column-dir: ttb, - rows: (auto, 1fr), - rect(height: 100%, fill: rgb("222222"))[foo], - rect(height: 100%, fill: rgb("547d0a"))[bar], - rect(height: 100%, fill: eastern)[hab], - rect(height: 100%, fill: conifer)[baz], - rect(height: 100%, width: 100%, fill: rgb("547d0a"))[bar], + columns: (1fr, 1cm, 1fr, 1fr), + column-dir: ttb, + rows: (auto, 1fr), + rect(height: 100%, fill: rgb("222222"))[foo], + rect(height: 100%, fill: rgb("547d0a"))[bar], + rect(height: 100%, fill: eastern)[hab], + rect(height: 100%, fill: conifer)[baz], + rect(height: 100%, width: 100%, fill: rgb("547d0a"))[bar], ) --- #page!(height: 3cm, margins: 0pt) #align!(center) #grid( - columns: (1fr,), - rows: (1fr, auto, 2fr), - [], rect(width: 100%)[A bit more to the top], [], + columns: (1fr,), + rows: (1fr, auto, 2fr), + [], rect(width: 100%)[A bit more to the top], [], ) diff --git a/tests/typ/layout/grid-2.typ b/tests/typ/layout/grid-2.typ index e28cfaf2d..fcb7037ee 100644 --- a/tests/typ/layout/grid-2.typ +++ b/tests/typ/layout/grid-2.typ @@ -3,27 +3,27 @@ --- #page!(width: 12cm, height: 2.5cm) #grid( - columns: 5, - gutter-columns: (2fr, 1fr, 1fr), - gutter-rows: 4 * (6pt,), - [*Quarter*], - [Expenditure], - [External Revenue], - [Financial ROI], - [_total_], - [*Q1*], - [173,472.57 \$], - [472,860.91 \$], - [51,286.84 \$], - [_350,675.18 \$_], - [*Q2*], - [93,382.12 \$], - [439,382.85 \$], - [-1,134.30 \$], - [_344,866.43 \$_], - [*Q3*], - [96,421.49 \$], - [238,583.54 \$], - [3,497.12 \$], - [_145,659.17 \$_], + columns: 5, + gutter-columns: (2fr, 1fr, 1fr), + gutter-rows: 4 * (6pt,), + [*Quarter*], + [Expenditure], + [External Revenue], + [Financial ROI], + [_total_], + [*Q1*], + [173,472.57 \$], + [472,860.91 \$], + [51,286.84 \$], + [_350,675.18 \$_], + [*Q2*], + [93,382.12 \$], + [439,382.85 \$], + [-1,134.30 \$], + [_344,866.43 \$_], + [*Q3*], + [96,421.49 \$], + [238,583.54 \$], + [3,497.12 \$], + [_145,659.17 \$_], ) diff --git a/tests/typ/layout/grid-3.typ b/tests/typ/layout/grid-3.typ index 450ce60cc..7e66eb2eb 100644 --- a/tests/typ/layout/grid-3.typ +++ b/tests/typ/layout/grid-3.typ @@ -3,16 +3,16 @@ --- #page!(width: 5cm, height: 3cm) #grid( - columns: 2, - gutter-rows: 3 * (8pt,), - [Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + columns: 2, + gutter-rows: 3 * (8pt,), + [Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis.], - [Text that is rather short], - [Fireflies], - [Critical], - [Decorum], - [Rampage], + Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis.], + [Text that is rather short], + [Fireflies], + [Critical], + [Decorum], + [Rampage], ) --- @@ -20,60 +20,60 @@ // that. #page!(width: 5cm, height: 2cm) #grid( - columns: 4 * (1fr,), - gutter-rows: (10pt,), - gutter-columns: (0pt, 10%), - image("../../res/rhino.png"), - align(right, rect(width: 100%, fill: eastern)[LoL]), - [rofl], - [\ A] * 3, - [Ha!\ ] * 3, + columns: 4 * (1fr,), + gutter-rows: (10pt,), + gutter-columns: (0pt, 10%), + image("../../res/rhino.png"), + align(right, rect(width: 100%, fill: eastern)[LoL]), + [rofl], + [\ A] * 3, + [Ha!\ ] * 3, ) --- // Test two columns in the same row overflowing by a different amount. #page!(width: 5cm, height: 2cm) #grid( - columns: 3 * (1fr,), - gutter-rows: (8pt,), - gutter-columns: (0pt, 10%), - [A], [B], [C], - [Ha!\ ] * 6, - [rofl], - [\ A] * 3, - [hello], - [darkness], - [my old] + columns: 3 * (1fr,), + gutter-rows: (8pt,), + gutter-columns: (0pt, 10%), + [A], [B], [C], + [Ha!\ ] * 6, + [rofl], + [\ A] * 3, + [hello], + [darkness], + [my old] ) --- // Test grid within a grid, overflowing. #page!(width: 5cm, height: 2.25cm) #grid( - columns: 4 * (1fr,), - gutter-rows: (10pt,), - gutter-columns: (0pt, 10%), - [A], [B], [C], [D], - grid(columns: 2, [A], [B], [C\ ]*3, [D]), - align(right, rect(width: 100%, fill: eastern)[LoL]), - [rofl], - [E\ ]*4, + columns: 4 * (1fr,), + gutter-rows: (10pt,), + gutter-columns: (0pt, 10%), + [A], [B], [C], [D], + grid(columns: 2, [A], [B], [C\ ]*3, [D]), + align(right, rect(width: 100%, fill: eastern)[LoL]), + [rofl], + [E\ ]*4, ) --- // Test partition of `fr` units before and after multi-region layout. #page!(width: 5cm, height: 4cm) #grid( - columns: 2 * (1fr,), - rows: (1fr, 2fr, auto, 1fr, 1cm), - gutter-rows: 4 * (10pt,), - rect(height: 100%, width: 100%, fill: rgb("ff0000"))[No height], - [foo], - rect(height: 100%, width: 100%, fill: rgb("fc0030"))[Still no height], - [bar], - [The nature of being itself is in question. Am I One? Am I Many? What is being alive?], - [baz], - [The answer], - [42], - [Other text of interest], + columns: 2 * (1fr,), + rows: (1fr, 2fr, auto, 1fr, 1cm), + gutter-rows: 4 * (10pt,), + rect(height: 100%, width: 100%, fill: rgb("ff0000"))[No height], + [foo], + rect(height: 100%, width: 100%, fill: rgb("fc0030"))[Still no height], + [bar], + [The nature of being itself is in question. Am I One? Am I Many? What is being alive?], + [baz], + [The answer], + [42], + [Other text of interest], ) diff --git a/tests/typ/layout/page.typ b/tests/typ/layout/page.typ index ba87ad519..80a644fb0 100644 --- a/tests/typ/layout/page.typ +++ b/tests/typ/layout/page.typ @@ -8,8 +8,8 @@ // Set all margins at once. #page(margins: 30pt)[ - #align(top, left)[TL] - #align(bottom, right)[BR] + #align(top, left)[TL] + #align(bottom, right)[BR] ] // Set individual margins. diff --git a/tests/typ/layout/pagebreak.typ b/tests/typ/layout/pagebreak.typ index ff15d156f..20962a719 100644 --- a/tests/typ/layout/pagebreak.typ +++ b/tests/typ/layout/pagebreak.typ @@ -9,9 +9,9 @@ First of two // Make sure that you can't do page related stuff in a container. A #box[ - B - #pagebreak() - #page("a4")[] + B + #pagebreak() + #page("a4")[] ] C diff --git a/tests/typ/layout/stack.typ b/tests/typ/layout/stack.typ index 7f434bd21..729d85fcf 100644 --- a/tests/typ/layout/stack.typ +++ b/tests/typ/layout/stack.typ @@ -3,9 +3,9 @@ --- #let rect(width, fill) = rect(width: width, height: 1cm, fill: fill) #stack( - rect(2cm, rgb("2a631a")), - rect(3cm, forest), - rect(1cm, conifer), + rect(2cm, rgb("2a631a")), + rect(3cm, forest), + rect(1cm, conifer), ) --- @@ -13,6 +13,6 @@ #let rect(width, fill) = rect(width: 1cm, height: 0.4cm, fill: fill) #box(height: 0.5cm, stack( - rect(3cm, forest), - rect(1cm, conifer), + rect(3cm, forest), + rect(1cm, conifer), )) diff --git a/tests/typ/markup/heading.typ b/tests/typ/markup/heading.typ index 0f5bb944d..bc0317b37 100644 --- a/tests/typ/markup/heading.typ +++ b/tests/typ/markup/heading.typ @@ -37,5 +37,5 @@ No = heading // Code blocks continue heading. = A { - "B" + "B" } diff --git a/tests/typ/text/align.typ b/tests/typ/text/align.typ index 2ffe1b4c2..9df5cd5ec 100644 --- a/tests/typ/text/align.typ +++ b/tests/typ/text/align.typ @@ -3,16 +3,16 @@ --- // Test that alignment depends on the paragraph's full width. #box[ - Hello World \ - #align(right)[World] + Hello World \ + #align(right)[World] ] --- // Test that a line with multiple alignments respects the paragraph's full // width. #box[ - Hello #align(center)[World] \ - Hello from the World + Hello #align(center)[World] \ + Hello from the World ] --- diff --git a/tests/typ/text/font.typ b/tests/typ/text/font.typ index cc906fbc8..1d28c331a 100644 --- a/tests/typ/text/font.typ +++ b/tests/typ/text/font.typ @@ -26,7 +26,7 @@ Emoji: 🐪, 🌋, 🏞 // Math. #font("Latin Modern Math")[ - ∫ 𝛼 + 3𝛽 d𝑡 + ∫ 𝛼 + 3𝛽 d𝑡 ] // Colors. @@ -37,8 +37,8 @@ Emoji: 🐪, 🌋, 🏞 #page!(width: 170pt) #let try(top, bottom) = rect(fill: conifer)[ - #font!(top-edge: top, bottom-edge: bottom) - `From `#top` to `#bottom + #font!(top-edge: top, bottom-edge: bottom) + `From `#top` to `#bottom ] #try(ascender, descender)