diff options
Diffstat (limited to 'default.beamer')
-rw-r--r-- | default.beamer | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/default.beamer b/default.beamer index b220a43b9..0806e362f 100644 --- a/default.beamer +++ b/default.beamer @@ -66,25 +66,16 @@ $if(url)$ \usepackage{url} $endif$ $if(graphics)$ -\usepackage{graphicx} -% Redefine \includegraphics so that, unless explicit options are -% given, the image width will not exceed the width of the page. -% Images get their normal width if they fit onto the page, but -% are scaled down if they would overflow the margins. +\usepackage{letltxmacro} \makeatletter -\def\ScaleIfNeeded{% - \ifdim\Gin@nat@width>\linewidth - \linewidth - \else - \Gin@nat@width - \fi -} +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} +\def\maxheight{\ifdim\Gin@nat@height>\textheight0.8\textheight\else\Gin@nat@height\fi} \makeatother -\let\Oldincludegraphics\includegraphics -{% - \catcode`\@=11\relax% - \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\ScaleIfNeeded]}}% -}% +\AtBeginDocument{ + \LetLtxMacro\Oldincludegraphics\includegraphics + \renewcommand{\includegraphics}[2][]{% + \Oldincludegraphics[#1,width=\maxwidth,height=\maxheight,keepaspectratio]{#2}} +} $endif$ % Comment these out if you don't want a slide with just the |