ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: ntg-context@ntg.nl
Subject: Re: Booktabs equivalent in Context
Date: Wed, 08 Aug 2007 18:23:53 -0400	[thread overview]
Message-ID: <20070808182353.5z60n2ipesg88s0o@web.mail.umich.edu> (raw)
In-Reply-To: <f9cbeb$6r3$1@sea.gmane.org>

Quoting Johannes Graumann <johannes_graumann@web.de>:

> Aditya Mahajan wrote:
>
>> Hi,
>>
>> The question of how to get tables equivalent to latex's booktabs
>> package has been discussed quite a few times in the past. Booktabs
>> package provides (top|mid|bottom)rule commands and a cmidrule command.
>> The top and bottom rules are 0.08em thick, the midrule is 0.05em thick,
>> and the cmidrules are 0.03em thick. The cmidrules do not extend beyond
>> the columns edge. Here is an example of how to do something similar
>> using tables in context <http://wiki.contextgarden.net/Table#Booktabs>.
>>
>> To me this looks exactly similar to the example in the booktabs manual.
>> Am I missing something, or is it fair to say that context can generate
>> booktabs like tables?

> Hello,
>
> I'm one of the booktab-equivalent requesters and in my case the request is
> motivated by the (sadly German-only)
> http://www.ctan.org/tex-archive/info/german/tabsatz/tabsatz.pdf
> Please compare examples on pages 4 and 5 for the cmidrule functionality I'm
> missing in ConTeXt. The clarity you can give classy looking tables with
> trimmed cmidrules is even more evident in the example on page 9. There's
> lots of more use of this in the document, but it gets too esoteric to be
> easily grasped quickly (IMHO).

Here is one attempt, which works correctly. Of course the best solution 
is to forget about the \omit and set the halign preamble correctly. But 
I have not been able to figure that out yet.

\starttext

\def\CMID{\normalTABLEshortrule}

\unprotect
\def\TableNC
  {\checkTABLEautorow
   \nextTABLEgrayline
   \ifnum\currentTABLEcolumn>\maxTABLEcolumn
     \setTABLEerror\TABLEmissingrow
     \handleTABLEerror
   \else
     \global\advance\currentTABLEcolumn \plusone
     \ifnum\currentTABLEcolumn=1\relax
       \normalTABLEquote
     \else
       \fancyTABLEquote
      \fi
   \fi}

\def\fancyTABLEquote      {\unskip\!ttRightGlue&\omit\hskip2em&} % "
\protect

\setuptables[rulethickness=0.03em]

\starttable[s0|l|l|]
  \HL[3]
  \NC Monat     \NC 1965  \NC 1966  \AR
  \NC \CMID     \NC \CMID \NC \CMID \DR
  \NC September \NC 2000  \NC 1700 \AR
  \HL[3]
\stoptable

\stoptext


Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2007-08-08 22:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-03 21:10 Aditya Mahajan
2007-08-04  7:28 ` Patrick Gundlach
2007-08-06  1:13   ` Aditya Mahajan
2007-08-11 21:05     ` Patrick Gundlach
2007-08-08 12:03 ` Johannes Graumann
2007-08-08 22:23   ` Aditya Mahajan [this message]
2007-08-09  5:06     ` Hamid Kamrani
2007-08-09  6:43       ` Wolfgang Schuster
2007-08-09  7:43         ` Aditya Mahajan
2007-08-09  8:56           ` Wolfgang Schuster
2007-08-09 16:14             ` Aditya Mahajan
2007-08-10  5:44               ` Wolfgang Schuster
2007-08-11 21:05           ` Patrick Gundlach
2007-08-09 16:01         ` Hamid Kamrani

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=20070808182353.5z60n2ipesg88s0o@web.mail.umich.edu \
    --to=adityam@umich.edu \
    --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).