ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

The Color Table Package


Enviado por   •  16 de Mayo de 2013  •  1.358 Palabras (6 Páginas)  •  405 Visitas

Página 1 de 6

The colortbl package

David Carlisle

2001/02/13

Abstract

This package implements a flexibable mechanism for giving colured ‘panels’

behind specified columns in a table. This package requires the array and

color packages.

1 Introduction

This package is for colouring tables (i.e., giving coloured panels behind column

entries). In that it has many similarities with Timothy Van Zandt’s colortab

package. The internal implementation is quite different though, also colortab works

with the table constructs of other formats besides LATEX. This package requires

LATEX (and its color and array packages).

First, a standard tabular, for comparison.

\begin{tabular}{|l|c|}

one&two\\

three&four

\end{tabular}

one two

three four

2 The \columncolor command

The examples below demonstrate various possibilities of the \columncolor command

introduced by this package. The vertical rules specified by | are kept in

all the examples, to make the column positioning clearer, although possibly you

would not want coloured panels and vertical rules in practice.

The package supplies a \columncolor command, that should (only) be used in

the argument of a > column specifier, to add a coloured panel behind the specified

column. It can be used in the main ‘preamble’ argument of array or tabular, and

also in \multicolumn specifiers.

The basic format is:

\columncolor[hcolor modeli]{hcolour i} [hleft overhangi][hright overhangi]

The first argument (or first two if the optional argument is used) are standard

color package arguments, as used by \color.

The last two arguments control how far the panel overlaps past the widest

entry in the column. If the right overhang argument is omitted then it defaults to

left overhang. If they are both omitted they default to \tabcolsep (in tabular) or

\arraycolsep (in array).

If the overhangs are both set to 0pt then the effect is:

This file has version number v0.1j, last revised 2001/02/13.

1

|>{\columncolor[gray]{.8}[0pt]}l|

>{\color{white}%

\columncolor[gray]{.2}[0pt]}l|

one two

three four

The default overhang of \tabcolsep produces:

|>{\columncolor[gray]{.8}}l|

>{\color{white}%

\columncolor[gray]{.2}}l|

one two

three four

You might want something between these two extremes. A value of .5\tabcolsep

produces the following effect

|>{\columncolor[gray]{.8}[.5\tabcolsep]}l|

>{\color{white}%

\columncolor[gray]{.2}[.5\tabcolsep]}l|

one two

three four

This package should work with most other packages that are compatible with

the array package syntax. In particular it works with longtable and dcolumn as the

following example shows.

Before starting give a little space: \setlength\minrowclearance{2pt}

A long table example

First two columns Third column

p-type D-type (dcolumn)

P-column and another one 12·34

Total (wrong) 100·6

Some long

text in the

first column

bbb 1·2

aaa and some long text

in the second

column

1·345

Total (wrong) 100·6

aaa bbb 1·345

Note that

the coloured

rules in all

columns

stretch to

accomodate

large entries

in one

column.

bbb 1·345

aaa bbb 100

Continued. . .

2

A long table example (continued)

First two columns Third column

p-type D-type (dcolumn)

aaa Depending on your

driver you may get

unsightly gaps or

lines where the

‘screens’ used to

produce different

shapes interact

badly.

...

Descargar como (para miembros actualizados)  txt (11.6 Kb)  
Leer 5 páginas más »
Disponible sólo en Clubensayos.com