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

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

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

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}
  • A very nice solution! No additional package necessary. – Sveinung Aug 23 at 20:49
  • @sveinung Thank you! – M. Al Jumaily Aug 24 at 21:30
3

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}
2

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} 

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.