diff options
author | Norbert Preining <norbert@preining.info> | 2021-04-15 03:01:50 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-04-15 03:01:50 +0000 |
commit | 0c0d0a7c62a746c3907f924435e917b8f137cd2d (patch) | |
tree | 431e3f6d38e84a53863bda1446e0d35fa83a74b3 /macros | |
parent | 9e35bd7917dd043a03a995a70b8d0b42482d4c7d (diff) |
CTAN sync 202104150301
Diffstat (limited to 'macros')
-rw-r--r-- | macros/latex/contrib/beamer-contrib/beamerswitch/README.md | 2 | ||||
-rw-r--r-- | macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-article.pdf | bin | 20075 -> 20112 bytes | |||
-rw-r--r-- | macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-handout.pdf | bin | 22344 -> 22397 bytes | |||
-rw-r--r-- | macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-trans.pdf | bin | 22958 -> 22998 bytes | |||
-rw-r--r-- | macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example.pdf | bin | 36590 -> 36629 bytes | |||
-rw-r--r-- | macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch.dtx | 243 | ||||
-rw-r--r-- | macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch.pdf | bin | 194565 -> 200906 bytes | |||
-rw-r--r-- | macros/plain/contrib/xintsession/README.md | 74 | ||||
-rw-r--r-- | macros/plain/contrib/xintsession/xintsession.tex | 416 |
9 files changed, 664 insertions, 71 deletions
diff --git a/macros/latex/contrib/beamer-contrib/beamerswitch/README.md b/macros/latex/contrib/beamer-contrib/beamerswitch/README.md index b2bba3935e..732401540c 100644 --- a/macros/latex/contrib/beamer-contrib/beamerswitch/README.md +++ b/macros/latex/contrib/beamer-contrib/beamerswitch/README.md @@ -88,7 +88,7 @@ first three steps. ## Licence -Copyright 2016–2020 Alex Ball. +Copyright 2016–2021 Alex Ball. This work consists of the file beamerswitch.dtx and a Makefile. diff --git a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-article.pdf b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-article.pdf Binary files differindex a291488379..79a6084f41 100644 --- a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-article.pdf +++ b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-article.pdf diff --git a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-handout.pdf b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-handout.pdf Binary files differindex e635ac4025..64cf18c023 100644 --- a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-handout.pdf +++ b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-handout.pdf diff --git a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-trans.pdf b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-trans.pdf Binary files differindex 69b8a10f0c..bd9bf2845b 100644 --- a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-trans.pdf +++ b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example-trans.pdf diff --git a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example.pdf b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example.pdf Binary files differindex de2af6109b..9ef988115a 100644 --- a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example.pdf +++ b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch-example.pdf diff --git a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch.dtx b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch.dtx index e8a6919c14..ee8b3498ee 100644 --- a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch.dtx +++ b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch.dtx @@ -93,7 +93,7 @@ first three steps. ## Licence -Copyright 2016–2020 Alex Ball. +Copyright 2016–2021 Alex Ball. This work consists of the file beamerswitch.dtx and a Makefile. @@ -106,9 +106,10 @@ This work is "maintained" (as per LPPL maintenance status) by %</readme> %<*example> -\PassOptionsToClass{a4paper,12pt}{article} -\PassOptionsToClass{14pt}{beamer} -\documentclass[also={trans,handout,article}]{beamerswitch} +\documentclass[% + beameroptions={ignorenonframetext,14pt}, + articleoptions={a4paper,12pt}, + also={trans,handout,article}]{beamerswitch} \handoutlayout{nup=3plus,border=1pt} \articlelayout{maketitle,frametitles=none} \usepackage[british]{babel} @@ -125,8 +126,8 @@ This work is "maintained" (as per LPPL maintenance status) by \title{A demonstration of the \textsf{beamerswitch} class} \subtitle{Testing features} -\author{Alex Ball} -\institute{University of Life} +\author{Alex Ball\inst{1}} +\institute{\inst{1}University of Life} \date{1 September 2016} \subject{A LaTeX class} \keywords{CTAN, literate programming} @@ -193,7 +194,7 @@ See: http://www.latex-project.org/lppl.txt \endpreamble \postamble -Copyright (C) 2016-2020 by Alex Ball <ab318@bath.ac.uk> +Copyright (C) 2016-2021 by Alex Ball <ab318@bath.ac.uk> \endpostamble \usedir{tex/latex/\jobname} @@ -228,7 +229,7 @@ Copyright (C) 2016-2020 by Alex Ball <ab318@bath.ac.uk> %<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<class>\ProvidesClass{beamerswitch} %<*class> - [2020/06/06 v1.7 Convenient mode selection in Beamer documents] + [2021/04/12 v1.8 Convenient mode selection in Beamer documents] %</class> %<*driver> \documentclass[12pt]{article} @@ -296,7 +297,7 @@ Copyright (C) 2016-2020 by Alex Ball <ab318@bath.ac.uk> \egroup } \makeatother -\tcbuselibrary{documentation,breakable,minted} +\tcbuselibrary{documentation,breakable,minted,raster} \colorlet{Option}{violet} \colorlet{Command}{red!75!black} \colorlet{Environment}{blue!75!black} @@ -311,6 +312,13 @@ Copyright (C) 2016-2020 by Alex Ball <ab318@bath.ac.uk> , numbersep=20pt , firstnumber=last } + , documentation minted options= + { breaklines + , fontsize=\small + , breakbefore=\{\[ + , breakafter=/\}\] + , breakbeforesymbolpre={} + } , index format=pgf , color command=Command , color environment=Environment @@ -381,7 +389,6 @@ Copyright (C) 2016-2020 by Alex Ball <ab318@bath.ac.uk> \index{\MyName@\tcbIndexPrintValCA {\MyName}|)}% } \makeatletter -\def\MY@EQUALS{=}% \newcommand{\resetmintedformat}{% % Comments \expandafter\def\csname PYGdefault@tok@c\endcsname{\let\PYGdefault@it=\textit\def\PYGdefault@tc####1{\textcolor{gray}{####1}}} @@ -525,30 +532,43 @@ If you have an existing \pkg{beamer} presentation and want convert it to use \begin{enumerate} \item - Have you specified class options other than \key{ignorenonframetext}? - If so, start by rewriting your \cs{documentclass} line in terms of - \cs{PassOptionsToClass} -- note that the optional argument (in square - brackets) becomes mandatory (in curly braces): + Replace the class \pkg{beamer} with \pkg{beamerswitch}. - \begin{multicols}{2} + Wrap any class options you have specified in braces and turn them into the + value of the \key{beameroptions} option: + + \begin{tcbraster}[raster equal height=rows] \begin{dispListing*}{title=Before,coltitle=black,fonttitle=\sffamily} \documentclass[10pt]{beamer} \end{dispListing*} - \columnbreak \begin{dispListing*}{title=After,coltitle=black,fonttitle=\sffamily} -\PassOptionsToClass{10pt}{beamer} +\documentclass[beameroptions={10pt}]{beamerswitch} \end{dispListing*} - \end{multicols} + \end{tcbraster} - Then add `\cs{documentclass}\brackets{beamerswitch}' directly below. + If you didn't specify any options, then give \key{beameroptions} a blank + value: - Otherwise, simply replace your \cs{documentclass} line with the - \texttt{beamerswitch} one. + \begin{tcbraster}[raster equal height=rows] +\begin{dispListing*}{title=Before,coltitle=black,fonttitle=\sffamily} +\documentclass{beamer} +\end{dispListing*} +\begin{dispListing*}{title=After,coltitle=black,fonttitle=\sffamily} +\documentclass[beameroptions={}]{beamerswitch} +\end{dispListing*} + \end{tcbraster} -\item - If you did \emph{not} specify \key{ignorenonframetext} as one of your - \pkg{beamer} options, add a `\cs{mode}\texttt{<all>}' line directly after - `\cs{begin}\brackets{document}'. + If you only specified \key{ignorenonframetext}, then you don't + need \key{beameroptions}: + + \begin{tcbraster}[raster equal height=rows] +\begin{dispListing*}{title=Before,coltitle=black,fonttitle=\sffamily} +\documentclass[ignorenonframetext]{beamer} +\end{dispListing*} +\begin{dispListing*}{title=After,coltitle=black,fonttitle=\sffamily} +\documentclass{beamerswitch} +\end{dispListing*} + \end{tcbraster} \item Wrap any preamble content intended only for your slides (like \cs{usetheme} @@ -558,7 +578,7 @@ If you have an existing \pkg{beamer} presentation and want convert it to use In summary, here is an example: -\begin{multicols}{2} +\begin{tcbraster}[raster equal height=rows] \begin{dispListing*}{title=Before,coltitle=black,fonttitle=\sffamily} \documentclass[10pt]{beamer} @@ -567,32 +587,28 @@ In summary, here is an example: \title{Test presentation} \begin{document} - \maketitle \end{document} \end{dispListing*} - \columnbreak \begin{dispListing*}{title=After,coltitle=black,fonttitle=\sffamily} -\PassOptionsToClass{10pt}{beamer} -\documentclass{beamerswitch} +\documentclass[beameroptions={10pt}]{beamerswitch} \mode<presentation>{% \usetheme{metropolis} } \title{Test presentation} \begin{document} -\mode<all> \maketitle \end{document} \end{dispListing*} -\end{multicols} +\end{tcbraster} At this point the document should compile exactly as before. If you intend to use article mode at all, I strongly suggest that you -proceed by converting your document body so it that works without the -`\cs{mode}\texttt{<all>}' line. That means making sure all slide content is in -a \env{frame} environment, new command definitions are moved to the preamble, -and so on. +proceed by converting your document body so it that works with \pkg{beamer}'s +\key{ignorenonframetext} option in place. That means making sure all slide +content is in a \env{frame} environment, new command definitions are moved +to the preamble, and so on. Lastly, read through the rest of this manual and see what \pkg{beamerswitch} can do for you! @@ -705,13 +721,27 @@ The class is loaded in the usual way: The various options are described below. +\subsection{Passing options to the underlying classes} + +\begin{docKey}{articleoptions}{=\marg{options}}{default and initially empty} + Passes the \meta{options} to the \pkg{article} class when in \key{article} + mode. +\end{docKey} + +\begin{docKey}{beameroptions}{=\marg{options}}{default and initially \val{ignorenonframetext}} + Passes the \meta{options} to the \pkg{beamer} class when in \key{beamer}, + \key{handout} or \key{trans} mode. Do not specify \val{handout} or \val{trans} + among the options as \pkg{beamerswitch} handles those for you. Note that the + default behaviour is to pass the \val{ignorenonframetext} option, so remember + to include it yourself if you start specifying other options. +\end{docKey} + + \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. +\key{article}, \key{beamer}, \key{trans} and \key{handout}. The normal way of choosing the mode is to use the respective class options. @@ -856,8 +886,8 @@ If you want to switch to using \texttt{rubber}, say, pre-define \documentclass{beamerswitch} \end{dispListing} -If you don't need the engine selection routine provided, simply pre-define -\cs{BeamerswitchSpawn} to do whatever you need it to do: +If you don't need the engine selection routine provided, you can replace it +by pre-defining \cs{BeamerswitchSpawn} to do whatever you need it to do instead: \begin{dispListing} \newcommand*{\BeamerswitchSpawn}[1]{% @@ -894,13 +924,6 @@ directives: load \pkg{hyperref} yourself at a different point, use this option. \end{docKey} -\pagebreak % TWEAK: may not be needed in future versions -\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 @@ -1171,12 +1194,20 @@ preamble. \end{dispListing} \end{docKey} +\begin{docKey}{instbreak}{=\meta{definition}}{no default, initially \cs{linebreak}} + In \key{article} mode, defines how \cs{and} is rendered when + \cs{insertinstitute} is used (such when the \key{maketitle} option is + active). Another good \meta{definition} to use might be \cs{quad}. +\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: +and \pkg{beamer} classes are loaded, if you don't like the class facilities for +doing this: \begin{dispListing} \PassOptionsToClass{a4paper,11pt}{article} % for article mode @@ -1335,6 +1366,26 @@ suggestions for improvements or new features to the % \end{optionkey} % \end{optionkey} % +% \changes{v1.8}{2021/04/12}{Add \key{beameroptions} option.} +% \begin{optionkey}{beameroptions} +% +% The \key{beameroptions} will passed to the \pkg{beamer} class. +% +% \begin{macrocode} +\define@cmdkey[DC]{beamerswitch}{beameroptions}[ignorenonframetext]{} +% \end{macrocode} +% \end{optionkey} +% +% \changes{v1.8}{2021/04/12}{Add \key{articleoptions} option.} +% \begin{optionkey}{articleoptions} +% +% The \key{articleoptions} will passed to the \pkg{article} class. +% +% \begin{macrocode} +\define@cmdkey[DC]{beamerswitch}{articleoptions}[]{} +% \end{macrocode} +% \end{optionkey} +% % \begin{optionkey}{nohyperref} % The \key{nohyperref} option stops the class from loading the \pkg{hyperref} % package in article mode. @@ -1344,9 +1395,10 @@ suggestions for improvements or new features to the % \end{macrocode} % \end{optionkey} % +% \changes{v1.8}{2021/04/12}{Deprecate redundant \key{textinst} option.} % \begin{optionkey}{textinst} -% The \key{textinst} option adjusts the superscript used for institution -% markers. +% The \key{textinst} option enforces \cs{textsuperscript} for institution +% markers. Recent versions of \pkg{beamer} do this by default. % % \begin{macrocode} \define@boolkey[DC]{beamerswitch}{textinst}[true]{} @@ -1357,7 +1409,7 @@ suggestions for improvements or new features to the % % \begin{macrocode} \setkeys[DC]{beamerswitch}{beamer=true,alsobeamer=false,alsotrans=false,% - alsohandout=false,alsoarticle=false} + alsohandout=false,alsoarticle=false,beameroptions,articleoptions} % \end{macrocode} % % Now we process the options given by the user. @@ -1481,12 +1533,27 @@ suggestions for improvements or new features to the % 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{macro}{beamer@insttitle} +% \begin{macro}{beamer@andtitle} +% \begin{macro}{beamer@instinst} +% \begin{macro}{beamer@andinst} +% We also add some beamer base macros that are needed for the +%\cs{insertinstitute} command. % % \begin{macrocode} \ifbool{DC@beamerswitch@article}{% + \PassOptionsToClass{\cmdDC@beamerswitch@articleoptions}{article} \LoadClass{article} \RequirePackage{beamerarticle} + \def\beamer@insttitle#1{\textsuperscript{#1}} + \def\beamer@andtitle{\quad} + \def\beamer@instinst#1{\textsuperscript{#1}\ignorespaces} + \def\beamer@andinst{\linebreak} % \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} % % 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 @@ -1532,7 +1599,8 @@ suggestions for improvements or new features to the % % \begin{macrocode} \ifbool{DC@beamerswitch@handout}{% - \LoadClass[ignorenonframetext,handout]{beamer} + \PassOptionsToClass{\cmdDC@beamerswitch@beameroptions}{beamer} + \LoadClass[handout]{beamer} % \end{macrocode} % % Handout mode lays multiple slides out on a single page. For this we use @@ -1547,9 +1615,11 @@ suggestions for improvements or new features to the % \begin{macrocode} }{% \ifbool{DC@beamerswitch@trans}{% - \LoadClass[ignorenonframetext,trans]{beamer} + \PassOptionsToClass{\cmdDC@beamerswitch@beameroptions}{beamer} + \LoadClass[trans]{beamer} }{% - \LoadClass[ignorenonframetext]{beamer} + \PassOptionsToClass{\cmdDC@beamerswitch@beameroptions}{beamer} + \LoadClass{beamer} }% } } @@ -1557,8 +1627,10 @@ suggestions for improvements or new features to the % % \subsection{Mode-independent layout} % +% \begin{macro}{beamer@insttitle} +% \begin{macro}{beamer@instinst} % We implement the option that formats institution markers in text mode rather -% than math mode. +% than math mode in older versions of \pkg{beamer}. % % \begin{macrocode} \ifbool{DC@beamerswitch@textinst}{% @@ -1566,7 +1638,10 @@ suggestions for improvements or new features to the \def\beamer@instinst#1{\textsuperscript{#1}\ignorespaces} }{} % \end{macrocode} +% \end{macro} +% \end{macro} % +% \begin{macro}{handoutlayout} % \subsection{Handout layout} % % \begin{optionkey}{paper} @@ -1594,8 +1669,8 @@ suggestions for improvements or new features to the % \begin{optionvalue}{4plus} % \begin{optionvalue}{6} % \begin{optionvalue}{8} -% \changes{v1.7}{2020/06/06}{Add \key{nup}\string\MY@EQUALS\val{1} option.} -% \changes{v1.7}{2020/06/06}{Add \key{nup}\string\MY@EQUALS\val{1plus} option.} +% \changes{v1.7}{2020/06/06}{Add \key{nup}!=\val{1} option.} +% \changes{v1.7}{2020/06/06}{Add \key{nup}!=\val{1plus} option.} % The \key{nup} option specifies how many slides to include per page. % The `plus' keyword indicates a layout with additional gaps for writing. % @@ -1656,7 +1731,7 @@ suggestions for improvements or new features to the % \end{optionkey} % % \begin{optionkey}{margin} -% \changes{v1.4}{2018/08/29}{Make margins around slides a configurable size} +% \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 @@ -1711,7 +1786,6 @@ suggestions for improvements or new features to the % \end{macrocode} % \end{macro} % -% \begin{macro}{handoutlayout} % \begin{macro}{beamerswitch@pnoadjust} % We set up the \cs{handoutlayout} command for applying these options. % @@ -2808,6 +2882,7 @@ suggestions for improvements or new features to the } % \end{macrocode} % +% \begin{macro}{articlelayout} % \subsection{Article layout} % % We provide some options for configuring the appearance of article mode. @@ -2834,7 +2909,7 @@ suggestions for improvements or new features to the % \end{macrocode} % % \begin{macro}{bsw@punct@test} -% \changes{v1.6.1}{2020/01/20}{Update expl3 syntax} +% \changes{v1.6.1}{2020/01/20}{Update expl3 syntax.} % Of course, we would rather not bother the user with this, so we introduce a % command for testing the title for final punctuation. % @@ -2916,7 +2991,20 @@ suggestions for improvements or new features to the % \end{optionvalue} % \end{optionkey} % -% \begin{macro}{articlelayout} +% \changes{v1.8}{2021/04/12}{Add \key{instbreak} option.} +% \begin{optionkey}{instbreak} +% \begin{macro}{beamerswitch@andinst} +% We offer an easy way of customizing how institutes are strung together. +% +% \begin{macrocode} +\let\beamerswitch@andinst\beamer@andinst +\define@key[AL]{beamerswitch}{instbreak}{% + \def\beamerswitch@andinst{#1}% +} +% \end{macrocode} +% \end{macro} +% \end{optionkey} +% % We provide a command for setting these options. % % \begin{macrocode} @@ -2943,10 +3031,10 @@ suggestions for improvements or new features to the \ifcsstring{beamerswitch@articleframetitles}{margin}{% \setbeamertemplate{frametitle}{% \marginpar[% - \raggedleft\noindent\emshape\textbf{\insertframetitle}\par + \raggedleft\noindent\itshape\textbf{\insertframetitle}\par \noindent\insertframesubtitle\par ]{% - \raggedright\noindent\emshape\textbf{\insertframetitle}\par + \raggedright\noindent\itshape\textbf{\insertframetitle}\par \noindent\insertframesubtitle\par }% } @@ -2964,6 +3052,12 @@ suggestions for improvements or new features to the % \end{optionvalue} % \end{optionvalue} % +% This is where the \key{instbreak} option takes effect. +% +% \begin{macrocode} + \let\beamer@andinst\beamerswitch@andinst +% \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. % @@ -2978,10 +3072,12 @@ suggestions for improvements or new features to the % % \begin{macrocode} \ifundef{\beamer@originstitute}{% - \renewcommand{\institute}[2][]{\def\insertinstitute{##2}}% + \renewcommand{\institute}[2][]{% + \def\insertinstitute{\def\inst{\beamer@instinst}\def\and{\beamer@andinst}##2}}% }{% \renewcommand{\institute}[2][]{% - \def\insertinstitute{##2}\beamer@originstitute{##2}}% + \def\insertinstitute{\def\inst{\beamer@instinst}\def\and{\beamer@andinst}##2}% + \beamer@originstitute{##2}}% }% % \end{macrocode} % @@ -2999,21 +3095,28 @@ suggestions for improvements or new features to the \vskip 1.5em% {% \large\lineskip .5em% +% \end{macrocode} +% +% \changes{v1.8}{2021/04/12}{Ensure proper rendering of \cs{inst} and \cs{and} +% in \cs{author}.} +% The second is to add the beamer definitions for \cs{inst} and \cs{and} in the +% author row. +% +% \begin{macrocode} \begin{tabular}[t]{c}% + \def\inst{\beamer@insttitle}\def\and{\beamer@andtitle}% \@author \end{tabular}\par }% % \end{macrocode} % -% The other is to add in a row for the institute information. +% The third 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 + \insertinstitute\par }% }% \vskip 1em% diff --git a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch.pdf b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch.pdf Binary files differindex 4d36201a45..ebd182790b 100644 --- a/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch.pdf +++ b/macros/latex/contrib/beamer-contrib/beamerswitch/beamerswitch.pdf diff --git a/macros/plain/contrib/xintsession/README.md b/macros/plain/contrib/xintsession/README.md new file mode 100644 index 0000000000..9821fcd2e7 --- /dev/null +++ b/macros/plain/contrib/xintsession/README.md @@ -0,0 +1,74 @@ +# xintsession README # + +## Usage ## + +xintsession.tex is to be used with etex (or pdftex or the other engines +with Plain as preloaded format) *interactively on the command line*. + +It will load [xintexpr](http://www.ctan.org/pkg/xint) and +[polexpr](http://www.ctan.org/pkg/polexpr) +(its version `0.8` or later is needed). + +The following explanations have been tested on a Unixen (Mac OS), +please adapt to your shell environment. + +You need 3 small steps to start a session: + +1. execute `etex`, or better, `rlwrap etex` to benefit from arrow keys + navigation and other improvements such as parentheses highlighting in + the input (and optionally, use the `-jobname` option here) +2. at the `**` prompt, enter `xintsession` and hit `RET`, +3. a welcome message is printed, hit the `RET` key at the `*` prompt. + +You are now ready to make computations! +Here is an example session (spaces do not matter): + + (Please type a command or say `\end') + * 1+1/2+1/3+1/4+1/5; + (@_1) 137/60 + * @_^3 ; + (@_2) 2571353/216000 + * add(1/i, i=1..50); + (@_3) 13943237577224054960759/3099044504245996706400 + *&fp + fp mode (16 digits) + * @_; + (@_4) 4.499205338329425 + * add(1/i, i=1..1000); + (@_5) 7.485470860550346 + *&bye + Did I say something wrong? + Session transcript written on xintsession-210413_20h24.tex + No pages of output. + Transcript written on xintsession.log. + +As this example shows, the computational engine can work in various +modes: exact, fp, fp16, fp24, fp32, int, and pol. One can define +variables and functions using `:=` syntax. + +If ill-formed input drops you into TeX error interaction mode, try +hitting `S` it may work to bring you back to normal session. + +For important explanations, enter `&help` at the prompt. + +## License ## + +Copyright (c) 2021 Jean-François Burnol + +See documentation of package [xintexpr](http://www.ctan.org/pkg/xint) for +contact information. + +This Work may be distributed and/or modified under the conditions of the +LaTeX Project Public License version 1.3c. This version of this license +is in + +> <http://www.latex-project.org/lppl/lppl-1-3c.txt> + +and version 1.3 or later is part of all distributions of LaTeX version +2005/12/01 or later. + +This Work has the LPPL maintenance status author-maintained. + +The Author of this Work is Jean-François Burnol. + +This Work consists of the package files xintsession.tex and README.md diff --git a/macros/plain/contrib/xintsession/xintsession.tex b/macros/plain/contrib/xintsession/xintsession.tex new file mode 100644 index 0000000000..271c6abff6 --- /dev/null +++ b/macros/plain/contrib/xintsession/xintsession.tex @@ -0,0 +1,416 @@ +% Release 0.1 (2021/04/13) of xintsession.tex +% author: Jean-Francois Burnol +% License: LPPL 1.3c (author-maintained) +% Usage: execute etex or pdftex +% then enter "xintsession" at the ** prompt +\input xintexpr.sty\relax% +\input xintbinhex.sty\relax% +\input polexpr.sty\relax% attention will crash if < 0.8 +\let\PolToExprOneTerm\PolToExprOneTermStyleB% +%\let\PolToExprTimes\empty% +% we do assume standard catcodes on loading and use +% \XINT_restorecatcodes as a convenience facility. +% It stores \endlinechar but not \newlinechar +\edef\xsrestorecatcodes{\csname XINT_restorecatcodes\endcsname% + \newlinechar\the\newlinechar\relax}% +\endlinechar 13 % +\newlinechar 10 +\catcode`_ 11 +\catcode`& 11 +\catcode`@ 11 +\catcode`^ 11 +\catcode`" 7 +\catcode0 12 +\newwrite\xs_out +\edef\xs_name{\jobname-\expandafter\xint_gobble_ii\the\year + \expandafter\xint_gobble_i\the\numexpr100+\month\relax + \expandafter\xint_gobble_i\the\numexpr100+\day\relax + _% + \expandafter\xint_gobble_i\the\numexpr(\time+30)/60+99h% + \expandafter\xint_gobble_i\the\numexpr100+\time-60*((\time+30)/60-1).tex}% +\immediate\openout\xs_out=\xs_name\relax +\begingroup\catcode37 12 +\gdef\xs_message#1{\message{#1}\immediate\write\xs_out{%#1}}\endgroup +{\catcode13\active\def +{""J}\catcode32\active\edef {\string }% +\catcode`?=0\catcode`\\=12\relax% +?xdef?xs_logo{% + _____ _____ + ____ ____(_)________ /_________ _________________ + __ |/_/_ /__ __ \ __/ _ \_ |/_/__ __ \_ ___/ + __> < _ / _ / / / /_ / __/_> < __ /_/ / / + /_/|_| /_/ /_/ /_/\__/ \___//_/|_| _ .___//_/ + /_/ + _____ _____ __________ + ___(_)________ /__________________ ________ /___(_)__ ______ + __ /__ __ \ __/ _ \_ ___/ __ `/ ___/ __/_ /__ | / / _ \ + _ / _ / / / /_ / __/ / / /_/ // /__ / /_ _ / __ |/ // __/ + /_/ /_/ /_/\__/ \___//_/ \__,_/ \___/ \__/ /_/ _____/ \___/ +}% +?immediate?write128{% + + xintsession 0.1 + Copyright (c) Jean-Francois Burnol, 2021. + + \jobname is ?jobname + Transcript will go to log and to ?xs_name + + ===> HIT THE <RET> KEY NOW! <=== +}}% +\def\xs_no{0}% +\XINT_expr_defvar_one{@___}{{0}}% +\XINT_expr_defvar_one{@__}{{0}}% +\XINT_expr_defvar_one{@_}{{0}}% +\def\xs_fetch{\let\xs_in\empty\xs_fetch_a}% +\begingroup +\catcode13\active% +\gdef\xs_fetch_a#1 +{% + \odef\xs_firstitem{\romannumeral0\xintfirstitem{#1.}}% + \ifcat\relax\expandafter\noexpand\xs_firstitem% + \expandafter\xs_cs% + \else% + \if &\expandafter\noexpand\xs_firstitem% + \expandafter\expandafter\expandafter\xs_magic% + \fi% + \fi% + \if;\expandafter\noexpand\romannumeral0\xintlastitem{#1}% + \xs_fetch_b#1^% + \else% + \message{(Use ; to end multi-line input)}% + \odef\xs_in{\xs_in#1}\expandafter\xs_fetch_a% + \fi% +}% +\endgroup +\def\xs_cs\if;\expandafter\noexpand\romannumeral0\xintlastitem#1#2\fi +{% + \xs_message{(executing \detokenize{#1} in background)} + #1\xs_fetch_a +}% +\def\xs_firstfour#1#2#3#4#5\xint_bye{#1#2#3#4}% +\def\xs_magic\if;\expandafter\noexpand\romannumeral0\xintlastitem#1#2\fi +{% +% this gets rid of spaces and an inadvertent ; except for &fp which is too +% short, but this puts a constraint on magic words, maybe I will revisit + \edef\xs_magic_in{\xs_firstfour#1\empty\empty\empty\empty\xint_bye}% + \ifcsname xs_magic@\xs_magic_in\endcsname + \csname xs_magic@\xs_magic_in\expandafter\endcsname + \else + \xs_message{(\detokenize\expandafter{\xint_gobble_i#1} is not a magic keyword: + ignored)}% + \fi\xs_fetch_a +}% +\def\xs_fetch_b#1;^% +{% + \odef\xs_in{\xs_in#1}\expandafter\xs_fetch_c +}% +\def\xs_fetch_c +{% + \if\relax\romannumeral`""@\detokenize\expandafter{\xs_in}\relax\expandafter\xs_pause\fi + \expandafter\xs_parse_a\xs_in:=^% +}% +\def\xs_pause\expandafter\xs_parse_a\xs_in:=^{\xs_pause_a\xs_fetch_a}% +\def\xs_pause_a\xs_fetch_a +{% + \xs_message{Need a break? OK, use \string\xintresume\space if you change your mind.}% + \xs_resetcats +}% +\def\xs_bye\xs_fetch_a +{% + \xs_message{Did I say something wrong?}% + \xs_message{Session transcript written on \xs_name}% +% \xs_resetcats + \immediate\closeout\xs_out +% expeditive exit because I need to think about generating new output +% filename with a check that it is not same (a minute may be too coarse?). +% Add random postfix? or simply do not bother rather... + \csname bye\endcsname +}% +\def\xs_parse_a#1:=#2% +{% + \xint_gob_til_^#2\xs_calc ^% + \def\xs_left{#1}\xs_parse_b#2% +}% +\def\xs_calc ^#1^% +{% + \edef\xs_no{\the\numexpr1+\xs_no}% + \xs_xintdefvar @_\xs_no=\xs_in;% + \immediate\write\xs_out + {\expandafter\string\xs_xintdefvar\space @_\xs_no:=% + \detokenize\expandafter{\xs_in};}% + \XINT_expr_defvar_one{@___}{\csname XINT_expr_varvalue_@__\endcsname}% + \XINT_expr_defvar_one{@__}{\csname XINT_expr_varvalue_@_\endcsname}% + \XINT_expr_defvar_one{@_}{\csname XINT_expr_varvalue_@_\xs_no\endcsname}% + \xs_message{(@_\xs_no)\space\space\space\space\xs_xinteval{@_\xs_no}}% + \xs_fetch +}% +\def\xs_parse_b #1:=^% +{% + \def\xs_right{#1}\expandafter\xs_parse_c\xs_left(;% +}% +\def\xs_parse_c #1(#2% +{% + \edef\xs_funcname{\expandafter\xint_zapspaces\detokenize{#1} \xint_gobble_i}% + \xint_gob_til_sc#2\xs_defvar;\xs_deffunc +}% +\def\xs_deffunc #1;% +{% +% attention: \xs_xintdeffunc needs to see parentheses immediately + \expandafter\xs_xintdeffunc\xs_left=\xs_right;% + \immediate\write\xs_out + {\expandafter\string\xs_xintdeffunc\space\detokenize\expandafter{\xs_left}:=% + \detokenize\expandafter{\xs_right};}% + \expandafter\ifx\xs_xintdeffunc\poldef + \xs_message{\xs_funcname\space = \PolToExpr{\xs_funcname}}% + \xs_message{Issue \string\PolGenFloatVariant{\xs_funcname} if fp evaluations + with \xs_funcname\space are intended}% + \else\xs_message{Function \xs_funcname\space defined}% + \fi\xs_fetch +}% +\def\xs_defvar;\xs_deffunc +{% + \edef\xs_no{\the\numexpr1+\xs_no}% + \xs_xintdefvar @_\xs_no=\xs_right;% + \immediate\write\xs_out + {\expandafter\string\xs_xintdefvar\space\detokenize\expandafter{\xs_left}:=% + \detokenize\expandafter{\xs_right};}% + \XINT_expr_defvar_one{@___}{\csname XINT_expr_varvalue_@__\endcsname}% + \XINT_expr_defvar_one{@__}{\csname XINT_expr_varvalue_@_\endcsname}% + \XINT_expr_defvar_one{@_}{\csname XINT_expr_varvalue_@_\xs_no\endcsname}% + % this is to allow multiple assignments + \expandafter\xs_xintdefvar\xs_left=@_\xs_no;% + \xs_message{(@_\xs_no)\space\space\space\space\xs_xinteval{@_\xs_no}}% + \xs_fetch +}% +\let\xs_magic@&pau\xs_pause_a +\let\xs_magic@&bye\xs_bye +\def\xs_magic@&fp +{% + \xs_message{fp mode (\xinttheDigits\space digits)}% + \def\xs_mode{fp}% + \def\xs_xintdefvar{\xintdeffloatvar}% + \def\xs_xintdeffunc{\xintdeffloatfunc}% + \def\xs_xinteval{\xintfloateval}% +}% +\expandafter\def\csname xs_magic@&fp1\endcsname +{% + \xintDigits*:=16;% + \xs_message{fp16 mode (trig reloaded)}% + \def\xs_mode{fp16}% + \def\xs_xintdefvar{\xintdeffloatvar}% + \def\xs_xintdeffunc{\xintdeffloatfunc}% + \def\xs_xinteval{\xintfloateval}% +}% +\expandafter\def\csname xs_magic@&fp2\endcsname +{% + \xintDigits*:=24;% + \xs_message{fp24 mode (trig reloaded)}% + \def\xs_mode{fp24}% + \def\xs_xintdefvar{\xintdeffloatvar}% + \def\xs_xintdeffunc{\xintdeffloatfunc}% + \def\xs_xinteval{\xintfloateval}% +}% +\expandafter\def\csname xs_magic@&fp3\endcsname +{% + \xintDigits*:=32;% + \xs_message{fp32 mode (trig reloaded)}% + \def\xs_mode{fp32}% + \def\xs_xintdefvar{\xintdeffloatvar}% + \def\xs_xintdeffunc{\xintdeffloatfunc}% + \def\xs_xinteval{\xintfloateval}% +}% +\def\xs_magic@&exa +{% + \xs_message{exact mode (floating point evaluations use \xinttheDigits\space digits)}% + \def\xs_mode{exact}% + \def\xs_xintdefvar{\xintdefvar}% + \def\xs_xintdeffunc{\xintdeffunc}% + \def\xs_xinteval{\xinteval}% +}% +\def\xs_magic@&int +{% + \xs_message{int mode (integer only: / rounds, // is floored division, /: is modulo)}% + \def\xs_mode{int}% + \def\xs_xintdefvar{\xintdefiivar}% + \def\xs_xintdeffunc{\xintdefiifunc}% + \def\xs_xinteval{\xintiieval}% +}% +\def\xs_magic@&pol +{% + \xs_message{pol mode (i.e. function definitions use \string\poldef)}% + \def\xs_mode{pol}% + \def\xs_xintdefvar{\xintdefvar}% + \def\xs_xintdeffunc{\poldef}% + \def\xs_xinteval{\xinteval}% +}% +\def\xs_magic@&mod{\xs_message{current mode: \xs_mode}}% +\def\xs_setcats +{% + \newlinechar10\endlinechar13% + \catcode13\active\catcode`@ 11\relax +}% +\def\xs_storecats{\edef\xs_resetcats +{% + \newlinechar\the\newlinechar + \endlinechar\the\endlinechar + \catcode13=\the\catcode13 + \catcode`@\the\catcode`@\relax +}}% +\begingroup +\catcode13\active\catcode32\active% +\gdef\xintstart{\edef {\string }\xs_setcats\def +{""J}\message{\xs_logo + Welcome to xintexpr interactive mode! + + - input is `;'-terminated and can extend over multiple lines, + - definitions must be done using the `:=' syntax, not `='. + + Any line starting with a control sequence is executed in the + background, interrupted numerical input resumes at next prompt. + + To pause, say either `;' or `&pause'. + To quit, say `&bye'. + For help say `&help'. + Starting in}\xs_magic@&exa\let +=\xs_fetch}\gdef\xintresume{\edef {\string }\xs_storecats\xs_setcats% +\message{Welcome back to xintexpr interactive mode!}\let +=\xs_fetch}\gdef\xs_help\xs_fetch_a{\def +{""J}\edef {\string }\message{% + - Terminate inputs using the `;' character. + + - Input can extend over multiple lines (<RET> terminated). + + - An empty input (`;' terminated) or the magic word `&pause' puts + the session on hold and switches to normal TeX interaction. + Use \string\xintresume to resume the session. + + - The numerical engine can work in various modes: + * exact mode means using \string\xintexpr context, + * fp mode uses \string\xintfloatexpr, + * int mode uses integer-only \string\xintiiexpr, + * pol mode makes function definitions using \string\poldef. + To activate a mode enter `&<mode name>' at the prompt + + - Lines starting with any control sequence are handed over to + TeX, and numerical input resumes on next line. + + - To change the floating point precision enter at the prompt: + \string\xintDigits*:= <some number>; + then at next prompt switch to fp mode using `&fp'. + This can be done in the midst of a computation! + +(1/5) HIT <RET> KEY +}\let +=\xs_help_b}\gdef\xs_help_b{\def +{""J}\message{% + - Specific toggles `&fp16', `&fp24', `&fp32' are already predefined. + + - Issue `&mode' if you forgot in what mode you are currently in. + + - Definitions (variables or functions) are done using `:='. + + IMPORTANT: currently, using a `=' by oversight will cause + breakage because xintsession thinks it is then a numerical + evaluation, not a definition, but there is no `=' operator in + xintexpr syntax. + + Perhaps in future it will be allowed to make definitions using + `=' and xintsession will check if it is not misinterpreting a + `=' from `<=', `>=', `!=', `==' or `seq()' syntax but this + currently was considered to add too much overhead for the + benefit. + + - Parentheses present before the `:=' trigger a function + definition, else a variable definition is done. + +(2/5) HIT <RET> KEY +}\let +=\xs_help_c}\gdef\xs_help_c{\def +{""J}\message{% + - Functions defined in one mode are not available for usage in other + modes without further steps; check xintexpr doc. + + - Polynomial definitions (pol mode) are function definitions + (see polexpr documentation). To use a polynomial also as a + numerical function when back in `fp' mode, issue + \string\PolGenFloatVariant{<polname>} at the prompt. + + - Variables defined in any mode can be used in any mode except: + * polynomials can be used as variables only in the pol and the + exact modes, + * integer only mode requires... integer only variables! + One can use num() wrapper see xintexpr documentation. + + - Whenever a variable is defined, or a computation is performed, + the result is assigned a label @_<integer>. These automatic + variables can then be used in subsequent computations. + + - In the case of a multi-variable assignment (see xintexpr doc) + the automatic variable @_<integer> holds the whole thing, which + may be a nutple or an ople, in addition to individual variables. + +(3/5) HIT <RET> KEY +}\let +=\xs_help_d}\gdef\xs_help_d{\def +{""J}\message{% + - The special variables @_, @__, and @___ hold the last, next + to last and next to next to last evaluation results. + + Known issues: + + - The [P] optional argument of \string\xintfloateval can not + be used because it is not recognized by \string\xintdeffloatvar, + one can use the float() function with its second argument. + + - Sometimes one wishes to use \string\xintexpr...\string\relax wrapper + inside fp mode; this is possible but can not be first in current + input line as it would trigger control sequence execution. Start + with 0+ or use parentheses. + + - The output format of the exact and fp mode is not yet decided + at upstream xintexpr; in particular trailing zeros are not + trimmed and floating point numbers are printed in diverging + ways in exact vs fp modes. Besides, the exact mode does + not do a systematic reduction to lowest terms. Use the + reduce() function (or preduce()). + + - By default, the ** and ^ operators operate only with integer + exponents in exact mode and with half-integers in fp mode. + Fractional powers are available via the pow(x,a) function. +(4/5) HIT <RET> KEY +}\let +=\xs_help_e}\gdef\xs_help_e{\def +{""J}\message{% + Known issues (cont.): + + - Refer to xintexpr \string\poormanloghack documentation on + how to let fractional powers be available with ** or ^, + and check polexpr documentation for related information. + + - A session transcript file is created which can be executed by + eTeX to redo all calculations; however @_, @__, and @__ + will not be defined in this context so need to be manually + replaced by the suitable @_<integer>. + + Future: + + - a plot() function will be added at some point to export + coordinates into a tex file for usage either with PSTricks or + TikZ/pgf. + + Caveat: + + Misformed xintexpr input can drop you into TeX error mode. + In that case, try escaping using `S'. It does work sometimes. + + Use `&bye' to terminate the session and the TeX run. + +(5/5) You are back to the xintexpr interactive session! (mode: \xs_mode) +}\let +=\xs_fetch\xs_fetch_a}\endgroup +\let\xs_magic@&hel\xs_help +\xsrestorecatcodes +\csname xs_storecats\endcsname +\catcode13\active\def +{\xintstart +}\endinput% |