17

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.

6
  • I was going to suggest using sidewaystable from rotating package, but for beamer, this isn't an option...
    – Seamus
    Mar 8, 2011 at 19:06
  • Sadly anything involving rotating the projector is indeed not quite an option. [SCNR] Mar 8, 2011 at 19:19
  • make a running minimal example and do not show only a fragment of your code
    – user2478
    Mar 8, 2011 at 19:25
  • See the related question "Formatting table". Mar 8, 2011 at 19:44
  • @Herbert: Done, I hope this does compile everywhere. I only tried pdflatex, as I am only interested in pdf output. Mar 8, 2011 at 19:44

2 Answers 2

24

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

1
  • 4
    That is indeed very impressive! Thanks alot! Mar 8, 2011 at 20:30
4
& \llap{\rotatebox[origin=rb]{-30}{\small adjacency\_list}}
& \llap{\rotatebox[origin=rb]{-30}{\small adjacency\_matrix}}
& \llap{\rotatebox[origin=rb]{-30}{\small compressed\_sparse\_row\_graph}}\\

maybe a solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.