Hi all

So I'm mooching through TLC (second edition). Page 244 goes
on about the new improved array and I decided to fix something
that's been niggling me for some time.
.....
\begin{tabular}{>{\raggedright}p{0.33\textwidth}>{\raggedright}p{0.33\textwidth}>{\raggedright}
p{0.3\textwidth}}

Haemorrhages. Error message says that a & has been changed. No,
it hasn't.

The array package redines the newline // so if you use it as the last declaration in a table it will not work. You need to reset the original value for the newline. Lookup PreserveBackspace in Goosens.

Add the following command to the top of your document:

\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
\let\PBS=\PreserveBackslash % shorthand for the above

\begin{tabular}{|>{\raggedright}p{0.33\textwidth}|>{\raggedright}p{0.33\textwidth}|>{\PBS\raggedright}
p{0.33\textwidth}|}
This is some long text to check column alignment. We want to see if its 
justified or set to ragged rig
ht - much better for narrow cols. & two & three
\end{tabular}

The above will now run OK. I jus added the vertical bars to check the ragged 
right was working.

And I'd like to set the command just the once (rather than fiddling each entry).

add the folloing to the top:

\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
\let\PBS=\PreserveBackslash % shorthand for the above

\begin{tabular}{|R|R|R|}
This is some long text to check column alignment. We want to see if its 
justified or set to ragged rig
ht - much better for narrow cols. & two & three
\end{tabular}


Mike -- Mike Lake Caver, Linux enthusiast and interested in anything technical. -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to