From 2ef7201046ce3e99ade2f2791ceabd36a100e33e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 30 Aug 2018 19:34:51 +0000 Subject: beamerswitch (30aug18) git-svn-id: svn://tug.org/texlive/trunk@48511 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/beamerswitch/beamerswitch.cls | 522 ++++++++++++++++----- 1 file changed, 415 insertions(+), 107 deletions(-) (limited to 'Master/texmf-dist/tex/latex/beamerswitch') diff --git a/Master/texmf-dist/tex/latex/beamerswitch/beamerswitch.cls b/Master/texmf-dist/tex/latex/beamerswitch/beamerswitch.cls index dbb4cd3030a..df711623170 100644 --- a/Master/texmf-dist/tex/latex/beamerswitch/beamerswitch.cls +++ b/Master/texmf-dist/tex/latex/beamerswitch/beamerswitch.cls @@ -15,7 +15,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{beamerswitch} - [2017/12/10 v1.3 Convenient mode selection in Beamer documents] + [2018/08/29 v1.4 Convenient mode selection in Beamer documents] \RequirePackage{xkeyval,xkvltxp,etoolbox,xstring,shellesc,iftex} \define@boolkey[DC]{beamerswitch}{beamer}[true]{% \ifbool{DC@beamerswitch@beamer}{% @@ -154,7 +154,111 @@ \def\beamer@insttitle#1{\textsuperscript{#1}} \def\beamer@instinst#1{\textsuperscript{#1}\ignorespaces} }{} +\def\beamerswitch@handoutpaper{a4paper} +\define@key[HL]{beamerswitch}{paper}{% + \def\beamerswitch@handoutpaper{#1}% +} +\newcounter{beamerswitch@nupcase} +\setcounter{beamerswitch@nupcase}{5} +\define@choicekey+[HL]{beamerswitch}{nup}[\val\nr]{2, 3, 3plus, 4, 4plus, 6, 8}{% + \setcounter{beamerswitch@nupcase}{\nr} +}{% + \ClassWarning{beamerswitch}{Value of `nup' not recognized. + Allowed values are 2, 3, 3plus, 4, 4plus, 6, and 8.}% +} \newcommand*{\beamerswitch@Border}{\relax} +\define@key[HL]{beamerswitch}{border}[0.4pt]{% + \RequirePackage{pgf}% + \ifdimcomp{#1}{>}{0pt}{% + \renewcommand*{\beamerswitch@Border}{\pgfsetlinewidth{#1}\pgfstroke}% + }{% + \renewcommand*{\beamerswitch@Border}{\relax}% + }% +} +\newlength{\beamerswitch@margin} +\setlength{\beamerswitch@margin}{5mm} +\define@key[HL]{beamerswitch}{margin}[0pt]{% + \setlength{\beamerswitch@margin}{#1}% +} +\define@boolkey[HL]{beamerswitch}{align}[true]{} +\newlength{\handoutpnobaseline} +\setlength{\handoutpnobaseline}{5mm} +\define@boolkey[HL]{beamerswitch}{pnos}[true]{} +\newlength{\beamerswitch@pnoadjust} +\newcommand*{\handoutlayout}[1]{% + \only{% + \setlength{\beamerswitch@pnoadjust}{1em}% + \setkeys[HL]{beamerswitch}{#1}% + \ifbool{HL@beamerswitch@pnos}{% + \def\pgfsys@endpicture{% + \raisebox{\the\handoutpnobaseline}[0pt][0pt]{% + \makebox[\pgfphysicalwidth]{% + \the\numexpr(\value{page} - 2 + (\beamerswitch@nup / 2))% + / \beamerswitch@nup\relax + }% + }\par + }% + \ifbool{HL@beamerswitch@align}{% + \ifcase\value{beamerswitch@nupcase}\relax + \addtolength{\beamerswitch@pnoadjust}{-0.333\beamerswitch@margin}% + \or + \addtolength{\beamerswitch@pnoadjust}{-0.5\beamerswitch@margin}% + \or + \addtolength{\beamerswitch@pnoadjust}{-0.5\beamerswitch@margin}% + \or + \addtolength{\beamerswitch@pnoadjust}{-0.333\beamerswitch@margin}% + \or + \addtolength{\beamerswitch@pnoadjust}{-0.6\beamerswitch@margin}% + \or + \addtolength{\beamerswitch@pnoadjust}{-0.5\beamerswitch@margin}% + \or + \addtolength{\beamerswitch@pnoadjust}{-0.6\beamerswitch@margin}% + \fi + }{}% + \ifdimcomp{\beamerswitch@margin}{<}% + {\handoutpnobaseline + \beamerswitch@pnoadjust}{% + \setlength{\beamerswitch@margin}% + {\the\dimexpr\handoutpnobaseline + \beamerswitch@pnoadjust\relax}% + }{}% + }{% + \def\pgfsys@endpicture{}% + }% + \ifcase\value{beamerswitch@nupcase}\relax + \def\beamerswitch@nup{2}% + \pgfpagesuselayout{1 by 2}[\beamerswitch@handoutpaper,% + border shrink=\the\beamerswitch@margin]% + \or + \def\beamerswitch@nup{3}% + \pgfpagesuselayout{1 by 3}[\beamerswitch@handoutpaper,% + border shrink=\the\beamerswitch@margin]% + \or + \def\beamerswitch@nup{3}% + \pgfpagesuselayout{1 by 3 narrow}[\beamerswitch@handoutpaper,% + border shrink=\the\beamerswitch@margin]% + \or + \def\beamerswitch@nup{4}% + \pgfpagesuselayout{2 by 2}[\beamerswitch@handoutpaper,% + landscape,border shrink=\the\beamerswitch@margin]% + \or + \def\beamerswitch@nup{4}% + \pgfpagesuselayout{1 by 4 narrow}[\beamerswitch@handoutpaper,% + border shrink=\the\beamerswitch@margin]% + \or + \def\beamerswitch@nup{6}% + \pgfpagesuselayout{2 by 3}[\beamerswitch@handoutpaper,% + border shrink=\the\beamerswitch@margin]% + \or + \def\beamerswitch@nup{8}% + \pgfpagesuselayout{2 by 4}[\beamerswitch@handoutpaper,% + border shrink=\the\beamerswitch@margin]% + \fi + }% +} +\AtEndPreamble{% + \ifdef{\beamerswitch@nup}{}{% + \handoutlayout{}% + }% +} \mode{% \pgfpagesdeclarelayout{1 by 2} { @@ -179,7 +283,11 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}{.5\pgfphysicalheight}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -187,7 +295,11 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=\pgfphysicalheight,% - center=\pgfpoint{.75\pgfphysicalwidth}{.5\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.75\pgfphysicalwidth - 0.333\beamerswitch@margin}{.5\pgfphysicalheight}% + }{% + \pgfpoint{.75\pgfphysicalwidth}{.5\pgfphysicalheight}% + }% }% \else % stack on top of one another @@ -197,7 +309,11 @@ border code=\beamerswitch@Border,% resized width=\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -205,7 +321,11 @@ border code=\beamerswitch@Border,% resized width=\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight + 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight}% + }% }% \fi } @@ -232,7 +352,11 @@ border code=\beamerswitch@Border,% resized width=.333\pgfphysicalwidth,% resized height=\pgfphysicalheight,% - center=\pgfpoint{.167\pgfphysicalwidth}{.5\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.167\pgfphysicalwidth + 0.5\beamerswitch@margin}{.5\pgfphysicalheight}% + }{% + \pgfpoint{.167\pgfphysicalwidth}{.5\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -248,7 +372,11 @@ border code=\beamerswitch@Border,% resized width=.333\pgfphysicalwidth,% resized height=\pgfphysicalheight,% - center=\pgfpoint{.833\pgfphysicalwidth}{.5\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.833\pgfphysicalwidth - 0.5\beamerswitch@margin}{.5\pgfphysicalheight}% + }{% + \pgfpoint{.833\pgfphysicalwidth}{.5\pgfphysicalheight}% + }% }% \else % stack on top of one another @@ -258,7 +386,11 @@ border code=\beamerswitch@Border,% resized width=\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% - center=\pgfpoint{.5\pgfphysicalwidth}{.833\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.5\pgfphysicalwidth}{.833\pgfphysicalheight - 0.5\beamerswitch@margin}% + }{% + \pgfpoint{.5\pgfphysicalwidth}{.833\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -274,7 +406,11 @@ border code=\beamerswitch@Border,% resized width=\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% - center=\pgfpoint{.5\pgfphysicalwidth}{.167\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.5\pgfphysicalwidth}{.167\pgfphysicalheight + 0.5\beamerswitch@margin}% + }{% + \pgfpoint{.5\pgfphysicalwidth}{.167\pgfphysicalheight}% + }% }% \fi } @@ -301,7 +437,12 @@ border code=\beamerswitch@Border,% resized width=.333\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.167\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.167\pgfphysicalwidth + 0.5\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.5\beamerswitch@margin}% + }{% + \pgfpoint{.167\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -309,7 +450,11 @@ border code=\beamerswitch@Border,% resized width=.333\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight - 0.5\beamerswitch@margin}% + }{% + \pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{3} {% @@ -317,7 +462,12 @@ border code=\beamerswitch@Border,% resized width=.333\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.833\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.833\pgfphysicalwidth - 0.5\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.5\beamerswitch@margin}% + }{% + \pgfpoint{.833\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \else % stack on top of one another @@ -327,7 +477,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.833\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.5\beamerswitch@margin}% + {.833\pgfphysicalheight - 0.5\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.833\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -335,7 +490,11 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.5\beamerswitch@margin}{.5\pgfphysicalheight}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{3} {% @@ -343,7 +502,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.167\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.5\beamerswitch@margin}% + {.167\pgfphysicalheight + 0.5\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.167\pgfphysicalheight}% + }% }% \fi } @@ -366,7 +530,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -374,7 +543,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.75\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.75\pgfphysicalwidth - 0.333\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.75\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{3} {% @@ -382,7 +556,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.25\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.25\pgfphysicalheight + 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.25\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{4} {% @@ -390,7 +569,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.75\pgfphysicalwidth}{.25\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.75\pgfphysicalwidth - 0.333\beamerswitch@margin}% + {.25\pgfphysicalheight + 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.75\pgfphysicalwidth}{.25\pgfphysicalheight}% + }% }% } \pgfpagesdeclarelayout{1 by 4 narrow} @@ -416,7 +600,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.125\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.125\pgfphysicalwidth + 0.6\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.125\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -424,7 +613,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.375\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.375\pgfphysicalwidth + 0.2\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.375\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{3} {% @@ -432,7 +626,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.625\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.625\pgfphysicalwidth - 0.2\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.625\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{4} {% @@ -440,7 +639,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.875\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.875\pgfphysicalwidth - 0.6\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.875\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \else % stack on top of one another @@ -450,7 +654,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.875\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.875\pgfphysicalheight - 0.6\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.875\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -458,7 +667,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.625\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.625\pgfphysicalheight - 0.2\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.625\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{3} {% @@ -466,7 +680,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25 \pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.375\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.375\pgfphysicalheight + 0.2\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.375\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{4} {% @@ -474,7 +693,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25 \pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.125\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.125\pgfphysicalheight + 0.6\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.125\pgfphysicalheight}% + }% }% \fi } @@ -501,7 +725,12 @@ border code=\beamerswitch@Border,% resized width=.333\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.167\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.167\pgfphysicalwidth + 0.5\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.167\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -509,7 +738,11 @@ border code=\beamerswitch@Border,% resized width=.333\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheigh - 0.333\beamerswitch@margint}% + }{% + \pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{3} {% @@ -517,7 +750,12 @@ border code=\beamerswitch@Border,% resized width=.333\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.833\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.833\pgfphysicalwidth - 0.5\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.833\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{4} {% @@ -525,7 +763,12 @@ border code=\beamerswitch@Border,% resized width=.333\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.167\pgfphysicalwidth}{.25\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.167\pgfphysicalwidth + 0.5\beamerswitch@margin}% + {.25\pgfphysicalheight + 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.167\pgfphysicalwidth}{.25\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{5} {% @@ -533,7 +776,11 @@ border code=\beamerswitch@Border,% resized width=.333\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight + 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{6} {% @@ -541,7 +788,12 @@ border code=\beamerswitch@Border,% resized width=.333\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.833\pgfphysicalwidth}{.25\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.833\pgfphysicalwidth - 0.5\beamerswitch@margin}% + {.25\pgfphysicalheight + 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.833\pgfphysicalwidth}{.25\pgfphysicalheight}% + }% }% \else % stack on top of one another @@ -550,7 +802,12 @@ border shrink=\pgfpageoptionborder,% resized width=.5\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.833\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.833\pgfphysicalheight - 0.5\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.833\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -558,7 +815,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% - center=\pgfpoint{.75\pgfphysicalwidth}{.833\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.75\pgfphysicalwidth - 0.333\beamerswitch@margin}% + {.833\pgfphysicalheight - 0.5\beamerswitch@margin}% + }{% + \pgfpoint{.75\pgfphysicalwidth}{.833\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{3} {% @@ -566,7 +828,11 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}{.5\pgfphysicalheight}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{4} {% @@ -574,7 +840,11 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% - center=\pgfpoint{.75\pgfphysicalwidth}{.5\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.75\pgfphysicalwidth - 0.333\beamerswitch@margin}{.5\pgfphysicalheight}% + }{% + \pgfpoint{.75\pgfphysicalwidth}{.5\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{5} {% @@ -582,7 +852,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.167\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.167\pgfphysicalheight + 0.5\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.167\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{6} {% @@ -590,7 +865,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% - center=\pgfpoint{.75\pgfphysicalwidth}{.167\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.75\pgfphysicalwidth - 0.333\beamerswitch@margin}% + {.167\pgfphysicalheight + 0.5\beamerswitch@margin}% + }{% + \pgfpoint{.75\pgfphysicalwidth}{.167\pgfphysicalheight}% + }% }% \fi } @@ -617,7 +897,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.125\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.125\pgfphysicalwidth + 0.6\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.125\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -625,7 +910,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.375\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.375\pgfphysicalwidth + 0.2\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.375\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{3} {% @@ -633,7 +923,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.625\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.625\pgfphysicalwidth - 0.2\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.625\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{4} {% @@ -641,7 +936,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.875\pgfphysicalwidth}{.75\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.875\pgfphysicalwidth - 0.6\beamerswitch@margin}% + {.75\pgfphysicalheight - 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.875\pgfphysicalwidth}{.75\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{5} {% @@ -649,7 +949,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.125\pgfphysicalwidth}{.25\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.125\pgfphysicalwidth + 0.6\beamerswitch@margin}% + {.25\pgfphysicalheight + 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.125\pgfphysicalwidth}{.25\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{6} {% @@ -657,7 +962,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.375\pgfphysicalwidth}{.25\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.375\pgfphysicalwidth + 0.2\beamerswitch@margin}% + {.25\pgfphysicalheight + 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.375\pgfphysicalwidth}{.25\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{7} {% @@ -665,7 +975,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.625\pgfphysicalwidth}{.25\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.625\pgfphysicalwidth - 0.2\beamerswitch@margin}% + {.25\pgfphysicalheight + 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.625\pgfphysicalwidth}{.25\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{8} {% @@ -673,7 +988,12 @@ border code=\beamerswitch@Border,% resized width=.25\pgfphysicalwidth,% resized height=.5\pgfphysicalheight,% - center=\pgfpoint{.875\pgfphysicalwidth}{.25\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.875\pgfphysicalwidth - 0.6\beamerswitch@margin}% + {.25\pgfphysicalheight + 0.333\beamerswitch@margin}% + }{% + \pgfpoint{.875\pgfphysicalwidth}{.25\pgfphysicalheight}% + }% }% \else % stack on top of one another @@ -683,7 +1003,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.875\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.875\pgfphysicalheight - 0.6\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.875\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{2} {% @@ -691,7 +1016,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% - center=\pgfpoint{.75\pgfphysicalwidth}{.875\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.75\pgfphysicalwidth - 0.333\beamerswitch@margin}% + {.875\pgfphysicalheight - 0.6\beamerswitch@margin}% + }{% + \pgfpoint{.75\pgfphysicalwidth}{.875\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{3} {% @@ -699,7 +1029,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.625\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.625\pgfphysicalheight - 0.2\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.625\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{4} {% @@ -707,7 +1042,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25\pgfphysicalheight,% - center=\pgfpoint{.75\pgfphysicalwidth}{.625\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.75\pgfphysicalwidth - 0.333\beamerswitch@margin}% + {.625\pgfphysicalheight - 0.2\beamerswitch@margin}% + }{% + \pgfpoint{.75\pgfphysicalwidth}{.625\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{5} {% @@ -715,7 +1055,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25 \pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.375\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.375\pgfphysicalheight + 0.2\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.375\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{6} {% @@ -723,7 +1068,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25 \pgfphysicalheight,% - center=\pgfpoint{.75\pgfphysicalwidth}{.375\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.75\pgfphysicalwidth - 0.333\beamerswitch@margin}% + {.375\pgfphysicalheight + 0.2\beamerswitch@margin}% + }{% + \pgfpoint{.75\pgfphysicalwidth}{.375\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{7} {% @@ -731,7 +1081,12 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25 \pgfphysicalheight,% - center=\pgfpoint{.25\pgfphysicalwidth}{.125\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.25\pgfphysicalwidth + 0.333\beamerswitch@margin}% + {.125\pgfphysicalheight + 0.6\beamerswitch@margin}% + }{% + \pgfpoint{.25\pgfphysicalwidth}{.125\pgfphysicalheight}% + }% }% \pgfpageslogicalpageoptions{8} {% @@ -739,63 +1094,16 @@ border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.25 \pgfphysicalheight,% - center=\pgfpoint{.75\pgfphysicalwidth}{.125\pgfphysicalheight}% + center=\ifbool{HL@beamerswitch@align}{% + \pgfpoint{.75\pgfphysicalwidth - 0.333\beamerswitch@margin}% + {.125\pgfphysicalheight + 0.6\beamerswitch@margin}% + }{% + \pgfpoint{.75\pgfphysicalwidth}{.125\pgfphysicalheight}% + }% }% \fi } } -\define@key[HL]{beamerswitch}{paper}{% - \def\beamerswitch@handoutpaper{#1}% -} -\newcounter{beamerswitch@nupcase} -\define@choicekey+[HL]{beamerswitch}{nup}[\val\nr]{2, 3, 3plus, 4, 4plus, 6, 8}{% - \setcounter{beamerswitch@nupcase}{\nr} -}{% - \ClassWarning{beamerswitch}{Value of `nup' not recognized. - Allowed values are 2, 3, 3plus, 4, 4plus, 6, and 8.}% -} -\define@key[HL]{beamerswitch}{border}[0.4pt]{% - \RequirePackage{pgf}% - \renewcommand*{\beamerswitch@Border}{\pgfsetlinewidth{#1}\pgfstroke}% -} -\define@boolkey[HL]{beamerswitch}{pnos}[true]{} -\newcommand*{\handoutlayout}[1]{% - \only{% - \setkeys[HL]{beamerswitch}{#1}% - \ifcase\value{beamerswitch@nupcase}\relax - \def\beamerswitch@nup{2} - \pgfpagesuselayout{1 by 2}[\beamerswitch@handoutpaper,border shrink=5mm]% - \or - \def\beamerswitch@nup{3} - \pgfpagesuselayout{1 by 3}[\beamerswitch@handoutpaper,border shrink=5mm]% - \or - \def\beamerswitch@nup{3} - \pgfpagesuselayout{1 by 3 narrow}[\beamerswitch@handoutpaper,border shrink=5mm]% - \or - \def\beamerswitch@nup{4} - \pgfpagesuselayout{2 by 2}[\beamerswitch@handoutpaper,landscape,border shrink=5mm]% - \or - \def\beamerswitch@nup{4} - \pgfpagesuselayout{1 by 4 narrow}[\beamerswitch@handoutpaper,border shrink=5mm]% - \or - \def\beamerswitch@nup{6} - \pgfpagesuselayout{2 by 3}[\beamerswitch@handoutpaper,border shrink=5mm]% - \or - \def\beamerswitch@nup{8} - \pgfpagesuselayout{2 by 4}[\beamerswitch@handoutpaper,border shrink=5mm]% - \fi - \ifbool{HL@beamerswitch@pnos}{% - \def\pgfsys@endpicture{% - \raisebox{5mm}[0pt][0pt]{% - \makebox[\pgfphysicalwidth]{% - \the\numexpr\value{page}/\beamerswitch@nup\relax - }% - }% - }% - }{}% - }% -} -\handoutlayout{paper=a4paper,nup=6} \define@boolkey[AL]{beamerswitch}{maketitle}[true]{} \newtoggle{titlepunct} \IfFileExists{xparse.sty}{\@tempswatrue}{\@tempswafalse} -- cgit v1.2.3