Format table based on caption #4004
-
I was wondering if it is possible to format a table based on a caption. What I tried is something like this: #show table.cell.where(y: 0).and(figure.caption.content.contains("Tabletype 1")) : set text(weight: "bold") But this throws the error Additionally I tried to make the table header bold with the following code which didn't work as excepted. #show table.header : it => set text(weight: "bold") |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hi, this is basically possible by adding a condition to the body of the show rule:
Note that you should check whether the cells body actually has the field But I guess using a show-rule to perform this action will only be worth if you'd be typing this very often. Another sensible approach might be just to declare a variable:
and use it in the table. |
Beta Was this translation helpful? Give feedback.
This can be achieved with the following code
"TableType 1"
.Note that this code has one caveat: Now,
figure(placement: auto/top/bottom)
will not work anymore for this table. This is unfortunate but …