Is it possible somehow to put a table with tabs inside an example?
As follows:
#let example(body) = figure(
kind: "example",
supplement: none,
body,
)
#show figure.where(kind: "example"): it => [
#v(1em)
#set par(first-line-indent: 0pt)
#align(left)[
(#context it.counter.display("1")) #it.body
]
#v(1em)
]
#example[
#table[
(a) [ab] [cdef] [ghi] \
(b) [jk] [lmnop] [qr] \
etc.
]
]
I am not what you are asking, because example is not a builtin Typst function. Do you have an example of the implementation of your example function.
That being said, it is possible to include a table inside a box a block, etc.
To improve the readability of your post please put your code backticks.
I’ve added the preamble code that sets up #example, and also the backticks, as requested.
#let example(body) = figure(
kind: "example",
supplement: none,
body,
)
#show figure.where(kind: "example"): it => [
#v(1em)
#set par(first-line-indent: 0pt)
#align(left)[
(#context it.counter.display("1")) #it.body
]
#v(1em)
]
#example[
#table[
(a) [ab] [cdef] [ghi] \
(b) [jk] [lmnop] [qr] \
etc.
]
]
Your problem seems to come from the definition of your table. Did you follow the Table guide? Indeed, your table is not properly formatted
1 Like
Thanks, Maucejo. I have now followed the table-formatting instructions carefully, and it’s producing exactly the result I wanted.