[texhax] problem with array package
E. Krishnan
ekmath at asianetindia.com
Wed Apr 26 04:03:38 CEST 2006
On Tue, 25 Apr 2006, Tom Sgouros wrote:
> \documentclass{article}
> \usepackage{array}
>
> \begin{document}
>
> \newcolumntype{X}{>{\raggedright}p{1.2in}}
> \newcolumntype{P}{>{\raggedright}p{3in}}
>
> \begin{tabular}[t]{|XP|} \hline
> Name & Description \\
> Start sentinel & 1 byte (the character). This should not be
> provided to the center. \\
> Format code & 1 byte alphabetic. The standard for financial
> institutions specifies the format code is ``B''. \\
> \end{tabular}
>
> \end{document}
>
>
> I get this error:
>
> > ! Extra alignment tab has been changed to \cr.
> > <recently read> \endtemplate
> >
> > l.27 Start sentinel &
> > 1 byte (the character). This should not be
>
> Can anyone tell me what I'm doing wrong?
The problem arises because the "\raggedright" command redefines the
linebreaking command "\\". The workaround is to redefine "\\" locally,
which is done by the command "\arraybackslash" in the "array" package.
So, just change your "newcolumntypes" to read
\newcolumntype{X}{>{\raggedright\arraybackslash}p{1.2in}}
\newcolumntype{P}{>{\raggedright\arraybackslash}p{3in}}
and everything would be fine.
Please note that the command "\arraybakslash" is available only in
the newer version of the "array" package.
--
Krishnan
More information about the texhax
mailing list