@@ -23,6 +23,9 @@ $endif$
2323$if(aspectratio)$
2424 aspectratio=$aspectratio$,
2525$endif$
26+ $if(babel-lang)$
27+ $babel-lang$,
28+ $endif$
2629$endif$
2730$for(classoption)$
2831 $classoption$$sep$,
@@ -57,13 +60,13 @@ $if(section-titles)$
5760}
5861\setbeamertemplate{section page}{
5962 \centering
60- \begin{beamercolorbox}[sep=12pt,center]{part title}
63+ \begin{beamercolorbox}[sep=12pt,center]{section title}
6164 \usebeamerfont{section title}\insertsection\par
6265 \end{beamercolorbox}
6366}
6467\setbeamertemplate{subsection page}{
6568 \centering
66- \begin{beamercolorbox}[sep=8pt,center]{part title}
69+ \begin{beamercolorbox}[sep=8pt,center]{subsection title}
6770 \usebeamerfont{subsection title}\insertsubsection\par
6871 \end{beamercolorbox}
6972}
@@ -299,15 +302,17 @@ $endif$
299302$if(graphics)$
300303\usepackage{graphicx}
301304\makeatletter
302- \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
303- \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
304- \makeatother
305- % Scale images if necessary, so that they will not overflow the page
306- % margins by default, and it is still possible to overwrite the defaults
307- % using explicit options in \includegraphics[width, height, ...]{}
308- \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
305+ \newsavebox\pandoc@box
306+ \newcommand*\pandocbounded[1]{% scales image to fit in text height/width
307+ \sbox\pandoc@box{#1}%
308+ \Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
309+ \Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
310+ \ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
311+ \ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
312+ \else\usebox{\pandoc@box}%
313+ \fi%
314+ }
309315% Set default figure placement to htbp
310- \makeatletter
311316\def\fps@figure{htbp}
312317\makeatother
313318$endif$
@@ -440,13 +445,15 @@ $endfor$
440445% get rid of language-specific shorthands (see #6817):
441446\let\LanguageShortHands\languageshorthands
442447\def\languageshorthands#1{}
448+ $if(selnolig-langs)$
449+ \ifLuaTeX
450+ \usepackage[$for(selnolig-langs)$$it$$sep$,$endfor$]{selnolig} % disable illegal ligatures
451+ \fi
452+ $endif$
443453$endif$
444454$for(header-includes)$
445455$header-includes$
446456$endfor$
447- \ifLuaTeX
448- \usepackage{selnolig} % disable illegal ligatures
449- \fi
450457$if(dir)$
451458\ifPDFTeX
452459 \TeXXeTstate=1
@@ -534,7 +541,7 @@ $if(institute)$
534541\institute{$for(institute)$$institute$$sep$ \and $endfor$}
535542$endif$
536543$if(titlegraphic)$
537- \titlegraphic{\includegraphics{$titlegraphic$}}
544+ \titlegraphic{\includegraphics$if(titlegraphicoptions)$[$for(titlegraphicoptions)$$titlegraphicoptions$$sep$, $endfor$]$endif$ {$titlegraphic$}}
538545$endif$
539546$if(logo)$
540547\logo{\includegraphics{$logo$}}
@@ -571,7 +578,8 @@ $if(beamer)$
571578$if(toc-title)$
572579 \frametitle{$toc-title$}
573580$endif$
574- \tableofcontents[hideallsubsections]
581+ \setcounter{tocdepth}{$toc-depth$}
582+ \tableofcontents
575583\end{frame}
576584$else$
577585{
0 commit comments