0

I am creating a beamer (latex) presentation, but I have some problems inserting images and tables,I have obtained this images and tables from R, with "savepdf" and "stargazer" respectively.

I need to insert a pdf image, which contains some plots, but what a I get is a slide with juts some part of the pdf image, I dont know how to do in order to have the entire image in the slide. This is my code:

\documentclass{beamer}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{hyperref,float}
\usepackage{array}
\usepackage{standalone}

\usetheme{CambridgeUS}

\begin{figure}[htbp]
\caption{Titulo del grafico}
\label{grafico_1}
\centering
\includegraphics[width=1\textwidth]{imagen_1.pdf}
\end{figure}

And the same problem happens with tables, I just get some part of it, and I dont know to have the entire table into the slide. This is my code:

\begin{table}[!htbp] \centering 
\caption{Estadísticos principales} 
\label{estadisticos} 
\begin{tabular}{@{\extracolsep{5pt}}lccccccc} 
\\[-1.8ex]\hline 
\hline \\[-1.8ex] 
Statistic & \multicolumn{1}{c}{Mean} & \multicolumn{1}{c}{St. Dev.} & 
\multicolumn{1}{c}{Min} & \multicolumn{1}{c}{Pctl(25)} & 
\multicolumn{1}{c}{Median} & \multicolumn{1}{c}{Pctl(75)} & 
\multicolumn{1}{c}{Max} \\ 
\hline \\[-1.8ex] 
1M & 1.560 & 1.914 & 0.103 & 0.238 & 0.400 & 2.877 & 5.866 \\ 
3M & 1.737 & 1.888 & 0.198 & 0.354 & 0.654 & 3.052 & 5.792 \\ 
6M & 1.917 & 1.813 & 0.281 & 0.561 & 0.938 & 3.290 & 5.692 \\ 
9M & 2.024 & 1.731 & 0.319 & 0.716 & 1.152 & 3.377 & 5.604 \\ 
12M & 2.134 & 1.660 & 0.455 & 0.918 & 1.279 & 3.556 & 5.614 \\ 
24M & 1.937 & 1.727 & 0.355 & 0.649 & 1.023 & 3.389 & 5.676 \\ 
36M & 2.176 & 1.631 & 0.430 & 0.962 & 1.369 & 3.704 & 5.663 \\ 
48M & 2.412 & 1.546 & 0.565 & 1.215 & 1.753 & 3.943 & 5.679 \\ 
60M & 2.627 & 1.470 & 0.753 & 1.502 & 1.971 & 4.098 & 5.697 \\ 
72M & 2.801 & 1.408 & 0.961 & 1.713 & 2.165 & 4.197 & 5.712 \\ 
84M & 2.978 & 1.351 & 1.066 & 1.890 & 2.455 & 4.279 & 5.727 \\ 
96M & 3.092 & 1.316 & 1.128 & 2.003 & 2.661 & 4.361 & 5.742 \\ 
108M & 3.209 & 1.283 & 1.190 & 2.122 & 2.848 & 4.445 & 5.756 \\ 
120M & 3.329 & 1.251 & 1.253 & 2.236 & 3.038 & 4.531 & 5.781 \\ 
\hline \\[-1.8ex] 
\end{tabular} 
\end{table} 

Thanks in advance!

  • 1
    Without having excess to your image, my best guess is that you need to make the image smaller, e.g. \includegraphics[width=0.5\textwidth]{imagen_1.pdf} or some other value – user36296 May 18 '18 at 9:36
  • 1
    And for the table, use a smaller font size. Try with something like \scriptsize – user36296 May 18 '18 at 9:37
  • 2
    If the above comments do not help, please make a compilable minimal working example (MWE) – user36296 May 18 '18 at 9:38
1

If your images don't fit on the slide, reduce their size by changing width=1\textwidth to something smaller. I don't have your images, so I can only guess.

To reduce the size of your tables, choose a smaller font size or reduze the amount of information you show on a single slide.

Some other comments:

  • you don't need \usepackage{graphicx} or \usepackage{hyperref} with beamer, as beamer already provied these functionalities
  • the float package does not make much sense in a documentclass without floats
  • floating specifier, such as [htbp], don't make sense in beamer
  • no need for \centering, beamer automatically centres figures and tables
  • I suggest to use the booktabs package to get a nicer spacing in your table
  • all these \multicolumn with span only a single column don't make much sense

\documentclass{beamer}

\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{array}
\usepackage{booktabs}

\usetheme{CambridgeUS}

\begin{document}

\begin{frame}
    \begin{figure}
        \caption{Titulo del grafico}
        \label{grafico_1}
        \includegraphics[width=.5\textwidth]{example-image}
    \end{figure}
\end{frame}


\begin{frame}
    \begin{table} 
        \caption{Estadísticos principales} 
        \label{estadisticos} 
        \small
        \begin{tabular}{lccccccc}
            \toprule
            Statistic & Mean & St. Dev. & Min & Pctl(25) & Median & Pctl(75) & Max \\ 
            \midrule 
            1M & 1.560 & 1.914 & 0.103 & 0.238 & 0.400 & 2.877 & 5.866 \\ 
            3M & 1.737 & 1.888 & 0.198 & 0.354 & 0.654 & 3.052 & 5.792 \\ 
            6M & 1.917 & 1.813 & 0.281 & 0.561 & 0.938 & 3.290 & 5.692 \\ 
            9M & 2.024 & 1.731 & 0.319 & 0.716 & 1.152 & 3.377 & 5.604 \\ 
            12M & 2.134 & 1.660 & 0.455 & 0.918 & 1.279 & 3.556 & 5.614 \\ 
            24M & 1.937 & 1.727 & 0.355 & 0.649 & 1.023 & 3.389 & 5.676 \\ 
            36M & 2.176 & 1.631 & 0.430 & 0.962 & 1.369 & 3.704 & 5.663 \\ 
            48M & 2.412 & 1.546 & 0.565 & 1.215 & 1.753 & 3.943 & 5.679 \\ 
            60M & 2.627 & 1.470 & 0.753 & 1.502 & 1.971 & 4.098 & 5.697 \\ 
            72M & 2.801 & 1.408 & 0.961 & 1.713 & 2.165 & 4.197 & 5.712 \\ 
            84M & 2.978 & 1.351 & 1.066 & 1.890 & 2.455 & 4.279 & 5.727 \\ 
            96M & 3.092 & 1.316 & 1.128 & 2.003 & 2.661 & 4.361 & 5.742 \\ 
            108M & 3.209 & 1.283 & 1.190 & 2.122 & 2.848 & 4.445 & 5.756 \\ 
            120M & 3.329 & 1.251 & 1.253 & 2.236 & 3.038 & 4.531 & 5.781 \\ 
            \bottomrule
        \end{tabular} 
    \end{table} 
\end{frame}

\end{document}
  • 1
    I don't know a boobtabs package :) – Troy May 18 '18 at 9:52

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.