diff options
| author | Pg Biel <9021226+PgBiel@users.noreply.github.com> | 2023-05-11 11:32:46 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-11 16:32:46 +0200 |
| commit | b5ad2468adafca40448035c80fdabab4b5f75a0f (patch) | |
| tree | 2b0d1ea4d29df9c21fb714d539dca7a8703452b9 /tests/typ/text | |
| parent | d19a4124de60b043e36e76dfe20fca193deb6a41 (diff) | |
Improve alignment of text inside raw blocks (#1034)
Diffstat (limited to 'tests/typ/text')
| -rw-r--r-- | tests/typ/text/raw-align.typ | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/typ/text/raw-align.typ b/tests/typ/text/raw-align.typ new file mode 100644 index 00000000..2e124ea9 --- /dev/null +++ b/tests/typ/text/raw-align.typ @@ -0,0 +1,37 @@ +// Test the alignment of text inside of raw blocks. + +--- +// Text inside raw block should be unaffected by outer alignment by default. +#set align(center) +#set page(width: 180pt) +#set text(6pt) + +#lorem(20) + +```py +def something(x): + return x + +a = 342395823859823958329 +b = 324923 +``` + +#lorem(20) + +--- +// Text inside raw block should follow the specified alignment. +#set page(width: 180pt) +#set text(6pt) + +#lorem(20) +#align(center, raw( + lang: "typ", + block: true, + align: right, + "#let f(x) = x\n#align(center, line(length: 1em))", +)) +#lorem(20) + +--- +// Error: 17-20 alignment must be horizontal +#set raw(align: top) |
