[Tex/LaTex] How to format table with long column head entries

tables

I would like to create some kind of feature matrix with available classes in columns and implemented features as rows. Problem is, that the class names are quite long.

Rotating them by 90° simply looked quite silly, so am looking for alternate ideas.

The only idea I had so far was to write the heading text horizontally with a arrow (or similar) matching the "heading row" with a column. But frankly I have no idea how to do something like this in latex.

An minimal example of my naive approach looks like this.

\documentclass{beamer}

\usepackage{tabularx}

% I am actually using a custom theme
% The space ``wasted'' is similar for PaloAlto though
\usetheme{PaloAlto}

\begin{document}
\frame
{
  \frametitle{Comparision of boost implemented graph classes}
  \begin{tabularx}{\textwidth}{X c c c}
    %
    % Column Headers, first column is empts
    %
    & \rotatebox{90}{adjacency\_list}
    & \rotatebox{90}{adjacency\_matrix}
    & \rotatebox{90}{compressed\_sparse\_row\_graph}      \
    %
    % Rows, I suspect I need about 10
    % Class               adjlist          adjmatrix     csrg
    \hline 
    AdjacencyGraph        & Yes            & No          & Yes \\
    Interface \#2         & Yes            & No          & Yes \\
    Interface \#3         & Yes            & No          & Yes \\
    Interface \#4         & Yes            & No          & Yes \\
    Interface \#5         & Yes            & No          & Yes \\
    Interface \#6         & Yes            & No          & Yes \\
    Interface \#7         & Yes            & No          & Yes \\
    Interface \#8         & Yes            & No          & Yes \\
    Interface \#9         & Yes            & No          & Yes \\
    % Rest omitted
  \end{tabularx}
}
\end{document}

If its important: I am doing this for a presentation with beamer.

Best Answer

Here's an example using your idea of putting the headers horizontally and connecting them to the columns with arrows:

\documentclass{beamer}
\usepackage{tikz}
\usepackage{tabularx}
\newcommand*{\hnode}[1]{\tikz[remember picture] \node (#1) {};}
% I am actually using a similar theme
% The space ``wasted'' is similar for PaloAlto though
\usetheme{PaloAlto}

\begin{document}
\frame
{
  \frametitle{Comparision of boost implemented graph classes}
  \begin{tabular}{l}
    %
    % Column Headers, first column is empts
    %
    compressed\_sparse\_row\_graph\hnode{H3}\\
    adjacency\_matrix\hnode{H2}\\
    adjacency\_list\hnode{H1}\\
    \\
  \end{tabular}
  \begin{tabularx}{\textwidth}{X c c c}
    %
    & \hnode{C1}
    & \hnode{C2}
    & \hnode{C3}\\
    % Rows, I suspect I need about 10
    % Class               adjlist          adjmatrix     csrg
    \hline 
    AdjacencyGraph        & Yes            & No          & Yes \\
    Interface \#2         & Yes            & No          & Yes \\
    Interface \#3         & Yes            & No          & Yes \\
    Interface \#4         & Yes            & No          & Yes \\
    Interface \#5         & Yes            & No          & Yes \\
    Interface \#6         & Yes            & No          & Yes \\
    Interface \#7         & Yes            & No          & Yes \\
    Interface \#8         & Yes            & No          & Yes \\
    Interface \#9         & Yes            & No          & Yes \\
    % Rest omitted
  \end{tabularx}
\tikz[remember picture,overlay] \draw (H1)  [very thick, red,->] -| (C1);
\tikz[remember picture,overlay] \draw (H2)  [very thick, red,->] -| (C2);
\tikz[remember picture,overlay] \draw (H3)  [very thick, red,->] -| (C3);
}

\end{document}

It actually looks pretty good, if I may say so myself.

beamer slide

Related Question