From 1b674ef86fe17b1011f19a929dfd82253eb90995 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 30 Jan 2018 21:04:41 +0000 Subject: hackthefootline (30jan18) git-svn-id: svn://tug.org/texlive/trunk@46494 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/hackthefootline/README.md | 8 +- .../hackthefootline/doc/hackthefootline-doc.pdf | Bin 165479 -> 179011 bytes .../hackthefootline/doc/hackthefootline-doc.tex | 58 ++++--- .../doc/hackthefootline-examples.pdf | Bin 86505 -> 86495 bytes .../doc/hackthefootline-examples.tex | 6 +- .../tex/latex/hackthefootline/hackthefootline.sty | 181 +++++++++++++-------- 6 files changed, 154 insertions(+), 99 deletions(-) diff --git a/Master/texmf-dist/doc/latex/hackthefootline/README.md b/Master/texmf-dist/doc/latex/hackthefootline/README.md index 5ca0a825fcc..f8de445941f 100644 --- a/Master/texmf-dist/doc/latex/hackthefootline/README.md +++ b/Master/texmf-dist/doc/latex/hackthefootline/README.md @@ -1,17 +1,17 @@ # hackthefootline -## Arbitrary footline selection for LaTeX beamer's standard themes. +## Arbitrary footline selection and configuration for LaTeX beamer's standard themes. Some `beamer` themes provide footlines -- and some do not. Now, if one wants to have a footline, he is restricted to the (outer) themes providing them or loads multiple themes. On top of that, these provided footlines are only configurable by redefining them as a whole, which is quite uncomfortable and yields many lines of additional code. -`hackthefootline` is a package taking over, defining and redefining different footlines, so they can be configured using key-value syntax. Also, it is possible (but *not* recommended) to switch between different footline types during a presentation. +`hackthefootline` is a package taking over, defining and redefining different footlines, so they can be configured using key-value syntax. Also, it is possible (but *not* recommended as it might distract your audience) to switch between different footline types during a presentation. ### Dependencies -`hackthefootline` depends on the `pgfkeys` package and -- obviously -- on the `beamer` class. +`hackthefootline` depends on the packages `ifthen` and `pgfkeys` and -- obviously -- on the `beamer` class. -Additional sophisticated features included also require `appendixnumberbeamer`, `etoolbox`, `calc` and `numprint`, but these four dependencies can be resolved by passing some options to the `hackthefootline` package. +Additional sophisticated features included also require `appendixnumberbeamer` (only when using beamer v3.48 and older), `etoolbox`, `calc` and `numprint`, but these four dependencies can be resolved by passing some options to the `hackthefootline` package. ### License This work is licensed under the LPPL 1.3c or any later version. diff --git a/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-doc.pdf b/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-doc.pdf index 6fe185b639a..3c4fd7485ed 100644 Binary files a/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-doc.pdf and b/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-doc.pdf differ diff --git a/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-doc.tex b/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-doc.tex index 14f5ed168f5..437d5308f13 100644 --- a/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-doc.tex +++ b/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-doc.tex @@ -1,5 +1,5 @@ -%% This is file 'hackthefootline-doc.tex', Version 2018-01-16 -%% Copyright 2017 Sebastian Friedl +%% This is file 'hackthefootline-doc.tex', Version 2018-01-29 +%% Copyright 2017-18 Sebastian Friedl %% %% This work may be distributed and/or modified under the conditions of the LaTeX Project %% Public License, either version 1.3c of this license or (at your option) any later version. @@ -16,7 +16,7 @@ %% ------------------------------------------------------------------------------------------- %% %% The hackthefootline package is a tool providing arbitrary footline selection and -%% configuration for LaTeX beamer's standard themes (other themes may also work, of course) +%% configuration for LaTeX beamer's standard themes (it may work with other themes as well) %% %% ------------------------------------------------------------------------------------------- %% @@ -77,7 +77,7 @@ \title{The \texttt{\bfseries hackthefootline} package \\ {\large\url{https://github.com/SFr682k/hackthefootline}}} \author{Sebastian Friedl \\ \href{mailto:sfr682k@t-online.de}{\ttfamily sfr682k@t-online.de}} -\date{2018/01/16} +\date{2018/01/29} \hypersetup{pdftitle={The hackthefootline package},pdfauthor={Sebastian Friedl}} @@ -97,9 +97,12 @@ \medskip \begin{abstract} - \noindent% - \textbf{Arbitrary footline selection and configuration for \LaTeX\ \texttt{beamer}'s standard themes.} + \parindent0pt\noindent% + \textbf{Arbitrary footline selection and configuration for \LaTeX\ \texttt{beamer}'s standard themes.} \\ "hackthefootline" is a package taking over, defining and redefining different footlines, so they can be configured using key-value syntax. + + \medskip + The basic layout of the two- and three-column footline is based on the original \LaTeX\ beamer split and infolines outer themes written by Till Tantau. \end{abstract} @@ -115,6 +118,10 @@ \DescribeMacro{beamer} Since "hackthefootline" is designed to modify "beamer"'s footlines, it is incompatible to any other document class. Therefore, load this package only in "beamer" documents! + \medskip + \DescribeMacro{ifthen} + This package is required to compare the length of some boxes. + \medskip \DescribeMacro{pgfkeys} "hackthefootline" heavily depends on the "pgfkeys" package for handling the whole key-value stuff. @@ -124,7 +131,8 @@ \medskip \DescribeMacro{appendixnumber-}\DescribeMacro{beamer} - The "appendixnumberbeamer" package implements a simple solution for appendix frames not being calculated into the total number of frames + \textit{\bfseries Only required when using \texttt{beamer} version 3.48 and older.} + This package is only required when using "beamer" version 3.48 or older. If you are using "beamer" version 3.49 or later\footnote{i. e. \TeX{}Live 2018 and later}, "hackthefootline" will rely on "beamer"'s internal appendix frame numbering mechanisms. \medskip \DescribeMacro{etoolbox} @@ -142,9 +150,18 @@ However, the four latter dependencies can be removed by using some package options. See section \ref{behavioropts} for further details. + \subsection*{Notice: Behavior inside the presentation's appendix} + \addcontentsline{toc}{subsection}{Notice: Behavior inside the presentation's appendix} + By default, appendix frames are \emph{not} counted into the total number of frames when using "hackthefootline". Appendix frame numbers will be counted from 1 when using fraction frame numbers. \\ + Also, frame numbers won't be displayed on footlines inside the appendix until this is changed using the means of the "\htfconfig" command. + + \medskip + This behavior can be suppressed by passing the "countappendixframes" option. + + \subsection*{License} \addcontentsline{toc}{subsection}{License} - \textcopyright\ 2017 Sebastian Friedl + \textcopyright\ 2017-18 Sebastian Friedl \smallskip This work may be distributed and/or modified under the conditions of the \LaTeX\ Project Public License, either version 1.3c of this license or (at your option) any later version. @@ -162,22 +179,8 @@ \end{itemize} - \subsection*{Acknowledgement} - \addcontentsline{toc}{subsection}{Acknowledgement} - The basic layout of the two-- and three--column footline is based on the original \LaTeX\ beamer split and infolines outer themes written by Till Tantau. - - - \subsection*{Notice: Behavior inside the presentation's appendix} - \addcontentsline{toc}{subsection}{Notice: Behavior inside the presentation's appendix} - By default, this package \emph{does not count appendix frames} into the total number of frames and resets the counter for frame numbers to 1 as soon as the "\appendix" command is used. Also, frame numbers won't be displayed on footlines inside the appendix. - - \medskip - This behavior can be suppressed by passing the \texttt{countappendixframes} option. - - \clearpage - @@ -263,9 +266,11 @@ \item[none] Remove the footline completely \end{description} - This key is provided although it is \emph{not} recommended to change its value within a document. - When initializing "hackthefootline" using a column option and switching to the "none" style, there will be a whitespace \enquote{reserved} for the footline left. \\ - The other way round, when initializing "hackthefootline" without a column option and switching to a footline, the footline will be cut off at half of its height. + + Although the "cols" key's value changes, the other keys' values stay the same. \textbf{If you change the number of columns of a footline, the other keys should be adjusted as well.} + + \medskip + \emph{Warning:} Changing this key's value too often might distract your audience. } \DescribeOption{title}{short, long, none}{% @@ -337,7 +342,7 @@ - \section{Default configurations} \label{defaultconfig}% TODO: Real pictures + \section{Default configurations} \label{defaultconfig} Depending on the selected number of columns, the default configuration of the footlines is as follows: \subsection*{One--column footline} @@ -360,7 +365,6 @@ - % TODO: rewrite, more examples from "real" beamer documents \section{Examples} \subsection{Setting up \texttt{hackthefootline}}\label{examples-setup} \paragraph{Example 1:} diff --git a/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-examples.pdf b/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-examples.pdf index 178db6caf8f..c81238f80f9 100644 Binary files a/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-examples.pdf and b/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-examples.pdf differ diff --git a/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-examples.tex b/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-examples.tex index 6536301c1bb..1c42246ad41 100644 --- a/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-examples.tex +++ b/Master/texmf-dist/doc/latex/hackthefootline/doc/hackthefootline-examples.tex @@ -1,5 +1,5 @@ -%% This is file 'hackthefootline-examples.tex', Version 2018-01-16 -%% Copyright 2017 Sebastian Friedl +%% This is file 'hackthefootline-examples.tex', Version 2018-01-29 +%% Copyright 2017-18 Sebastian Friedl %% %% This work may be distributed and/or modified under the conditions of the LaTeX Project %% Public License, either version 1.3c of this license or (at your option) any later version. @@ -16,7 +16,7 @@ %% ------------------------------------------------------------------------------------------- %% %% The hackthefootline package is a tool providing arbitrary footline selection and -%% configuration for LaTeX beamer's standard themes (other themes may also work, of course) +%% configuration for LaTeX beamer's standard themes (it may work with other themes as well) %% %% ------------------------------------------------------------------------------------------- %% diff --git a/Master/texmf-dist/tex/latex/hackthefootline/hackthefootline.sty b/Master/texmf-dist/tex/latex/hackthefootline/hackthefootline.sty index 0882f0fbf07..14d83c28148 100644 --- a/Master/texmf-dist/tex/latex/hackthefootline/hackthefootline.sty +++ b/Master/texmf-dist/tex/latex/hackthefootline/hackthefootline.sty @@ -1,5 +1,5 @@ -%% This is file 'hackthefootline.sty', Version 2018-01-16 -%% Copyright 2017 Sebastian Friedl +%% This is file 'hackthefootline.sty', Version 2018-01-29 +%% Copyright 2017-18 Sebastian Friedl %% %% This work may be distributed and/or modified under the conditions of the LaTeX Project %% Public License, either version 1.3c of this license or (at your option) any later version. @@ -32,9 +32,10 @@ %% ------------------------------------------------------------------------------------------- -\ProvidesPackage{hackthefootline}[2018/01/16 hackthefootline: Arbitrary footline selection and configuration for LaTeX beamer's standard themes] +\ProvidesPackage{hackthefootline}[2018/01/29 hackthefootline: Arbitrary footline selection and configuration for LaTeX beamer's standard themes] \mode +\RequirePackage{ifthen} \RequirePackage{pgfkeys} \newcommand{\htfprintmessage}{% @@ -42,9 +43,9 @@ \typeout{========================================} \typeout{THE FOOTLINE HAS BEEN TAKEN OVER} \typeout{by the hackthefootline package} - \typeout{Version 2018/01/16} + \typeout{Version 2018/01/29} \typeout{} - \typeout{(c) 2017 Sebastian Friedl} + \typeout{(c) 2017-18 Sebastian Friedl} \typeout{Licensed under LPPL 1.3c or later} \typeout{========================================} \typeout{}} @@ -53,21 +54,14 @@ % PACKAGE OPTIONS AND VARIABLES -- INCLUDES AUXILIARY STUFF ------------------------------------------------------------------------------------- -% Check whether a column package option has been specified -\newif\ifbeamer@htfinitcolsetup -\beamer@htfinitcolsetupfalse - \DeclareOptionBeamer{onecol}{% - \beamer@htfinitcolsetuptrue% \htfconfig{title=short, authinst=both, date=none, framenrs=fraction, atsep=colon}% \AtBeginDocument{\htfconfig{cols=one}}\htfprintmessage} \DeclareOptionBeamer{twocols}{% - \beamer@htfinitcolsetuptrue% - \htfconfig{title=short, authinst=onlyauthor, date=none, framenrs=none}% + \htfconfig{title=short, authinst=onlyauthor, date=none, framenrs=none, atsep=colon}% \AtBeginDocument{\htfconfig{cols=two}}\htfprintmessage} \DeclareOptionBeamer{threecols}{% - \beamer@htfinitcolsetuptrue% - \htfconfig{title=short, authinst=instpths, date=short, framenrs=fraction}% + \htfconfig{title=short, authinst=instpths, date=short, framenrs=fraction, atsep=colon}% \AtBeginDocument{\htfconfig{cols=three}}\htfprintmessage} \newif\ifbeamer@htfcountappendixframes @@ -93,39 +87,9 @@ \newif\ifbeamer@htfnotitle \newif\ifbeamer@htfshowframenrs -% Auxiliary command creating a warning when using a footline without according package option -\newcommand{\htfcheckforinit}{% - \ifbeamer@htfinitcolsetup\else% - \PackageWarning{hackthefootline}{When using hacked footlines, please specify an according package option.} - \fi} - - - -% ACTIONS FOR NOT COUNTING APPENDIX FRAMES ------------------------------------------------------------------------------------------------------ - -\ifbeamer@htfcountappendixframes\else - % Required packages - \RequirePackage{appendixnumberbeamer} - \RequirePackage{etoolbox} - - % Removes frame numbers for appendix slides - \apptocmd{\appendix}{% - \htfconfig{framenrs=none} - }{}{} -\fi - - - -% REQUIREMENTS FOR SOME "FUNNY STUFF" ----------------------------------------------------------------------------------------------------------- - -\ifbeamer@htffunnystuff - % Frame numbering in %: requirements, package settings, variables, commands - \RequirePackage{calc} - \RequirePackage[addmissingzero,autolanguage,nosepfour]{numprint} - \npdefunit{percent}{\%}{1} - \newlength{\progress} - \newcommand{\updateprogress}{\setlength{\progress}{100pt*\ratio{\insertframenumber pt}{\inserttotalframenumber pt}}} -\fi +% Own replacement for \beamer@inappendix; required for compatibility reasons +\newif\ifbeamer@htfinsideappendix +\beamer@htfinsideappendixfalse @@ -153,11 +117,22 @@ % Frame Numbers \defbeamertemplate{htf-framenrs}{none}{} \defbeamertemplate{htf-framenrs}{counter}{\insertframenumber} -\defbeamertemplate{htf-framenrs}{fraction}{\insertframenumber~/~\inserttotalframenumber} +\defbeamertemplate{htf-framenrs}{fraction}{% + \ifbeamer@htfcountappendixframes{\insertframenumber~/~\inserttotalframenumber}% + \else% + \ifx\insertmainframenumber\@undefined{\insertframenumber~/~\inserttotalframenumber}% + \else% + % beamer v3.49 and later: detect whether appendix has been entered and use the required templates and use internal cmds + \ifbeamer@htfinsideappendix{\insertframenumberinappendix~/~\insertappendixframenumber}% + \else{\insertframenumber~/~\insertmainframenumber}% + \fi% + \fi% + \fi} \ifbeamer@htffunnystuff - \defbeamertemplate{htf-framenrs}{percent}{\updateprogress\nprounddigits{0}\lenprint[percent]{\progress}} + \defbeamertemplate{htf-framenrs}{percent}{\htfupdateprogress\nprounddigits{0}\lenprint[htfpercent]{\htfprogress}} \fi + % Author-Title-Seperator \defbeamertemplate{htf-atsep}{colon}{:~~~~} \defbeamertemplate{htf-atsep}{comma}{,~} @@ -167,13 +142,16 @@ % FOOTLINE DEFINITIONS -------------------------------------------------------------------------------------------------------------------------- +% Auxiliary length +\newlength{\htfframenrboxwidth}% + % No footline \defbeamertemplate*{footline}{htf-none}{} % One column \defbeamertemplate{footline}{htf-onecol}{% \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex,leftskip=.3cm,rightskip=.3cm]{palette primary}% - \usebeamerfont{author in head/foot} + \usebeamerfont{author in head/foot}% \usebeamertemplate{htf-authinst}% % \beamer@htfinsertsepfalse @@ -190,15 +168,29 @@ \hfill \usebeamercolor{date in head/foot} \usebeamertemplate{htf-date} - % Dummy space for frame numbers - \ifbeamer@htfshowframenrs \hspace{5.75em} \fi + % + % Measure the largest required space when printing frame numbers + \newbox\htfpagenumbox% + \newbox\htfpercframenumbox% + \setbox\htfpagenumbox=\hbox{0\inserttotalframenumber~/~0\inserttotalframenumber}% + \setbox\htfpercframenumbox=\hbox{100\,\%}% + \ifthenelse{\lengthtest{\wd\htfpagenumbox > \wd\htfpercframenumbox}}% + {\setlength{\htfframenrboxwidth}{\wd\htfpagenumbox}}% + {\setlength{\htfframenrboxwidth}{\wd\htfpercframenumbox}}% + % + \ifbeamer@htfshowframenrs \hspace{\htfframenrboxwidth}\hspace{.2\htfframenrboxwidth}~\fi% \end{beamercolorbox}% \ifbeamer@htfshowframenrs \vspace{-3.25ex} \hfill% - \begin{beamercolorbox}[wd=6.25em,ht=2.25ex,dp=1ex,right,rightskip=.3cm]{palette primary} - \usebeamertemplate{htf-framenrs} - \end{beamercolorbox} + \addtolength{\htfframenrboxwidth}{.3cm}% + \addtolength{\htfframenrboxwidth}{2em}% + \addtolength{\htfframenrboxwidth}{.5\htfframenrboxwidth}% + \hspace{-1.3\htfframenrboxwidth}% + \begin{beamercolorbox}[wd=1.3\htfframenrboxwidth,ht=2.25ex,dp=1ex,right,rightskip=.3cm]{bg}% + % The color *has* to be set here; otherwise, the page number box will cover parts of the date + \usebeamercolor[fg]{date in head/foot}\usebeamertemplate{htf-framenrs} + \end{beamercolorbox}% \fi} % Two columns @@ -225,13 +217,26 @@ \end{beamercolorbox}% \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right,rightskip=.3cm]{date in head/foot}% \usebeamerfont{date in head/foot}\usebeamertemplate{htf-date}% - % Dummy space for frame numbers - \ifbeamer@htfshowframenrs \hspace{5.75em} \fi + % + % Measure the largest required space when printing frame numbers + \newbox\htfpagenumbox% + \newbox\htfpercframenumbox% + \setbox\htfpagenumbox=\hbox{0\inserttotalframenumber~/~0\inserttotalframenumber}% + \setbox\htfpercframenumbox=\hbox{100\,\%}% + \ifthenelse{\lengthtest{\wd\htfpagenumbox > \wd\htfpercframenumbox}}% + {\setlength{\htfframenrboxwidth}{\wd\htfpagenumbox}}% + {\setlength{\htfframenrboxwidth}{\wd\htfpercframenumbox}}% + % + \ifbeamer@htfshowframenrs \hspace{\htfframenrboxwidth}\hspace{.2\htfframenrboxwidth}~\fi% \end{beamercolorbox}% \ifbeamer@htfshowframenrs% - \hspace{-6.25em}% - \begin{beamercolorbox}[wd=6.25em,ht=2.25ex,dp=1ex,right,rightskip=.3cm]{date in head/foot}% - \usebeamertemplate{htf-framenrs} + \addtolength{\htfframenrboxwidth}{.3cm}% + \addtolength{\htfframenrboxwidth}{2em}% + \addtolength{\htfframenrboxwidth}{.5\htfframenrboxwidth}% + \hspace{-1.3\htfframenrboxwidth}% + \begin{beamercolorbox}[wd=1.3\htfframenrboxwidth,ht=2.25ex,dp=1ex,right,rightskip=.3cm]{bg}% + % The color *has* to be set here; otherwise, the page number box will cover parts of the date + \usebeamercolor[fg]{date in head/foot}\usebeamertemplate{htf-framenrs} \end{beamercolorbox}% \fi}% \vskip0pt} @@ -242,12 +247,13 @@ \pgfkeys{/hackthefootline/cols/.cd, .is choice, .default=none, - one/.code={\setbeamertemplate{footline}[htf-onecol]}, - two/.code={\setbeamertemplate{footline}[htf-twocols]}, - three/.code={\setbeamertemplate{footline}[htf-threecols]}, + one/.code={\setbeamertemplate{footline}[htf-onecol]\beamer@calculateheadfoot}, + two/.code={\setbeamertemplate{footline}[htf-twocols]\beamer@calculateheadfoot}, + three/.code={\setbeamertemplate{footline}[htf-threecols]\beamer@calculateheadfoot}, none/.code={% \htfconfig{framenrs=none}% - \setbeamertemplate{footline}[htf-none]}, + \setbeamertemplate{footline}[htf-none]% + \beamer@calculateheadfoot}, } \pgfkeys{/hackthefootline/title/.cd, @@ -339,8 +345,53 @@ -% END OF FILE ----------------------------------------------------------------------------------------------------------------------------------- +% PROCESS OPTIONS ------------------------------------------------------------------------------------------------------------------------------- +% This *has* to be done here, otherwise mysterious things will happen ... +% and too many packages will be required ... \ProcessOptionsBeamer + + + +% ACTIONS FOR NOT COUNTING APPENDIX FRAMES ------------------------------------------------------------------------------------------------------ + +\ifbeamer@htfcountappendixframes\else + % Required packages + \ifx\insertmainframenumber\@undefined\RequirePackage{appendixnumberbeamer}\fi % only beamer v3.48 and earlier + \RequirePackage{etoolbox} + + % Removes frame numbers for appendix slides + \apptocmd{\appendix}{% + \htfconfig{framenrs=none} + \beamer@htfinsideappendixtrue + }{}{} +\fi + + + +% REQUIREMENTS FOR SOME "FUNNY STUFF" ----------------------------------------------------------------------------------------------------------- + +\ifbeamer@htffunnystuff + % Frame numbering in %: requirements, package settings, variables, commands + \RequirePackage{calc} + \RequirePackage[addmissingzero,autolanguage,nosepfour]{numprint} + \npdefunit{htfpercent}{\%}{1} + \newlength{\htfprogress} + \def\htfupdateprogress{% + \ifbeamer@htfcountappendixframes\setlength{\htfprogress}{100pt*\ratio{\insertframenumber pt}{\inserttotalframenumber pt}}% + \else% + \ifx\insertmainframenumber\@undefined\setlength{\htfprogress}{100pt*\ratio{\insertframenumber pt}{\inserttotalframenumber pt}}% + \else% + \ifbeamer@htfinsideappendix\setlength{\htfprogress}{100pt*\ratio{\insertframenumberinappendix pt}{\insertappendixframenumber pt}}% + \else\setlength{\htfprogress}{100pt*\ratio{\insertframenumber pt}{\insertmainframenumber pt}}% + \fi% + \fi% + \fi} +\fi + + + +% END OF FILE ----------------------------------------------------------------------------------------------------------------------------------- + \mode \endinput \ No newline at end of file -- cgit v1.2.3