diff options
author | Karl Berry <karl@freefriends.org> | 2019-01-28 22:04:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-01-28 22:04:15 +0000 |
commit | 99c613f04edeed8a28efac69411132ea2cd8164d (patch) | |
tree | 08dfa6b30c8ee0ed1fd6d71f5cde0542efb80cdd /Master/texmf-dist/source | |
parent | 3e868961dcbbe4a5ef7f395e1d9cb824100e0046 (diff) |
beamerswitch (28jan19)
git-svn-id: svn://tug.org/texlive/trunk@49849 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
3 files changed, 121 insertions, 26 deletions
diff --git a/Master/texmf-dist/source/latex/beamerswitch/Makefile b/Master/texmf-dist/source/latex/beamerswitch/Makefile new file mode 100644 index 00000000000..56df2d3e87e --- /dev/null +++ b/Master/texmf-dist/source/latex/beamerswitch/Makefile @@ -0,0 +1,52 @@ +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 + tex -interaction=batchmode $(NAME).dtx >/dev/null +$(NAME).pdf: $(NAME).dtx + lualatex -shell-escape -recorder -interaction=batchmode $(NAME).dtx >/dev/null + if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi + latexmk -silent -pdflua -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 -pdflua -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) diff --git a/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.dtx b/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.dtx index 38340046358..3c72f4f40d4 100644 --- a/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.dtx +++ b/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.dtx @@ -93,7 +93,7 @@ first three steps. ## Licence -Copyright 2016–2018 Alex Ball. +Copyright 2016–2019 Alex Ball. This work consists of the file beamerswitch.dtx and a Makefile. @@ -185,7 +185,7 @@ This work is "maintained" (as per LPPL maintenance status) by ---------------------------------------------------------------- beamerswitch --- Convenient mode selection in Beamer documents Author: Alex Ball -E-mail: a.j.ball@bath.ac.uk +E-mail: ab318@bath.ac.uk License: Released under the LaTeX Project Public License v1.3c or later See: http://www.latex-project.org/lppl.txt ---------------------------------------------------------------- @@ -193,7 +193,7 @@ See: http://www.latex-project.org/lppl.txt \endpreamble \postamble -Copyright (C) 2016-2018 by Alex Ball <a.j.ball@bath.ac.uk> +Copyright (C) 2016-2019 by Alex Ball <ab318@bath.ac.uk> \endpostamble \usedir{tex/latex/\jobname} @@ -228,7 +228,7 @@ Copyright (C) 2016-2018 by Alex Ball <a.j.ball@bath.ac.uk> %<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<class>\ProvidesClass{beamerswitch} %<*class> - [2018/09/05 v1.4.1 Convenient mode selection in Beamer documents] + [2019/01/28 v1.5 Convenient mode selection in Beamer documents] %</class> %<*driver> \documentclass[12pt]{article} @@ -331,26 +331,33 @@ Copyright (C) 2016-2018 by Alex Ball <a.j.ball@bath.ac.uk> \newcommand*{\env}[1]{\textcolor{Environment}{\ttfamily #1}} \newcommand*{\key}[1]{\textcolor{Option}{\ttfamily #1}} \newcommand*{\val}[1]{\textcolor{Value}{\ttfamily #1}} + +\makeatletter \renewenvironment{macro}[1]{% - \def\MyName{#1}% - \index{\MyName@\tcbIndexPrintComC {\MyName}|(emph}% + \StrSubstitute{#1}{\detokenize{@}}{"@}[\MyName]% + \edef\saved@macroname{\expandafter\string\csname #1\endcsname}% + \let\saved@indexname\saved@macroname + \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}|)}% + \index{\MyName @\tcbIndexPrintComC {\MyName}|)}% } \renewenvironment{environment}[1]{% - \def\MyName{#1}% - \index{\MyName@\tcbIndexPrintEnvCA {\MyName}|(emph}% - \index{Environments!\MyName@\tcbIndexPrintEnvC {\MyName}|(emph}% + \StrSubstitute{#1}{\detokenize{@}}{"@}[\MyName]% + \edef\saved@macroname{#1}% + \let\saved@indexname\saved@macroname + \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}|)}% + \index{Environments!\MyName @\tcbIndexPrintEnvC {\MyName}|)}% + \index{\MyName @\tcbIndexPrintEnvCA {\MyName}|)}% } +\makeatother \newenvironment{optionkey}[1]{% \def\MyName{#1}% \index{\MyName@\tcbIndexPrintKeyCA {\MyName}|(emph}% @@ -495,7 +502,6 @@ 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} -\changes{v1.1}{2016/08/19}{Fix \key{maketitle} and \key{textinst} options.} \changes{v1.2}{2016/05/22}{Add `Quick start guide' section.} \section{Quick start guide} @@ -1081,9 +1087,7 @@ using the following command in the preamble. \end{docKey} \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. + Puts a rectangular border of thickness \meta{length} around each slide. \end{docKey} \begin{docKey}{margin}{=\meta{length}}{default 0pt, initially 5mm} @@ -1357,8 +1361,8 @@ suggestions for improvements or new features to the % \end{macro} % \end{macro} % -% \changes{v1.3}{2017/12/10}{Decompose \cs{BeamerswitchSpawn} into further configurable macros.} % \begin{macro}{BeamerswitchSpawn} +% \changes{v1.3}{2017/12/10}{Decompose \cs{BeamerswitchSpawn} into further configurable macros.} % \begin{macro}{SpawnedTeX} % \begin{macro}{SpawnedPDFTeX} % \begin{macro}{SpawnedXeTeX} @@ -1572,19 +1576,31 @@ suggestions for improvements or new features to the % % \begin{optionkey}{border} % \begin{macro}{beamerswitch@Border} +% \changes{v1.5}{2019/01/28}{Remove empty frames from end of handout.} % 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. % % This is implemented as a PGF drawing command, which is initially set up to do -% nothing but gets filled out if the option is selected. +% nothing but gets filled out if the option is selected. As part of this, we +% calculate the number of the current slide (|handoutpno| gives the current page +% number minus one; \cs{beamerswitch@nup} is the number of slides per page; +% and \cs{pgf@cpn} gives the count of the current slide on the current page). +% If this exceeds the total number of slides, we suppress the border. % % \begin{macrocode} \newcommand*{\beamerswitch@Border}{\relax} \define@key[HL]{beamerswitch}{border}[0.4pt]{% \RequirePackage{pgf}% \ifdimcomp{#1}{>}{0pt}{% - \renewcommand*{\beamerswitch@Border}{\pgfsetlinewidth{#1}\pgfstroke}% + \renewcommand*{\beamerswitch@Border}{% + \ifnumcomp{(\value{handoutpno} * \beamerswitch@nup) + \the\pgf@cpn}% + {>}{\beamer@endpageofdocument}{% + \relax + }{% + \pgfsetlinewidth{#1}\pgfstroke + }% + }% }{% \renewcommand*{\beamerswitch@Border}{\relax}% }% @@ -1593,8 +1609,8 @@ suggestions for improvements or new features to the % \end{macro} % \end{optionkey} % -% \changes{v1.4}{2018/08/29}{Make margins around slides a configurable size} % \begin{optionkey}{margin} +% \changes{v1.4}{2018/08/29}{Make margins around slides a configurable size} % \begin{macro}{beamerswitch@margin} % The \key{margin} option controls how much white space is added around each % slide on handout pages. It corresponds to the \texttt{border shrink} option @@ -1650,9 +1666,24 @@ suggestions for improvements or new features to the % \end{macro} % % \begin{macro}{handoutlayout} -% \begin{macro}{beamerswitch@nup} +% \begin{macro}{beamerswitch@pnoadjust} % We set up the \cs{handoutlayout} command for applying these options. % +% The hook \cs{beamerswitch@footer} is used to step the page number +% counter |handoutpno|; if page numering is active, it also places the +% number on the page centered and \cs{handoutpnobaseline} up from the +% bottom. +% +% The length \cs{beamerswitch@pnoadjust} is, conceptually, the height +% of the page number. When page numbers are active, the margin around +% slides is automatically increased to guarantee that the top of the +% page number will not be higher than the bottom of the lowest slide. +% Currently this does not account for extra whitespace arising from +% aspect ratio issues. When the \key{align} option is active, the margin +% at the bottom of the page is increased, but to save a register we +% make the adjustment to \cs{beamerswitch@pnoadjust} instead of a copy +% of \cs{beamerswitch@margin}. +% % \begin{macrocode} \newlength{\beamerswitch@pnoadjust} \newcommand*{\handoutlayout}[1]{% @@ -1694,8 +1725,18 @@ suggestions for improvements or new features to the {\the\dimexpr\handoutpnobaseline + \beamerswitch@pnoadjust\relax}% }{}% }{% - \def\beamerswitch@footer{}% + \def\beamerswitch@footer{\stepcounter{handoutpno}}% }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{beamerswitch@nup} +% The value of the \key{nup} option is used both to select the layout +% and set the value of \cs{beamerswitch@nup}. The latter is used to +% suppress unwanted borders and check if \cs{handoutlayout} has been +% called. +% +% \begin{macrocode} \ifcase\value{beamerswitch@nupcase}\relax \def\beamerswitch@nup{2}% \pgfpagesuselayout{1 by 2}[\beamerswitch@handoutpaper,% @@ -2315,6 +2356,7 @@ suggestions for improvements or new features to the \pgfpageslogicalpageoptions{1} {% border shrink=\pgfpageoptionborder,% + border code=\beamerswitch@Border,% resized width=.5\pgfphysicalwidth,% resized height=.333\pgfphysicalheight,% center=\ifbool{HL@beamerswitch@align}{% @@ -2630,6 +2672,7 @@ suggestions for improvements or new features to the % % We provide some options for configuring the appearance of article mode. % +% \changes{v1.1}{2016/08/19}{Fix \key{maketitle} and \key{textinst} options.} % \begin{optionkey}{maketitle} % The \key{maketitle} option triggers adjustments in how the title block is % printed. diff --git a/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.ins b/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.ins index 9db81b07ff1..5fedb56b8f0 100644 --- a/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.ins +++ b/Master/texmf-dist/source/latex/beamerswitch/beamerswitch.ins @@ -8,7 +8,7 @@ %% ---------------------------------------------------------------- %% beamerswitch --- Convenient mode selection in Beamer documents %% Author: Alex Ball -%% E-mail: a.j.ball@bath.ac.uk +%% E-mail: ab318@bath.ac.uk %% License: Released under the LaTeX Project Public License v1.3c or later %% See: http://www.latex-project.org/lppl.txt %% ---------------------------------------------------------------- @@ -20,7 +20,7 @@ ---------------------------------------------------------------- beamerswitch --- Convenient mode selection in Beamer documents Author: Alex Ball -E-mail: a.j.ball@bath.ac.uk +E-mail: ab318@bath.ac.uk License: Released under the LaTeX Project Public License v1.3c or later See: http://www.latex-project.org/lppl.txt ---------------------------------------------------------------- @@ -28,7 +28,7 @@ See: http://www.latex-project.org/lppl.txt \endpreamble \postamble -Copyright (C) 2016-2018 by Alex Ball <a.j.ball@bath.ac.uk> +Copyright (C) 2016-2019 by Alex Ball <ab318@bath.ac.uk> \endpostamble \usedir{tex/latex/\jobname} @@ -41,6 +41,6 @@ Copyright (C) 2016-2018 by Alex Ball <a.j.ball@bath.ac.uk> } \endbatchfile %% -%% Copyright (C) 2016-2018 by Alex Ball <a.j.ball@bath.ac.uk> +%% Copyright (C) 2016-2019 by Alex Ball <ab318@bath.ac.uk> %% %% End of file `beamerswitch.ins'. |