1

I am trying to get the table below to the left and the bullets (below the table) to show up to the right of the table in Beamer. Can anyone show me how to do that?

\documentclass[10pt,t]{beamer}
%\documentclass[11pt,handout]{beamer}
\usetheme{JuanLesPins}
%\usecolortheme[RGB={215,215,215}]{structure}%Change RGB numbers to alter color
\usecolortheme{seahorse}
\setbeamertemplate{bibliography item}[text]

\usepackage[absolute,overlay]{textpos}%Used to place logo
\usepackage{tikz}
\usepackage{multirow}
\usepackage[style=mla,autocite=footnote,maxnames=2,babel=hyphen,abbreviate=false,backend=bibtex,mcite]{biblatex}
\usepackage{CJKutf8} % Chinese package
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usepackage{lipsum}
\setbeamertemplate{caption}[numbered]

\begin{document}
\begin{frame}{p-values for 100 and 1000 Random Variates}
\begin{table}[h]\small

\begin{tabular}{l|l|l|}
\cline{2-3}
\multirow{2}{*}{} & \multicolumn{2}{l|}{100 Replications} \\ \cline{2-3} 
 & \multicolumn{2}{l|}{Data Points} \\ \hline
\multicolumn{1}{|l|}{Case} & 100 & 1000 \\ \hline
\multicolumn{1}{|l|}{1} & 0.99 & 1.00 \\ \hline
\multicolumn{1}{|l|}{2} & 0.96 & 0.43 \\ \hline
\multicolumn{1}{|l|}{3} & 0.03 & 0.00 \\ \hline
\multicolumn{1}{|l|}{4} & 0.99 & 0.97 \\ \hline
\multicolumn{1}{|l|}{5} & 0.99 & UNK \\ \hline
\multicolumn{1}{|l|}{6} & 0.97 & 1.00 \\ \hline
\multicolumn{1}{|l|}{7} & 0.97 & 0.75 \\ \hline
\multicolumn{1}{|l|}{8} & 0.97 & 0.98 \\ \hline
\multicolumn{1}{|l|}{9} & 0.99 & 0.88 \\ \hline
\multicolumn{1}{|l|}{10} & 0.98 & 0.56 \\ \hline
\multicolumn{1}{|l|}{11} & 0.86 & UNK \\ \hline
\multicolumn{1}{|l|}{12} & 0.16 & 0.00 \\ \hline
\end{tabular}
\end{table}

\begin{itemize}
\item I want the table to the left
\item and these bullets to the right
\end{itemize}
\end{frame}


\end{document} 
  • 1
    Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Jun 1 '15 at 1:03
  • My apologies. I have added it – dsmalenb Jun 1 '15 at 1:08
  • A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – user31729 Jun 1 '15 at 1:11
3

First, always post complete code. In this case, it is crucial to know that your code requires multirow to compile. Here's a Minimal Working Example based on your code:

\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{table}[h]\small
\begin{tabular}{l|l|l|}
\cline{2-3}
\multirow{2}{*}{} & \multicolumn{2}{l|}{100 Replications} \\ \cline{2-3}
 & \multicolumn{2}{l|}{Data Points} \\ \hline
\multicolumn{1}{|l|}{Case} & 100 & 1000 \\ \hline
\multicolumn{1}{|l|}{1} & 0.99 & 1.00 \\ \hline
\multicolumn{1}{|l|}{2} & 0.96 & 0.43 \\ \hline
\multicolumn{1}{|l|}{3} & 0.03 & 0.00 \\ \hline
\multicolumn{1}{|l|}{4} & 0.99 & 0.97 \\ \hline
\multicolumn{1}{|l|}{5} & 0.99 & UNK \\ \hline
\multicolumn{1}{|l|}{6} & 0.97 & 1.00 \\ \hline
\multicolumn{1}{|l|}{7} & 0.97 & 0.75 \\ \hline
\multicolumn{1}{|l|}{8} & 0.97 & 0.98 \\ \hline
\multicolumn{1}{|l|}{9} & 0.99 & 0.88 \\ \hline
\multicolumn{1}{|l|}{10} & 0.98 & 0.56 \\ \hline
\multicolumn{1}{|l|}{11} & 0.86 & UNK \\ \hline
\multicolumn{1}{|l|}{12} & 0.16 & 0.00 \\ \hline
\end{tabular}
\end{table}

\begin{itemize}
\item I want the table to the left
\item and these bullets to the right
\end{itemize}
\end{document}

This demonstrates the problem you are asking about:

problem

A blank line in your source tells TeX to start a new paragraph. If you want the bullets to the right, then you do not want a paragraph break before them so do not leave a blank line.

A table, however, is a float. It is not part of the regular text at all. LaTeX will move it where it best fits where 'best' is based on an algorithm with which you may not always agree.

There are two possibilities:

  1. You wanted a float but you wanted the itemisation to be in the float not outside it.
  2. You didn't want a float at all.

(2) seems more likely, so I'll go with that. In that case, we don't want to use the table environment at all but we do want to contain the scope of the \small switch. So let's use curly brackets rather than the table environment:

  {\small
    \begin{tabular}{l|l|l|}
      \cline{2-3}
      \multirow{2}{*}{} & \multicolumn{2}{l|}{100 Replications} \\ \cline{2-3}
      & \multicolumn{2}{l|}{Data Points} \\ \hline
      \multicolumn{1}{|l|}{Case} & 100 & 1000 \\ \hline
      \multicolumn{1}{|l|}{1} & 0.99 & 1.00 \\ \hline
      \multicolumn{1}{|l|}{2} & 0.96 & 0.43 \\ \hline
      \multicolumn{1}{|l|}{3} & 0.03 & 0.00 \\ \hline
      \multicolumn{1}{|l|}{4} & 0.99 & 0.97 \\ \hline
      \multicolumn{1}{|l|}{5} & 0.99 & UNK \\ \hline
      \multicolumn{1}{|l|}{6} & 0.97 & 1.00 \\ \hline
      \multicolumn{1}{|l|}{7} & 0.97 & 0.75 \\ \hline
      \multicolumn{1}{|l|}{8} & 0.97 & 0.98 \\ \hline
      \multicolumn{1}{|l|}{9} & 0.99 & 0.88 \\ \hline
      \multicolumn{1}{|l|}{10} & 0.98 & 0.56 \\ \hline
      \multicolumn{1}{|l|}{11} & 0.86 & UNK \\ \hline
      \multicolumn{1}{|l|}{12} & 0.16 & 0.00 \\ \hline
    \end{tabular}
  }

The next problem is that the itemize environment always starts a new line all on its own. That is, it inserts some vertical space before and after the list. So we need, essentially, to make TeX see the itemisation as a single unit i.e. a box (everything is a box to TeX - it is essentially an elaborate programme for fitting boxes into other boxes). You could do this in various ways, but a minipage environment seems as good as any:

  \begin{minipage}{.5\textwidth}
    \begin{itemize}
      \item I want the table to the left
      \item and these bullets to the right
    \end{itemize}

This is starting to look better:

boxes

Of course, you might want the itemisation to take up more or less of the width of the page. If so, you can adjust the minipage accordingly.

There are various ways you might improve this. One would be to centre each of the table and the list relative to its own minipage. For example:

  \begin{minipage}{.5\textwidth}
    \small
    \centering
    \begin{tabular}{l|l|l|}
      \cline{2-3}
      \multirow{2}{*}{} & \multicolumn{2}{l|}{100 Replications} \\ \cline{2-3}
      & \multicolumn{2}{l|}{Data Points} \\ \hline
      \multicolumn{1}{|l|}{Case} & 100 & 1000 \\ \hline
      \multicolumn{1}{|l|}{1} & 0.99 & 1.00 \\ \hline
      \multicolumn{1}{|l|}{2} & 0.96 & 0.43 \\ \hline
      \multicolumn{1}{|l|}{3} & 0.03 & 0.00 \\ \hline
      \multicolumn{1}{|l|}{4} & 0.99 & 0.97 \\ \hline
      \multicolumn{1}{|l|}{5} & 0.99 & UNK \\ \hline
      \multicolumn{1}{|l|}{6} & 0.97 & 1.00 \\ \hline
      \multicolumn{1}{|l|}{7} & 0.97 & 0.75 \\ \hline
      \multicolumn{1}{|l|}{8} & 0.97 & 0.98 \\ \hline
      \multicolumn{1}{|l|}{9} & 0.99 & 0.88 \\ \hline
      \multicolumn{1}{|l|}{10} & 0.98 & 0.56 \\ \hline
      \multicolumn{1}{|l|}{11} & 0.86 & UNK \\ \hline
      \multicolumn{1}{|l|}{12} & 0.16 & 0.00 \\ \hline
    \end{tabular}
  \end{minipage}%
  \begin{minipage}{.5\textwidth}
    \centering
    \begin{itemize}
      \item I want the table to the left
      \item and these bullets to the right
    \end{itemize}
  \end{minipage}

centred within minipages

\documentclass{article}
\usepackage{multirow}
\begin{document}
  \begin{minipage}{.5\textwidth}
    \small
    \centering
    \begin{tabular}{l|l|l|}
      \cline{2-3}
      \multirow{2}{*}{} & \multicolumn{2}{l|}{100 Replications} \\ \cline{2-3}
      & \multicolumn{2}{l|}{Data Points} \\ \hline
      \multicolumn{1}{|l|}{Case} & 100 & 1000 \\ \hline
      \multicolumn{1}{|l|}{1} & 0.99 & 1.00 \\ \hline
      \multicolumn{1}{|l|}{2} & 0.96 & 0.43 \\ \hline
      \multicolumn{1}{|l|}{3} & 0.03 & 0.00 \\ \hline
      \multicolumn{1}{|l|}{4} & 0.99 & 0.97 \\ \hline
      \multicolumn{1}{|l|}{5} & 0.99 & UNK \\ \hline
      \multicolumn{1}{|l|}{6} & 0.97 & 1.00 \\ \hline
      \multicolumn{1}{|l|}{7} & 0.97 & 0.75 \\ \hline
      \multicolumn{1}{|l|}{8} & 0.97 & 0.98 \\ \hline
      \multicolumn{1}{|l|}{9} & 0.99 & 0.88 \\ \hline
      \multicolumn{1}{|l|}{10} & 0.98 & 0.56 \\ \hline
      \multicolumn{1}{|l|}{11} & 0.86 & UNK \\ \hline
      \multicolumn{1}{|l|}{12} & 0.16 & 0.00 \\ \hline
    \end{tabular}
  \end{minipage}%
  \begin{minipage}{.5\textwidth}
    \centering
    \begin{itemize}
      \item I want the table to the left
      \item and these bullets to the right
    \end{itemize}
  \end{minipage}
\end{document}

But I think you should also reconsider the formatting of your table. The documentation for booktabs is very good on this topic, if a little dogmatic at times. I was going to illustrate one way you might redo it but I realised that I don't understand the table well enough to do this. Is the middle column 'Data' and the right 'Points'? Or are '100' and '1000' different numbers of 'Data Points'? But then what does the '100 Replications' refer to?

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.