ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Patrick Gundlach" <patrick@gundla.ch>
Subject: Re: good-looking tables in context
Date: 31 Mar 2005 22:32:40 +0200	[thread overview]
Message-ID: <m2y8c3zhcn.fsf@levana.de> (raw)
In-Reply-To: <424C1DFA.6010708@wxs.nl> (Hans Hagen's message of "Thu, 31 Mar 2005 17:57:46 +0200")

Hello Hans,


[LaTeX tables]

> what exactly are you missing?

There is a good file that pretty much describes what I am missing
(perhaps haven't found in a manual - I never looked that close):

http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf

There are commands like \toprule, \midrule, \bottomrule that insert
horizontal rules with different thickness (default values, optional
ones can be added with [..] right after the command). Eckhart has sent
an example in his first post.


To get a horizontal rule from column a to column b you can (in LaTeX)
use:

\cmidrule[<wd>](<trim>){a–b}

where wd is the rulethickness, trim is where to cut off a bit, and a,
b the columns. This is a very nice command that I often use.

\addlinespace addes a little space between rows. 


Table preambles can be complicated... but the next one is pretty
simple:

\begin{tabular}{@{}rll*{22}cv{40em}@{}}

means: to the left of the table, there should be no whitespace (i.e.
the leftmost glyph of the table should be tight to the preceding
glyph) now, there is a right aligned column, two left aligned, 22
centered columns and one type "v" and to the right there should be no
whitespace either. The column type v is defined like this

\newcolumntype{v}[1]{>{\raggedright\hspace{0pt}}p{#1}}

Ragged right but so that the first word can be hyphenated.

Or another columntype could be:

\newcolumntype{R}[1]{%
  >{\begin{turn}{90}\begin{minipage}[t][0pt]{#1}\smalltabsize\raggedright\hspace{0pt}}l%
  <{\end{minipage}\end{turn}}%
}

that would lead to rotated raggedright text in a smaller font.


I know that ConTeXt tables have a lot of features that LaTeX tables
don't have.

Patrick
-- 
ConTeXt wiki: http://contextgarden.net

  reply	other threads:[~2005-03-31 20:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-28 14:22 Eckhart Guthöhrlein
2005-03-30 20:38 ` Patrick Gundlach
2005-03-31 14:13   ` Eckhart Guthöhrlein
2005-03-31 15:57     ` Hans Hagen
2005-03-31 20:32       ` Patrick Gundlach [this message]
2005-04-01  8:29         ` Hans Hagen
2005-04-03 19:07           ` Patrick Gundlach
2005-04-06 12:19             ` Eckhart Guthöhrlein
2005-04-10  0:10               ` Paul Tremblay
2005-04-10  8:59                 ` Patrick Gundlach

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=m2y8c3zhcn.fsf@levana.de \
    --to=patrick@gundla.ch \
    --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).