The array
package documentation, on pages 2 and 3 has the explanations:




Additional explanation
To answer your specific question:
\newcolumntype{Y}{>{\small\raggedright\arraybackslash}X}
defines a new type of column called Y
based on a X
column (this column type is defined by the tabularx
package and it is basically a p{ <width>}
column, where <width>
is calculated by the package) but typesets the content using \small
font size and with ragged-right text.
To sum up, Y
is now a p{<width>}
column whose contents will be typeset in \small
font size and ragged-right. And now, instead of the cumbersome
\begin{tabularx}{0.5\linewidth}{c>{\small\raggedright\arraybackslash}Xl>{\small\raggedright\arraybackslash}X}
...
\end{tabularx}
you can simply say
\begin{tabularx}{0.5\linewidth}{cYlY}
...
\end{tabularx}
\newcolumntype
with arguments
Let's say, as an example, that we need a table with three p{}
type columns with the following specifications:
- First column: width=4cm, color=(shade of) blue; ragged-left content.
- Second column: width=3cm, color=(shade of) red; ragged-left content.
- First column: width=5cm, color=(shade of) green; ragged-left content.
The best thing here is to define a new column type; \newcolumntype
also receives parameters (like \newcommand
), so in this case we need a new type with two parameters: color and width:
\newcolumntype{C}[2]{>{\columncolor{#1}\raggedleft\arraybackslash}p{#2}}
And the table format would look like
\begin{tabular}{C{red!30}{4cm}C{blue!20}{3cm}C{green!20}{5cm}}
...
\end{tabular}
The complete example:
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{array}
\newcolumntype{C}[2]{>{\columncolor{#1}\raggedleft}p{#2}}
\begin{document}
\noindent
\begin{tabular}{C{red!30}{4cm}C{blue!20}{3cm}C{green!20}{5cm}}
Some test text to illustrate the new column type
& Some test text to illustrate the new column type
& Some test text to illustrate the new column type
\end{tabular}
\end{document}
The result:

\arraybackslash
As for \arraybackslash
, the \raggedright
, \raggedleft
, and \centering
declarations redefine \\
in a way which conflicts with its use in a tabular
or array
environments. The command \arraybackslash
(implemented in array
and tabularx
) restores the meaning of \\
for use in array
and tabular
(you would only need \arraybackslash
for the last column).
>{}
is prepended to all the cells in the columnY
. More info can be found in thearray
documentation.texdoc array
and read page 2>{}
,{}<
syntax, and page 3 for\newcolumntype
.