2

I originally had a list in itemize that I wanted on the left and a "legend" created by tabular I wanted on the bottom right of a slide in a presentation. Then, I learned that wraptable doesn't work with lists (itemize), so I changed my list to a table as well, and now I'm using minipages to put the two tables left-right alignment. However, the alignment is vertical (top-bottom) and doesn't fit well. I realized if a tabular column has text that makes it wider, minipage doesn't seem to override that (I suspect). Does anyone have a clever way to get the legend "Clusters" on the bottom right? See code below.

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{movie15, xcolor, multicol, amsmath, graphicx, subfigure, float, wrapfig}
\mode<presentation> {
  \usetheme{Warsaw}      
  \usecolortheme{beaver} 
  \usefonttheme{serif}  
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
} 
\def\clusterA{\hfill\rlap{\hspace{0cm}\textcolor{blue}{$\bigstar$}}}
\def\clusterB{\hfill\rlap{\hspace{0cm}\textcolor{red}{$\bigstar$}}}
\def\clusterC{\hfill\rlap{\hspace{0cm}\textcolor{green}{$\bigstar$}}}


\begin{frame}{DSM-5 Comorbidity Clusters}
\begin{minipage}{0.74\textwidth}
  \begin{tabular}{|r l l|}
    \clusterA & Neurodevelopmental Disorders (ID, ADHD, ASD) &  \\ 
    \clusterA & Schizophrenia Spectrum/Psychotic Disorders (SZ) & I \\ 
    \clusterB & Bipolar Disorders (I, II) & I\\ 
    \clusterB & Depressive Disorders (MDD) & I\\ 
    \clusterB & Anxiety Disorders (GAD, Phobias, Panic) & I \\ 
    \clusterB & Obsessive-Compulsive Disorders (OCD) & I \\ 
    \clusterB & Trauma \& Stress-Related Disorders (PTSD) & I \\ 
              & Dissociative Disorders (DID) & I \\ 
              & Somatic Symptom Disorders & III
  \end{tabular}
\end{minipage}

\begin{minipage}{0.24\textwidth}
  \begin{table}[]
    \begin{tabular}{|c c|} \hline 
      \multicolumn{2}{|c|}{Clusters} \\
      \hline
      \clusterA & A \\ 
      \clusterB & B \\ 
      \clusterC & C \\ 
      \hline 
    \end{tabular} 
  \end{table} 
\end{minipage}
\end{frame}

Note I've tried both \textwidth and \linewidth in the minipage options and it doesn't change anything. See picture below for current layout. Again, I want the Clusters legend on the bottom right 20% of the page and the first table flushed left to give room for the second table on the bottom right.

[[NOTE:: don't pay attention to the text in the tables - they may be inaccurate/they are my best guesses before research.]]

enter image description here

1
  • Welcome to TeX.SX! It doesn't really have anything to do with minipage, but that line breaking isn't enabled in the default column types for tabular (r, c, l). One way around that is to switch to tabularx, and make the second column of type X, like in Fix column width of table. The second thing to consider is that a blank line is the same as a paragraph break, so your two tables would end up below one another even if there was room for both. Jun 29 '15 at 21:35
2

You can dispense with the minipages; it's enough to use a tabular with b (botoom) alignment in which the central column is of paragraph type p{<length>} (thus allowing text wrapping) and not to leave blank lines between the tabular and the legend:

enter image description here

The code:

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{movie15, multicol, float, wrapfig}
\usepackage{array}

\mode<presentation> {
  \usetheme{Warsaw}      
  \usecolortheme{beaver} 
  \usefonttheme{serif}  
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
} 
\def\clusterA{\hfill\rlap{\hspace{0cm}\textcolor{blue}{$\bigstar$}}}
\def\clusterB{\hfill\rlap{\hspace{0cm}\textcolor{red}{$\bigstar$}}}
\def\clusterC{\hfill\rlap{\hspace{0cm}\textcolor{green}{$\bigstar$}}}

\begin{document}

\begin{frame}{DSM-5 Comorbidity Clusters}

  \begin{tabular}[b]{|r >{\raggedright}p{6.5cm} l|}
    \clusterA & Neurodevelopmental Disorders (ID, ADHD, ASD) &  \\ 
    \clusterA & Schizophrenia Spectrum/Psychotic Disorders (SZ) & I \\ 
    \clusterB & Bipolar Disorders (I, II) & I\\ 
    \clusterB & Depressive Disorders (MDD) & I\\ 
    \clusterB & Anxiety Disorders (GAD, Phobias, Panic) & I \\ 
    \clusterB & Obsessive-Compulsive Disorders (OCD) & I \\ 
    \clusterB & Trauma \& Stress-Related Disorders (PTSD) & I \\ 
              & Dissociative Disorders (DID) & I \\ 
              & Somatic Symptom Disorders & III
  \end{tabular}\hfill
% <- important to preven ending the paragraph
    \begin{tabular}{|c c|} \hline 
      \multicolumn{2}{|c|}{Clusters} \\
      \hline
      \clusterA & A \\ 
      \clusterB & B \\ 
      \clusterC & C \\ 
      \hline 
    \end{tabular} 
\end{frame}

\end{document}

Declaring bottom alignment for both tabulars:

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{movie15, xcolor, multicol, amsmath, graphicx, subfigure, float, wrapfig}
\usepackage{array}

\mode<presentation> {
  \usetheme{Warsaw}      
  \usecolortheme{beaver} 
  \usefonttheme{serif}  
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
} 
\def\clusterA{\hfill\rlap{\hspace{0cm}\textcolor{blue}{$\bigstar$}}}
\def\clusterB{\hfill\rlap{\hspace{0cm}\textcolor{red}{$\bigstar$}}}
\def\clusterC{\hfill\rlap{\hspace{0cm}\textcolor{green}{$\bigstar$}}}

\begin{document}

\begin{frame}{DSM-5 Comorbidity Clusters}

  \begin{tabular}[b]{|r >{\raggedright}p{6.5cm} l|}
    \clusterA & Neurodevelopmental Disorders (ID, ADHD, ASD) &  \\ 
    \clusterA & Schizophrenia Spectrum/Psychotic Disorders (SZ) & I \\ 
    \clusterB & Bipolar Disorders (I, II) & I\\ 
    \clusterB & Depressive Disorders (MDD) & I\\ 
    \clusterB & Anxiety Disorders (GAD, Phobias, Panic) & I \\ 
    \clusterB & Obsessive-Compulsive Disorders (OCD) & I \\ 
    \clusterB & Trauma \& Stress-Related Disorders (PTSD) & I \\ 
              & Dissociative Disorders (DID) & I \\ 
              & Somatic Symptom Disorders & III
  \end{tabular}\hfill
% <- important to preven ending the paragraph
    \begin{tabular}[b]{|c c|} \hline 
      \multicolumn{2}{|c|}{Clusters} \\
      \hline
      \clusterA & A \\ 
      \clusterB & B \\ 
      \clusterC & C \\ 
      \hline 
    \end{tabular} 
\end{frame}

\end{document}

enter image description here

As a side note, amsmath, xcolor and graphicx are automatically loaded by beamer; subfigure is obsolete, use subfig instead.

1
  • Thanks so much, Gonzalo! I had no idea about the "b" alignment option. A simple, elegant solution! Jun 30 '15 at 15:56

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.