0

Possible Duplicate:
Easiest way to delete a column?

I have many table in my document, and I have decided I don't want one of their columns to appear in the output. I don't want to just remove the columns -- the tables are long and fiddly to edit, I might change my mind and want the column back, etc. So I am trying to come up with a new column specifier (using the array package) that discards a column entirely, making the table appear as if said column was not in the source code ("commented out," as it were). Here's an example document, with a couple ideas I've tried with no success:

\documentclass{article}
\usepackage{array}

\def\FooGobble#1\EndGobble{}

% leaves extra blank space between the columns
%\newcolumntype{X}{>{\FooGobble}l<{\EndGobble}}

% continues to typeset SURPRISE
%\newcolumntype{X}{p{0in}}

% still leaves extra space
\newcolumntype{X}{>{\FooGobble}p{0in}<{\EndGobble}}

\begin{document}

\begin{tabular}{lXl}
    first col & SURPRISE & second col \\
\end{tabular}

should appear the same as:

\begin{tabular}{ll}
    first col & second col \\
\end{tabular}

\end{document}

Thanks!

David Carlisle
  • 757,742
Aaron
  • 2,591
  • 2
    There are a couple of very nice solutions to an identical question here: Easiest way to delete a column? http://tex.stackexchange.com/q/16604/2693 – Alan Munn May 06 '11 at 02:02
  • Ack, I didn't think to use the word "delete" when I was searching for similar questions. :/ – Aaron May 06 '11 at 05:47

0 Answers0