ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Gerion Entrup <gerion.entrup@flump.de>
Subject: [NTG-context] Re: How to specify a default formatting for TABLE
Date: Tue, 2 Jul 2024 00:17:36 +0200	[thread overview]
Message-ID: <34663299-e8db-9bfe-f2ec-8a908366588a@gmail.com> (raw)
In-Reply-To: <3492953.QJadu78ljV@falbala>

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.

1. Put your table settings in a setups-block and load the one you want 
at the start of your table.

2. You don't need \setupcolors[state=start] because colors are enabled 
by default (since a veee...eeery long time).

3. 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2024-07-01 22:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 21:56 [NTG-context] " Gerion Entrup
2024-07-01 22:17 ` Wolfgang Schuster [this message]
2024-07-01 22:23   ` [NTG-context] " Gerion Entrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34663299-e8db-9bfe-f2ec-8a908366588a@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=gerion.entrup@flump.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).