Resize Text and Images in Beamer presentations
August 11 2018170 words, ~1 min. read
emacs, org-mode, tex, beamer
Till recently, while preparing for beamer presentations in Emacs org-mode, I was using BEAMER_opt property value as shrink, when the size of the table/text and or figure/image exceeds the available width or height. I learnt that using shrink is not a recommended approach and while looking for better alternatives, I came across the \resizebox in graphicx package in LaTeX.
For example, to resize the generated SVG in the sample mentioned below to 50% and 80% of the available width and height accordingly, I had to surround the corresponding content (in this case, the source code block which generates SVG content using graphviz) with the LaTeX fragment using \resizebox.
#+LATEX: \resizebox{0.5\textwidth}{0.8\textheight} {
#+BEGIN_SRC dot :file test-dot.svg :cmdline -Kdot -Tsvg
graph g {
a -- b;
b -- c;
c -- a;
}
#+END SRC
#+LATEX: }
Note: Instead of providing both \textwidth and \textheight, we can specify only one and the other could be provided as an exclamation mark, !, to maintain aspect ratio. For more details, please refer the documentation.