Friday, October 20, 2006

Insert List into Tabular in Latex

Here is the code. But I still cannot figure out how to do under Beamer. The ultimate goal is to insert the Figure into the left top corner and put the list on the right.

\documentclass[12pt]{article}
\makeatletter % Yes, it's horrible
\def\spacehack{%
\@minipagetrue% % Disables spacing above
\expandafter\everypar\expandafter{% % Add stuff to \everypar
\the\everypar% % Do what was there before
\@minipagefalse% % Clear the mystic flag
\everypar={}% % And reset \everypar
}%
\let\@oldbs=\\% % Remember old \\ command
\def\\{\nointerlineskip\@oldbs}% % Turn off final odd spacing
}
\makeatother

%
\begin{document}
%
\begin{tabular}{p{40mm}p{40mm}p{40mm}}\hline
& Advantages & Disadvantages \\ \hline
Method 1 & \spacehack\begin{enumerate}
\setlength{\itemsep}{-\parsep}
\item item one
\item item two
\item item three
\end{enumerate} & \spacehack\begin{enumerate}
\item item one
\item item two
\end{enumerate} \\[-12pt] \hline
Method 2 & \begin{enumerate}
\item item one
\end{enumerate} & \begin{enumerate}
\item item one
\item item two
\end{enumerate} \\ \hline
Method 3 & \begin{enumerate}
\item item one
\end{enumerate} & \begin{enumerate}
\item item one
\end{enumerate} \\ \hline
\end{tabular}

\end{document}

No comments: