5

I would like the tabular in the following slide to be placed "floating" in the upper right corner of the slide. How can I do it?

enter image description here

\documentclass{beamer}

\begin{document}             
\begin{frame}                                                            
  \begin{itemize}                                                        
    \item comment 1 regarding table                                      
    \item comment 2                                                                                                                               
    \item comment 3                                                      
    \item comment 3                                                      
    \item comment 3                                                      
    \item comment                                                        
    \item comment                                                        
    \item comment                                                        
    \item comment                                                        
    \item tabular should be floating in the upper right corner           
  \end{itemize}                                                          
\begin{tabular}{|c|c|}\hline                                             
0&0\\\hline                                                              
0&0\\\hline                                                              
1&1\\\hline                                                              
0&0\\\hline                                                              
0&1\\\hline                                                              
1&0\\\hline                                                              
\end{tabular}                                                            
\end{frame}                                                              
\end{document}  

4 Answers 4

4

Here is a way with tikz overlay:

\documentclass[fragile]{beamer}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\begin{document}             
\begin{frame}                                                            
  \begin{itemize}                                                        
    \item comment 1 regarding table                                      
    \item comment 2                                                                                                                               
    \item comment 3                                                      
    \item comment 3                                                      
    \item comment 3                                                      
    \item comment                                                        
    \item comment                                                        
    \item comment                                                        
    \item comment                                                        
    \item tabular should be floating in the upper right corner           
  \end{itemize}                                                     

\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north east] at ($(current page.north east)+(-1cm,-1.5cm)$){\begin{tabular}{|c|c|}\hline                                             
0&0\\\hline                                                              
0&0\\\hline                                                              
1&1\\\hline                                                              
0&0\\\hline                                                              
0&1\\\hline                                                              
1&0\\\hline                                                              
\end{tabular}};
\end{tikzpicture}
\end{frame}                                         
\end{document}  

enter image description here

3
  • I like this way because it's easier to control position.
    – Marc Kees
    Commented Aug 23, 2019 at 20:21
  • This also does not affect width of text in items.
    – Marc Kees
    Commented Aug 23, 2019 at 20:35
  • Happy TeXing @MarcKees...
    – koleygr
    Commented Aug 23, 2019 at 20:40
5

It is possible to create columns with the column environment.

screenshot

\documentclass[]{beamer}
\usetheme{Madrid}
%\usepackage{tikz}

\begin{document}
\begin{frame}  
\begin{columns}[T]
\begin{column}{10cm}
  \begin{itemize}                                                        
    \item comment 1 regarding table                                      
    \item comment 2                                                                                                                               
    \item comment 3                                                      
    \item comment 3                                                      
    \item comment 3                                                      
    \item comment                                                        
    \item comment                                                        
    \item comment                                                        
    \item comment                                                        
    \item tabular should be floating in the upper right corner           
  \end{itemize}  
\end{column}
\begin{column}{5cm}
\begin{tabular}{|c|c|}\hline                                             
0&0\\\hline                                                              
0&0\\\hline                                                              
1&1\\\hline                                                              
0&0\\\hline                                                              
0&1\\\hline                                                              
1&0\\\hline                                                              
\end{tabular} 
\end{column}
\end{columns}                                                          


\end{frame} 
\end{document}
1
  • 1
    Good solution. I like it very much! Commented Aug 23, 2019 at 20:26
5

How about using minipage environment and control the left/right column with respect to the \textwidth:

Output

\documentclass{beamer}
\begin{document}
\begin{frame}
  \begin{minipage}[t]{0.85\textwidth}% Left side
    \begin{itemize}
      \item comment 1 regarding table
      \item comment 2
      \item comment 3
      \item comment 3
      \item comment 3
      \item comment
      \item comment
      \item comment
      \item comment
      \item tabular should be floating in the upper right corner
    \end{itemize}
  \end{minipage}\begin{minipage}[t]{0.15\textwidth}\vspace{0pt}% Right side
    \begin{tabular}{|c|c|}\hline
      0&0\\\hline
      0&0\\\hline
      1&1\\\hline
      0&0\\\hline
      0&1\\\hline
      1&0\\\hline
    \end{tabular}
  \end{minipage}
\end{frame}
\end{document}
2
  • A very nice solution! No additional package necessary.
    – Sveinung
    Commented Aug 23, 2019 at 20:49
  • @sveinung Thank you! Commented Aug 24, 2019 at 21:30
3

Use the package textpos. You may use negative values if you want the tabular higher up and more to the right:

enter image description here

\documentclass{beamer}
\usepackage[overlay]{textpos}
\begin{document}             
\begin{frame}                                                            
  \begin{textblock*}{0.15\linewidth}(0.9\textwidth, 0.001\textheight)
\begin{tabular}{|c|c|}\hline                                             
0&0\\\hline                                                              
0&0\\\hline                                                              
1&1\\\hline                                                              
0&0\\\hline                                                              
0&1\\\hline                                                              
1&0\\\hline                                                              
\end{tabular}                                                            
  \end{textblock*}
  \begin{itemize}                                                        
    \item comment 1 regarding table                                      
    \item comment 2                                                                                                                               
    \item comment 3                                                      
    \item comment 3                                                      
    \item comment 3                                                      
    \item comment                                                        
    \item comment                                                        
    \item comment                                                        
    \item comment                                                        
    \item tabular should be floating in the upper right corner           
  \end{itemize}                                                          
\end{frame}                                                              
\end{document} 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .