When I insert an image into the slide it gets cropped to fit into the slide. How do make an image to scale to fit in without cropping or padding?

To include an image I use:


org file header:

#+startup: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [bigger]
#+OPTIONS: toc:nil

and config file contains the following:

; allow for export=>beamer by placing

;; #+LaTeX_CLASS: beamer in org files
(unless (boundp 'org-export-latex-classes)
  (setq org-export-latex-classes nil))
(add-to-list 'org-export-latex-classes
  ;; beamer class, for presentations
      \\setbeameroption{show notes}

     ("\\section{%s}" . "\\section*{%s}")


  ;; letter class, for formal letters

  (add-to-list 'org-export-latex-classes


     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
     ("\\paragraph{%s}" . "\\paragraph*{%s}")
     ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))


after countless hours of research here is the solution. includegraphics accepts width parameter and by using textwidth variable we could set the correct size.

#+LaTeX:\includegraphics[width = 1.06\textwidth]{curves.jpg}
| improve this answer | |

Another option is to use

#+ATTR_LATEX: :width 1.06\textwidth

This is described here: https://orgmode.org/manual/Images-in-LaTeX-export.html

For specifying image ‘:width’, ‘:height’, and other ‘:options’, use this syntax:

#+ATTR_LATEX: :width 5cm :options angle=90
| improve this answer | |
  • Can you add a relevant quote from the documentation? Links might break over time, and it's expected to add a relevant quote to your answer. – user12563 Sep 3 '19 at 15:31
  • I think there is a typo in the first snippet. 10.6 times the text width is almost guaranteed to make the image not fit into the slide. Is it maybe 1.06? – logc Jul 4 at 6:13
  • Have you seen the size of my slides? :-) Seriously, though, you are right of course. In fact, the factor is in general probably going to be less that one. – loris Jul 6 at 8:08

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.