# [tex-live] How to do ... with array package?

Fri Feb 26 12:51:37 CET 2010

Procházka Lukáš Ing. - Pontex s. r. o. wrote:
> Dear friends,
>
> I have problem setting centered alignment of some columns in a table
> (array package, tabular enviroment).
>
> I can do it in any inner column, but not in the last one. I tried
> '\centering' command, 'center' environment, math mode using '\$', but I'm
> not able to do it successfully.
>
> Could you give me some help?
>
> Here's the code (also in the attachment):
>
>
> \documentclass[11pt,a4paper]{article}
>
> \usepackage[cp1250]{inputenc}
> \usepackage[T1]{fontenc}
>
> \usepackage{a4wide,array}
>
>
> \begin{document}
>
>    \newcolumntype{C}{>{\centering}m{.5in}}
>    \newcolumntype{V}{m{.5in}}
>
>    \begin{tabular}{|C|c|V|}
>    %\begin{tabular}{|C|c|C|} % The 'C' in the last column causes error!
>      \hline
>      1     & ab ab ab    & 3 abcd efgh \\
>      \hline
>      11111 & 2 2 2       & 3.3 \\
>      \hline
>      1     & 2 2 2 3 3 3 & 3.33 \\
>      \hline
>      1     & 2 2 2       & 3 \\
>      \hline
>    \end{tabular}
>
> \end{document}
>
>
> I use TeXLive 2009 under WinXP.
>
>
> Best regards,
>
> Lukas Prochazka
>

you are better of sending to the texhax mailing list (see tug.org), this
list is for TeXLIve development, not LaTeX macro problems

You problem is answered in the array manual

use

\newcolumntype{C}{>{\centering\arraybackslash}m{.5in}}

\centering messes with the meaning of \\, \arraybackslash restores it to
its meaning in arrays and tabulars.

>
> NB:
>
> This is my first mail to this conference; I hope it is not off-topic.
>
> Firstly I referred my problem to Mr. Frank Mittelbach and/or Mr. David
> Carlisle.
>
> Both of them are cited as authors of LaTeX array package documentation;
> unfortunately, there is no mail address in it.
>
> The only mail to them I found was carlisle at cs.man.ac.uk. But the message
> returned to me as undeliverable.

--

/daleif