[texhax] Conditionally Formatting Tabular Cells

Uwe Lueck uwe.lueck at web.de
Wed Aug 4 14:20:14 CEST 2010


Uwe Lueck <uwe.lueck at web.de>, 04.08.2010 13:46:11:
>... actually the final column needs an extra type or macro for incrementing the row number -- U.L.

... more straightforward: the first column, also better as TeX allows omitting final &s -- sorry, Uwe.

>-----Ursprüngliche Nachricht-----
>Von: Uwe Lueck 
>Gesendet: 04.08.2010 11:48:27
>An: texhax at tug.org,mb78aa at yahoo.com
>Betreff: Re: [texhax] Conditionally Formatting Tabular Cells
>
>"Mike B." <mb78aa at yahoo.com>, 14.07.2010 05:41:33:
>>Can you explain what you meant about defining columns styles?.
>
>Sorry ... just as I wrote earlier: the documentation of the array package (ctan.org/pkg/array) explains a command for defining new LaTeX table column types much like \newcommand. The rest would be straightforward macro programming using \newcounter, \stepcounter, and \ifnum (I like TeX's primitive conditionals) or the ifthen package (ctan.org/pkg/ifthen). 
>
>With Plain TeX, you can similarly define some one-parameter macro \CondCol such that the template line of \halign contains \CondCol{#}.
>
>Cheers, 
>
>    Uwe.
>
>
>>--- On Tue, 13/7/10, Uwe Lueck  wrote:
>>
>>> From: Uwe Lueck 
>>> Subject: Re: [texhax] Conditionally Formatting Tabular Cells
>>> To: texhax at tug.org, mb78aa at yahoo.com
>>> Date: Tuesday, 13 July, 2010, 10:31 PM
>>> "Mike B." <mb78aa at yahoo.com>,
>>> 13.07.2010 02:53:47
>>> >Is it possible to format groups of tabular cells?.
>>> >I have a tabular with several rows and columns and I
>>> wish to modify the formatting (for example, to \tt) for
>>> groups of cells (not an entire row or column).  There
>>> may several such groups inside the tabular so manually
>>> entering the formatting commands for each cell seems
>>> tedious.
>>> >
>>> >So basically I am looking for a way to conditionally
>>> format tabular cells, so a meta-code is something like
>>> >if row==1:2 and column==1:3 \tt
>>> >if row==5:7 and column==6:7 \tt
>>> >
>>> >to change two groups of cells to \tt.
>>> 
>>> I think this can be done using cell formats (for entire
>>> columns indeed) that actually step column and row counters
>>> and that execute conditionals corresponding to your
>>> specifications, but I cannot type the details right now. I
>>> would try a plain TeX version or the facility of array.sty
>>> or so for establishing user-defined column types. There may
>>> be some more helpful package like
>>> 
>>>     http://ctan.org/pkg/makecell
>>> 
>>> HTH -- Uwe.
>>> 
>>
>>
>_______________________________________________
>TeX FAQ: http://www.tex.ac.uk/faq
>Mailing list archives: http://tug.org/pipermail/texhax/
>More links: http://tug.org/begin.html
>
>Automated subscription management: http://tug.org/mailman/listinfo/texhax
>Human mailing list managers: postmaster at tug.org
>
>_______________________________________________
>TeX FAQ: http://www.tex.ac.uk/faq
>Mailing list archives: http://tug.org/pipermail/texhax/
>More links: http://tug.org/begin.html
>
>Automated subscription management: http://tug.org/mailman/listinfo/texhax
>Human mailing list managers: postmaster at tug.org



More information about the texhax mailing list