texlive[41914] Master: beamerswitch

commits+karl at tug.org commits+karl at tug.org
Tue Aug 23 18:45:43 CEST 2016


Revision: 41914
          http://tug.org/svn/texlive?view=revision&revision=41914
Author:   karl
Date:     2016-08-23 18:45:43 +0200 (Tue, 23 Aug 2016)
Log Message:
-----------
beamerswitch

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/libexec/ctan2tds
    trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/beamerswitch/
    trunk/Master/texmf-dist/doc/latex/beamerswitch/Makefile
    trunk/Master/texmf-dist/doc/latex/beamerswitch/README.md
    trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-article.pdf
    trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-handout.pdf
    trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-trans.pdf
    trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example.pdf
    trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example.tex
    trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch.pdf
    trunk/Master/texmf-dist/source/latex/beamerswitch/
    trunk/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.dtx
    trunk/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.ins
    trunk/Master/texmf-dist/tex/latex/beamerswitch/
    trunk/Master/texmf-dist/tex/latex/beamerswitch/beamerswitch.cls
    trunk/Master/tlpkg/tlpsrc/beamerswitch.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/beamerswitch/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/latex/beamerswitch/Makefile	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/beamerswitch/Makefile	2016-08-23 16:45:43 UTC (rev 41914)
@@ -0,0 +1,50 @@
+NAME  = beamerswitch
+SHELL = bash
+PWD   = $(shell pwd)
+TEMP := $(shell mktemp -d -t tmp.XXXXXXXXXX)
+TDIR  = $(TEMP)/$(NAME)
+VERS  = $(shell ltxfileinfo -v $(NAME).dtx)
+LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL)
+UTREE = $(shell kpsewhich --var-value TEXMFHOME)
+
+.PHONY: clean distclean inst install uninst uninstall zip ctan
+
+all:	$(NAME).pdf $(NAME)-example.pdf clean
+	@exit 0
+$(NAME).cls $(NAME)-example.tex: $(NAME).dtx
+	lualatex -synctex=1 -shell-escape -interaction=batchmode $(NAME).dtx >/dev/null
+$(NAME).pdf: $(NAME).dtx
+	latexmk -silent -lualatex -synctex=1 -shell-escape -interaction=batchmode $(NAME).dtx >/dev/null
+$(NAME)-example.pdf $(NAME)-example-trans.pdf $(NAME)-example-handout.pdf $(NAME)-example-article.pdf: $(NAME).cls $(NAME)-example.tex
+	latexmk -silent -lualatex -synctex=1 -shell-escape -interaction=batchmode $(NAME)-example.tex >/dev/null
+clean:
+	rm -f $(NAME){,-example,-example-article,-example-handout,-example-trans}.{aux,bbl,bcf,blg,doc,fdb_latexmk,fls,glo,gls,hd,idx,ilg,ind,listing,log,nav,out,run.xml,snm,synctex.gz,tcbtemp,toc,vrb}
+	rm -rf _minted-$(NAME)
+distclean: clean
+	rm -f $(NAME).{pdf,ins,cls} $(NAME)-example.{tex,pdf} $(NAME)-example-{article,handout,trans}.pdf
+inst: all
+	mkdir -p $(UTREE)/{tex,source,doc}/latex/$(NAME)
+	cp $(NAME).dtx $(NAME).ins $(UTREE)/source/latex/$(NAME)
+	cp $(NAME).cls $(UTREE)/tex/latex/$(NAME)
+	cp $(NAME).pdf $(NAME)-example.{tex,pdf} $(NAME)-example-trans.pdf $(NAME)-example-handout.pdf $(NAME)-example-article.pdf README.md $(UTREE)/doc/latex/$(NAME)
+	mktexlsr
+uninst:
+	rm -r $(UTREE)/{tex,source,doc}/latex/$(NAME)
+	mktexlsr
+install: all
+	sudo mkdir -p $(LOCAL)/{tex,source,doc}/latex/$(NAME)
+	sudo cp $(NAME).dtx $(NAME).ins $(LOCAL)/source/latex/$(NAME)
+	sudo cp $(NAME).cls $(LOCAL)/tex/latex/$(NAME)
+	sudo cp $(NAME).pdf $(NAME)-example.pdf $(NAME)-example-trans.pdf $(NAME)-example-handout.pdf $(NAME)-example-article.pdf README.md $(LOCAL)/doc/latex/$(NAME)
+	mktexlsr
+uninstall:
+	sudo rm -r $(LOCAL)/{tex,source,doc}/latex/$(NAME)
+	mktexlsr
+zip: all
+	mkdir $(TDIR)
+	cp $(NAME).{pdf,dtx} $(NAME)-example.{tex,pdf} $(NAME)-example-trans.pdf $(NAME)-example-handout.pdf $(NAME)-example-article.pdf $(NAME).cls README.md Makefile $(TDIR)
+	cd $(TEMP); zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)
+ctan: all
+	mkdir $(TDIR)
+	cp $(NAME).{pdf,dtx} $(NAME)-example.pdf $(NAME)-example-trans.pdf $(NAME)-example-handout.pdf $(NAME)-example-article.pdf README.md Makefile $(TDIR)
+	cd $(TEMP); zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)


