Am Dienstag, 2. Juli 2024, 00:17:36 MESZ schrieb Wolfgang Schuster:
Gerion Entrup schrieb am 01.07.2024 um 23:56:
Hi,
I want to format a bunch a tables with the same formatting. It seems that specifying the \setupTABLE commands as part of the preamble works.
However, I need some tables that are formatted in another way. Is there a generic way to specify this?
Here is a MWE: [...]
The last two tables should be formatted as if the four setupTABLE commands in the header are not existent. My solution does not work, however.
- Put your table settings in a setups-block and load the one you want
at the start of your table.
- You don't need \setupcolors[state=start] because colors are enabled
by default (since a veee...eeery long time).
- You can replace \bTD ... \eTD with \bTH ... \eTH for table headers to
get bold text.
%%%% begin example \startsetups[table:a] \setupTABLE [each] [frame=off,width=1cm,height=1cm,align={middle,lohi}] \setupTABLE [each] [background=color,backgroundcolor=lightgray] \stopsetups
\startsetups[table:b] \setupTABLE [each] [frame=off,width=2cm,height=1.2\lineheight,align=middle] \setupTABLE [each] [topframe=on,bottomframe=on] \stopsetups
\starttext
\bTABLE \bTR \bTD A \eTD \bTD B \eTD \eTR \bTR \bTD C \eTD \bTD D \eTD \eTR \eTABLE
\blank
\bTABLE[setups=table:a] \bTR \bTD A \eTD \bTD B \eTD \eTR \bTR \bTD C \eTD \bTD D \eTD \eTR \eTABLE
\blank
\bTABLE[setups=table:b] \bTR \bTD A \eTD \bTD B \eTD \eTR \bTR \bTD C \eTD \bTD D \eTD \eTR \eTABLE
\stoptext %%%% end example
Wolfgang
Thank you very much! That are a bunch of nice tricks. The setups environment is really powerful. I will actively search for this keyword in the documentation next time.
Gerion