aboutsummaryrefslogtreecommitdiff
path: root/test/tables.typst
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-11-15 21:16:27 -0800
committerJohn MacFarlane <[email protected]>2023-11-15 21:17:06 -0800
commit3591733e19f3a8db200c6170e6e543eb97e91728 (patch)
tree7801c926bb8115398fce93f95497777b47d32910 /test/tables.typst
parent13e1b49224ccd5a70af8f3b99b9a5ed6b9dfc48c (diff)
Typst writer: better handling of tables with captions.
We now put these in a figure with a caption argument. Closes #9194.
Diffstat (limited to 'test/tables.typst')
-rw-r--r--test/tables.typst41
1 files changed, 24 insertions, 17 deletions
diff --git a/test/tables.typst b/test/tables.typst
index 99a483616..46b3e7133 100644
--- a/test/tables.typst
+++ b/test/tables.typst
@@ -1,6 +1,7 @@
Simple table with caption:
-#align(center)[#table(
+#figure(
+align(center)[#table(
columns: 4,
align: (col, row) => (right,left,center,auto,).at(col),
inset: 6pt,
@@ -17,13 +18,14 @@ Simple table with caption:
[1],
[1],
[1],
+)]
+, caption: [Demonstration of simple table syntax.]
)
-#align(center, [Demonstration of simple table syntax.])
-]
Simple table without caption:
-#align(center)[#table(
+#figure(
+align(center)[#table(
columns: 4,
align: (col, row) => (right,left,center,auto,).at(col),
inset: 6pt,
@@ -40,12 +42,13 @@ Simple table without caption:
[1],
[1],
[1],
+)]
)
-]
Simple table indented two spaces:
-#align(center)[#table(
+#figure(
+align(center)[#table(
columns: 4,
align: (col, row) => (right,left,center,auto,).at(col),
inset: 6pt,
@@ -62,13 +65,14 @@ Simple table indented two spaces:
[1],
[1],
[1],
+)]
+, caption: [Demonstration of simple table syntax.]
)
-#align(center, [Demonstration of simple table syntax.])
-]
Multiline table with caption:
-#align(center)[#table(
+#figure(
+align(center)[#table(
columns: 4,
align: (col, row) => (center,left,right,left,).at(col),
inset: 6pt,
@@ -81,13 +85,14 @@ Multiline table with caption:
[row],
[5.0],
[Here’s another one. Note the blank line between rows.],
+)]
+, caption: [Here’s the caption. It may span multiple lines.]
)
-#align(center, [Here’s the caption. It may span multiple lines.])
-]
Multiline table without caption:
-#align(center)[#table(
+#figure(
+align(center)[#table(
columns: 4,
align: (col, row) => (center,left,right,left,).at(col),
inset: 6pt,
@@ -100,12 +105,13 @@ Multiline table without caption:
[row],
[5.0],
[Here’s another one. Note the blank line between rows.],
+)]
)
-]
Table without column headers:
-#align(center)[#table(
+#figure(
+align(center)[#table(
columns: 4,
align: (col, row) => (right,left,center,right,).at(col),
inset: 6pt,
@@ -121,12 +127,13 @@ Table without column headers:
[1],
[1],
[1],
+)]
)
-]
Multiline table without column headers:
-#align(center)[#table(
+#figure(
+align(center)[#table(
columns: 4,
align: (col, row) => (center,left,right,auto,).at(col),
inset: 6pt,
@@ -138,5 +145,5 @@ Multiline table without column headers:
[row],
[5.0],
[Here’s another one. Note the blank line between rows.],
+)]
)
-]