Property changes on: trunk/Master/texmf-dist/doc/latex/beamerswitch/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/beamerswitch/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/beamerswitch/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/beamerswitch/README.md	2016-08-23 16:45:43 UTC (rev 41914)
@@ -0,0 +1,82 @@
+# beamerswitch: Convenient mode selection in Beamer documents
+
+This class is a wrapper around the `beamer` class to make it easier to use the
+same document to generate the different forms of the presentation: the slides
+themselves, an abbreviated slide set for transparencies or online reference,
+an n-up handout version, and a transcript or set of notes using the `article`
+class.
+
+## Installation
+
+### Dependencies
+
+To compile the documentation you will need to have the `minted` package working,
+which in turn relies on Python 2.6+ and Pygments. See the documentation of that
+package for details.
+
+There is an example file that demonstrates the features of the class.
+The class itself depends only on packages easily available through TeX
+distributions and CTAN. One feature relies on `latexmk` though you can work
+around that if you have the patience.
+
+Note that the zip file on the [Releases] page on GitHub contains all the files
+you need, pre-compiled.
+
+[Releases]: https://github.com/alex-ball/beamerswitch/releases
+
+### Automated way
+
+A makefile is provided which you can use with the Make utility:
+
+  * Running `make` generates the class file and documentation.
+  * Running `make inst` installs the files to your home TeX tree.
+  * Running `make install` installs the files to the local TeX tree.
+  * Running `make uninst` uninstalls the files to your home TeX tree.
+  * Running `make uninstall` uninstalls the files to the local TeX tree.
+
+### Manual way
+
+To install the class from scratch, follow these instructions. If you have
+downloaded the zip file from the [Releases] page on GitHub, you can skip the
+first two steps.
+
+ 1. Process `beamerswitch.dtx` with your favourite version of LaTeX with shell
+    escape enabled (as required by `minted` for typesetting the listings). You
+    will also need to run it through `makeindex`. This will generate the class
+    file and the main documentation (DVI or PDF), plus an example file
+    `beamerswitch-example.tex`.
+
+ 2. Process `beamerswitch-example.tex` with your favourite version of LaTeX. If
+    you enable shell escape and have `latexmk` installed you will end up with
+    another four documents (DVI or PDF). Otherwise you will get one.
+
+ 3. To install the files, create the following folders in your chosen TeX tree
+    and copy the files across as shown (read `.pdf` as `.dvi` if that is what
+    you generated):
+
+     * `source/latex/beamerswitch`:
+       `beamerswitch.dtx`,
+       (`beamerswitch.ins`)
+     * `tex/latex/beamerswitch`:
+       `beamerswitch.cls`
+     * `doc/latex/beamerswitch`:
+       `beamerswitch.pdf`,
+       `beamerswitch-example.tex`,
+       `beamerswitch-example.pdf`,
+       `beamerswitch-example-article.pdf`,
+       `beamerswitch-example-handout.pdf`,
+       `beamerswitch-example-trans.pdf`
+
+## Licence
+
+Copyright 2016 Alex Ball.
+
+This work consists of the file beamerswitch.dtx and a Makefile.
+
+This work may be distributed and/or modified under the conditions of the
+[LaTeX Project Public License (LPPL)](http://www.latex-project.org/lppl.txt),
+either version 1.3c of this license or (at your option) any later version.
+
+This work is "maintained" (as per LPPL maintenance status) by
+[Alex Ball](http://alexball.me.uk/).
+


Property changes on: trunk/Master/texmf-dist/doc/latex/beamerswitch/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-article.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-article.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-article.pdf	2016-08-23 16:29:25 UTC (rev 41913)
+++ trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-article.pdf	2016-08-23 16:45:43 UTC (rev 41914)

Property changes on: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-article.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-handout.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-handout.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-handout.pdf	2016-08-23 16:29:25 UTC (rev 41913)
+++ trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-handout.pdf	2016-08-23 16:45:43 UTC (rev 41914)

Property changes on: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-handout.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-trans.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-trans.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-trans.pdf	2016-08-23 16:29:25 UTC (rev 41913)
+++ trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-trans.pdf	2016-08-23 16:45:43 UTC (rev 41914)

Property changes on: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example-trans.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example.pdf	2016-08-23 16:29:25 UTC (rev 41913)
+++ trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example.pdf	2016-08-23 16:45:43 UTC (rev 41914)

Property changes on: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example.tex	2016-08-23 16:45:43 UTC (rev 41914)
@@ -0,0 +1,82 @@
+%%
+%% This is file `beamerswitch-example.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% beamerswitch.dtx  (with options: `example')
+%% ----------------------------------------------------------------
+%% beamerswitch --- Convenient mode selection in Beamer documents
+%% Author:  Alex Ball
+%% E-mail:  a.j.ball at bath.ac.uk
+%% License: Released under the LaTeX Project Public License v1.3c or later
+%% See:     http://www.latex-project.org/lppl.txt
+%% ----------------------------------------------------------------
+%% 
+\PassOptionsToClass{a4paper,12pt}{article}
+\PassOptionsToClass{14pt}{beamer}
+\documentclass[also={trans,handout,article}]{beamerswitch}
+\handoutlayout{nup=3plus,border=1pt}
+\articlelayout{maketitle,frametitles=none}
+\usepackage[british]{babel}
+\mode<article>{
+  \usepackage[hmargin=3cm,vmargin=2.5cm]{geometry}
+}
+\mode<presentation>{
+  \usefonttheme{professionalfonts}
+}
+\mode<handout>{
+  \usecolortheme{dove}
+}
+\usepackage{libertine}
+
+\title{A demonstration of the \textsf{beamerswitch} class}
+\subtitle{Testing features}
+\author{Alex Ball}
+\institute{University of Life}
+\date{1 September 2016}
+\subject{A LaTeX class}
+\keywords{CTAN, literate programming}
+
+\begin{document}
+  \begin{frame}
+    \maketitle
+  \end{frame}
+
+  This very brief demonstration shows how to use the \textsf{beamerswitch} class.
+  It allows easy switching between four \textsf{beamer} modes:
+
+  \begin{frame}{Beamer modes}
+    \begin{itemize}[<+->]
+      \item \textbf{beamer:} regular slides
+      \item \textbf{trans:} slides suitable for printing on transparencies
+      \item \textbf{handout:} slides suitable for printing on paper
+      \item \textbf{article:} transcript, paper, notes or other article-style
+        document based on the slides
+    \end{itemize}
+  \end{frame}
+
+  Notice how the text outside frames is only shown in article mode. Also,
+
+  \begin{frame}{Features shown in this example}
+    \begin{itemize}[<+->]
+      \item Different class options are passed to the \textsf{beamer} and
+        \textsf{article} classes.
+      \item The `trans' and `handout' versions do not have the intermediate
+        slides used by the `beamer' version for uncovering content.
+      \item The handout has three slides to a page with room for handwritten
+        notes at the side, and is in black and white.
+    \end{itemize}
+
+    \uncover<+->{See the source code of this example to see how it was done.}
+  \end{frame}
+
+  This PDF also has title and author information saved in the metadata (look
+  at the properties in your PDF viewer).
+
+  Happy {\LaTeX}ing!
+\end{document}
+%% 
+%% Copyright (C) 2016 by Alex Ball <a.j.ball at bath.ac.uk>
+%%
+%% End of file `beamerswitch-example.tex'.


Property changes on: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch-example.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch.pdf	2016-08-23 16:29:25 UTC (rev 41913)
+++ trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch.pdf	2016-08-23 16:45:43 UTC (rev 41914)

Property changes on: trunk/Master/texmf-dist/doc/latex/beamerswitch/beamerswitch.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.dtx	2016-08-23 16:45:43 UTC (rev 41914)
@@ -0,0 +1,2318 @@
+% \iffalse meta-comment
+%<*internal>
+\iffalse
+%</internal>
+%<*readme>
+# beamerswitch: Convenient mode selection in Beamer documents
+
+This class is a wrapper around the `beamer` class to make it easier to use the
+same document to generate the different forms of the presentation: the slides
+themselves, an abbreviated slide set for transparencies or online reference,
+an n-up handout version, and a transcript or set of notes using the `article`
+class.
+
+## Installation
+
+### Dependencies
+
+To compile the documentation you will need to have the `minted` package working,
+which in turn relies on Python 2.6+ and Pygments. See the documentation of that
+package for details.
+
+There is an example file that demonstrates the features of the class.
+The class itself depends only on packages easily available through TeX
+distributions and CTAN. One feature relies on `latexmk` though you can work
+around that if you have the patience.
+
+Note that the zip file on the [Releases] page on GitHub contains all the files
+you need, pre-compiled.
+
+[Releases]: https://github.com/alex-ball/beamerswitch/releases
+
+### Automated way
+
+A makefile is provided which you can use with the Make utility:
+
+  * Running `make` generates the class file and documentation.
+  * Running `make inst` installs the files to your home TeX tree.
+  * Running `make install` installs the files to the local TeX tree.
+  * Running `make uninst` uninstalls the files to your home TeX tree.
+  * Running `make uninstall` uninstalls the files to the local TeX tree.
+
+### Manual way
+
+To install the class from scratch, follow these instructions. If you have
+downloaded the zip file from the [Releases] page on GitHub, you can skip the
+first two steps.
+
+ 1. Process `beamerswitch.dtx` with your favourite version of LaTeX with shell
+    escape enabled (as required by `minted` for typesetting the listings). You
+    will also need to run it through `makeindex`. This will generate the class
+    file and the main documentation (DVI or PDF), plus an example file
+    `beamerswitch-example.tex`.
+
+ 2. Process `beamerswitch-example.tex` with your favourite version of LaTeX. If
+    you enable shell escape and have `latexmk` installed you will end up with
+    another four documents (DVI or PDF). Otherwise you will get one.
+
+ 3. To install the files, create the following folders in your chosen TeX tree
+    and copy the files across as shown (read `.pdf` as `.dvi` if that is what
+    you generated):
+
+     * `source/latex/beamerswitch`:
+       `beamerswitch.dtx`,
+       (`beamerswitch.ins`)
+     * `tex/latex/beamerswitch`:
+       `beamerswitch.cls`
+     * `doc/latex/beamerswitch`:
+       `beamerswitch.pdf`,
+       `beamerswitch-example.tex`,
+       `beamerswitch-example.pdf`,
+       `beamerswitch-example-article.pdf`,
+       `beamerswitch-example-handout.pdf`,
+       `beamerswitch-example-trans.pdf`
+
+## Licence
+
+Copyright 2016 Alex Ball.
+
+This work consists of the file beamerswitch.dtx and a Makefile.
+
+This work may be distributed and/or modified under the conditions of the
+[LaTeX Project Public License (LPPL)](http://www.latex-project.org/lppl.txt),
+either version 1.3c of this license or (at your option) any later version.
+
+This work is "maintained" (as per LPPL maintenance status) by
+[Alex Ball](http://alexball.me.uk/).
+
+%</readme>
+%<*example>
+\PassOptionsToClass{a4paper,12pt}{article}
+\PassOptionsToClass{14pt}{beamer}
+\documentclass[also={trans,handout,article}]{beamerswitch}
+\handoutlayout{nup=3plus,border=1pt}
+\articlelayout{maketitle,frametitles=none}
+\usepackage[british]{babel}
+\mode<article>{
+  \usepackage[hmargin=3cm,vmargin=2.5cm]{geometry}
+}
+\mode<presentation>{
+  \usefonttheme{professionalfonts}
+}
+\mode<handout>{
+  \usecolortheme{dove}
+}
+\usepackage{libertine}
+
+\title{A demonstration of the \textsf{beamerswitch} class}
+\subtitle{Testing features}
+\author{Alex Ball}
+\institute{University of Life}
+\date{1 September 2016}
+\subject{A LaTeX class}
+\keywords{CTAN, literate programming}
+
+\begin{document}
+  \begin{frame}
+    \maketitle
+  \end{frame}
+  
+  This very brief demonstration shows how to use the \textsf{beamerswitch} class.
+  It allows easy switching between four \textsf{beamer} modes:
+  
+  \begin{frame}{Beamer modes}
+    \begin{itemize}[<+->]
+      \item \textbf{beamer:} regular slides
+      \item \textbf{trans:} slides suitable for printing on transparencies
+      \item \textbf{handout:} slides suitable for printing on paper
+      \item \textbf{article:} transcript, paper, notes or other article-style
+        document based on the slides
+    \end{itemize}
+  \end{frame}
+  
+  Notice how the text outside frames is only shown in article mode. Also,
+  
+  \begin{frame}{Features shown in this example}
+    \begin{itemize}[<+->]
+      \item Different class options are passed to the \textsf{beamer} and
+        \textsf{article} classes.
+      \item The `trans' and `handout' versions do not have the intermediate
+        slides used by the `beamer' version for uncovering content.
+      \item The handout has three slides to a page with room for handwritten
+        notes at the side, and is in black and white.
+    \end{itemize}
+    
+    \uncover<+->{See the source code of this example to see how it was done.}
+  \end{frame}
+  
+  This PDF also has title and author information saved in the metadata (look
+  at the properties in your PDF viewer).
+  
+  Happy {\LaTeX}ing!
+\end{document}
+%</example>
+%<*internal>
+\fi
+\def\nameofplainTeX{plain}
+\ifx\fmtname\nameofplainTeX\else
+  \expandafter\begingroup
+\fi
+%</internal>
+%<*install>
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+\preamble
+----------------------------------------------------------------
+beamerswitch --- Convenient mode selection in Beamer documents
+Author:  Alex Ball
+E-mail:  a.j.ball at bath.ac.uk
+License: Released under the LaTeX Project Public License v1.3c or later
+See:     http://www.latex-project.org/lppl.txt
+----------------------------------------------------------------
+
+\endpreamble
+\postamble
+
+Copyright (C) 2016 by Alex Ball <a.j.ball at bath.ac.uk>
+\endpostamble
+
+\usedir{tex/latex/\jobname}
+\generate{
+  \file{\jobname.cls}{\from{\jobname.dtx}{class}}
+}
+\usedir{doc/latex/\jobname}
+\generate{
+  \file{\jobname-example.tex}{\from{\jobname.dtx}{example}}
+}
+%</install>
+%<install>\endbatchfile
+%<*internal>
+\usedir{source/latex/\jobname}
+\generate{
+  \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+}
+\nopreamble\nopostamble
+\usedir{doc/latex/\jobname}
+\generate{
+  \file{README.md}{\from{\jobname.dtx}{readme}}
+}
+\ifx\fmtname\nameofplainTeX
+  \expandafter\endbatchfile
+\else
+  \expandafter\endgroup
+\fi
+%</internal>
+%<*driver>
+\ProvidesFile{beamerswitch.dtx}
+%</driver>
+%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<class>\ProvidesClass{beamerswitch}
+%<*class>
+    [2016/08/19 v1.1 Convenient mode selection in Beamer documents]
+%</class>
+%<*driver>
+\documentclass[12pt]{article}
+% Page Layout
+\usepackage[a4paper,hmargin=30mm,vmargin=25mm,nohead]{geometry}
+% Typography
+\usepackage[charter,expert]{mathdesign}
+\makeatletter
+\def\hrulefill{\leavevmode\leaders \hrule height \rulethickness \hfill\kern\z@}
+\makeatother
+\usepackage{iftex}
+\ifPDFTeX
+  \usepackage[utf8]{inputenc}
+  \usepackage[T1]{fontenc}
+  \usepackage[scaled=0.96,sups]{XCharter}
+  \usepackage[scaled=0.95,tabular]{sourcesanspro}
+  \usepackage[varl,varqu]{zi4}
+\else
+  \usepackage{fontspec}
+  \setmainfont
+    [Scale=0.96
+    ,Ligatures=TeX
+    ]%
+    {XCharter}
+  \setsansfont
+    [Scale=MatchLowercase
+    ,Ligatures=TeX
+    ,StylisticSet=4
+    ,BoldFont={Source Sans Pro Bold}
+    ,ItalicFont={Source Sans Pro Italic}
+    ,BoldItalicFont={Source Sans Pro Bold Italic}
+    ]%
+    {Source Sans Pro}
+  \setmonofont
+    [Scale=MatchLowercase
+    ,RawFeature={extend=0.83}
+    ,BoldFont={Source Code Pro Bold}
+    ,BoldItalicFont={Source Code Pro Bold}
+    ,AutoFakeSlant=0.2
+    ,ItalicFeatures={StylisticSet=2,StylisticSet=3}
+    ,BoldItalicFeatures={FakeSlant=0.2,StylisticSet=2,StylisticSet=3}
+    ]%
+    {Source Code Pro}
+\fi
+% Improving the look of the documentation
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{6pt plus 2pt minus 1pt}
+\usepackage{multicol}
+\usepackage{enumitem}
+\setlist[itemize]{%
+  topsep={6pt plus 2pt minus 1pt},%
+  partopsep={0pt plus 0.05em},%
+  itemsep={0.2em plus 0.05em minus 0.05em},%
+  parsep={0pt plus 0.05em},%
+}
+\usepackage[bookmarks,raiselinks,pageanchor,hyperindex,colorlinks]{hyperref}
+\usepackage{etoolbox}
+\usepackage{tcolorbox,doc}
+\makeatletter
+\renewenvironment{theglossary}{%
+  \bgroup
+    \glossary at prologue
+    \GlossaryParms \let\item\@idxitem \ignorespaces
+}{%
+  \egroup
+}
+\makeatother
+\tcbuselibrary{documentation,breakable,minted}
+\colorlet{Option}{violet}
+\colorlet{Command}{red!75!black}
+\colorlet{Environment}{blue!75!black}
+\colorlet{Value}{olive!75!black}
+\colorlet{Color}{cyan!75!black}
+\tcbset
+  { listing engine=minted
+  , minted options=
+    { breaklines
+    , fontsize=\footnotesize
+    , linenos
+    , numbersep=20pt
+    , firstnumber=last
+    }
+  , index format=pgf
+  , color command=Command
+  , color environment=Environment
+  , color key=Option
+  , color value=Value
+  , color color=Color
+  }
+\renewcommand{\theFancyVerbLine}{\footnotesize\itshape\color{gray}\arabic{FancyVerbLine}}
+\let\tcbcs=\cs
+\renewcommand*{\cs}[1]{\textcolor{Command}{\tcbcs{#1}}}
+\def\sqbrackets#1{%
+  \texttt{\textcolor{Option}{[}#1\textcolor{Option}{]}}}
+\def\brackets#1{%
+  \texttt{\textcolor{Environment}{\char`\{}#1\textcolor{Environment}{\char`\}}}}
+\def\marg#1{%
+  \textcolor{Environment}{\ttfamily\char`\{}\meta{#1}\textcolor{Environment}{\ttfamily\char`\}}}
+\newcommand*{\env}[1]{\textcolor{Environment}{\ttfamily #1}}
+\newcommand*{\key}[1]{\textcolor{Option}{\ttfamily #1}}
+\newcommand*{\val}[1]{\textcolor{Value}{\ttfamily #1}}
+\renewenvironment{macro}[1]{%
+  \def\MyName{#1}%
+  \index{\MyName@\tcbIndexPrintComC {\MyName}|(emph}%
+}{%
+  \ifdef{\MyName}{}{%
+    \errmessage{You have closed a macro environment you have not opened on \the\inputlineno.}%
+  }
+  \index{\MyName@\tcbIndexPrintComC {\MyName}|)}%
+}
+\renewenvironment{environment}[1]{%
+  \def\MyName{#1}%
+  \index{\MyName@\tcbIndexPrintEnvCA {\MyName}|(emph}%
+  \index{Environments!\MyName@\tcbIndexPrintEnvC {\MyName}|(emph}%
+}{%
+  \ifdef{\MyName}{}{%
+    \errmessage{You have closed an environment environment you have not opened on \the\inputlineno.}%
+  }
+  \index{Environments!\MyName@\tcbIndexPrintEnvC {\MyName}|)}%
+  \index{\MyName@\tcbIndexPrintEnvCA {\MyName}|)}%
+}
+\newenvironment{optionkey}[1]{%
+  \def\MyName{#1}%
+  \index{\MyName@\tcbIndexPrintKeyCA {\MyName}|(emph}%
+  \index{Keys!\MyName@\tcbIndexPrintKeyC {\MyName}|(emph}%
+}{%
+  \ifdef{\MyName}{}{%
+    \errmessage{You have closed an optionkey environment you have not opened on \the\inputlineno.}%
+  }
+  \index{Keys!\MyName@\tcbIndexPrintKeyC {\MyName}|)}%
+  \index{\MyName@\tcbIndexPrintKeyCA {\MyName}|)}%
+}
+\newenvironment{optionvalue}[1]{%
+  \def\MyName{#1}%
+  \index{\MyName@\tcbIndexPrintValCA {\MyName}|(emph}%
+  \index{Values!\MyName@\tcbIndexPrintValC {\MyName}|(emph}%
+}{%
+  \ifdef{\MyName}{}{%
+    \errmessage{You have closed an optionvalue environment you have not opened on \the\inputlineno.}%
+  }
+  \index{Values!\MyName@\tcbIndexPrintValC {\MyName}|)}%
+  \index{\MyName@\tcbIndexPrintValCA {\MyName}|)}%
+}
+\makeatletter
+\newcommand{\resetmintedformat}{%
+  % Comments
+  \expandafter\def\csname PYGdefault at tok@c\endcsname{\let\PYGdefault at it=\textit\def\PYGdefault at tc####1{\textcolor{gray}{####1}}}
+  % Command sequences
+  \expandafter\def\csname PYGdefault at tok@k\endcsname{\def\PYGdefault at tc####1{\textcolor{Command}{####1}}}
+  % Optional arguments
+  \expandafter\def\csname PYGdefault at tok@na\endcsname{\def\PYGdefault at tc####1{\textcolor{Option}{####1}}}
+  % Braces
+  \expandafter\def\csname PYGdefault at tok@nb\endcsname{\def\PYGdefault at tc####1{\textcolor{Environment}{####1}}}
+}
+\apptocmd{\minted at checkstyle}{\resetmintedformat}{}{}
+\makeatother
+\newcommand{\pkg}[1]{\href{http://www.ctan.org/pkg/#1}{\textsf{#1}}}
+\MakeShortVerb{\|}
+\makeatletter
+\let\PrintMacroName\@gobble
+\let\PrintEnvName\@gobble
+\renewenvironment{tcb at manual@entry}{\begin{list}{}{%
+  \setlength{\topsep}{0pt}
+  \setlength{\partopsep}{0pt}
+  \setlength{\leftmargin}{\kvtcb at doc@left}%
+  \setlength{\itemindent}{0pt}%
+  \setlength{\itemsep}{0pt}%
+  \setlength{\parsep}{0pt}%
+  \setlength{\rightmargin}{\kvtcb at doc@right}%
+  }\item}{\end{list}}
+\makeatother
+% This bit inspired by ydoc
+\makeatletter
+\newwrite\ydocwrite
+\def\ydocfname{\jobname.tcbtemp}
+\def\ydoc at catcodes{%
+  \let\do\@makeother
+  \dospecials
+  \catcode`\\=\active
+  \catcode`\^^M=\active
+  \catcode`\ =\active
+}
+\def\macrocode{%
+  \begingroup
+  \ydoc at catcodes
+  \macro at code
+}
+\def\endmacrocode{}
+\begingroup
+\endlinechar\m at ne
+\@firstofone{%
+\catcode`\|=0\relax
+\catcode`\(=1\relax
+\catcode`\)=2\relax
+\catcode`\*=14\relax
+\catcode`\{=12\relax
+\catcode`\}=12\relax
+\catcode`\ =12\relax
+\catcode`\%=12\relax
+\catcode`\\=\active
+\catcode`\^^M=\active
+\catcode`\ =\active
+}*
+|gdef|macro at code#1^^M%    \end{macrocode}(*
+|endgroup|expandafter|macro@@code|expandafter(|ydoc at removeline#1|noexpand|lastlinemacro)*
+)*
+|gdef|ydoc at removeline#1^^M(|noexpand|firstlinemacro)*
+|gdef|ydoc at defspecialmacros(*
+|def^^M(|noexpand|newlinemacro)*
+|def (|noexpand|spacemacro)*
+|def\(|noexpand|bslashmacro)*
+)*
+|gdef|ydoc at defrevspecialmacros(*
+|def|newlinemacro(|noexpand^^M)*
+|def|spacemacro(|noexpand )*
+|def|bslashmacro(|noexpand\)*
+)*
+|endgroup
+\def\macro@@code#1{%
+  {\ydoc at defspecialmacros
+  \xdef\themacrocode{#1}}%
+  \PrintMacroCode
+  \end{macrocode}%
+}
+\def\PrintMacroCode{%
+  \begingroup
+  \let\firstlinemacro\empty
+  \let\lastlinemacro\empty
+  \def\newlinemacro{^^J}%
+  \let\bslashmacro\bslash
+  \let\spacemacro\space
+  \immediate\openout\ydocwrite=\ydocfname\relax
+  \immediate\write\ydocwrite{\themacrocode}%
+  \immediate\closeout\ydocwrite
+  \let\input\@input
+  \tcbinputlisting{breakable,listing only,docexample,listing file=\ydocfname}%
+  \endgroup
+}
+\makeatother
+
+\DisableCrossrefs
+\makeindex
+%\CodelineIndex
+\RecordChanges
+\begin{document}
+
+\GetFileInfo{\jobname.dtx}
+\DoNotIndex{\documentclass,\newcommand,\newenvironment}
+
+\title{\textsf{beamerswitch} --- Convenient mode selection in Beamer documents}
+\author{Alex Ball}
+\date{Class \fileversion\ --- \filedate}
+
+\maketitle
+
+\begin{absquote}
+This class is a wrapper around the \pkg{beamer} class to make it easier to use the
+same document to generate the different forms of the presentation: the slides
+themselves, an abbreviated slide set for transparencies or online reference,
+an n-up handout version, and a transcript or set of notes using the \pkg{article}
+class.
+
+To contact the author about this package, please visit the GitHub
+page where the code is hosted: \url{https://github.com/alex-ball/beamerswitch}.
+\end{absquote}
+
+\section{Introduction}
+
+With \pkg{beamer}, it is possible to typeset the same document code in different
+ways to get different effects. The result you get depends on a potentially
+confusing mix of options, modes, and indeed classes.
+
+Beamer has five modes for typesetting content. There are three modes that
+produce regular slides:
+
+\begin{itemize}
+\item
+  The \key{beamer} mode relates to the normal, default slide set.
+\item
+  The \key{trans} class option switches to the mode of the same name. It is
+  intended for transparencies, but is really just an alternative mode that
+  ignores `bare' overlay specifications.
+\item
+  The \key{handout} class option switches to the mode of the same name. It is
+  intended for print-friendly versions, but is really just another alternative
+  mode that ignores `bare' overlay specifications.
+\end{itemize}
+
+The \pkg{beamer} manual shows how to use \key{handout} mode in conjunction
+with \pkg{pgfpages} to get several slides on a single side of A4 (or Letter)
+paper.
+
+Beamer can also produce a double-height or double-width slide set, with the
+intention that each half will be shown on a different display (e.g. one for
+the audience, one for the speaker). There are three variations of this,
+activated using \cs{setbeameroption}:
+
+\begin{itemize}
+\item
+  \key{show notes on second screen} uses the second screen for text marked up
+  using \cs{note}\marg{text}.
+\item
+  \key{second mode text on second screen} uses the second screen for showing
+  the slide typeset in \key{second} mode rather than \key{beamer}. Unlike
+  \key{trans} and \key{handout}, \key{second} responds to `bare' overlay
+  specifications.
+\item
+  \key{previous slide on second screen}, uses the second screen either for
+  showing the previous slide or, if the slide has the \key{typeset second}
+  option set, for showing the current slide typeset in \key{second} mode.
+\end{itemize}
+
+The final variation is to use a different class altogether, such as
+\pkg{article}, in conjunction with \pkg{beamerarticle}. In this case the content
+is set free-flowing in \key{article} mode, without any of the frame furniture.
+
+The \pkg{beamer} manual suggests coping with all these variations by having the
+document code in one file, and using it as input to other files that each set up
+a different mode of operation. This is fine but a bit of a fiddle. It would be
+nice to be able to get the same effect using a single file and, ideally, a
+single command invocation.
+
+The \pkg{beamerswitch} class addresses this issue by acting as a wrapper around
+the various options, and providing a common interface for switching between
+modes. More specifically, it has three main functions:
+
+\begin{enumerate}
+\item
+  To provide more choice of handout-mode layouts than \pkg{pgfpages} gives you
+  out-of-the-box. Additionally, I hope you will find the method for selecting
+  them more memorable.
+\item
+  To enable you to switch to \key{article} mode with a simple change of class
+  option, instead of having to fiddle with commented-out \cs{documentclass} and
+  \cs{usepackage} lines.
+\item
+  To allow you to override the \pkg{beamer} mode from the command line, by
+  choosing a given jobname suffix. Primarily this is to allow you to generate
+  the different versions programmatically. Indeed, the class provides facilities
+  for generating multiple versions with a single command.
+\end{enumerate}
+
+\section{Dependencies}
+
+To use \pkg{beamerswitch}, you will need to have the following packages available
+and reasonably up to date on your system. All of these ship with recent \TeX\
+distributions.
+
+\begin{multicols}{3}
+  \begin{itemize}
+    \item \pkg{beamer}
+    \item \pkg{etoolbox}
+    \item \pkg{hyperref}
+    \item \pkg{iftex}
+    \item \pkg{pgf}
+    \item \pkg{shellesc}
+    \item \pkg{xkeyval}
+    \item \pkg{xstring}
+  \end{itemize}
+\end{multicols}
+
+One feature of the class uses \pkg{latexmk} by default, though you can configure
+it to use something else if you need or want to.
+
+\section{Loading the class}
+
+The class is loaded in the usual way:
+
+\begin{tcolorbox}[docexample,fontupper=\small]
+\cs{documentclass}\oarg{options}\brackets{beamerswitch}
+\end{tcolorbox}
+
+The various options are described below.
+
+\subsection{Choosing the mode of the current run}
+
+The \pkg{beamerswitch} class, as explained above, does not do much itself but
+rather helps you to switch between \pkg{beamer} modes, specifically
+\key{article}, \key{beamer}, \key{trans} and \key{handout}. Note that it loads
+\pkg{beamer} with the \key{ignorenonframetext} option, so that text outside
+frames is only shown in \key{article} mode.
+
+The normal way of choosing the mode is to use the respective class options.
+
+\begin{docKey}{article}{}{no value, initially unset}
+  Switches to \key{article} mode, which uses the \pkg{article} class and
+  resembles a normal article.
+\end{docKey}
+
+\begin{docKey}{beamer}{}{no value, initially set}
+  Switches to \key{beamer} mode, which uses the \pkg{beamer} class and
+  resembles a normal slideshow.
+\end{docKey}
+
+\begin{docKey}{handout}{}{no value, initially unset}
+  Switches to \key{handout} mode, which uses the \pkg{beamer} class but uses a
+  different series of overlay specifications. It resembles a set of printed
+  pages with multiple slides shown on each page.
+\end{docKey}
+
+\begin{docKey}{trans}{}{no value, initially unset}
+  Switches to \key{trans} mode, which uses the \pkg{beamer} class and
+  resembles a normal slideshow, but uses a different series of overlay
+  specifications.
+\end{docKey}
+
+There is, however, a sneaky second way of setting the mode that overrides the
+first, and that is to use the \cs{jobname}. By default, this is the name of your
+\LaTeX\ file minus the \texttt{.tex} extension, but you can set it to something
+else when you run \LaTeX. If you set the \cs{jobname} to end in one of the
+following suffixes, the mode will automatically switch:
+
+\begin{itemize}
+  \item \texttt{-article} will switch to \key{article} mode.
+  \item \texttt{-handout} will switch to \key{handout} mode.
+  \item \texttt{-slides} will switch to \key{beamer} mode.
+  \item \texttt{-trans} will switch to \key{trans} mode.
+\end{itemize}
+
+The idea is that you can keep your source document the same, but by running
+\LaTeX\ with an alternative \cs{jobname}, you can get a different version out
+with a meaningfully different file name.
+
+Of course, you may not want to use those suffixes. Perhaps you want them in
+German; perhaps your document's file name already ends in one of them; perhaps
+`article' or `trans' doesn't describe what you're using those modes for. The
+suffixes are provided by the following commands:
+
+\begin{docCommand}{ArticleSuffix}{}
+  Holds the \cs{jobname} suffix that triggers \key{article} mode.
+\end{docCommand}
+
+\begin{docCommand}{BeamerSuffix}{}
+  Holds the \cs{jobname} suffix that triggers \key{beamer} mode.
+\end{docCommand}
+
+\begin{docCommand}{HandoutSuffix}{}
+  Holds the \cs{jobname} suffix that triggers \key{handout} mode.
+\end{docCommand}
+
+\begin{docCommand}{TransSuffix}{}
+  Holds the \cs{jobname} suffix that triggers \key{trans} mode.
+\end{docCommand}
+
+The CamelCase is an admittedly rather obscure signal to you that, if you want to
+change them to something else, you should do so via \cs{newcommand} before
+loading the class:
+
+\begin{dispListing}
+\newcommand*{\ArticleSuffix}{-script}
+\documentclass{beamerswitch}
+\end{dispListing}
+
+\subsection{Using more than one mode at once}
+
+Another handy feature of the class is that it can spawn parallel compilations,
+so you could in theory generate all four versions from a single command. It
+achieves this magic by escaping to the shell and running \pkg{latexmk}. Thus
+for it to work you need to run \LaTeX\ with shell escape enabled and you need
+\pkg{latexmk} to be installed.
+
+\begin{docKey}{alsoarticle}{}{no value, initially unset}
+  Spawns a new compilation process in \key{article} mode.
+\end{docKey}
+
+\begin{docKey}{alsobeamer}{}{no value, initially unset}
+  Spawns a new compilation process in \key{beamer} mode.
+\end{docKey}
+
+\begin{docKey}{alsohandout}{}{no value, initially unset}
+  Spawns a new compilation process in \key{handout} mode.
+\end{docKey}
+
+\begin{docKey}{alsotrans}{}{no value, initially unset}
+  Spawns a new compilation process in \key{trans} mode.
+\end{docKey}
+
+\begin{docKey}{also}{=\marg{comma-separated list of modes}}{no default, initially empty}
+  Spawns compilation processes in each of the specified modes. Note that the
+  list has to be wrapped in braces, and only the four aforementioned modes are
+  recognized.
+\end{docKey}
+
+If you would rather use a tool other than \pkg{latexmk} to managed your spawned
+compilation processes, it is possible to do that. Bear in mind, though, that
+\pkg{beamerswitch} is not clever enough to spot if you have already compiled the
+other version on a previous run so you have to take care of that yourself. The
+command that does the business is this:
+
+\begin{docCommand}{BeamerswitchSpawn}{\marg{suffix}}
+  Spawns a new compilation process with \meta{suffix} appended to the
+  \cs{jobname}.
+\end{docCommand}
+
+See the \hyperref[sec:implementation]{Implementation} section below for the
+default definition. Again, if you want to pre-define this to do something else,
+you have to do it before loading the class:
+
+\begin{dispListing}
+\newcommand{\BeamerswitchSpawn}[1]{%
+  \ShellEscape{...}%
+}
+\documentclass{beamerswitch}
+\end{dispListing}
+
+\subsection{Improving compatibility}
+
+\begin{docKey}{nohyperref}{}{no value, initially unset}
+  The \pkg{beamer} class loads \pkg{hyperref} for you, but when you switch to \key{article} mode, \pkg{beamerarticle} doesn't, so it is easy for you to get
+  caught out. To protect you from this, \pkg{beamerswitch} \emph{does} load
+  \pkg{hyperref} in \key{article} mode, with the pleasing side effect that
+  \cs{subject} and \cs{keywords} then work as intended instead of throwing
+  errors.
+
+  \medskip
+  To achieve this, the class has to load \pkg{hyperref} quite early on, which
+  can cause trouble with certain other packages. If you would rather
+  load \pkg{hyperref} yourself at a different point, use this option.
+\end{docKey}
+
+\begin{docKey}{textinst}{}{no value, initially unset}
+  In all modes, patches the \cs{inst} command so that it prints its argument
+  using \cs{textsuperscript} instead of a mathematical superscript. This helps
+  avoid unnecessary font changes.
+\end{docKey}
+
+\section{Setting the layout of the handouts}
+
+The class provides a simplified interface to the \pkg{pgfpages} package. By
+default, it prints six slides to a side of A4 paper, but you can change this by
+using the following command in the preamble.
+
+\begin{docCommand}{handoutlayout}{\marg{options}}
+  Configures the layout of the page when using \key{handout} mode. It has no
+  effect in other modes. The available \meta{options} are listed below.
+\end{docCommand}
+
+\begin{docKey}{paper}{=\meta{paper size}}{no default, initially \val{a4paper}}
+  Selects the size of paper to use for \key{handout} mode. The value is passed
+  directly to \pkg{pgfpages}, so consult the documentation of that package for
+  the allowed values. You can find them under the documentation for the
+  \key{resize to} layout.
+\end{docKey}
+
+\begin{docKey}{nup}{=\val{2}\textbar \val{3}\textbar \val{3plus}\textbar \val{4}\textbar \val{4plus}\textbar \val{6}\textbar \val{8}}{no default, initially \val{6}}
+  Selects how many slides are shown on a single page in \key{handout} mode.
+  The `plus' layouts leave blank space for recipients to make handwritten notes
+  next to each slide. The effects of the various values are shown in Figure~\ref{fig:layouts} on page~\pageref{fig:layouts}. Note that the \docValue{2},
+  \docValue{3plus}, \docValue{4} and \docValue{6} layouts are intended for
+  slides in the usual 4:3 aspect ratio, while the \docValue{3}, \docValue{4plus}
+  and \docValue{8} layouts are intended for widescreen slides.
+\end{docKey}
+
+\newtcolorbox{pseudopage}[1][]%
+{sharp corners
+  ,width=7.1em
+  ,halign=flush center
+  ,height=10em
+  ,valign=center
+  ,size=fbox
+  ,boxrule=0.5mm
+  ,colback=yellow!5
+  ,#1
+}
+\newtcolorbox{pseudoslide}[1][]%
+{nobeforeafter
+  ,width=3em
+  ,halign=flush center
+  ,height=2.25em
+  ,valign=center
+  ,size=fbox
+  ,boxrule=0.5mm
+  ,colframe=ExampleFrame
+  ,colback=ExampleBack
+  ,#1
+}
+\newtcolorbox{pseudowideslide}[1][]%
+{nobeforeafter
+  ,width=3em
+  ,halign=flush center
+  ,height=1.69em
+  ,valign=center
+  ,size=fbox
+  ,boxrule=0.5mm
+  ,colframe=ExampleFrame
+  ,colback=ExampleBack
+  ,#1
+}
+\begin{figure}[t!]
+  \centering
+  \begin{minipage}[b]{11em}
+    \centering
+    \begin{pseudopage}
+      \begin{pseudoslide}[width=6em,height=4.5em]
+        \texttt{1}
+      \end{pseudoslide}\par\smallskip
+      \begin{pseudoslide}[width=6em,height=4.5em]
+        \texttt{2}
+      \end{pseudoslide}
+    \end{pseudopage}
+    \par
+    (a) \key{nup}=\val{2}
+  \end{minipage}
+  \begin{minipage}[b]{11em}
+    \centering
+    \begin{pseudopage}
+      \begin{pseudowideslide}[width=4.89em,height=2.75em]
+        \texttt{1}
+      \end{pseudowideslide}
+      \par\smallskip
+      \begin{pseudowideslide}[width=4.89em,height=2.75em]
+        \texttt{2}
+      \end{pseudowideslide}
+      \par\smallskip
+      \begin{pseudowideslide}[width=4.89em,height=2.75em]
+        \texttt{3}
+      \end{pseudowideslide}
+    \end{pseudopage}
+    \par
+    (b) \key{nup}=\val{3}
+  \end{minipage}
+  \begin{minipage}[b]{11em}
+    \centering
+    \begin{pseudopage}[halign=flush left]
+      \begin{pseudoslide}\texttt{1}\end{pseudoslide}
+      \par\medskip
+      \begin{pseudoslide}\texttt{2}\end{pseudoslide}
+      \par\medskip
+      \begin{pseudoslide}\texttt{3}\end{pseudoslide}
+    \end{pseudopage}
+    \par
+    (c) \key{nup}=\val{3plus}
+  \end{minipage}
+  \par\bigskip
+  \begin{minipage}[b]{11em}
+    \centering
+    \begin{pseudopage}[width=10em,height=7.1em]
+      \begin{pseudoslide}[width=4em,height=3em]
+        \texttt{1}
+      \end{pseudoslide}\enspace
+      \begin{pseudoslide}[width=4em,height=3em]
+        \texttt{2}
+      \end{pseudoslide}\par\smallskip
+      \begin{pseudoslide}[width=4em,height=3em]
+        \texttt{3}
+      \end{pseudoslide}\enspace
+      \begin{pseudoslide}[width=4em,height=3em]
+        \texttt{4}
+      \end{pseudoslide}
+    \end{pseudopage}
+    \par
+    (d) \key{nup}=\val{4}
+  \end{minipage}
+  \begin{minipage}[b]{11em}
+    \centering
+    \begin{pseudopage}[halign=flush left]
+      \begin{pseudowideslide}\texttt{1}\end{pseudowideslide}
+      \par\medskip
+      \begin{pseudowideslide}\texttt{2}\end{pseudowideslide}
+      \par\medskip
+      \begin{pseudowideslide}\texttt{3}\end{pseudowideslide}
+      \par\medskip
+      \begin{pseudowideslide}\texttt{4}\end{pseudowideslide}
+    \end{pseudopage}
+    \par
+    (e) \key{nup}=\val{4plus}
+  \end{minipage}
+  \begin{minipage}[b]{11em}
+    \centering
+    \begin{pseudopage}
+      \begin{pseudoslide}\texttt{1}\end{pseudoslide}
+      \begin{pseudoslide}\texttt{2}\end{pseudoslide}
+      \par\medskip
+      \begin{pseudoslide}\texttt{3}\end{pseudoslide}
+      \begin{pseudoslide}\texttt{4}\end{pseudoslide}
+      \par\medskip
+      \begin{pseudoslide}\texttt{5}\end{pseudoslide}
+      \begin{pseudoslide}\texttt{6}\end{pseudoslide}
+    \end{pseudopage}
+    \par
+    (f) \key{nup}=\val{6}
+  \end{minipage}
+  \par\bigskip
+  \begin{minipage}[b]{11em}
+    \centering
+    \begin{pseudopage}
+      \begin{pseudowideslide}\texttt{1}\end{pseudowideslide}
+      \begin{pseudowideslide}\texttt{2}\end{pseudowideslide}
+      \par\medskip
+      \begin{pseudowideslide}\texttt{3}\end{pseudowideslide}
+      \begin{pseudowideslide}\texttt{4}\end{pseudowideslide}
+      \par\medskip
+      \begin{pseudowideslide}\texttt{5}\end{pseudowideslide}
+      \begin{pseudowideslide}\texttt{6}\end{pseudowideslide}
+      \par\medskip
+      \begin{pseudowideslide}\texttt{7}\end{pseudowideslide}
+      \begin{pseudowideslide}\texttt{8}\end{pseudowideslide}
+    \end{pseudopage}
+    \par
+    (g) \key{nup}=\val{8}
+  \end{minipage}
+  \par
+  \caption{Handout layouts provided by \pkg{beamerswitch}}
+  \label{fig:layouts}
+\end{figure}
+
+\begin{docKey}{border}{=\meta{length}}{default 0.4pt, initially 0pt}
+  Puts a rectangular border of thickness \meta{length} around each slide. Note
+  that the borders are drawn regardless of whether a slide is actually printed,
+  so you may end up with empty boxes on the last page.
+\end{docKey}
+
+\begin{docKey}{pnos}{}{no value, initially unset}
+  Adds page numbers to the bottom of each page.
+\end{docKey}
+
+\section{Changing the look of article mode}
+
+Some additional options can be set by using the following command in the
+preamble.
+
+\begin{docCommand}{articlelayout}{\marg{options}}
+  Configures the appearance of \key{article} mode. It has no effect in other
+  modes. The available \meta{options} are listed below.
+\end{docCommand}
+
+\begin{docKey}{maketitle}{}{no value, initially unset}
+  In \key{article} mode, adjusts the \cs{maketitle} routine:
+  \begin{itemize}
+  \item
+    The title is printed closer to the top margin.
+  \item
+    The subtitle is shown joined to the title using a colon (rather than on a
+    new line).
+  \item
+    The institute is shown directly beneath the author name, similar to the
+    \pkg{beamer} layout, so you can use \cs{inst} just as in \pkg{beamer} to tie
+    authors to their affiliations.
+  \end{itemize}
+
+  If you have \pkg{xparse} (and hence \pkg{expl3}) installed, the class will
+  detect cases where your title ends in a character like `?' and will not add a
+  colon to it in that case. You can also suppress the colon manually with the
+  following code (add it \emph{after} using \cs{title} if automatic detection is
+  in effect):
+
+\begin{dispListing}
+\toggletrue{titlepunct}
+\end{dispListing}
+\end{docKey}
+
+\begin{docKey}{frametitles}{=\val{para}\textbar\val{margin}\textbar\val{none}}{no default, initially \val{para}}
+  In \key{article} mode, affects how frame titles are printed. By default,
+  \pkg{beamerarticle} prints them as paragraph headings, represented by
+  the value \docValue{para}. To have them printed in the margin (using
+  \cs{marginpar}), use \docValue{margin}. To omit them altogether, use the value
+  \docValue{none}.
+\end{docKey}
+
+\section{Tips for further configuration}
+
+There are some other ways to customize the behaviour of the various modes.
+
+You can use the standard \LaTeX\ methods for customizing how the \pkg{article}
+and \pkg{beamer} classes are loaded:
+
+\begin{dispListing}
+\PassOptionsToClass{a4paper,11pt}{article} % for article mode
+\PassOptionsToClass{utf8}{beamer} % for beamer, handout, trans modes
+\documentclass{beamerswitch}
+\end{dispListing}
+
+And of course there is the standard \pkg{beamer} way of passing different
+options to different modes:
+
+\begin{dispListing}
+\documentclass{beamerswitch}
+\mode<article>{
+  \usepackage[utf8]{inputenc}
+}
+\mode<beamer>{
+  \setbeameroption{second mode text on second screen}
+}
+\end{dispListing}
+
+\section{Feedback}
+
+I hope you find this class useful. Please report any bugs and add any
+suggestions for improvements or new features to the
+\href{https://github.com/alex-ball/beamerswitch/issues}{Issue Tracker} on GitHub.
+
+\StopEventually{^^A
+  \PrintChanges
+  \printindex
+}
+
+\newpage
+\section{Implementation}\label{sec:implementation}
+
+\setcounter{FancyVerbLine}{18}%
+\DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+% \iffalse
+%<*class>
+% \fi
+%
+% \subsection{Dependencies}
+%
+% We use the following packages:
+% \begin{itemize}
+% \item
+%   \pkg{xkeyval} with \pkg{xkvltxp} for setting options
+% \item
+%   \pkg{etoolbox} for command patches and list processing
+% \item
+%   \pkg{xstring} for comparisons
+% \item
+%   \pkg{shellesc} for running parallel compilations
+% \item
+%   \pkg{iftex} for determining which engine to use
+% \end{itemize}
+%
+%    \begin{macrocode}
+\RequirePackage{xkeyval,xkvltxp,etoolbox,xstring,shellesc,iftex}
+%    \end{macrocode}
+%
+% \subsection{Class options}
+%
+% We recognize four main modes of operation: `beamer', `trans', `handout', and
+% `article'.
+%
+% \begin{optionkey}{beamer}
+% The \key{beamer} option triggers beamer mode.
+%
+%    \begin{macrocode}
+\define at boolkey[DC]{beamerswitch}{beamer}[true]{%
+  \ifbool{DC at beamerswitch@beamer}{%
+    \setkeys[DC]{beamerswitch}{trans=false}
+    \setkeys[DC]{beamerswitch}{handout=false}
+    \setkeys[DC]{beamerswitch}{article=false}
+  }{}%
+}
+%    \end{macrocode}
+% \end{optionkey}
+%
+% \begin{optionkey}{trans}
+% The \key{trans} option triggers trans mode.
+%
+%    \begin{macrocode}
+\define at boolkey[DC]{beamerswitch}{trans}[true]{%
+  \ifbool{DC at beamerswitch@trans}{%
+    \setkeys[DC]{beamerswitch}{beamer=false}
+    \setkeys[DC]{beamerswitch}{handout=false}
+    \setkeys[DC]{beamerswitch}{article=false}
+  }{}%
+}
+%    \end{macrocode}
+% \end{optionkey}
+%
+% \begin{optionkey}{handout}
+% The \key{handout} option triggers handout mode.
+%
+%    \begin{macrocode}
+\define at boolkey[DC]{beamerswitch}{handout}[true]{%
+  \ifbool{DC at beamerswitch@handout}{%
+    \setkeys[DC]{beamerswitch}{beamer=false}
+    \setkeys[DC]{beamerswitch}{trans=false}
+    \setkeys[DC]{beamerswitch}{article=false}
+  }{}%
+}
+%    \end{macrocode}
+% \end{optionkey}
+%
+% \begin{optionkey}{article}
+% The \key{article} option triggers article mode.
+%
+%    \begin{macrocode}
+\define at boolkey[DC]{beamerswitch}{article}[true]{%
+  \ifbool{DC at beamerswitch@article}{%
+    \setkeys[DC]{beamerswitch}{beamer=false}
+    \setkeys[DC]{beamerswitch}{trans=false}
+    \setkeys[DC]{beamerswitch}{handout=false}
+  }{}%
+}
+%    \end{macrocode}
+% \end{optionkey}
+%
+% \begin{optionkey}{also}
+% \begin{optionkey}{alsobeamer}
+% \begin{optionkey}{alsotrans}
+% \begin{optionkey}{alsohandout}
+% \begin{optionkey}{alsoarticle}
+% \begin{macro}{beamerswitch at SetAlso}
+% The \key{also} option allows the user to specify a set of alternative modes
+% to typeset in parallel, in a comma-separated list. Alternatively, the user
+% can specify the Boolean \key{also*} options directly.
+%
+%    \begin{macrocode}
+\define at boolkey[DC]{beamerswitch}{alsobeamer}[true]{}
+\define at boolkey[DC]{beamerswitch}{alsotrans}[true]{}
+\define at boolkey[DC]{beamerswitch}{alsohandout}[true]{}
+\define at boolkey[DC]{beamerswitch}{alsoarticle}[true]{}
+\newcommand{\beamerswitch at SetAlso}[1]{%
+  \key at ifundefined[DC]{beamerswitch}{also#1}{%
+    \ClassWarning{beamerswitch}{`#1' is not a valid value for option `also'}%
+  }{%
+    \setkeys[DC]{beamerswitch}{also#1}%
+  }%
+}
+\define at key[DC]{beamerswitch}{also}{%
+  \forcsvlist{\beamerswitch at SetAlso}{#1}%
+}
+%    \end{macrocode}
+% \end{macro}
+% \end{optionkey}
+% \end{optionkey}
+% \end{optionkey}
+% \end{optionkey}
+% \end{optionkey}
+%
+% \begin{optionkey}{nohyperref}
+% The \key{nohyperref} option stops the class from loading the \pkg{hyperref}
+% package in article mode.
+%
+%    \begin{macrocode}
+\define at boolkey[DC]{beamerswitch}{nohyperref}[true]{}
+%    \end{macrocode}
+% \end{optionkey}
+%
+% \begin{optionkey}{textinst}
+% The \key{textinst} option adjusts the superscript used for institution
+% markers.
+%
+%    \begin{macrocode}
+\define at boolkey[DC]{beamerswitch}{textinst}[true]{}
+%    \end{macrocode}
+% \end{optionkey}
+%
+% The default behaviour is to use beamer mode only.
+%
+%    \begin{macrocode}
+\setkeys[DC]{beamerswitch}{beamer=true,alsobeamer=false,alsotrans=false,%
+  alsohandout=false,alsoarticle=false}
+%    \end{macrocode}
+%
+% Now we process the options given by the user.
+%
+%    \begin{macrocode}
+\ProcessOptionsX[DC]<beamerswitch>
+%    \end{macrocode}
+%
+% \subsection{Jobname-based mode switching}
+%
+% \begin{macro}{BeamerSuffix}
+% \begin{macro}{TransSuffix}
+% \begin{macro}{HandoutSuffix}
+% \begin{macro}{ArticleSuffix}
+% We define some default values for the special suffixes.
+%
+%    \begin{macrocode}
+\providecommand*{\BeamerSuffix}{-slides}
+\providecommand*{\TransSuffix}{-trans}
+\providecommand*{\HandoutSuffix}{-handout}
+\providecommand*{\ArticleSuffix}{-article}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{BeamerswitchSpawn}
+% We provide a special routine for spawning new \LaTeX\ processes. We allow
+% for the possibility of the user overriding this routine with another one,
+% perhaps using a different automation tool.
+%
+%    \begin{macrocode}
+\providecommand{\BeamerswitchSpawn}[1]{%
+  \ifbool{PDFTeX}{%
+    \ShellEscape{latexmk -silent -pdf -synctex=1 -interaction=batchmode -jobname=\jobname#1 \jobname}
+  }{%
+    \ifbool{LuaTeX}{%
+      \ShellEscape{latexmk -silent -lualatex -synctex=1 -interaction=batchmode -jobname=\jobname#1 \jobname}
+    }{%
+      \ifbool{XeTeX}{%
+        \ShellEscape{latexmk -silent -xelatex -synctex=1 -interaction=batchmode -jobname=\jobname#1 \jobname}
+      }{%
+        \ShellEscape{latexmk -silent -synctex=1 -interaction=batchmode -jobname=\jobname#1 \jobname}
+      }%
+    }%
+  }%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% We check for special jobnames and use them to override the above mode-related
+% options. Note that if this happens, the \key{also*} options are ignored.
+%
+%    \begin{macrocode}
+\IfEndWith*{\jobname}{\BeamerSuffix}{%
+  \setkeys[DC]{beamerswitch}{beamer=true}
+}{%
+  \IfEndWith*{\jobname}{\TransSuffix}{%
+    \setkeys[DC]{beamerswitch}{trans=true}
+  }{%
+    \IfEndWith*{\jobname}{\HandoutSuffix}{%
+      \setkeys[DC]{beamerswitch}{handout=true}
+    }{%
+      \IfEndWith*{\jobname}{\ArticleSuffix}{%
+        \setkeys[DC]{beamerswitch}{article=true}
+      }{%
+        \ifbool{DC at beamerswitch@alsobeamer}{%
+          \BeamerswitchSpawn{\BeamerSuffix}%
+        }{}
+        \ifbool{DC at beamerswitch@alsotrans}{%
+          \BeamerswitchSpawn{\TransSuffix}%
+        }{}
+        \ifbool{DC at beamerswitch@alsohandout}{%
+          \BeamerswitchSpawn{\HandoutSuffix}%
+        }{}
+        \ifbool{DC at beamerswitch@alsoarticle}{%
+          \BeamerswitchSpawn{\ArticleSuffix}%
+        }{}
+      }%
+    }%
+  }%
+}%
+%    \end{macrocode}
+%
+% \subsection{Setting up modes}
+%
+% For article mode, we load the \pkg{article} class and the \pkg{beamerarticle}
+% support package. Apologies for anyone hoping for \pkg{scrartcl} or
+% \pkg{memoir} alternatives.
+%
+%    \begin{macrocode}
+\ifbool{DC at beamerswitch@article}{%
+  \LoadClass{article}
+  \RequirePackage{beamerarticle}
+%    \end{macrocode}
+%
+% It seems as though \pkg{beamerarticle} expects \pkg{hyperref} to be loaded,
+% but doesn't actually do it itself. So we oblige, using the default options
+% specified by \pkg{beamer}.
+%
+%    \begin{macrocode}
+  \ifbool{DC at beamerswitch@nohyperref}{}{%
+    \RequirePackage[bookmarks=true,%
+    bookmarksopen=true,%
+    pdfborder={0 0 0},%
+    pdfhighlight={/N},%
+    linkbordercolor={.5 .5 .5}]{hyperref}%
+  }
+%    \end{macrocode}
+%
+% While \pkg{beamer} takes care of adding presentation metadata to the PDF
+% properties, \pkg{beamerarticle} misses the title and author properties. (It
+% does manage to set the subject and keywords, though.) We achieve parity with
+% some additional \cs{hypersetup}. Note that \pkg{beamerarticle} appends the
+% subtitle to \cs{@title} with a linebreak and this does odd things in the
+% context of \key{pdftitle}, so we fix it with \cs{pdfstringdefDisableCommands}.
+%
+%    \begin{macrocode}
+  \AtBeginDocument{%
+    \@ifpackageloaded{hyperref}{%
+      \pdfstringdefDisableCommands{\def\\<#1>#2{ - #2}}
+      \begingroup
+      \hypersetup{pdftitle={\@title}}%
+      \def\and{\unskip, }%
+      \let\thanks=\@gobble
+      \let\inst=\@gobble
+      \hypersetup{pdfauthor={\@author}}%
+      \endgroup
+    }{}%
+  }
+}{%
+%    \end{macrocode}
+%
+%
+% For the presentation modes, we load the \pkg{beamer} class with appropriate
+% options. Since we are targeting users wanting different versions of their
+% presentations with the same code, we activate \key{ignorenonframetext}.
+%
+%    \begin{macrocode}
+  \ifbool{DC at beamerswitch@handout}{%
+    \LoadClass[ignorenonframetext,handout]{beamer}
+%    \end{macrocode}
+%
+% Handout mode lays multiple slides out on a single page. For this we use
+% \pkg{pgfpages}. The actual configuration is handled later.
+%
+%    \begin{macrocode}
+    \RequirePackage{pgfpages}
+%    \end{macrocode}
+%
+% We also activate \key{ignorenonframetext} for the other two modes.
+%
+%    \begin{macrocode}
+  }{%
+    \ifbool{DC at beamerswitch@trans}{%
+      \LoadClass[ignorenonframetext,trans]{beamer}
+    }{%
+      \LoadClass[ignorenonframetext]{beamer}
+    }%
+  }
+}
+%    \end{macrocode}
+%
+% \subsection{Mode-independent layout}
+%
+% We implement the option that formats institution markers in text mode rather
+% than math mode.
+%
+%    \begin{macrocode}
+\ifbool{DC at beamerswitch@textinst}{%
+  \def\beamer at insttitle#1{\textsuperscript{#1}}
+  \def\beamer at instinst#1{\textsuperscript{#1}\ignorespaces}
+}{}
+%    \end{macrocode}
+%
+% \subsection{Handout layout}
+%
+% \begin{macro}{beamerswitch at Border}
+% We set up a command for drawing borders around the slides in handout mode.
+% This is initially set up to do nothing.
+%
+%    \begin{macrocode}
+\newcommand*{\beamerswitch at Border}{\relax}
+%    \end{macrocode}
+% \end{macro}
+%
+% Though \pkg{pgfpages} defines some perfectly fine layouts, we need to add
+% configurability to the existing ones and provide some new ones.
+%
+% The `1 by 2' layout is similar to the normal \key{2 on 1} layout.
+%
+%    \begin{macrocode}
+\mode<handout>{%
+  \pgfpagesdeclarelayout{1 by 2}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=2,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \fi
+  }
+%    \end{macrocode}
+%
+% The `1 by 3' layout is similar to the `1 by 2', but with an extra row.
+%
+%    \begin{macrocode}
+  \pgfpagesdeclarelayout{1 by 3}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=3,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=\pgfphysicalheight,%
+      center=\pgfpoint{.167\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=\pgfphysicalheight,%
+      center=\pgfpoint{.833\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.833\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.167\pgfphysicalheight}%
+    }%
+    \fi
+  }
+%    \end{macrocode}
+%
+% The `1 by 3 narrow' layout is like the `1 by 3' layout but restricted to the
+% left (or top) half of the page.
+%
+%    \begin{macrocode}
+  \pgfpagesdeclarelayout{1 by 3 narrow}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=3,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.167\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.833\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.833\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.167\pgfphysicalheight}%
+    }%
+    \fi
+  }
+%    \end{macrocode}
+%
+% The `2 by 2' layout is similar to the normal \key{4 on 1} layout.
+%
+%    \begin{macrocode}
+  \pgfpagesdeclarelayout{2 by 2}
+  {
+    \edef\pgfpageoptionheight{\the\paperheight} 
+    \edef\pgfpageoptionwidth{\the\paperwidth}
+    \edef\pgfpageoptionborder{0pt}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=4,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth%
+    }
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+  }
+%    \end{macrocode}
+%
+% The `1 by 4 narrow' layout puts four slides in a column on the left half of
+% the page (or in a row on the top half).
+%
+%    \begin{macrocode}
+  \pgfpagesdeclarelayout{1 by 4 narrow}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=4,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.125\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.375\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.625\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.875\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.875\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.625\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.375\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.125\pgfphysicalheight}%
+    }%
+    \fi
+  }
+%    \end{macrocode}
+%
+% The `2 by 3' layout positions the slides as three rows of two slides each.
+%
+%    \begin{macrocode}
+  \pgfpagesdeclarelayout{2 by 3}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=6,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.167\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.833\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.167\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{5}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{6}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.833\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.833\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.833\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{5}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.167\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{6}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.167\pgfphysicalheight}%
+    }%
+    \fi
+  }
+%    \end{macrocode}
+%
+% The `2 by 4' layout layout positions the slides as four rows of two slides each.
+%
+%    \begin{macrocode}
+  \pgfpagesdeclarelayout{2 by 4}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=8,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.125\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.375\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.625\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.875\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{5}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.125\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{6}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.375\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{7}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.625\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{8}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.875\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.875\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.875\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.625\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.625\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{5}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.375\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{6}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.375\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{7}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.125\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{8}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.125\pgfphysicalheight}%
+    }%
+    \fi
+  }
+}
+%    \end{macrocode}
+%
+% \begin{optionkey}{paper}
+% \begin{macro}{beamerswitch at handoutpaper}
+% In theory it would be nice to anticipate the paper size that the article mode
+% would use, and pass that as an option to \cs{pgfpagesuselayout} but as that's
+% unlikely to be clean code, we settle here for setting it with an option.
+%
+%    \begin{macrocode}
+\define at key[HL]{beamerswitch}{paper}{%
+  \def\beamerswitch at handoutpaper{#1}%
+}
+%    \end{macrocode}
+% \end{macro}
+% \end{optionkey}
+%
+% \begin{optionkey}{nup}
+% \begin{optionvalue}{2}
+% \begin{optionvalue}{3}
+% \begin{optionvalue}{3plus}
+% \begin{optionvalue}{4}
+% \begin{optionvalue}{4plus}
+% \begin{optionvalue}{6}
+% \begin{optionvalue}{8}
+% The \key{nup} option specifies how many slides to include per page.
+% The `plus' keyword indicates a layout with additional gaps for writing.
+%
+%    \begin{macrocode}
+\newcounter{beamerswitch at nupcase}
+\define at choicekey+[HL]{beamerswitch}{nup}[\val\nr]{2, 3, 3plus, 4, 4plus, 6, 8}{%
+  \setcounter{beamerswitch at nupcase}{\nr}
+}{%
+  \ClassWarning{beamerswitch}{Value of `nup' not recognized.
+    Allowed values are 2, 3, 3plus, 4, 4plus, 6, and 8.}%
+}
+%    \end{macrocode}
+% \end{optionvalue}
+% \end{optionvalue}
+% \end{optionvalue}
+% \end{optionvalue}
+% \end{optionvalue}
+% \end{optionvalue}
+% \end{optionvalue}
+% \end{optionkey}
+%
+% \begin{optionkey}{border}
+% The \key{borders} option switches on borders around the slides on handout
+% pages (and gaps where slides would appear if there were enough). The value
+% is used to set the width of the border.
+%
+%    \begin{macrocode}
+\define at key[HL]{beamerswitch}{border}[0.4pt]{%
+  \RequirePackage{pgf}%
+  \renewcommand*{\beamerswitch at Border}{\pgfsetlinewidth{#1}\pgfstroke}%
+}
+%    \end{macrocode}
+% \end{optionkey}
+%
+% \begin{optionkey}{pnos}
+% The \key{pnos} option switches on page numbers for handout pages.
+%
+%    \begin{macrocode}
+\define at boolkey[HL]{beamerswitch}{pnos}[true]{}
+%    \end{macrocode}
+% \end{optionkey}
+%
+% \begin{macro}{handoutlayout}
+% \begin{macro}{beamerswitch at nup}
+% We set up the \cs{handoutlayout} command for applying these options.
+%
+%    \begin{macrocode}
+\newcommand*{\handoutlayout}[1]{%
+  \only<handout>{%
+    \setkeys[HL]{beamerswitch}{#1}%
+    \ifcase\value{beamerswitch at nupcase}\relax
+      \def\beamerswitch at nup{2}
+      \pgfpagesuselayout{1 by 2}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{3}
+      \pgfpagesuselayout{1 by 3}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{3}
+      \pgfpagesuselayout{1 by 3 narrow}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{4}
+      \pgfpagesuselayout{2 by 2}[\beamerswitch at handoutpaper,landscape,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{4}
+      \pgfpagesuselayout{1 by 4 narrow}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{6}
+      \pgfpagesuselayout{2 by 3}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{8}
+      \pgfpagesuselayout{2 by 4}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \fi
+    \ifbool{HL at beamerswitch@pnos}{%
+      \def\pgfsys at endpicture{%
+        \raisebox{5mm}[0pt][0pt]{%
+          \makebox[\pgfphysicalwidth]{%
+            \the\numexpr\value{page}/\beamerswitch at nup\relax
+          }%
+        }%
+      }%
+    }{}%
+  }%
+}
+%    \end{macrocode}
+%\end{macro}
+%\end{macro}
+%
+% We initialize the class with a layout of six slides on A4 paper.
+%
+%    \begin{macrocode}
+\handoutlayout{paper=a4paper,nup=6}
+%    \end{macrocode}
+%
+% \subsection{Article layout}
+%
+% We provide some options for configuring the appearance of article mode.
+%
+% \begin{optionkey}{maketitle}
+% The \key{maketitle} option triggers adjustments in how the title block is
+% printed.
+%
+%    \begin{macrocode}
+\define at boolkey[AL]{beamerswitch}{maketitle}[true]{}
+%    \end{macrocode}
+% \end{optionkey}
+%
+% One will be to join the title and subtitle with a colon. There is an edge case
+% where, if the user provides a title that ends in `!' or `?' \emph{and}
+% provides a subtitle while this option is in effect, they will end up with
+% clashing punctuation in the middle of the displayed title (`!:' or `?:'). We
+% therefore introduce a toggle that, if set true, suppresses the additional
+% colon.
+%
+%    \begin{macrocode}
+\newtoggle{titlepunct}
+%    \end{macrocode}
+%
+% \begin{macro}{bsw at punct@test}
+% Of course, we would rather not bother the user with this, so we introduce a
+% command for testing the title for final punctuation.
+%
+% The only way I can seem to do this is by switching to \pkg{expl3} syntax.
+% Rather than introduce extra hard dependencies to cope with what will probably
+% be quite a rare issue, we make the dependency soft: it will only be applied
+% if \pkg{xparse} is available. If there is demand for it, we could introduce
+% a class option to switch this code on or off, but let's see how we go.
+%
+%    \begin{macrocode}
+\IfFileExists{xparse.sty}{\@tempswatrue}{\@tempswafalse}
+\if at tempswa
+  \RequirePackage{xparse}
+  \ExplSyntaxOn
+  \NewDocumentCommand{\bsw at punct@test}{m}{\l_bsw_punct_test:n {#1}}
+  \cs_new_protected:Nn \l_bsw_punct_test:n
+  {
+    \str_case_x:nnTF { \str_item:nn {#1} {-1} }
+      {
+        { , } { }
+        { ; } { }
+        { : } { }
+        { . } { }
+        { ! } { }
+        { ? } { }
+      }
+      { \global\toggletrue{titlepunct} }
+      { \global\togglefalse{titlepunct} }
+  }
+  \ExplSyntaxOff
+%    \end{macrocode}
+%
+% We insert this test into the definitions for \cs{title} introduced by
+% \pkg{beamer}\slash\pkg{beamerarticle}.
+%
+%    \begin{macrocode}
+  \mode<article>{%
+    \renewcommand{\title}[2][]{\beamer at origtitle{#2}\bsw at punct@test{#2}}
+  }
+  \mode<presentation>{%
+    \long\def\beamer at title[#1]#2{%
+      \def\inserttitle{#2}%
+      \def\beamer at shorttitle{#1}%
+      \bsw at punct@test{#2}%
+    }
+  }
+\else
+  \wlog{Beamerswitch: Auto-detection of title punctuation not available.}
+\fi
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{optionkey}{frametitles}
+% \begin{macro}{beamerswitch at articleframetitles}
+% We offer some alternatives for handling frame titles in article mode.
+% \begin{itemize}
+% \item
+%   \val{para} is what \pkg{beamerarticle} normally does.
+% \item
+%   \val{margin} puts the frame titles in the margin.
+% \item
+%   \val{none} gets rid of them entirely.
+% \end{itemize}
+%
+%    \begin{macrocode}
+\define at choicekey+[AL]{beamerswitch}{frametitles}{para, margin, none}{%
+  \def\beamerswitch at articleframetitles{#1}%
+}{%
+  \ClassWarning{beamerswitch}{Value of `frametitles' not recognized.
+    Allowed values are para, margin, and none.}%
+}
+%    \end{macrocode}
+% \end{macro}
+% \end{optionkey}
+%
+% \begin{macro}{articlelayout}
+% We provide a command for setting these options.
+%
+%    \begin{macrocode}
+\newcommand{\articlelayout}[1]{%
+  \setkeys[AL]{beamerswitch}{#1}%
+%    \end{macrocode}
+%
+% The following options are mode specific.
+%
+%    \begin{macrocode}
+  \mode<article>{%
+%    \end{macrocode}
+%
+% Personally I find slide titles somewhat intrusive in article mode. They can
+% easily end up duplicating section headings in running text, or captions in
+% figures. You may have other ideas, so we keep this behaviour configurable.
+%
+% The \val{margin} value is implemented using \cs{marginpar}.
+%
+%    \begin{macrocode}
+    \ifcsstring{beamerswitch at articleframetitles}{margin}{%
+      \setbeamertemplate{frametitle}{%
+        \marginpar[%
+          \raggedleft\noindent\emshape\textbf{\insertframetitle}\par
+          \noindent\insertframesubtitle\par
+        ]{%
+          \raggedright\noindent\emshape\textbf{\insertframetitle}\par
+          \noindent\insertframesubtitle\par
+        }%
+      }
+    }{%
+      \ifcsstring{beamerswitch at articleframetitles}{none}{%
+        \setbeamertemplate{frametitle}{}
+      }{%
+        \ifcsstring{beamerswitch at articleframetitles}{para}{%
+          \setbeamertemplate{frametitle}[default]
+        }{}%
+      }%
+    }
+%    \end{macrocode}
+%
+% This is where we make our adjustments to \cs{maketitle}. We start by joining
+% the subtitle to the title by means of a colon instead of a newline.
+%
+%    \begin{macrocode}
+    \ifbool{AL at beamerswitch@maketitle}{%
+      \renewcommand{\subtitle}[2][]{%
+        \def\insertsubtitle{##2}\gappto\@title{\iftoggle{titlepunct}{}{:} ##2}%
+      }
+%    \end{macrocode}
+%
+% We add support for printing the institute information.
+%
+%    \begin{macrocode}
+      \ifundef{\beamer at originstitute}{%
+        \renewcommand{\institute}[2][]{\def\insertinstitute{##2}}%
+      }{%
+        \renewcommand{\institute}[2][]{\def\insertinstitute{##2}\beamer at originstitute{##2}}%
+      }%
+%    \end{macrocode}
+%
+% Our first change to \cs{maketitle} itself is to remove the initial vertical
+% space.
+%
+%    \begin{macrocode}
+      \def\@maketitle{%
+        \newpage
+        \null
+        \begin{center}%
+          \let\footnote\thanks
+          {\LARGE \@title \par}%
+          \vskip 1.5em%
+          {%
+            \large\lineskip .5em%
+            \begin{tabular}[t]{c}%
+              \@author
+            \end{tabular}\par
+          }%
+%    \end{macrocode}
+%
+% The other is to add in a row for the institute information.
+%
+%    \begin{macrocode}
+          \ifdefvoid{\insertinstitute}{}{%
+            {%
+              \normalsize\lineskip .5em%
+              \begin{tabular}[t]{c}%
+                \insertinstitute
+              \end{tabular}\par
+            }%
+          }%
+          \vskip 1em%
+          {\large \@date}%
+        \end{center}%
+        \par\vskip 1.5em%
+      }%
+    }{}%
+  }%
+%    \end{macrocode}
+%
+% For consistency, if the \key{maketitle} option has been passed, we change the
+% PDF metadata in the other modes to use the colon convention for joining the
+% title and subtitle.
+%
+%    \begin{macrocode}
+  \mode<presentation>{%
+    \ifbool{AL at beamerswitch@maketitle}{%
+      \ifbool{beamer at autopdfinfo}{%
+        \patchcmd{\beamer at firstminutepatches}{%
+          \inserttitle\ifx\insertsubtitle\@empty\else\ - \insertsubtitle\fi
+        }{%
+          \inserttitle\ifx\insertsubtitle\@empty\else\iftoggle{titlepunct}{}{:} \insertsubtitle\fi
+        }{}{}%
+      }{}%
+    }{}%
+  }%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% There is no more.
+%
+%    \begin{macrocode}
+\endinput
+%    \end{macrocode}
+% \iffalse
+%</class>
+% \fi
+%\Finale


Property changes on: trunk/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.ins	2016-08-23 16:45:43 UTC (rev 41914)
@@ -0,0 +1,46 @@
+%%
+%% This is file `beamerswitch.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% beamerswitch.dtx  (with options: `install')
+%% ----------------------------------------------------------------
+%% beamerswitch --- Convenient mode selection in Beamer documents
+%% Author:  Alex Ball
+%% E-mail:  a.j.ball at bath.ac.uk
+%% License: Released under the LaTeX Project Public License v1.3c or later
+%% See:     http://www.latex-project.org/lppl.txt
+%% ----------------------------------------------------------------
+%% 
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+\preamble
+----------------------------------------------------------------
+beamerswitch --- Convenient mode selection in Beamer documents
+Author:  Alex Ball
+E-mail:  a.j.ball at bath.ac.uk
+License: Released under the LaTeX Project Public License v1.3c or later
+See:     http://www.latex-project.org/lppl.txt
+----------------------------------------------------------------
+
+\endpreamble
+\postamble
+
+Copyright (C) 2016 by Alex Ball <a.j.ball at bath.ac.uk>
+\endpostamble
+
+\usedir{tex/latex/\jobname}
+\generate{
+  \file{\jobname.cls}{\from{\jobname.dtx}{class}}
+}
+\usedir{doc/latex/\jobname}
+\generate{
+  \file{\jobname-example.tex}{\from{\jobname.dtx}{example}}
+}
+\endbatchfile
+%% 
+%% Copyright (C) 2016 by Alex Ball <a.j.ball at bath.ac.uk>
+%%
+%% End of file `beamerswitch.ins'.

Added: trunk/Master/texmf-dist/tex/latex/beamerswitch/beamerswitch.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/beamerswitch/beamerswitch.cls	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/beamerswitch/beamerswitch.cls	2016-08-23 16:45:43 UTC (rev 41914)
@@ -0,0 +1,909 @@
+%%
+%% This is file `beamerswitch.cls',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% beamerswitch.dtx  (with options: `class')
+%% ----------------------------------------------------------------
+%% beamerswitch --- Convenient mode selection in Beamer documents
+%% Author:  Alex Ball
+%% E-mail:  a.j.ball at bath.ac.uk
+%% License: Released under the LaTeX Project Public License v1.3c or later
+%% See:     http://www.latex-project.org/lppl.txt
+%% ----------------------------------------------------------------
+%% 
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesClass{beamerswitch}
+    [2016/08/19 v1.1 Convenient mode selection in Beamer documents]
+\RequirePackage{xkeyval,xkvltxp,etoolbox,xstring,shellesc,iftex}
+\define at boolkey[DC]{beamerswitch}{beamer}[true]{%
+  \ifbool{DC at beamerswitch@beamer}{%
+    \setkeys[DC]{beamerswitch}{trans=false}
+    \setkeys[DC]{beamerswitch}{handout=false}
+    \setkeys[DC]{beamerswitch}{article=false}
+  }{}%
+}
+\define at boolkey[DC]{beamerswitch}{trans}[true]{%
+  \ifbool{DC at beamerswitch@trans}{%
+    \setkeys[DC]{beamerswitch}{beamer=false}
+    \setkeys[DC]{beamerswitch}{handout=false}
+    \setkeys[DC]{beamerswitch}{article=false}
+  }{}%
+}
+\define at boolkey[DC]{beamerswitch}{handout}[true]{%
+  \ifbool{DC at beamerswitch@handout}{%
+    \setkeys[DC]{beamerswitch}{beamer=false}
+    \setkeys[DC]{beamerswitch}{trans=false}
+    \setkeys[DC]{beamerswitch}{article=false}
+  }{}%
+}
+\define at boolkey[DC]{beamerswitch}{article}[true]{%
+  \ifbool{DC at beamerswitch@article}{%
+    \setkeys[DC]{beamerswitch}{beamer=false}
+    \setkeys[DC]{beamerswitch}{trans=false}
+    \setkeys[DC]{beamerswitch}{handout=false}
+  }{}%
+}
+\define at boolkey[DC]{beamerswitch}{alsobeamer}[true]{}
+\define at boolkey[DC]{beamerswitch}{alsotrans}[true]{}
+\define at boolkey[DC]{beamerswitch}{alsohandout}[true]{}
+\define at boolkey[DC]{beamerswitch}{alsoarticle}[true]{}
+\newcommand{\beamerswitch at SetAlso}[1]{%
+  \key at ifundefined[DC]{beamerswitch}{also#1}{%
+    \ClassWarning{beamerswitch}{`#1' is not a valid value for option `also'}%
+  }{%
+    \setkeys[DC]{beamerswitch}{also#1}%
+  }%
+}
+\define at key[DC]{beamerswitch}{also}{%
+  \forcsvlist{\beamerswitch at SetAlso}{#1}%
+}
+\define at boolkey[DC]{beamerswitch}{nohyperref}[true]{}
+\define at boolkey[DC]{beamerswitch}{textinst}[true]{}
+\setkeys[DC]{beamerswitch}{beamer=true,alsobeamer=false,alsotrans=false,%
+  alsohandout=false,alsoarticle=false}
+\ProcessOptionsX[DC]<beamerswitch>
+\providecommand*{\BeamerSuffix}{-slides}
+\providecommand*{\TransSuffix}{-trans}
+\providecommand*{\HandoutSuffix}{-handout}
+\providecommand*{\ArticleSuffix}{-article}
+\providecommand{\BeamerswitchSpawn}[1]{%
+  \ifbool{PDFTeX}{%
+    \ShellEscape{latexmk -silent -pdf -synctex=1 -interaction=batchmode -jobname=\jobname#1 \jobname}
+  }{%
+    \ifbool{LuaTeX}{%
+      \ShellEscape{latexmk -silent -lualatex -synctex=1 -interaction=batchmode -jobname=\jobname#1 \jobname}
+    }{%
+      \ifbool{XeTeX}{%
+        \ShellEscape{latexmk -silent -xelatex -synctex=1 -interaction=batchmode -jobname=\jobname#1 \jobname}
+      }{%
+        \ShellEscape{latexmk -silent -synctex=1 -interaction=batchmode -jobname=\jobname#1 \jobname}
+      }%
+    }%
+  }%
+}
+\IfEndWith*{\jobname}{\BeamerSuffix}{%
+  \setkeys[DC]{beamerswitch}{beamer=true}
+}{%
+  \IfEndWith*{\jobname}{\TransSuffix}{%
+    \setkeys[DC]{beamerswitch}{trans=true}
+  }{%
+    \IfEndWith*{\jobname}{\HandoutSuffix}{%
+      \setkeys[DC]{beamerswitch}{handout=true}
+    }{%
+      \IfEndWith*{\jobname}{\ArticleSuffix}{%
+        \setkeys[DC]{beamerswitch}{article=true}
+      }{%
+        \ifbool{DC at beamerswitch@alsobeamer}{%
+          \BeamerswitchSpawn{\BeamerSuffix}%
+        }{}
+        \ifbool{DC at beamerswitch@alsotrans}{%
+          \BeamerswitchSpawn{\TransSuffix}%
+        }{}
+        \ifbool{DC at beamerswitch@alsohandout}{%
+          \BeamerswitchSpawn{\HandoutSuffix}%
+        }{}
+        \ifbool{DC at beamerswitch@alsoarticle}{%
+          \BeamerswitchSpawn{\ArticleSuffix}%
+        }{}
+      }%
+    }%
+  }%
+}%
+\ifbool{DC at beamerswitch@article}{%
+  \LoadClass{article}
+  \RequirePackage{beamerarticle}
+  \ifbool{DC at beamerswitch@nohyperref}{}{%
+    \RequirePackage[bookmarks=true,%
+    bookmarksopen=true,%
+    pdfborder={0 0 0},%
+    pdfhighlight={/N},%
+    linkbordercolor={.5 .5 .5}]{hyperref}%
+  }
+  \AtBeginDocument{%
+    \@ifpackageloaded{hyperref}{%
+      \pdfstringdefDisableCommands{\def\\<#1>#2{ - #2}}
+      \begingroup
+      \hypersetup{pdftitle={\@title}}%
+      \def\and{\unskip, }%
+      \let\thanks=\@gobble
+      \let\inst=\@gobble
+      \hypersetup{pdfauthor={\@author}}%
+      \endgroup
+    }{}%
+  }
+}{%
+  \ifbool{DC at beamerswitch@handout}{%
+    \LoadClass[ignorenonframetext,handout]{beamer}
+    \RequirePackage{pgfpages}
+  }{%
+    \ifbool{DC at beamerswitch@trans}{%
+      \LoadClass[ignorenonframetext,trans]{beamer}
+    }{%
+      \LoadClass[ignorenonframetext]{beamer}
+    }%
+  }
+}
+\ifbool{DC at beamerswitch@textinst}{%
+  \def\beamer at insttitle#1{\textsuperscript{#1}}
+  \def\beamer at instinst#1{\textsuperscript{#1}\ignorespaces}
+}{}
+\newcommand*{\beamerswitch at Border}{\relax}
+\mode<handout>{%
+  \pgfpagesdeclarelayout{1 by 2}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=2,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \fi
+  }
+  \pgfpagesdeclarelayout{1 by 3}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=3,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=\pgfphysicalheight,%
+      center=\pgfpoint{.167\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=\pgfphysicalheight,%
+      center=\pgfpoint{.833\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.833\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.167\pgfphysicalheight}%
+    }%
+    \fi
+  }
+  \pgfpagesdeclarelayout{1 by 3 narrow}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=3,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.167\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.833\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.833\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.167\pgfphysicalheight}%
+    }%
+    \fi
+  }
+  \pgfpagesdeclarelayout{2 by 2}
+  {
+    \edef\pgfpageoptionheight{\the\paperheight}
+    \edef\pgfpageoptionwidth{\the\paperwidth}
+    \edef\pgfpageoptionborder{0pt}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=4,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth%
+    }
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+  }
+  \pgfpagesdeclarelayout{1 by 4 narrow}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=4,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.125\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.375\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.625\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.875\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.875\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.625\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.375\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.125\pgfphysicalheight}%
+    }%
+    \fi
+  }
+  \pgfpagesdeclarelayout{2 by 3}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=6,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.167\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.833\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.167\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{5}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{6}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.333\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.833\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.833\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.833\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.5\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{5}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.167\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{6}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.333\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.167\pgfphysicalheight}%
+    }%
+    \fi
+  }
+  \pgfpagesdeclarelayout{2 by 4}
+  {
+    \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+    \edef\pgfpageoptionwidth{\the\paperheight}
+    \def\pgfpageoptionborder{0pt}
+    \def\pgfpageoptionfirstshipout{1}
+  }
+  {
+    \pgfpagesphysicalpageoptions
+    {%
+      logical pages=8,%
+      physical height=\pgfpageoptionheight,%
+      physical width=\pgfpageoptionwidth,%
+      current logical shipout=\pgfpageoptionfirstshipout%
+    }
+    \ifdim\paperheight>\paperwidth\relax
+    % put side-by-side
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.125\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.375\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.625\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.875\pgfphysicalwidth}{.75\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{5}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.125\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{6}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.375\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{7}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.625\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{8}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.25\pgfphysicalwidth,%
+      resized height=.5\pgfphysicalheight,%
+      center=\pgfpoint{.875\pgfphysicalwidth}{.25\pgfphysicalheight}%
+    }%
+    \else
+    % stack on top of one another
+    \pgfpageslogicalpageoptions{1}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.875\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{2}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.875\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{3}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.625\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{4}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25\pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.625\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{5}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.375\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{6}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.375\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{7}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.25\pgfphysicalwidth}{.125\pgfphysicalheight}%
+    }%
+    \pgfpageslogicalpageoptions{8}
+    {%
+      border shrink=\pgfpageoptionborder,%
+      border code=\beamerswitch at Border,%
+      resized width=.5\pgfphysicalwidth,%
+      resized height=.25 \pgfphysicalheight,%
+      center=\pgfpoint{.75\pgfphysicalwidth}{.125\pgfphysicalheight}%
+    }%
+    \fi
+  }
+}
+\define at key[HL]{beamerswitch}{paper}{%
+  \def\beamerswitch at handoutpaper{#1}%
+}
+\newcounter{beamerswitch at nupcase}
+\define at choicekey+[HL]{beamerswitch}{nup}[\val\nr]{2, 3, 3plus, 4, 4plus, 6, 8}{%
+  \setcounter{beamerswitch at nupcase}{\nr}
+}{%
+  \ClassWarning{beamerswitch}{Value of `nup' not recognized.
+    Allowed values are 2, 3, 3plus, 4, 4plus, 6, and 8.}%
+}
+\define at key[HL]{beamerswitch}{border}[0.4pt]{%
+  \RequirePackage{pgf}%
+  \renewcommand*{\beamerswitch at Border}{\pgfsetlinewidth{#1}\pgfstroke}%
+}
+\define at boolkey[HL]{beamerswitch}{pnos}[true]{}
+\newcommand*{\handoutlayout}[1]{%
+  \only<handout>{%
+    \setkeys[HL]{beamerswitch}{#1}%
+    \ifcase\value{beamerswitch at nupcase}\relax
+      \def\beamerswitch at nup{2}
+      \pgfpagesuselayout{1 by 2}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{3}
+      \pgfpagesuselayout{1 by 3}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{3}
+      \pgfpagesuselayout{1 by 3 narrow}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{4}
+      \pgfpagesuselayout{2 by 2}[\beamerswitch at handoutpaper,landscape,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{4}
+      \pgfpagesuselayout{1 by 4 narrow}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{6}
+      \pgfpagesuselayout{2 by 3}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \or
+      \def\beamerswitch at nup{8}
+      \pgfpagesuselayout{2 by 4}[\beamerswitch at handoutpaper,border shrink=5mm]%
+    \fi
+    \ifbool{HL at beamerswitch@pnos}{%
+      \def\pgfsys at endpicture{%
+        \raisebox{5mm}[0pt][0pt]{%
+          \makebox[\pgfphysicalwidth]{%
+            \the\numexpr\value{page}/\beamerswitch at nup\relax
+          }%
+        }%
+      }%
+    }{}%
+  }%
+}
+\handoutlayout{paper=a4paper,nup=6}
+\define at boolkey[AL]{beamerswitch}{maketitle}[true]{}
+\newtoggle{titlepunct}
+\IfFileExists{xparse.sty}{\@tempswatrue}{\@tempswafalse}
+\if at tempswa
+  \RequirePackage{xparse}
+  \ExplSyntaxOn
+  \NewDocumentCommand{\bsw at punct@test}{m}{\l_bsw_punct_test:n {#1}}
+  \cs_new_protected:Nn \l_bsw_punct_test:n
+  {
+    \str_case_x:nnTF { \str_item:nn {#1} {-1} }
+      {
+        { , } { }
+        { ; } { }
+        { : } { }
+        { . } { }
+        { ! } { }
+        { ? } { }
+      }
+      { \global\toggletrue{titlepunct} }
+      { \global\togglefalse{titlepunct} }
+  }
+  \ExplSyntaxOff
+  \mode<article>{%
+    \renewcommand{\title}[2][]{\beamer at origtitle{#2}\bsw at punct@test{#2}}
+  }
+  \mode<presentation>{%
+    \long\def\beamer at title[#1]#2{%
+      \def\inserttitle{#2}%
+      \def\beamer at shorttitle{#1}%
+      \bsw at punct@test{#2}%
+    }
+  }
+\else
+  \wlog{Beamerswitch: Auto-detection of title punctuation not available.}
+\fi
+\define at choicekey+[AL]{beamerswitch}{frametitles}{para, margin, none}{%
+  \def\beamerswitch at articleframetitles{#1}%
+}{%
+  \ClassWarning{beamerswitch}{Value of `frametitles' not recognized.
+    Allowed values are para, margin, and none.}%
+}
+\newcommand{\articlelayout}[1]{%
+  \setkeys[AL]{beamerswitch}{#1}%
+  \mode<article>{%
+    \ifcsstring{beamerswitch at articleframetitles}{margin}{%
+      \setbeamertemplate{frametitle}{%
+        \marginpar[%
+          \raggedleft\noindent\emshape\textbf{\insertframetitle}\par
+          \noindent\insertframesubtitle\par
+        ]{%
+          \raggedright\noindent\emshape\textbf{\insertframetitle}\par
+          \noindent\insertframesubtitle\par
+        }%
+      }
+    }{%
+      \ifcsstring{beamerswitch at articleframetitles}{none}{%
+        \setbeamertemplate{frametitle}{}
+      }{%
+        \ifcsstring{beamerswitch at articleframetitles}{para}{%
+          \setbeamertemplate{frametitle}[default]
+        }{}%
+      }%
+    }
+    \ifbool{AL at beamerswitch@maketitle}{%
+      \renewcommand{\subtitle}[2][]{%
+        \def\insertsubtitle{##2}\gappto\@title{\iftoggle{titlepunct}{}{:} ##2}%
+      }
+      \ifundef{\beamer at originstitute}{%
+        \renewcommand{\institute}[2][]{\def\insertinstitute{##2}}%
+      }{%
+        \renewcommand{\institute}[2][]{\def\insertinstitute{##2}\beamer at originstitute{##2}}%
+      }%
+      \def\@maketitle{%
+        \newpage
+        \null
+        \begin{center}%
+          \let\footnote\thanks
+          {\LARGE \@title \par}%
+          \vskip 1.5em%
+          {%
+            \large\lineskip .5em%
+            \begin{tabular}[t]{c}%
+              \@author
+            \end{tabular}\par
+          }%
+          \ifdefvoid{\insertinstitute}{}{%
+            {%
+              \normalsize\lineskip .5em%
+              \begin{tabular}[t]{c}%
+                \insertinstitute
+              \end{tabular}\par
+            }%
+          }%
+          \vskip 1em%
+          {\large \@date}%
+        \end{center}%
+        \par\vskip 1.5em%
+      }%
+    }{}%
+  }%
+  \mode<presentation>{%
+    \ifbool{AL at beamerswitch@maketitle}{%
+      \ifbool{beamer at autopdfinfo}{%
+        \patchcmd{\beamer at firstminutepatches}{%
+          \inserttitle\ifx\insertsubtitle\@empty\else\ - \insertsubtitle\fi
+        }{%
+          \inserttitle\ifx\insertsubtitle\@empty\else\iftoggle{titlepunct}{}{:} \insertsubtitle\fi
+        }{}{}%
+      }{}%
+    }{}%
+  }%
+}
+%% 
+%% Copyright (C) 2016 by Alex Ball <a.j.ball at bath.ac.uk>
+%%
+%% End of file `beamerswitch.cls'.


Property changes on: trunk/Master/texmf-dist/tex/latex/beamerswitch/beamerswitch.cls
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2016-08-23 16:29:25 UTC (rev 41913)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2016-08-23 16:45:43 UTC (rev 41914)
@@ -75,7 +75,7 @@
     bbcard bbding bbm bbm-macros bbold bbold-type1 bchart bclogo
     beamer beamer2thesis beamer-FUBerlin beamer-tut-pt beamer-verona
     beameraudience beamercolorthemeowl beamerdarkthemes beamerposter
-    beamersubframe
+    beamersubframe beamerswitch
     beamertheme-detlevcm beamertheme-epyt beamertheme-metropolis
     beamertheme-phnompenh beamertheme-upenn-bc
     beamerthemejltree

Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2016-08-23 16:29:25 UTC (rev 41913)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2016-08-23 16:45:43 UTC (rev 41914)
@@ -152,7 +152,6 @@
  'beamer',      "&MAKEbeamer",
  'beamer2thesis',       "&MAKEflatten",
  'beamer-contrib',      "die 'skipping, use subdirs'",
- 'beamerswitch',	"die 'skipping, cannot extract, ->author 20aug16'",
  'beamertheme-metropolis',	"&MAKEflatten",
  'beamertheme-upenn-bc',	"&MAKEflatten",
  'beebe',               "die 'skipping, MAKEbeebe needs work, sorry'",
@@ -2343,6 +2342,7 @@
  'basque-book'  => 'latex',  # requires interaction
  'basque-date'  => 'latex',  # requires interaction
  'bbold'	=> 'pdflatex',
+ 'beamerswitch' => 'tex',    # no doc regen
  'bguq'         => 'latex',  # requires interaction
  'bhcexam'      => 'latex',  # requires interaction
  'bosisio'      => 'latex -translate-file=empty.tcx',   # ^^, no 8-bit

Added: trunk/Master/tlpkg/tlpsrc/beamerswitch.tlpsrc
===================================================================
Modified: trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2016-08-23 16:29:25 UTC (rev 41913)
+++ trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2016-08-23 16:45:43 UTC (rev 41914)
@@ -10,6 +10,7 @@
 depend asypictureb
 depend autoarea
 depend bardiag
+depend beamerswitch
 depend binarytree
 depend blochsphere
 depend bloques



More information about the tex-live-commits mailing list