summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-03-11 03:00:57 +0000
committerNorbert Preining <norbert@preining.info>2022-03-11 03:00:57 +0000
commitdc086771e418d7c66a541d2831b468375c5f7090 (patch)
tree182467c4304d5956a3caa8a691ce27b14faeacaf /macros/latex
parent6367aa11ef0b99d86693b685ab67096514792a0f (diff)
CTAN sync 202203110300
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/asmeconf/README.md8
-rw-r--r--macros/latex/contrib/asmeconf/asmeconf-template.pdfbin599456 -> 585147 bytes
-rw-r--r--macros/latex/contrib/asmeconf/asmeconf-template.tex6
-rw-r--r--macros/latex/contrib/asmeconf/asmeconf.cls27
-rw-r--r--macros/latex/contrib/asmeconf/examples/asmeconf-authorgrid-example.pdfbin639103 -> 596306 bytes
-rw-r--r--macros/latex/contrib/asmeconf/examples/asmeconf-fontspec.pdfbin370592 -> 369381 bytes
-rw-r--r--macros/latex/contrib/asmeconf/examples/asmeconf-fontspec.tex2
-rw-r--r--macros/latex/contrib/asmeconf/examples/asmeconf-lualatex-ode-example.pdfbin280349 -> 254973 bytes
-rw-r--r--macros/latex/contrib/asmeconf/examples/asmeconf-lualatex-ode-example.tex2
-rw-r--r--macros/latex/contrib/asmeconf/examples/asmeconf-wide-equation-example/asmeconf-template-widetext.pdfbin2931161 -> 2930107 bytes
-rw-r--r--macros/latex/contrib/asmeconf/examples/asmeconf-wide-equation-example/asmeconf-template-widetext.tex17
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/demo/trigon_demo.pdfbin419465 -> 416666 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.dtx13
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.pdfbin367313 -> 366853 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamercolorthemetrigon.dtx2
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerfontthemetrigon.dtx2
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerinnerthemetrigon.dtx20
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerouterthemetrigon.dtx16
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerthemetrigon.dtx2
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem-doc.pdfbin117102 -> 117097 bytes
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem-doc.tex6
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem.sty92
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx169
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin592701 -> 592859 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex26
-rw-r--r--macros/latex/contrib/functional/README.txt5
-rw-r--r--macros/latex/contrib/functional/functional.pdfbin0 -> 189483 bytes
-rw-r--r--macros/latex/contrib/functional/functional.sty686
-rw-r--r--macros/latex/contrib/functional/functional.tex994
-rw-r--r--macros/latex/contrib/tiscreen/README2
-rw-r--r--macros/latex/contrib/tiscreen/doc/tiscreen-doc.pdfbin150094 -> 229778 bytes
-rw-r--r--macros/latex/contrib/tiscreen/doc/tiscreen-doc.tex263
-rw-r--r--macros/latex/contrib/tiscreen/tex/tiscreen.sty149
-rw-r--r--macros/latex/contrib/verifiche/verifiche-example.pdfbin175815 -> 190102 bytes
-rw-r--r--macros/latex/contrib/verifiche/verifiche.dtx120
-rw-r--r--macros/latex/contrib/verifiche/verifiche.pdfbin523647 -> 551397 bytes
-rw-r--r--macros/latex/contrib/xsavebox/ChangeLog6
-rw-r--r--macros/latex/contrib/xsavebox/xsavebox.pdfbin368610 -> 378552 bytes
-rw-r--r--macros/latex/contrib/xsavebox/xsavebox.sty73
-rw-r--r--macros/latex/contrib/xsavebox/xsavebox.tex15
40 files changed, 2367 insertions, 356 deletions
diff --git a/macros/latex/contrib/asmeconf/README.md b/macros/latex/contrib/asmeconf/README.md
index 66bbf88e30..c45516e710 100644
--- a/macros/latex/contrib/asmeconf/README.md
+++ b/macros/latex/contrib/asmeconf/README.md
@@ -1,7 +1,7 @@
#asmeconf: A latex template for ASME conference papers#
- Version 1.28 dated 2022/02/14.
+ Version 1.29 dated 2022/03/10.
####Overview####
This class provides a LaTeX template for ASME Conference papers formatted according to
@@ -79,6 +79,12 @@
---
####Change log####
+ v1.29 (2022/03/10)
+ - Include current date and venue for 2022 IMECE (subject to change)
+ - Edit example .tex file for asmewide.sty to remove description of unreleased development code
+ - Fix bug in nofoot option that stopped capitalization of captions
+ - Adjust scale factors on typewriter (raise to 1.05) and sans serif fonts (lower to 0.91)
+
v1.28 (2022/02/14)
- Introduce asmewide.sty, an experimental package for setting page-width equations in a two column format. A document with examples of use is included.
- Increase scale of sans serif font under fontspec from 0.9 to 0.94, to better match newtxtext under pdflatex
diff --git a/macros/latex/contrib/asmeconf/asmeconf-template.pdf b/macros/latex/contrib/asmeconf/asmeconf-template.pdf
index 81365c217c..1544f87ee3 100644
--- a/macros/latex/contrib/asmeconf/asmeconf-template.pdf
+++ b/macros/latex/contrib/asmeconf/asmeconf-template.pdf
Binary files differ
diff --git a/macros/latex/contrib/asmeconf/asmeconf-template.tex b/macros/latex/contrib/asmeconf/asmeconf-template.tex
index 1e3c938e79..8d3fbfb485 100644
--- a/macros/latex/contrib/asmeconf/asmeconf-template.tex
+++ b/macros/latex/contrib/asmeconf/asmeconf-template.tex
@@ -4,7 +4,7 @@
%% This file is asmeconf-template.tex, a LaTeX template to format ASME Conference papers according to
%% the requirements on ASME's conference web pages, and including hypertext support for the pdf.
%%
-%% This file is version 1.28 dated 2022/02/14
+%% This file is version 1.29 dated 2022/03/10
%%
%% As of version 1.11, this template defaults to ASME's newer conference guidelines first posted July 2019.
%% Those guidelines changed the requested author block formatting to be inline.
@@ -113,8 +113,8 @@
\ConfName{Proceedings of the ASME 2022\linebreak International Mechanical Engineering Congress and Exposition}
\ConfAcronym{IMECE2022}
-\ConfDate{November XX-YY, 2022} % update once this is known (expected March 2022)
-\ConfCity{Location, ST} % update once this is known (expected March 2022)
+\ConfDate{October 30--November 3, 2022} % update
+\ConfCity{Columbus, OH} % update
\PaperNo{IMECE2022-XXXX}
% Units of measure (e.g., cm) and other specialty lowercase terms in the title should be
diff --git a/macros/latex/contrib/asmeconf/asmeconf.cls b/macros/latex/contrib/asmeconf/asmeconf.cls
index 8a2a2c952f..e513eee7b8 100644
--- a/macros/latex/contrib/asmeconf/asmeconf.cls
+++ b/macros/latex/contrib/asmeconf/asmeconf.cls
@@ -5,8 +5,8 @@
%% ASME conference requirements as represented on ASME's conference web pages in 2022.
%%
%% This file's version and date:
- \def\versionno{1.28}
- \def\versiondate{2022/02/14\space}
+ \def\versionno{1.29}
+ \def\versiondate{2022/03/10\space}
%%
%% Author: John H. Lienhard, V
%% Department of Mechanical Engineering
@@ -349,9 +349,9 @@
\DeclareOption{lineno}{\ac@linenotrue}
%% option to omit ASME footer [nofoot]
-\DeclareOption{nofoot}{%
- \AtBeginDocument{\pagestyle{plain}}%
-}
+\newif\ifac@nofoot\ac@nofootfalse
+\DeclareOption{nofoot}{\ac@nofoottrue}
+
%%% option [contractor] to obtain government contractor copyright notice.
\newif\ifac@contractor\ac@contractorfalse
@@ -507,12 +507,12 @@
\RequirePackage[]{babel}
\ifpdftex
- \RequirePackage[]{newtxtext}
- \RequirePackage[varqu,varl]{inconsolata}% sans typewriter font
+ \RequirePackage[helvratio=.91]{newtxtext}% rescaled 22/03/10
+ \RequirePackage[varqu,varl,scale=1.05]{inconsolata}% sans typewriter font % rescaled 22/03/10
\RequirePackage[]{newtxmath}
\else
\ifac@fontspec
- \RequirePackage[varqu,varl]{inconsolata} % typewriter font for math
+ \RequirePackage[varqu,varl]{inconsolata} % typewriter font for math
\renewcommand\rmdefault{ntxtlf} % roman font for math
\RequirePackage[T1]{fontenc} % qhv is not TU encoded, 2021/12/24
\DeclareFontFamily{T1}{\sfdefault}{} % sf for math
@@ -538,11 +538,11 @@
BoldFont = *-bold,
BoldItalicFont = *-bolditalic,
Numbers = Lining,
- Scale=0.94,% same as for newtx; former value 0.9 too small 2022/01/15
+ Scale=0.91,% same as for newtx; former value 0.9 too small 2022/01/15
]
\setmonofont{Inconsolatazi4}[% This otf font ships with the LaTeX Inconsolata package (it's in TeX Live)
\MonoNotMono,% match newtxtext if we enable wordspacing
- Scale=1,
+ Scale=1.05,% rescaled from 1, 22/03/10
Extension = .otf,
UprightFont = *-Regular,
ItalicFont = *-Regular,% has no italic face
@@ -905,8 +905,8 @@
\babelprovide[import, captions/abstract = Muhtasari, language = Default]{swahili}
%
\else % use lualatex without font support for other languages (easier set-up and still enables luacode for numerics)
- \RequirePackage[nofontspec]{newtxtext}% will lose some accented characters this way ... better to use fontspec
- \RequirePackage[varqu,varl]{inconsolata}% sans typewriter font
+ \RequirePackage[nofontspec,helvratio=0.91]{newtxtext}% will lose some accented characters this way ... better to use fontspec
+ \RequirePackage[varqu,varl,scale=1.05]{inconsolata}% sans typewriter font
\RequirePackage[]{newtxmath}
\fi
\fi
@@ -999,6 +999,9 @@
\fancyfoot[CE,CO]{\@SetFont\thepage\\[1ex]\footnotesize The United States Government retains, and by accepting the article for publication, the publisher acknowledges that the United States Government retains, a non-exclusive, paid-up, irrevocable, worldwide license to publish or reproduce the published form of this work, or allow others to do so, for United States Government purposes.}
\fi
+\ifac@nofoot
+ \fancyfoot[RO,RE]{}
+\fi
%%%%%% footnotes %%%%%%%
\RequirePackage{fnpos}
diff --git a/macros/latex/contrib/asmeconf/examples/asmeconf-authorgrid-example.pdf b/macros/latex/contrib/asmeconf/examples/asmeconf-authorgrid-example.pdf
index 600ff30201..d765aef5a3 100644
--- a/macros/latex/contrib/asmeconf/examples/asmeconf-authorgrid-example.pdf
+++ b/macros/latex/contrib/asmeconf/examples/asmeconf-authorgrid-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/asmeconf/examples/asmeconf-fontspec.pdf b/macros/latex/contrib/asmeconf/examples/asmeconf-fontspec.pdf
index c2fc29a440..05e276803f 100644
--- a/macros/latex/contrib/asmeconf/examples/asmeconf-fontspec.pdf
+++ b/macros/latex/contrib/asmeconf/examples/asmeconf-fontspec.pdf
Binary files differ
diff --git a/macros/latex/contrib/asmeconf/examples/asmeconf-fontspec.tex b/macros/latex/contrib/asmeconf/examples/asmeconf-fontspec.tex
index c4ae6c0497..242e35ce91 100644
--- a/macros/latex/contrib/asmeconf/examples/asmeconf-fontspec.tex
+++ b/macros/latex/contrib/asmeconf/examples/asmeconf-fontspec.tex
@@ -188,7 +188,7 @@ The needed fonts are listed in Table~\ref{tab:2}.
%%%%%%%%%%%%%%% two column table %%%%%%%%%%%%%%%%%%
\NewDocumentCommand\R{O{11pt}}{\rule{0pt}{#1}}
\begin{table*}[t!]
-\caption{System fonts used by \AC\ with \FS. For all fonts, load regular and bold face. For Latin, Cyrillic, and Greek, also load italic and bold italic. For Noto Sans Arabic, install semibold instead of bold.\label{tab:2}}%
+\caption{System fonts used by \NoCaseChange{\AC} with \NoCaseChange{\FS}. For all fonts, load regular and bold face. For Latin, Cyrillic, and Greek, also load italic and bold italic. For Noto Sans Arabic, install semibold instead of bold.\label{tab:2}}%
\centering{%
\begin{tabular*}{\textwidth}{@{\hspace*{0.5em}}@{\extracolsep{\fill}}>{\raggedright}p{6em}>{\raggedright}p{12em}>{\raggedright}p{10em}p{23em}@{\hspace*{0.5em}}}
\toprule
diff --git a/macros/latex/contrib/asmeconf/examples/asmeconf-lualatex-ode-example.pdf b/macros/latex/contrib/asmeconf/examples/asmeconf-lualatex-ode-example.pdf
index 3443ed0425..08d31a1ec5 100644
--- a/macros/latex/contrib/asmeconf/examples/asmeconf-lualatex-ode-example.pdf
+++ b/macros/latex/contrib/asmeconf/examples/asmeconf-lualatex-ode-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/asmeconf/examples/asmeconf-lualatex-ode-example.tex b/macros/latex/contrib/asmeconf/examples/asmeconf-lualatex-ode-example.tex
index 891c2207d7..7857276b96 100644
--- a/macros/latex/contrib/asmeconf/examples/asmeconf-lualatex-ode-example.tex
+++ b/macros/latex/contrib/asmeconf/examples/asmeconf-lualatex-ode-example.tex
@@ -191,7 +191,7 @@ Here, $A$ is a constant. We may adopt a fourth-order Runge-Kutta algorithm for t
The algorithm is implemented directly in the preamble of this file, and the results are plotted in Fig.~\ref{fig:1} for $A = \{0.25, 0.5, 0.75, 1.0\}$. Plotting is done using the \texttt{PGFPLOTS} package~\cite{pgfplots}.
-Landscape figures, such as Fig.~\ref{fig:1}, may be produced at full-page size by putting \verb|\usepackage[figuresright]{rotating}| in your \texttt{.tex} file's preamble and using the \texttt{sidewaysfigure*} environment~\cite{fairbairns}.
+Landscape figures may be produced at full-page size by putting \verb|\usepackage[figuresright]{rotating}| (Fig.~\ref{fig:1}) into your \texttt{.tex} file's preamble and using the \texttt{sidewaysfigure*} environment~\cite{fairbairns}.
\begin{sidewaysfigure*}
\begin{tikzpicture}
diff --git a/macros/latex/contrib/asmeconf/examples/asmeconf-wide-equation-example/asmeconf-template-widetext.pdf b/macros/latex/contrib/asmeconf/examples/asmeconf-wide-equation-example/asmeconf-template-widetext.pdf
index 3b915adbcc..cf119cdbde 100644
--- a/macros/latex/contrib/asmeconf/examples/asmeconf-wide-equation-example/asmeconf-template-widetext.pdf
+++ b/macros/latex/contrib/asmeconf/examples/asmeconf-wide-equation-example/asmeconf-template-widetext.pdf
Binary files differ
diff --git a/macros/latex/contrib/asmeconf/examples/asmeconf-wide-equation-example/asmeconf-template-widetext.tex b/macros/latex/contrib/asmeconf/examples/asmeconf-wide-equation-example/asmeconf-template-widetext.tex
index 209cf294ca..2456b0266d 100644
--- a/macros/latex/contrib/asmeconf/examples/asmeconf-wide-equation-example/asmeconf-template-widetext.tex
+++ b/macros/latex/contrib/asmeconf/examples/asmeconf-wide-equation-example/asmeconf-template-widetext.tex
@@ -11,15 +11,14 @@
%%
%% NB: the strip environment from cuted is incompatible with the [lineno] option to asmeconf!
-\documentclass[nofoot,colorlinks,balance,pdf-a]{asmeconf}
+\documentclass[nofoot,colorlinks,balance,pdf-acolorlinks,balance,pdf-a]{asmeconf}
-\def\ACwidetextversion{1.0}
-\def\ACwidetextdate{January 10, 2022}
+\def\ACwidetextversion{1.1}
+\def\ACwidetextdate{February 15, 2022}
\usepackage{lipsum}% Latin filler text
\usepackage{asmewide}
-
\begin{filecontents}{asme-wide-equations.bib}
@online{lienhard2021,
author = {Lienhard, John H., V},
@@ -123,7 +122,6 @@ to be read---the rest is simply filler to aid in layout.}
\subsection{Subsection}
\lipsum[5-6]
-
%%%%%%%%%%%%%%%%%%%% Example WT1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Single Wide Equation on the Page}
@@ -226,15 +224,16 @@ Our competitor's data & 72.321 & 141.384 \\[1pt]
\end{table*}
%%%%%%%%%%%%%%%% end table %%%%%%%%%%%%%%%%%%%
-\lipsum[17-24]
+\lipsum[17-23]
+\lipsum[24]
%%%%%%%%%%%%%%%%%%%% Examples WT4 & WT5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Wide Equation Pair Split Across Page Break and Followed by Wide Equation}
-\textcolor{red}{Here, we turn off automatic top line so that it does not appear again at the top of the next page: \texttt{\textbackslash TopLineOff}. We instead issue a command to create the top line inside the \texttt{widetext} environment, \texttt{\textbackslash LineAbove}. We must remember to restore the automatic top line after we exit the \texttt{widetext} environment: \texttt{\textbackslash TopLineOn}.}
+\textcolor{red}{Note that the upper rule is cleared after the first use in a \texttt{widetext} environment. This means that it will not show up at the top of the next page.}
-\textcolor{red}{The \texttt{\textbackslash newpage} command may optionally be used between the equations to force the second one onto the following page, e.g., try removing the source code line \texttt{\textbackslash lipsum[27]} with and without \texttt{\textbackslash newpage}.}
+\textcolor{red}{The \texttt{\textbackslash newpage} command may optionally be used between the equations to force the second one onto the following page, e.g., try removing the source code line \texttt{\textbackslash lipsum[24]} with and without \texttt{\textbackslash newpage}.}
\begin{widetext}
\begin{equation}\mathbf{WT4:}
@@ -295,7 +294,7 @@ q_\textrm{gray} & q_\textrm{int, $T_1$} & q_\textrm{int, $T_m$} & q_\textrm{exa
\lipsum[50-60]
-\textcolor{red}{In this case, we drop the top line: \texttt{\textbackslash begin\{widetext\}[][b]}.}
+\textcolor{red}{In the following example, we leave out the top line: \texttt{\textbackslash begin\{widetext\}[][b]}.}
\vskip 80pt% <== an extra skip to push this widetext over the edge
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/demo/trigon_demo.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/demo/trigon_demo.pdf
index 45942368e5..157574bf15 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/demo/trigon_demo.pdf
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/demo/trigon_demo.pdf
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.dtx
index 7e1dce7af9..bc46840940 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.dtx
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.dtx
@@ -426,6 +426,19 @@ An easy way to customize the theme is to redefine these colors using
\end{lstlisting}
in your preamble.
+\subsection{Logos}
+
+The package allows the inclusion of logos on the title page and on the content
+slides. For that, the following commands are defined:
+\begin{lstlisting}
+ \biglogo[<options>]{path/to/your/titlepage_logo}
+ \smalllogo[<options>]{path/to/your/titlepage_logo}
+\end{lstlisting}
+These two commands are just replacements for |\includegraphics| and they will
+pass the options as-is so you can perfectly size and position the images.
+
+
+
\section{Tips \& Tricks}
\subsection{Backup Slides}
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.pdf
index 99d6007081..f70379b53a 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.pdf
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.pdf
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamercolorthemetrigon.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamercolorthemetrigon.dtx
index d5da8918f1..9e5780a7e7 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamercolorthemetrigon.dtx
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamercolorthemetrigon.dtx
@@ -13,7 +13,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{beamercolorthemetrigon}[2021/11/10 v0.6.2 Trigon color theme]
+\ProvidesPackage{beamercolorthemetrigon}[2022/03/10 v0.6.3 Trigon color theme]
%</package>
% \fi
% \CheckSum{0}
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerfontthemetrigon.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerfontthemetrigon.dtx
index 790af1b4f9..0d2d1b15ba 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerfontthemetrigon.dtx
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerfontthemetrigon.dtx
@@ -13,7 +13,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{beamerfontthemetrigon}[2021/11/10 v0.6.2 Trigon font theme]
+\ProvidesPackage{beamerfontthemetrigon}[2022/03/10 v0.6.3 Trigon font theme]
%</package>
% \fi
% \CheckSum{0}
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerinnerthemetrigon.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerinnerthemetrigon.dtx
index 614cfb3854..5726c1a543 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerinnerthemetrigon.dtx
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerinnerthemetrigon.dtx
@@ -13,7 +13,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{beamerinnerthemetrigon}[2021/11/10 v0.6.2 Trigon inner theme]
+\ProvidesPackage{beamerinnerthemetrigon}[2022/03/10 v0.6.3 Trigon inner theme]
%</package>
% \fi
% \CheckSum{0}
@@ -46,12 +46,15 @@
%
% \subsubsection{Definitions}
%
-% We define the command |\logobig| to specify the logo that needs to be applied
-% displayed on the title frame.
+% We define the command |\biglogo| to specify the logo that needs to be
+% displayed on the title frame. This command is just a replacement for
+% |\includegraphics|, so it accepts the same options.
% \begin{macrocode}
\def\logbig{}
-\newcommand\biglogo[1]{
- \def\logbig{#1}
+\newcommand\biglogo[2][width=0.28\textwidth]{
+ \ifx#2\@empty\else
+ \def\logbig{\includegraphics[#1]{#2}}
+ \fi
}
% \end{macrocode}
%
@@ -290,7 +293,7 @@
\path[fill=tBg]\rightTriangle{0.45\paperwidth}{\the\paperheight};
\ifx\logbig\@empty \else
\node[anchor=north east,inner sep=0mm] at
- (.96*\the\paperwidth,.96*\the\paperheight) {\includegraphics[width=0.28\textwidth]{\logbig}};
+ (.96*\the\paperwidth,.96*\the\paperheight) {\logbig};
\fi
\end{tikzpicture}
}
@@ -305,7 +308,8 @@
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\leftColorTriangle{0.58\paperwidth}{0}{tGrey!30!tBg}
\ifx\logbig\@empty \else
- \node[anchor=north east,inner sep=0mm] at (.94*\the\paperwidth,.94*\the\paperheight) {\includegraphics[width=0.33\textwidth]{\logbig}};
+ \node[anchor=north east,inner sep=0mm] at
+ (.94*\the\paperwidth,.94*\the\paperheight) {\logbig};
\fi
\ifx\inserttitlegraphic\@empty
\leftColorTriangle{0.58\paperwidth}{\the\paperheight}{tTheme}
@@ -491,7 +495,7 @@
\begin{minipage}[t][][t]{\textwidth}
\centering%
\ifx\logbig\@empty \else
- \includegraphics[height=0.15\textheight]{\logbig}
+ \logbig
\fi
\end{minipage}
\vskip15pt
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerouterthemetrigon.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerouterthemetrigon.dtx
index d33c019bcc..de5dc23c16 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerouterthemetrigon.dtx
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerouterthemetrigon.dtx
@@ -13,7 +13,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{beamerouterthemetrigon}[2021/11/10 v0.6.2 Trigon outer theme]
+\ProvidesPackage{beamerouterthemetrigon}[2022/03/10 v0.6.3 Trigon outer theme]
%</package>
% \fi
% \CheckSum{0}
@@ -35,12 +35,16 @@
% \end{macrocode}
%
% \subsubsection{Definitions}
-% We define the command |\logsmall| to specify the logo that needs to be applied
-% displayed on all normal frames.
+%
+% We define the command |\smalllogo| to specify the logo that needs to be applied
+% displayed on all normal frames. This command is just a replacement for
+% |\includegraphics|, so it accepts the same options.
% \begin{macrocode}
\def\logsmall{}
-\newcommand\smalllogo[1]{
- \def\logsmall{#1}
+\newcommand\smalllogo[2][width=20pt]{
+ \ifx#2\@empty\else
+ \def\logsmall{\includegraphics[#1]{#2}}
+ \fi
}
% \end{macrocode}
%
@@ -100,7 +104,7 @@
\defbeamertemplate{headline}{none}{}
\defbeamertemplate*{headline}{logo}{
\ifx\logsmall\@empty\else
- \hfill\includegraphics[width=20pt]{\logsmall}\hspace{20pt}\vspace{-40pt}
+ \hfill\logsmall\hspace{20pt}\vspace{-40pt}
\fi
}
% \end{macrocode}
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerthemetrigon.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerthemetrigon.dtx
index 0f097e81ac..f2c56ad5ea 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerthemetrigon.dtx
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerthemetrigon.dtx
@@ -13,7 +13,7 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{beamerthemetrigon}[2021/11/10 v0.6.2 Trigon Beamer theme]
+\ProvidesPackage{beamerthemetrigon}[2022/03/10 v0.6.3 Trigon Beamer theme]
%</package>
% \fi
% \CheckSum{0}
diff --git a/macros/latex/contrib/create-theorem/create-theorem-doc.pdf b/macros/latex/contrib/create-theorem/create-theorem-doc.pdf
index 0339c47d91..5ec3992fbe 100644
--- a/macros/latex/contrib/create-theorem/create-theorem-doc.pdf
+++ b/macros/latex/contrib/create-theorem/create-theorem-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/create-theorem/create-theorem-doc.tex b/macros/latex/contrib/create-theorem/create-theorem-doc.tex
index 8a3bf3f607..ef84ddfca5 100644
--- a/macros/latex/contrib/create-theorem/create-theorem-doc.tex
+++ b/macros/latex/contrib/create-theorem/create-theorem-doc.tex
@@ -85,10 +85,12 @@
\begin{document}
+\def\PackageVersion{2022/03/10}
+
\title{\createtheorempackage{}\\\smallskip\itshape Initializing theorem-like environments with multilingual support}
\author{Jinwen XU}
-\thanks{Corresponding to: \texttt{\createtheorempackage{} 2022/03/03}}
-\date{March 2022, in Paris}
+\thanks{Corresponding to: \texttt{\createtheorempackage{} \PackageVersion}}
+\date{\TheDate{\PackageVersion}[only-year-month], in Paris}
\maketitle
diff --git a/macros/latex/contrib/create-theorem/create-theorem.sty b/macros/latex/contrib/create-theorem/create-theorem.sty
index f9fa3d4e9f..b7439ea466 100644
--- a/macros/latex/contrib/create-theorem/create-theorem.sty
+++ b/macros/latex/contrib/create-theorem/create-theorem.sty
@@ -13,7 +13,7 @@
\RequirePackage{l3keys2e}
\ProvidesExplPackage
{create-theorem}
- {2022/03/03} {}
+ {2022/03/10} {}
{Initializing theorem-like environments with multilingual support}
\keys_define:nn { create-theorem }
@@ -90,27 +90,27 @@
, Crefname .value_required:n = true
, heading~style .code:n = { \crthm_set_name_style_heading:en { \l__crthm_current_env_tl } { #1 } }
, heading~style .value_required:n = true
- , heading-style .meta:n = { heading~style = #1 }
+ , heading-style .meta:n = { heading~style = { #1 } }
, heading-style .value_required:n = true
- , heading style .meta:n = { heading~style = #1 }
+ , heading style .meta:n = { heading~style = { #1 } }
, heading style .value_required:n = true
, crefname~style .code:n = { \crthm_set_name_style_crefname:en { \l__crthm_current_env_tl } { #1 } }
, crefname~style .value_required:n = true
- , crefname-style .meta:n = { crefname~style = #1 }
+ , crefname-style .meta:n = { crefname~style = { #1 } }
, crefname-style .value_required:n = true
- , crefname style .meta:n = { crefname~style = #1 }
+ , crefname style .meta:n = { crefname~style = { #1 } }
, crefname style .value_required:n = true
, Crefname~style .code:n = { \crthm_set_name_style_Crefname:en { \l__crthm_current_env_tl } { #1 } }
, Crefname~style .value_required:n = true
- , Crefname-style .meta:n = { Crefname~style = #1 }
+ , Crefname-style .meta:n = { Crefname~style = { #1 } }
, Crefname-style .value_required:n = true
- , Crefname style .meta:n = { Crefname~style = #1 }
+ , Crefname style .meta:n = { Crefname~style = { #1 } }
, Crefname style .value_required:n = true
, numbering~style .code:n = { \crthm_set_name_style_numbering:en { \l__crthm_current_env_tl } { #1 } }
, numbering~style .value_required:n = true
- , numbering-style .meta:n = { numbering~style = #1 }
+ , numbering-style .meta:n = { numbering~style = { #1 } }
, numbering-style .value_required:n = true
- , numbering style .meta:n = { numbering~style = #1 }
+ , numbering style .meta:n = { numbering~style = { #1 } }
, numbering style .value_required:n = true
, unknown .code:n = {}
}
@@ -317,17 +317,23 @@
\cs_set:cpn { #4 ref@ #1 @format@second } ##1##2##3
{
\crefpairconjunction
+ \group_begin:
\crthm_format_short_generic:nnn { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } } { ##2 } { ##3 }
+ \group_end:
}
\cs_set:cpn { #4 ref@ #1 @format@middle } ##1##2##3
{
\crefmiddleconjunction
+ \group_begin:
\crthm_format_short_generic:nnn { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } } { ##2 } { ##3 }
+ \group_end:
}
\cs_set:cpn { #4 ref@ #1 @format@last } ##1##2##3
{
\creflastconjunction
+ \group_begin:
\crthm_format_short_generic:nnn { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } } { ##2 } { ##3 }
+ \group_end:
}
\crthm_define_format_long_version:nnnn { #2 } { #4 refrange@ #1 @format }
@@ -355,26 +361,32 @@
\cs_set:cpn { #4 refrange@ #1 @format@second } ##1##2##3##4##5##6
{
\crefpairconjunction
+ \group_begin:
\crthm_format_long_generic:nnnnnn
{ \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } }
{ \tl_use:c { g_crthm_number_style_ #2 _tl } { ##2 } }
{ ##3 } { ##4 } { ##5 } { ##6 }
+ \group_end:
}
\cs_set:cpn { #4 refrange@ #1 @format@middle } ##1##2##3##4##5##6
{
\crefmiddleconjunction
+ \group_begin:
\crthm_format_long_generic:nnnnnn
{ \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } }
{ \tl_use:c { g_crthm_number_style_ #2 _tl } { ##2 } }
{ ##3 } { ##4 } { ##5 } { ##6 }
+ \group_end:
}
\cs_set:cpn { #4 refrange@ #1 @format@last } ##1##2##3##4##5##6
{
\creflastconjunction
+ \group_begin:
\crthm_format_long_generic:nnnnnn
{ \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } }
{ \tl_use:c { g_crthm_number_style_ #2 _tl } { ##2 } }
{ ##3 } { ##4 } { ##5 } { ##6 }
+ \group_end:
}
}
@@ -387,7 +399,7 @@
{
\cs_new:cn { crthm_format_ #2 :nnn }
{
- #3 ##2 #4 \nobreakspace { \tl_use:c { g_crthm_number_style_ #1 _tl } { ##1 } } ##3
+ { #3 } ##2 { #4 } \nobreakspace { \tl_use:c { g_crthm_number_style_ #1 _tl } { ##1 } } ##3
}
\cs_set_eq:cc { #2 } { crthm_format_ #2 :nnn }
}
@@ -401,7 +413,7 @@
{
\cs_new:cn { crthm_format_ #2 :nnnnnn }
{
- #3 ##3 #4
+ { #3 } ##3 { #4 }
\nobreakspace \crefrangepreconjunction
{ \tl_use:c { g_crthm_number_style_ #1 _tl } { ##1 } }
##4 \crefrangeconjunction
@@ -519,18 +531,18 @@
, name .value_required:n = true
, name~style .code:n = { \exp_args:Ne \NameTheorem { \l__crthm_current_env_tl } { #1 } }
, name~style .value_required:n = true
- , name-style .meta:n = { name~style = #1 }
+ , name-style .meta:n = { name~style = { #1 } }
, name-style .value_required:n = true
- , name style .meta:n = { name~style = #1 }
+ , name style .meta:n = { name~style = { #1 } }
, name style .value_required:n = true
, style .code:n = { \bool_set_true:N \l__crthm_creating_apply_style_bool
\tl_set:Nn \l__crthm_creating_apply_style_tl { #1 } }
, style .value_required:n = true
- , apply~style .meta:n = { style = #1 }
+ , apply~style .meta:n = { style = { #1 } }
, apply~style .value_required:n = true
- , apply-style .meta:n = { style = #1 }
+ , apply-style .meta:n = { style = { #1 } }
, apply-style .value_required:n = true
- , apply style .meta:n = { style = #1 }
+ , apply style .meta:n = { style = { #1 } }
, apply style .value_required:n = true
, numberless .bool_set:N = \l__crthm_creating_numberless_bool
, create~starred~version .bool_set:N = \l__crthm_creating_create_starred_bool
@@ -542,9 +554,9 @@
, copy~existed .code:n = { \bool_set_true:N \l__crthm_creating_copy_existed_bool
\tl_set:Nn \l__crthm_creating_copy_existed_tl { #1 } }
, copy~existed .value_required:n = true
- , copy-existed .meta:n = { copy~existed = #1 }
+ , copy-existed .meta:n = { copy~existed = { #1 } }
, copy-existed .value_required:n = true
- , copy existed .meta:n = { copy~existed = #1 }
+ , copy existed .meta:n = { copy~existed = { #1 } }
, copy existed .value_required:n = true
, quiet .bool_set:N = \l__crthm_creating_quiet_bool
, quiet .initial:n = { false }
@@ -555,27 +567,27 @@
{
, parent~counter .code:n = { \crthm_counter_within:en { \l__crthm_current_env_tl } { #1 } }
, parent~counter .value_required:n = true
- , parent-counter .meta:n = { parent~counter = #1 }
+ , parent-counter .meta:n = { parent~counter = { #1 } }
, parent-counter .value_required:n = true
- , parent counter .meta:n = { parent~counter = #1 }
+ , parent counter .meta:n = { parent~counter = { #1 } }
, parent counter .value_required:n = true
- , number~within .meta:n = { parent~counter = #1 }
+ , number~within .meta:n = { parent~counter = { #1 } }
, number~within .value_required:n = true
- , number-within .meta:n = { parent~counter = #1 }
+ , number-within .meta:n = { parent~counter = { #1 } }
, number-within .value_required:n = true
- , number within .meta:n = { parent~counter = #1 }
+ , number within .meta:n = { parent~counter = { #1 } }
, number within .value_required:n = true
, shared~counter .code:n = { \crthm_counter_alias:en { \l__crthm_current_env_tl } { #1 } }
, shared~counter .value_required:n = true
- , shared-counter .meta:n = { shared~counter = #1 }
+ , shared-counter .meta:n = { shared~counter = { #1 } }
, shared-counter .value_required:n = true
- , shared counter .meta:n = { shared~counter = #1 }
+ , shared counter .meta:n = { shared~counter = { #1 } }
, shared counter .value_required:n = true
- , number~like .meta:n = { shared~counter = #1 }
+ , number~like .meta:n = { shared~counter = { #1 } }
, number~like .value_required:n = true
- , number-like .meta:n = { shared~counter = #1 }
+ , number-like .meta:n = { shared~counter = { #1 } }
, number-like .value_required:n = true
- , number like .meta:n = { shared~counter = #1 }
+ , number like .meta:n = { shared~counter = { #1 } }
, number like .value_required:n = true
, unknown .code:n = {}
}
@@ -692,33 +704,33 @@
, name .value_required:n = true
, name~style .code:n = { \exp_args:Ne \NameTheorem { \l__crthm_current_env_tl } { #1 } }
, name~style .value_required:n = true
- , name-style .meta:n = { name~style = #1 }
+ , name-style .meta:n = { name~style = { #1 } }
, name-style .value_required:n = true
- , name style .meta:n = { name~style = #1 }
+ , name style .meta:n = { name~style = { #1 } }
, name style .value_required:n = true
, parent~counter .code:n = { \crthm_counter_within:en { \l__crthm_current_env_tl } { #1 } }
, parent~counter .value_required:n = true
- , parent-counter .meta:n = { parent~counter = #1 }
+ , parent-counter .meta:n = { parent~counter = { #1 } }
, parent-counter .value_required:n = true
- , parent counter .meta:n = { parent~counter = #1 }
+ , parent counter .meta:n = { parent~counter = { #1 } }
, parent counter .value_required:n = true
- , number~within .meta:n = { parent~counter = #1 }
+ , number~within .meta:n = { parent~counter = { #1 } }
, number~within .value_required:n = true
- , number-within .meta:n = { parent~counter = #1 }
+ , number-within .meta:n = { parent~counter = { #1 } }
, number-within .value_required:n = true
- , number within .meta:n = { parent~counter = #1 }
+ , number within .meta:n = { parent~counter = { #1 } }
, number within .value_required:n = true
, shared~counter .code:n = { \crthm_counter_alias:en { \l__crthm_current_env_tl } { #1 } }
, shared~counter .value_required:n = true
- , shared-counter .meta:n = { shared~counter = #1 }
+ , shared-counter .meta:n = { shared~counter = { #1 } }
, shared-counter .value_required:n = true
- , shared counter .meta:n = { shared~counter = #1 }
+ , shared counter .meta:n = { shared~counter = { #1 } }
, shared counter .value_required:n = true
- , number~like .meta:n = { shared~counter = #1 }
+ , number~like .meta:n = { shared~counter = { #1 } }
, number~like .value_required:n = true
- , number-like .meta:n = { shared~counter = #1 }
+ , number-like .meta:n = { shared~counter = { #1 } }
, number-like .value_required:n = true
- , number like .meta:n = { shared~counter = #1 }
+ , number like .meta:n = { shared~counter = { #1 } }
, number like .value_required:n = true
, unknown .code:n = {}
}
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 660f3e6375..cb9c5ee12e 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2022/03/08}{1.643}
+\ProvidesExplClass{easybook}{2022/03/10}{1.643}
{Easily typesetting Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -303,7 +303,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2022/03/08}{1.643}
+\ProvidesExplPackage{easybase}{2022/03/10}{1.643}
{Easily typesetting Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -433,9 +433,10 @@
}
\PassOptionsToPackage{list = off}{bicaption}
-\PassOptionsToPackage{many}{tcolorbox}
+\PassOptionsToPackage{nonewpage}{imakeidx}
\PassOptionsToPackage{upint}{newtxmath}
\PassOptionsToPackage{svgnames}{xcolor}
+\PassOptionsToPackage{many}{tcolorbox}
\ProcessKeysOptions{easybase}
\PassOptionsToPackage{\g__eb_ctex_options_clist}{ctex}
\@ifclassloaded{ctexbook}{}
@@ -548,10 +549,10 @@
{
\color{ctex@emph}
\eb@tag@brackets@left
- \bgroup
- \ignorespaces{#1}\unskip\@@italiccorr
- \eb@tag@brackets@right
- \egroup
+ {
+ \ignorespaces{#1}\unskip\@@italiccorr
+ \eb@tag@brackets@right
+ }
}
}
\ctex_define:nn { style }
@@ -837,14 +838,14 @@
{ \bool_set_true:N \l__eb_fnpara_bottom_bool }
{ flush }
{
- \tl_set:Nn \l__eb_footnote_value_tl { default }
+ \tl_set:Nn \l__eb_footnote_value_tl { plain }
\clist_push:Nn \l__eb_footnote_value_clist {#1}
}
}
{
\bool_lazy_or:nnT
{ \str_if_eq_p:nn {#1} { hang } }
- { \str_if_eq_p:nn {#1} { default } }
+ { \str_if_eq_p:nn {#1} { plain } }
{ \tl_set:Nn \l__eb_footnote_value_tl {#1} }
}
}
@@ -873,12 +874,12 @@
\clist_new:N \l__eb_footnote_value_clist
\ctex_define:nn { hdrset }
{
- fnindent .dim_set:N = \footindent,
- fnindent .initial:n = 0.8em,
- fnparskip .skip_set:N = \footparskip,
+ fnfirstindent .dim_set:N = \fnfirstindent,
+ fnfirstindent .initial:n = 0.8em,
+ fnparskip .skip_set:N = \fnparskip,
fnparskip .initial:n = 0ex plus .1ex,
- fnparindent .tl_set:N = \footparindent,
- fnparindent .initial:n = 2em,
+ fnafterindent .tl_set:N = \fnafterindent,
+ fnafterindent .initial:n = 2em,
fnpara-form .tl_set:N = \l__eb_fnpara_format_tl,
fntext-pos .tl_set:N = \l__eb_fntext_position_tl,
fntext-pos .initial:n = super,
@@ -888,7 +889,7 @@
fncust-form .code:n = \eb_fnboth_format_set:nn {#1} { cust },
fnboth-form .meta:n = { fnmate-form = #1,fncust-form = #1 },
footnotetype .multichoices:nn =
- { default,hang,bottom,para,flush }
+ { plain,hang,bottom,para,flush }
{ \eb_footnote_value_handle:n {#1} },
footnotetype .value_required:n = true,
footnotetype .initial:n = hang,
@@ -931,51 +932,61 @@
\eb_fnpara_if_pos_bottom:
}
\cs_new_protected:Npn \setspread #1 { \linespread{#1}\selectfont }
+\cs_new:Npn \eb@footmisc@ifvoid #1#2#3 { \ifvoid #1#2\else #3\fi }
\cs_new_protected:Npn \eb_fnpara_if_pos_bottom:
{
\bool_if:NT \l__eb_fnpara_bottom_bool
{
- \cs_set:Npn \@makecol
+ \@ifpackageloaded{footmisc}
+ {\msg_warning:nn { easybase } { bottom-not-compatible }}
{
- \setbox\@outputbox\box\@cclv
- \xdef\@freelist{\@freelist\@midlist}
- \global\let\@midlist\@empty
- \@combinefloats
- \eb@footmisc@ifvoid\footins{}
- {
- \setbox\@outputbox\vbox
- \bgroup
- \boxmaxdepth\@maxdepth
- \unvbox\@outputbox
- \vfill\relax
- \vskip\skip\footins
- \color@begingroup
- \normalcolor\footnoterule
- \unvbox\footins
- \color@endgroup
- \egroup
- }
- \eb@footmisc@ifvoid\@kludgeins
- {\@makespecialcolbox}
+ \cs_set:Npn \@makecol
{
- \setbox\@outputbox\vbox to\@colht
+ \setbox\@outputbox\box\@cclv
+ \xdef\@freelist{\@freelist\@midlist}
+ \global\let\@midlist\@empty
+ \@combinefloats
+ \eb@footmisc@ifvoid\footins{}
{
- \@texttop\dimen@\dp\@outputbox
+ \setbox\@outputbox\vbox
+ \bgroup
+ \boxmaxdepth\@maxdepth
\unvbox\@outputbox
- \vskip -\dimen@\@textbottom
+ \vfill\relax
+ \vskip\skip\footins
+ \color@begingroup
+ \normalcolor\footnoterule
+ \unvbox\footins
+ \color@endgroup
+ \egroup
}
+ \eb@footmisc@ifvoid\@kludgeins
+ {\@makespecialcolbox}
+ {
+ \setbox\@outputbox\vbox to\@colht
+ {
+ \@texttop\dimen@\dp\@outputbox
+ \unvbox\@outputbox
+ \vskip -\dimen@\@textbottom
+ }
+ }
+ \global\maxdepth\@maxdepth
}
- \global\maxdepth\@maxdepth
}
}
}
+\msg_new:nnn { easybase } { bottom-not-compatible }
+ {
+ Not~compatible~with~the~'footmisc'~package, \\
+ Please~use~the~'bottom'~option~of~'footmisc'~package.
+ }
\cs_new_protected:Npn \eb_footnote_direct_hang:
{
\hbox_set:Nn \l_tmpa_box
{
- \dim_compare:nNnTF { \footindent } > { 0pt }
- { \hbox_to_wd:nn { \footindent } { \eb@makefnmark\hss } }
+ \dim_compare:nNnTF { \fnfirstindent } > { 0pt }
+ { \hbox_to_wd:nn { \fnfirstindent } { \eb@makefnmark\hss } }
{ \eb@makefnmark }
}
\dim_set:Nn \leftmargin { \box_wd:N \l_tmpa_box }
@@ -987,23 +998,23 @@
\mode_leave_vertical:
\hbox_overlap_left:n { \box_use:N \l_tmpa_box }
}
-\cs_new_protected:Npn \eb_footnote_direct_default:
+\cs_new_protected:Npn \eb_footnote_direct_plain:
{
\noindent
\clist_if_in:NnT \l__eb_footnote_value_clist { flush }
- { \dim_zero:N \footindent }
- \int_case:nn { \dim_sign:V \footindent }
+ { \dim_zero:N \fnfirstindent }
+ \int_case:nn { \dim_sign:V \fnfirstindent }
{
{ 1 } { \use_i:nnn }
{ 0 } { \use_ii:nnn }
{ -1 } { \use_iii:nnn }
}
- { \hbox_to_wd:nn { \footindent } { \hss\eb@makefnmark } }
+ { \hbox_to_wd:nn { \fnfirstindent } { \hss\eb@makefnmark } }
{ \hbox_overlap_left:n { \eb@makefnmark } }
{
\hbox_overlap_left:n
{
- \hbox_to_wd:nn { -\footindent }
+ \hbox_to_wd:nn { -\fnfirstindent }
{ \eb@makefnmark\hss }
}
}
@@ -1014,21 +1025,32 @@
\str_case:Vn \l__eb_footnote_value_tl
{
{ hang } { \use_i:nn }
- { default } { \use_ii:nn }
+ { plain } { \use_ii:nn }
}
{ \eb_footnote_direct_hang: }
- { \eb_footnote_direct_default: }
- \skip_set:NV \parskip \footparskip
- \dim_set:NV \parindent \footparindent
+ { \eb_footnote_direct_plain: }
+ \skip_set:NV \parskip \fnparskip
+ \dim_set:NV \parindent \fnafterindent
\l__eb_fnpara_format_tl{#1}
\tl_if_eq:NnT \l__eb_footnote_value_tl { hang } { \par }
\group_end:
}
-\cs_set_eq:NN \eb@makefntext@save \@makefntext
+\eb_patch_cmd:wnn { \@footnotetext,\@mpfootnotetext }
+ { \reset@font }
+ {
+ \setspread{\fp_use:N \l__eb_spread_footnote_fp}
+ \tl_use:N \l__eb_subfont_footnote_tl
+ }
+\cs_set_eq:NN \eb@@makefntext \@makefntext
+\cs_set_eq:NN \eb@@footnotetext \@footnotetext
\ctex_at_end_package:nn { footmisc }
{
\eb_package_date_check:nn { footmisc } { 2022/02/10 }
- \notbool{FN@para}{\cs_set_eq:NN \@makefntext \eb@makefntext@save}{}
+ \ifbool{FN@para}{}
+ {
+ \cs_set_eq:NN \@makefntext \eb@@makefntext
+ \cs_set_eq:NN \@footnotetext \eb@@footnotetext
+ }
\ifboolexpr
{
bool {FN@hangfoot} or
@@ -1045,7 +1067,7 @@
\msg_new:nnn { easybase } { footmisc }
{
It~is~not~recommended~that~you~use~the \\
- hang,~symbol,~perpage,~marginal,~flushmargin~or~bottom \\
+ hang,~symbol,~perpage,~marginal~or~flushmargin \\
options~of~the~'footmisc'~package.
}
@@ -1079,12 +1101,6 @@
\@footnotemark
}
}
-\eb_patch_cmd:wnn { \@footnotetext,\@mpfootnotetext }
- { \reset@font }
- {
- \setspread{\fp_use:N \l__eb_spread_footnote_fp}
- \tl_use:N \l__eb_subfont_footnote_tl
- }
\ctex_at_end_package:nn { hyperref }
{
\cs_set:Npn \@xfootnotemark [#1]
@@ -1140,13 +1156,12 @@
\defdownfntmark
{
\eb_fnmate_format_initial:
- \tl_if_eq:NnT \l__eb_fntext_position_tl { super }
+ \tl_if_eq:NnTF \l__eb_fntext_position_tl { super }
{ \eb@fnmate@super* }
+ { \use:n }
{
\tl_use:N \l__eb_fntext_before_tl
- \bgroup
- \l__eb_fnmate_format_tl{\@thefnmark}
- \egroup
+ { \l__eb_fnmate_format_tl{\@thefnmark} }
}
\tl_use:N \l__eb_fntext_after_tl
}
@@ -1196,8 +1211,6 @@
\eb@@makefnmark{#1}{#1}\@footnotetext{#2}
\group_end:
}
-\cs_new:Npn \eb@footmisc@ifvoid #1#2#3 { \ifvoid #1#2\else #3\fi }
-\cs_set:Npn \thempfootnote { \int_to_alph:n { \c@mpfootnote } }
\newcounter{bichapter}
\newcounter{bisection}[bichapter]
@@ -1557,18 +1570,18 @@
{
\normalsize\normalfont
\titlerule*[#3]{\IfValueTF{#4}{\scalebox{#4}{#5}}{#5}}#6
- \bgroup
- \IfBooleanF{#2}
{
- \IfBooleanTF{#1}
- {\thecontentspage}
+ \IfBooleanF{#2}
{
- \bool_if:NTF \l__eb_toc_dot_align_bool
- { \contentspage }
- { \thecontentspage }
+ \IfBooleanTF{#1}
+ {\thecontentspage}
+ {
+ \bool_if:NTF \l__eb_toc_dot_align_bool
+ { \contentspage }
+ { \thecontentspage }
+ }
}
}
- \egroup
}
\ctex_set:n
{
@@ -1619,7 +1632,6 @@
\group_begin:
\tl_set_eq:NN \eb@toc@title \indexname
\cs_set_eq:NN \imki@indexlevel \use_none:n
- \setkeys{imkiindex}{noclearpage}
\IfValueT{#3}{\keys_set:nn { eb/floattoc } {#3}}
\cs_set_protected:Npn \imki@indexheaders
{
@@ -1797,8 +1809,9 @@
\cs_set_protected:Npn \hangpara #1#2
{
- \setlength{\hangindent}{#1}
- \hangafter #2\noindent\ignorespaces
+ \dim_set:Nn \hangindent {#1}
+ \int_set:Nn \hangafter {#2}
+ \noindent\ignorespaces
}
\DeclareDocumentEnvironment{hangparas}{mm+b}
{
@@ -2312,7 +2325,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2022/03/08}{1.643}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2022/03/10}{1.643}
{Customization of tcolorbox for easybook}
\cs_set_protected:Npn \addtotcbstyle #1#2
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index fe31a2f561..38e91e5c54 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex
index ae9ecb96b5..495bca8f59 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -21,8 +21,8 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK使用手册,
- version = v1.643,
- date = 2022/03/08,
+ version = v1.644,
+ date = 2022/03/10,
authors = 瞿毅,
info = 简便地排版中文学位论文或书籍,
email = q1jx@foxmail.com,
@@ -790,20 +790,20 @@
\end{commands}
\subsection{脚注格式}
-模块 \module*{hdrset} 还可以灵活调整脚注编号和内容的格式。格式主要包括脚注标记的编号类型、字体、附加符号、对齐方式和缩进距离等,以及脚注内容的首行缩进、行距和字体等。基本思想是默认脚注和自定义编号脚注标记的格式分离,两种类型脚注各自正文和内容的标记又共享格式,默认脚注中正文和内容标记的编号类型分离。
+模块 \module*{hdrset} 还可以灵活调整脚注编号和内容的格式。格式主要包括脚注标记的编号类型、字体、附加符号和对齐方式等,以及脚注内容的首行缩进、行距和字体等。基本思想是默认脚注和自定义编号脚注标记的格式分离,两种类型脚注各自正文和内容的标记又共享格式,默认脚注中正文和内容标记的编号类型分离。目前脚注模块基本兼容 \pkg*{footmisc} 宏包。
\begin{options}
- \keychoice{footnotetype}{hang,default,flush,bottom}\Module{hdrset}\Default{hang}
- 脚注的类型。悬挂缩进 \code{hang} 是默认值,\code{default} 是原始的类型,\code{flush} 使脚注内容标记位于脚注首行边缘外侧并右对齐。当存在浮动环境排版时,脚注可能位于页面中间,\code{bottom} 使脚注始终位于页面底端。其中 \code{bottom} 是复合选项,可以与前三种类型重复或复合使用:
+ \keychoice{footnotetype}{plain,hang,flush,bottom}\Module{hdrset}\Default{hang}
+ 脚注的类型。悬挂缩进 \code{hang} 是默认值,\code{plain} 是原始的类型,\code{flush} 使脚注内容标记位于脚注首行边缘外侧并右对齐。当存在浮动环境排版时,脚注可能位于页面中间,\code{bottom} 使脚注始终位于页面底端。其中 \code{bottom} 是复合选项,可以与前三种类型重复或复合使用:
\begin{ctexexam}
- \ebhdrset{footnotetype = default,footnotetype = bottom}
+ \ebhdrset{footnotetype = plain,footnotetype = bottom}
\ebhdrset{footnotetype = {hang,bottom}}
\end{ctexexam}
- \keyval{fnindent}{刚性长度}\Default{0.8em}
- 每个脚注首段的首行缩进(选项 \option*{hang} 为整体缩进),等于长度 \cs{footindent} 的值。
+ \keyval{fnfirstindent}{刚性长度}\Default{0.8em}
+ 每个脚注首段的首行缩进(选项 \option*{hang} 为整体缩进),等于长度 \cs{fnfirstindent} 的值。
+ \keyval{fnafterindent}{刚性长度}\Default{2em}
+ 每个脚注第二段及之后段落的首行缩进,等于长度 \cs{fnafterindent} 的值。
\keyval{fnparskip}{弹性长度}\Default{0ex}
- 不同脚注的段落间距,等于长度 \cs{footparskip} 的值。
- \keyval{fnparindent}{刚性长度}\Default{2em}
- 每个脚注第二段及之后段落的首行缩进,等于长度 \cs{footparindent} 的值。
+ 不同脚注的段落间距,等于长度 \cs{fnparskip} 的值。
\keychoice{fntext-pos}{normal,super}\Default{super}
设置脚注内容标记的位置,正常文本或是上标形式。
\keychoice{fnmark-num}{plain,pifont,pifont*,pisans,pisans*,short num}\Default{plain}
@@ -904,7 +904,7 @@
引导线选项 \option{tocrule} 中一般可以使用基于 \cs*{xleaders} 命令的 \cs{tocrule} 绘制引导线。
\begin{commands}
\command{tocrule}[\sarg\harg\oarg{引导点间距}\darg{放大因子}\marg{引导点}\oarg{页码格式}]
- 生成目录引导线的命令,需要在引导线选项 \option{tocrule} 中使用。带有星号的命令与 \keyis{dotalign}{false} 效果相同。带有 \harg{} 号的命令不添加引导线后的目录页码。\meta{引导点间距} 需带有长度单位,\meta{放大因子} 为 \meta{引导点} 的放大倍数。\meta{页码格式} 的代码位于页码前面,可以设置页码字体和距离等,最后一个命令可以带有一个参数为页码编号。
+ 生成目录引导线的命令,需要在引导线选项 \option{tocrule} 中使用。带有星号的命令与 \keyis{dotalign}{false} 效果相同。带有 \harg{} 号的命令不添加引导线后的目录页码。\meta{引导点间距} 需带有长度单位,\meta{放大因子} 为 \meta{引导点} 的放大倍数。\meta{页码格式} 中最后一个命令可以带有一个参数为页码编号。
\end{commands}
\keyval{tocafter}{距离命令}\dtag\Default{\cs*{hspace}\Marg{1em}}
目录条目编号与标题间的代码,默认为插入 \code{1em} 横向距离。
@@ -1318,7 +1318,7 @@
\item 增加英文主文档目录钩子选项 \option{bibetween}。
\end{version}
\shortversion{v = 1.638,date = 2022/03/04,changes = 增加目录条目样式选项注册命令 \cs{RegisterTocName}。}
- \shortversion{v = 1.643,date = 2022/03/08,changes = 增加浮动环境目录声明命令 \cs{DeclareFloatList} 配合 \pkg*{caption} 宏包。}
+ \shortversion{v = 1.644,date = 2022/03/10,changes = 增加浮动环境目录声明命令 \cs{DeclareFloatList} 配合 \pkg*{caption} 宏包。}
\end{changelog}
\nocite{*}
diff --git a/macros/latex/contrib/functional/README.txt b/macros/latex/contrib/functional/README.txt
new file mode 100644
index 0000000000..fcb1672c0c
--- /dev/null
+++ b/macros/latex/contrib/functional/README.txt
@@ -0,0 +1,5 @@
+Functional: LaTeX2 functional interfaces to LaTeX3 programming layer
+Copyright : 2022 (c) Jianrui Lyu <tolvjr@163.com>
+Repository: https://github.com/lvjr/functional
+Repository: https://bitbucket.org/lvjr/functional
+License : The LaTeX Project Public License 1.3c
diff --git a/macros/latex/contrib/functional/functional.pdf b/macros/latex/contrib/functional/functional.pdf
new file mode 100644
index 0000000000..f9f553a0da
--- /dev/null
+++ b/macros/latex/contrib/functional/functional.pdf
Binary files differ
diff --git a/macros/latex/contrib/functional/functional.sty b/macros/latex/contrib/functional/functional.sty
new file mode 100644
index 0000000000..95e5ada3dc
--- /dev/null
+++ b/macros/latex/contrib/functional/functional.sty
@@ -0,0 +1,686 @@
+%%% -*- coding: utf-8 -*-
+%% ----------------------------------------------------------------------------
+%% Functional: LaTeX2 functional interfaces to LaTeX3 programming layer
+%% Copyright : 2022 (c) Jianrui Lyu <tolvjr@163.com>
+%% Repository: https://github.com/lvjr/functional
+%% License : The LaTeX Project Public License 1.3c
+%% ----------------------------------------------------------------------------
+
+%%% --------------------------------------------------------
+%%> \section{Interfaces for Function Definitions (l3basics)}
+%%% --------------------------------------------------------
+
+\NeedsTeXFormat{LaTeX2e}[2018-04-01]
+
+\RequirePackage{expl3}
+\ProvidesExplPackage{functional}{2022-03-10}{2022A}
+ {^^JLaTeX2 functional interfaces to LaTeX3 programming layer}
+
+\cs_generate_variant:Nn \iow_log:n { V }
+\cs_generate_variant:Nn \tl_set:Nn { Ne }
+
+\tl_new:N \gResultTl
+\int_new:N \l__fun_arg_count_int
+\tl_new:N \l__fun_parameters_defined_tl
+\tl_const:Nn \c__fun_parameter_defined_i__tl { } % no argument
+\tl_const:Nn \c__fun_parameter_defined_i_i_tl { #1 }
+\tl_const:Nn \c__fun_parameter_defined_i_ii_tl { #1 #2 }
+\tl_const:Nn \c__fun_parameter_defined_i_iii_tl { #1 #2 #3 }
+\tl_const:Nn \c__fun_parameter_defined_i_iv_tl { #1 #2 #3 #4 }
+\tl_const:Nn \c__fun_parameter_defined_i_v_tl { #1 #2 #3 #4 #5 }
+\tl_const:Nn \c__fun_parameter_defined_i_vi_tl { #1 #2 #3 #4 #5 #6 }
+\tl_const:Nn \c__fun_parameter_defined_i_vii_tl { #1 #2 #3 #4 #5 #6 #7 }
+\tl_const:Nn \c__fun_parameter_defined_i_viii_tl { #1 #2 #3 #4 #5 #6 #7 #8 }
+\tl_const:Nn \c__fun_parameter_defined_i_ix_tl { #1 #2 #3 #4 #5 #6 #7 #8 #9 }
+\tl_new:N \l__fun_parameters_called_tl
+\tl_const:Nn \c__fun_parameter_called_i_i_tl { {#1} }
+\tl_const:Nn \c__fun_parameter_called_i_ii_tl { {#1}{#2} }
+\tl_const:Nn \c__fun_parameter_called_i_iii_tl { {#1}{#2}{#3} }
+\tl_const:Nn \c__fun_parameter_called_i_iv_tl { {#1}{#2}{#3}{#4} }
+\tl_const:Nn \c__fun_parameter_called_i_v_tl { {#1}{#2}{#3}{#4}{#5} }
+\tl_const:Nn \c__fun_parameter_called_i_vi_tl { {#1}{#2}{#3}{#4}{#5}{#6} }
+\tl_const:Nn \c__fun_parameter_called_i_vii_tl { {#1}{#2}{#3}{#4}{#5}{#6}{#7} }
+\tl_new:N \l__fun_parameters_true_tl
+\tl_new:N \l__fun_parameters_false_tl
+\tl_const:Nn \c__fun_parameter_called_i_tl { {#1} }
+\tl_const:Nn \c__fun_parameter_called_ii_tl { {#2} }
+\tl_const:Nn \c__fun_parameter_called_iii_tl { {#3} }
+\tl_const:Nn \c__fun_parameter_called_iv_tl { {#4} }
+\tl_const:Nn \c__fun_parameter_called_v_tl { {#5} }
+\tl_const:Nn \c__fun_parameter_called_vi_tl { {#6} }
+\tl_const:Nn \c__fun_parameter_called_vii_tl { {#7} }
+\tl_const:Nn \c__fun_parameter_called_viii_tl { {#8} }
+\tl_const:Nn \c__fun_parameter_called_ix_tl { {#9} }
+\tl_new:N \l__fun_argument_tl
+\tl_new:N \l__fun_argument_i_tl
+\tl_new:N \l__fun_argument_ii_tl
+\tl_new:N \l__fun_argument_iii_tl
+\tl_new:N \l__fun_argument_iv_tl
+\tl_new:N \l__fun_argument_v_tl
+\tl_new:N \l__fun_argument_vi_tl
+\tl_new:N \l__fun_argument_vii_tl
+\tl_new:N \l__fun_argument_viii_tl
+\tl_new:N \l__fun_argument_ix_tl
+
+%% #1: function name; #2: argument specification; #3 function body
+\cs_new_protected:Npn \__fun_new_function:Nnn #1 #2 #3
+ {
+ \int_set:Nn \l__fun_arg_count_int { \tl_count:n {#2} } % spaces are ignored
+ \tl_set_eq:Nc \l__fun_parameters_defined_tl
+ { c__fun_parameter_defined_i_ \int_to_roman:n { \l__fun_arg_count_int } _tl }
+ \exp_last_unbraced:NcV \cs_new_protected:Npn
+ { __fun_defined_ \cs_to_str:N #1 : w }
+ \l__fun_parameters_defined_tl
+ {
+ \__fun_group_begin:
+ \tl_gclear:N \gResultTl
+ #3
+ \__fun_tracing_log:e { [O] ~ \gResultTl }
+ \__fun_group_end:
+ }
+ \use:c { __fun_new_with_arg_ \int_to_roman:n { \l__fun_arg_count_int } :NnV }
+ #1 {#2} \l__fun_parameters_defined_tl
+ }
+\cs_generate_variant:Nn \__fun_new_function:Nnn { cne }
+
+\cs_set_eq:NN \PrgNewFunction \__fun_new_function:Nnn
+
+\tl_new:N \g__fun_last_result_tl
+
+%% #1: function name; #2: argument specification; #3 function body
+\cs_new_protected:Npn \__fun_new_conditional:Nnn #1 #2 #3
+ {
+ \__fun_new_function:Nnn #1 { #2 } { #3 }
+ \tl_set_eq:Nc \l__fun_parameters_called_tl
+ { c__fun_parameter_called_i_ \int_to_roman:n { \l__fun_arg_count_int } _tl }
+ \tl_set_eq:Nc \l__fun_parameters_true_tl
+ { c__fun_parameter_called_ \int_to_roman:n { \l__fun_arg_count_int + 1 } _tl }
+ \tl_set_eq:Nc \l__fun_parameters_false_tl
+ { c__fun_parameter_called_ \int_to_roman:n { \l__fun_arg_count_int + 2 } _tl }
+ \__fun_new_function:cne { \cs_to_str:N #1 TF } { #2 n n }
+ {
+ #1 \exp_not:V \l__fun_parameters_called_tl
+ \exp_not:n
+ {
+ \tl_set_eq:NN \g__fun_last_result_tl \gResultTl
+ \tl_gclear:N \gResultTl
+ \exp_last_unbraced:NV \bool_if:NTF \g__fun_last_result_tl
+ }
+ \exp_not:V \l__fun_parameters_true_tl
+ \exp_not:V \l__fun_parameters_false_tl
+ }
+ }
+
+\cs_set_eq:NN \PrgNewConditional \__fun_new_conditional:Nnn
+
+%% #1: function name; #2: argument specifications; #3 parameters tl defined
+%% Some times we need to create a function without arguments
+\cs_new_protected:Npn \__fun_new_with_arg_:Nnn #1 #2 #3
+ {
+ \cs_new_protected:Npn #1 #3
+ {
+ \__fun_evaluate:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__fun_new_with_arg_:Nnn { NnV }
+
+%% #1: function name; #2: argument specifications; #3 parameters tl defined
+\cs_new_protected:Npn \__fun_new_with_arg_i:Nnn #1 #2 #3
+ {
+ \cs_new_protected:Npn #1 #3
+ {
+ \tl_set:Nn \l__fun_argument_i_tl { ##1 }
+ \__fun_evaluate:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__fun_new_with_arg_i:Nnn { NnV }
+
+%% #1: function name; #2: argument specifications; #3 parameters tl defined
+\cs_new_protected:Npn \__fun_new_with_arg_ii:Nnn #1 #2 #3
+ {
+ \cs_new_protected:Npn #1 #3
+ {
+ \tl_set:Nn \l__fun_argument_i_tl { ##1 }
+ \tl_set:Nn \l__fun_argument_ii_tl { ##2 }
+ \__fun_evaluate:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__fun_new_with_arg_ii:Nnn { NnV }
+
+%% #1: function name; #2: argument specifications; #3 parameters tl defined
+\cs_new_protected:Npn \__fun_new_with_arg_iii:Nnn #1 #2 #3
+ {
+ \cs_new_protected:Npn #1 #3
+ {
+ \tl_set:Nn \l__fun_argument_i_tl { ##1 }
+ \tl_set:Nn \l__fun_argument_ii_tl { ##2 }
+ \tl_set:Nn \l__fun_argument_iii_tl { ##3 }
+ \__fun_evaluate:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__fun_new_with_arg_iii:Nnn { NnV }
+
+%% #1: function name; #2: argument specifications; #3 parameters tl defined
+\cs_new_protected:Npn \__fun_new_with_arg_iv:Nnn #1 #2 #3
+ {
+ \cs_new_protected:Npn #1 #3
+ {
+ \tl_set:Nn \l__fun_argument_i_tl { ##1 }
+ \tl_set:Nn \l__fun_argument_ii_tl { ##2 }
+ \tl_set:Nn \l__fun_argument_iii_tl { ##3 }
+ \tl_set:Nn \l__fun_argument_iv_tl { ##4 }
+ \__fun_evaluate:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__fun_new_with_arg_iv:Nnn { NnV }
+
+%% #1: function name; #2: argument specifications; #3 parameters tl defined
+\cs_new_protected:Npn \__fun_new_with_arg_v:Nnn #1 #2 #3
+ {
+ \cs_new_protected:Npn #1 #3
+ {
+ \tl_set:Nn \l__fun_argument_i_tl { ##1 }
+ \tl_set:Nn \l__fun_argument_ii_tl { ##2 }
+ \tl_set:Nn \l__fun_argument_iii_tl { ##3 }
+ \tl_set:Nn \l__fun_argument_iv_tl { ##4 }
+ \tl_set:Nn \l__fun_argument_v_tl { ##5 }
+ \__fun_evaluate:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__fun_new_with_arg_v:Nnn { NnV }
+
+%% #1: function name; #2: argument specifications; #3 parameters tl defined
+\cs_new_protected:Npn \__fun_new_with_arg_vi:Nnn #1 #2 #3
+ {
+ \cs_new_protected:Npn #1 #3
+ {
+ \tl_set:Nn \l__fun_argument_i_tl { ##1 }
+ \tl_set:Nn \l__fun_argument_ii_tl { ##2 }
+ \tl_set:Nn \l__fun_argument_iii_tl { ##3 }
+ \tl_set:Nn \l__fun_argument_iv_tl { ##4 }
+ \tl_set:Nn \l__fun_argument_v_tl { ##5 }
+ \tl_set:Nn \l__fun_argument_vi_tl { ##6 }
+ \__fun_evaluate:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__fun_new_with_arg_vi:Nnn { NnV }
+
+%% #1: function name; #2: argument specifications; #3 parameters tl defined
+\cs_new_protected:Npn \__fun_new_with_arg_vii:Nnn #1 #2 #3
+ {
+ \cs_new_protected:Npn #1 #3
+ {
+ \tl_set:Nn \l__fun_argument_i_tl { ##1 }
+ \tl_set:Nn \l__fun_argument_ii_tl { ##2 }
+ \tl_set:Nn \l__fun_argument_iii_tl { ##3 }
+ \tl_set:Nn \l__fun_argument_iv_tl { ##4 }
+ \tl_set:Nn \l__fun_argument_v_tl { ##5 }
+ \tl_set:Nn \l__fun_argument_vi_tl { ##6 }
+ \tl_set:Nn \l__fun_argument_vii_tl { ##7 }
+ \__fun_evaluate:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__fun_new_with_arg_vii:Nnn { NnV }
+
+%% #1: function name; #2: argument specifications; #3 parameters tl defined
+\cs_new_protected:Npn \__fun_new_with_arg_viii:Nnn #1 #2 #3
+ {
+ \cs_new_protected:Npn #1 #3
+ {
+ \tl_set:Nn \l__fun_argument_i_tl { ##1 }
+ \tl_set:Nn \l__fun_argument_ii_tl { ##2 }
+ \tl_set:Nn \l__fun_argument_iii_tl { ##3 }
+ \tl_set:Nn \l__fun_argument_iv_tl { ##4 }
+ \tl_set:Nn \l__fun_argument_v_tl { ##5 }
+ \tl_set:Nn \l__fun_argument_vi_tl { ##6 }
+ \tl_set:Nn \l__fun_argument_vii_tl { ##7 }
+ \tl_set:Nn \l__fun_argument_viii_tl { ##8 }
+ \__fun_evaluate:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__fun_new_with_arg_viii:Nnn { NnV }
+
+%% #1: function name; #2: argument specifications; #3 parameters tl defined
+\cs_new_protected:Npn \__fun_new_with_arg_ix:Nnn #1 #2 #3
+ {
+ \cs_new_protected:Npn #1 #3
+ {
+ \tl_set:Nn \l__fun_argument_i_tl { ##1 }
+ \tl_set:Nn \l__fun_argument_ii_tl { ##2 }
+ \tl_set:Nn \l__fun_argument_iii_tl { ##3 }
+ \tl_set:Nn \l__fun_argument_iv_tl { ##4 }
+ \tl_set:Nn \l__fun_argument_v_tl { ##5 }
+ \tl_set:Nn \l__fun_argument_vi_tl { ##6 }
+ \tl_set:Nn \l__fun_argument_vii_tl { ##7 }
+ \tl_set:Nn \l__fun_argument_viii_tl { ##8 }
+ \tl_set:Nn \l__fun_argument_ix_tl { ##9 }
+ \__fun_evaluate:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__fun_new_with_arg_ix:Nnn { NnV }
+
+\int_new:N \g__fun_nesting_level_int
+\int_new:N \l__fun_argtype_number_int
+\tl_new:N \l__fun_argtype_tl
+\tl_const:Nn \c__fun_argtype_m_tl { m }
+\tl_const:Nn \c__fun_argtype_M_tl { M }
+\tl_const:Nn \c__fun_argtype_n_tl { n }
+\tl_const:Nn \c__fun_argtype_N_tl { N }
+
+%% #1: function name; #2: argument specifications
+\cs_new_protected:Npn \__fun_evaluate:Nn #1 #2
+ {
+ \int_zero:N \l__fun_argtype_number_int
+ \int_gincr:N \g__fun_nesting_level_int
+ \__fun_arguments_gclear:
+ \tl_map_variable:nNn { #2 } \l__fun_argtype_tl % spaces are ignored
+ {
+ \int_incr:N \l__fun_argtype_number_int
+ \tl_set_eq:Nc \l__fun_argument_tl
+ { l__fun_argument_ \int_to_roman:n { \l__fun_argtype_number_int } _tl }
+ \tl_case:Nn \l__fun_argtype_tl
+ {
+ \c__fun_argtype_m_tl
+ {
+ \__fun_evaluate_and_put_argument:N \l__fun_argument_tl
+ }
+ \c__fun_argtype_M_tl
+ {
+ \__fun_evaluate_and_put_argument:N \l__fun_argument_tl
+ }
+ \c__fun_argtype_n_tl
+ {
+ \__fun_arguments_gput:e { { \exp_not:V \l__fun_argument_tl } }
+ }
+ \c__fun_argtype_N_tl
+ {
+ \__fun_arguments_gput:e { \exp_not:V \l__fun_argument_tl }
+ }
+ }
+ }
+ \__fun_arguments_log:N #1
+ \__fun_arguments_called:c { __fun_defined_ \cs_to_str:N #1 : w }
+ \int_gdecr:N \g__fun_nesting_level_int
+ \__fun_return_result:
+ }
+
+\cs_set_eq:NN \__fun_cs_temp:w \scan_stop:
+
+\cs_new_protected:Npn \__fun_evaluate_and_put_argument:N #1
+ {
+ \cs_set_eq:Nc \__fun_cs_temp:w
+ {
+ __fun_defined_ \exp_last_unbraced:Ne \cs_to_str:N { \tl_head:N #1 } : w
+ }
+ \cs_if_exist:NTF \__fun_cs_temp:w
+ {
+ #1
+ \__fun_arguments_gput:e { { \exp_not:V \gResultTl } }
+ }
+ {
+ \__fun_arguments_gput:e { { \exp_not:V #1 } }
+ }
+ }
+
+\cs_new_protected:Npn \__fun_arguments_called:N #1
+ {
+ \exp_last_unbraced:Nv
+ #1 { g__fun_arguments_ \int_use:N \g__fun_nesting_level_int _tl }
+ }
+\cs_generate_variant:Nn \__fun_arguments_called:N { c }
+
+\cs_new_protected:Npn \__fun_arguments_gclear:
+ {
+ \tl_gclear:c { g__fun_arguments_ \int_use:N \g__fun_nesting_level_int _tl }
+ }
+
+\cs_new_protected:Npn \__fun_arguments_log:N #1
+ {
+ \__fun_tracing_log:e
+ {
+ [I] ~ \token_to_str:N #1
+ \exp_not:v { g__fun_arguments_ \int_use:N \g__fun_nesting_level_int _tl }
+ }
+ }
+
+\cs_new_protected:Npn \__fun_arguments_gput:n #1
+ {
+ \tl_gput_right:cn
+ { g__fun_arguments_ \int_use:N \g__fun_nesting_level_int _tl } { #1 }
+ }
+\cs_generate_variant:Nn \__fun_arguments_gput:n { e }
+
+\cs_new_protected:Npn \__fun_put_result:n #1
+ {
+ \tl_gput_right:Nn \gResultTl { #1 }
+ }
+\cs_generate_variant:Nn \__fun_put_result:n { e, V }
+
+\PrgNewFunction \Result { m }
+ {
+ \__fun_put_result:n { #1 }
+ }
+
+\PrgNewFunction \Name { m }
+ {
+ \exp_args:Nc \__fun_put_result:n { #1 }
+ }
+\cs_set_eq:NN \UseName \Name
+
+\PrgNewFunction \Expand { m }
+ {
+ \__fun_put_result:e { #1 }
+ }
+\cs_set_eq:NN \UseExpand \Expand
+
+\PrgNewFunction \Value { M }
+ {
+ \__fun_put_result:V #1
+ }
+\cs_set_eq:NN \UseValue \Value
+
+\cs_set_eq:NN \ExpNot \exp_not:n
+\cs_set_eq:NN \ExpValue \exp_not:V
+
+\cs_new_protected:Npn \__fun_return_result:
+ {
+ \int_compare:nNnT { \g__fun_nesting_level_int } = { 0 }
+ { \tl_use:N \gResultTl }
+ }
+
+\tl_new:N \l__fun_variable_type_tl
+
+\prg_new_protected_conditional:Npnn \__fun_if_global_variable:N #1 { TF }
+ {
+ \tl_set:Ne \l__fun_variable_type_tl
+ { \exp_args:Ne \tl_head:n { \cs_to_str:N #1 } }
+ \str_if_eq:VnTF \l__fun_variable_type_tl { g }
+ { \prg_return_true: }
+ {
+ \str_if_eq:VnTF \l__fun_variable_type_tl { c }
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+ }
+
+%% We must not put an assignment inside a group
+\cs_new_protected:Npn \__fun_do_assignment:Nnn #1 #2 #3
+ {
+ \__fun_group_end:
+ \__fun_if_global_variable:NTF #1 { #2 } { #3 }
+ \__fun_group_begin:
+ }
+
+\bool_new:N \l__fun_scoping_bool
+
+\cs_new_protected:Npn \__fun_scoping_true:
+ {
+ \cs_set_eq:NN \__fun_group_begin: \group_begin:
+ \cs_set_eq:NN \__fun_group_end: \group_end:
+ }
+
+\cs_new_protected:Npn \__fun_scoping_false:
+ {
+ \cs_set_eq:NN \__fun_group_begin: \scan_stop:
+ \cs_set_eq:NN \__fun_group_end: \scan_stop:
+ }
+
+\cs_new_protected:Npn \__fun_scoping_set:
+ {
+ \bool_if:NTF \l__fun_scoping_bool
+ { \__fun_scoping_true: } { \__fun_scoping_false: }
+ }
+
+\bool_new:N \l__fun_tracing_bool
+\tl_new:N \l__tracing_text_tl
+
+\cs_new_protected:Npn \__fun_tracing_log_on:n #1
+ {
+ \tl_set:Ne \l__tracing_text_tl
+ {
+ \prg_replicate:nn
+ { \int_eval:n { (\g__fun_nesting_level_int - 1) * 4 } } { ~ }
+ }
+ \tl_put_right:Nn \l__tracing_text_tl { #1 }
+ \iow_log:V \l__tracing_text_tl
+ }
+\cs_generate_variant:Nn \__fun_tracing_log_on:n { e, V }
+
+\cs_new_protected:Npn \__fun_tracing_log_off:n #1 { }
+\cs_generate_variant:Nn \__fun_tracing_log_off:n { e, V }
+
+\cs_new_protected:Npn \__fun_tracing_true:
+ {
+ \cs_set_eq:NN \__fun_tracing_log:n \__fun_tracing_log_on:n
+ \cs_set_eq:NN \__fun_tracing_log:e \__fun_tracing_log_on:e
+ \cs_set_eq:NN \__fun_tracing_log:V \__fun_tracing_log_on:V
+ }
+
+\cs_new_protected:Npn \__fun_tracing_false:
+ {
+ \cs_set_eq:NN \__fun_tracing_log:n \__fun_tracing_log_off:n
+ \cs_set_eq:NN \__fun_tracing_log:e \__fun_tracing_log_off:e
+ \cs_set_eq:NN \__fun_tracing_log:V \__fun_tracing_log_off:V
+ }
+
+\cs_new_protected:Npn \__fun_tracing_set:
+ {
+ \bool_if:NTF \l__fun_tracing_bool
+ { \__fun_tracing_true: } { \__fun_tracing_false: }
+ }
+
+\keys_define:nn { functional }
+ {
+ scoping .bool_set:N = \l__fun_scoping_bool,
+ tracing .bool_set:N = \l__fun_tracing_bool,
+ }
+
+\NewDocumentCommand \Functional { m }
+ {
+ \keys_set:nn { functional } { #1 }
+ \__fun_scoping_set:
+ \__fun_tracing_set:
+ }
+
+\Functional { scoping = false, tracing = false }
+
+\PrgNewFunction \UseOne { n }
+ {
+ \Result { #1 }
+ }
+
+\PrgNewFunction \GobbleOne { n }
+ {
+ \Result { }
+ }
+
+\PrgNewFunction \UseGobble { n n }
+ {
+ \UseOne { #1 }
+ }
+
+\PrgNewFunction \GobbleUse { n n }
+ {
+ \UseOne { #2 }
+ }
+
+%%% --------------------------------------------------------
+%%> \section{Interfaces for Control Structures (l3prg)}
+%%% --------------------------------------------------------
+
+\bool_const:Nn \cTrueBool { \c_true_bool }
+\bool_const:Nn \cFalseBool { \c_false_bool }
+
+\bool_new:N \lTmpaBool \bool_new:N \lTmpbBool \bool_new:N \lTmpcBool
+\bool_new:N \lTmpiBool \bool_new:N \lTmpjBool \bool_new:N \lTmpkBool
+\bool_new:N \l@Funx@Bool \bool_new:N \l@Funy@Bool \bool_new:N \l@Funz@Bool
+
+\bool_new:N \gTmpaBool \bool_new:N \gTmpbBool \bool_new:N \gTmpcBool
+\bool_new:N \gTmpiBool \bool_new:N \gTmpjBool \bool_new:N \gTmpkBool
+\bool_new:N \g@Funx@Bool \bool_new:N \g@Funy@Bool \bool_new:N \g@Funz@Bool
+
+\cs_set_eq:NN \BoolNew \bool_new:N
+\cs_set_eq:NN \BoolLog \bool_log:N
+
+\PrgNewFunction \BoolSetTrue { M }
+ {
+ \__fun_do_assignment:Nnn #1 { \bool_gset_true:N #1 } { \bool_set_true:N #1 }
+ }
+
+\PrgNewFunction \BoolSetFalse { M }
+ {
+ \__fun_do_assignment:Nnn #1 { \bool_gset_false:N #1 } { \bool_set_false:N #1 }
+ }
+
+\PrgNewConditional \BoolIf { N }
+ {
+ \Result { #1 }
+ }
+
+%%% --------------------------------------------------------
+%%> \section{Interfaces for Token Lists (l3tl)}
+%%% --------------------------------------------------------
+
+\tl_new:N \lTmpaTl \tl_new:N \lTmpbTl \tl_new:N \lTmpcTl
+\tl_new:N \lTmpiTl \tl_new:N \lTmpjTl \tl_new:N \lTmpkTl
+\tl_new:N \l@Funx@Tl \tl_new:N \l@Funy@Tl \tl_new:N \l@Funz@Tl
+
+\tl_new:N \gTmpaTl \tl_new:N \gTmpbTl \tl_new:N \gTmpcTl
+\tl_new:N \gTmpiTl \tl_new:N \gTmpjTl \tl_new:N \gTmpkTl
+\tl_new:N \g@Funx@Tl \tl_new:N \g@Funy@Tl \tl_new:N \g@Funz@Tl
+
+\cs_set_eq:NN \TlNew \tl_new:N
+\cs_set_eq:NN \TlLog \tl_log:N
+
+\PrgNewFunction \TlClear { M }
+ {
+ \__fun_do_assignment:Nnn #1 { \tl_gclear:N #1 } { \tl_clear:N #1 }
+ }
+
+\PrgNewFunction \TlSet { M m }
+ {
+ \__fun_do_assignment:Nnn #1 { \tl_gset:Nn #1 {#2} } { \tl_set:Nn #1 {#2} }
+ }
+
+\PrgNewFunction \TlPutLeft { M m }
+ {
+ \__fun_do_assignment:Nnn #1
+ { \tl_gput_left:Nn #1 {#2} } { \tl_put_left:Nn #1 {#2} }
+ }
+
+\PrgNewFunction \TlPutRight { M m }
+ {
+ \__fun_do_assignment:Nnn #1
+ { \tl_gput_right:Nn #1 {#2} } { \tl_put_right:Nn #1 {#2} }
+ }
+
+\PrgNewFunction \TlUse { M }
+ {
+ \Result { \Value #1 }
+ }
+
+\PrgNewConditional \TlIfEmpty { N }
+ {
+ \tl_if_empty:NTF #1
+ { \Result { \cTrueBool } }
+ { \Result { \cFalseBool } }
+ }
+
+\PrgNewConditional \TlIfEq { N N }
+ {
+ \tl_if_eq:NNTF #1 #2
+ { \Result { \cTrueBool } }
+ { \Result { \cFalseBool } }
+ }
+
+%%% --------------------------------------------------------
+%%> \section{Interfaces for Integers (l3int)}
+%%% --------------------------------------------------------
+
+\int_new:N \lTmpaInt \int_new:N \lTmpbInt \int_new:N \lTmpcInt
+\int_new:N \lTmpiInt \int_new:N \lTmpjInt \int_new:N \lTmpkInt
+\int_new:N \l@Funx@Int \int_new:N \l@Funy@Int \int_new:N \l@Funz@Int
+
+\int_new:N \gTmpaInt \int_new:N \gTmpbInt \int_new:N \gTmpcInt
+\int_new:N \gTmpiInt \int_new:N \gTmpjInt \int_new:N \gTmpkInt
+\int_new:N \g@Funx@Int \int_new:N \g@Funy@Int \int_new:N \g@Funz@Int
+
+\cs_set_eq:NN \IntNew \int_new:N
+\cs_set_eq:NN \IntLog \int_log:N
+
+\PrgNewFunction \IntZero { M }
+ {
+ \__fun_do_assignment:Nnn #1 { \int_gzero:N #1 } { \int_zero:N #1 }
+ }
+
+\PrgNewFunction \IntIncr { M }
+ {
+ \__fun_do_assignment:Nnn #1 { \int_gincr:N #1 } { \int_incr:N #1 }
+ }
+
+\PrgNewFunction \IntDecr { M }
+ {
+ \__fun_do_assignment:Nnn #1 { \int_gdecr:N #1 } { \int_decr:N #1 }
+ }
+
+\PrgNewFunction \IntSet { M m }
+ {
+ \__fun_do_assignment:Nnn #1 { \int_gset:Nn #1 {#2} } { \int_set:Nn #1 {#2} }
+ }
+
+\PrgNewFunction \IntAdd { M m }
+ {
+ \__fun_do_assignment:Nnn #1 { \int_gadd:Nn #1 {#2} } { \int_add:Nn #1 {#2} }
+ }
+
+\PrgNewFunction \IntSub { M m }
+ {
+ \__fun_do_assignment:Nnn #1 { \int_gsub:Nn #1 {#2} } { \int_sub:Nn #1 {#2} }
+ }
+
+\PrgNewFunction \IntUse { M }
+ {
+ \Result { \Value #1 }
+ }
+
+\PrgNewFunction \IntEval { m }
+ {
+ \Result { \Expand { \int_eval:n { #1 } } }
+ }
+
+\PrgNewFunction \IntMathAdd { m m }
+ {
+ \int_set:Nn \l@Funx@Int { \int_eval:n { #1 + #2 } }
+ \Result { \Value \l@Funx@Int }
+ }
+
+\PrgNewFunction \IntMathSub { m m }
+ {
+ \int_set:Nn \l@Funx@Int { \int_eval:n { #1 - #2 } }
+ \Result { \Value \l@Funx@Int }
+ }
+
+\PrgNewFunction \IntMathMult { m m }
+ {
+ \int_set:Nn \l@Funx@Int { \int_eval:n { #1 * #2 } }
+ \Result { \Value \l@Funx@Int }
+ }
+
+\PrgNewFunction \IntMathDiv { m m }
+ {
+ \int_set:Nn \l@Funx@Int { \int_eval:n { #1 / #2 } }
+ \Result { \Value \l@Funx@Int }
+ }
+
+\PrgNewFunction \IntStepVariable { m m m M n }
+ {
+ \int_step_variable:nnnNn { #1 } { #2 } { #3 } #4 { #5 }
+ }
+
+\PrgNewConditional \IntCompare { m N m }
+ {
+ \int_compare:nNnTF {#1} #2 {#3}
+ { \Result { \cTrueBool } }
+ { \Result { \cFalseBool } }
+ }
+
diff --git a/macros/latex/contrib/functional/functional.tex b/macros/latex/contrib/functional/functional.tex
new file mode 100644
index 0000000000..18dfa30662
--- /dev/null
+++ b/macros/latex/contrib/functional/functional.tex
@@ -0,0 +1,994 @@
+% -*- coding: utf-8 -*-
+
+\documentclass[oneside]{book}
+\usepackage[a4paper,margin=2.5cm]{geometry}
+
+\newcommand*{\myversion}{2022A}
+\newcommand*{\mydate}{Version \myversion\ (\the\year-\mylpad\month-\mylpad\day)}
+\newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi}
+
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{4pt plus 1pt minus 1pt}
+
+\usepackage{codehigh}
+
+\colorlet{highback}{blue9}
+%\CodeHigh{lite}
+\CodeHigh{language=latex/latex2,style/main=highback,style/code=highback}
+\NewCodeHighEnv{code}{style/main=gray9,style/code=gray9}
+\NewCodeHighEnv{demo}{style/main=gray9,style/code=gray9,demo}
+
+\NewDocumentCommand\MySubScript{m}{$_{#1}$}
+
+\ExplSyntaxOn
+\NewDocumentCommand\PrintVarList{m}{
+ \clist_set:Nn \l_tmpa_clist {#1}
+ \clist_map_inline:Nn \l_tmpa_clist
+ {
+ \token_to_str:N ##1 ~
+ }
+}
+\NewDocumentCommand\RelaceChacters{m}{
+ \tl_set:Nn \lTmpaTl {#1}
+ \regex_replace_once:nnN { \_ } { \c{MySubScript} } \lTmpaTl
+}
+\ExplSyntaxOff
+
+\NewDocumentEnvironment{variable}{m}{
+ \vspace{5pt}
+ \begin{minipage}{\linewidth}
+ \hrule\vspace{4pt}\obeylines%
+ \begingroup
+ \ttfamily\bfseries\color{azure3}
+ \PrintVarList{#1}
+ \endgroup
+ \par\vspace{4pt}\hrule
+ \end{minipage}\par\nopagebreak\vspace{4pt}
+}{%
+ \vspace{5pt}%
+}
+
+\NewDocumentEnvironment{function}{m}{
+ \vspace{5pt}%
+}{\vspace{5pt}}
+
+\NewDocumentEnvironment{syntax}{}{%
+ \begin{minipage}{\linewidth}
+ \hrule\vspace{4pt}\obeylines%
+}{%
+ \par\vspace{4pt}\hrule
+ \end{minipage}\par\nopagebreak\vspace{4pt}
+}
+
+\NewDocumentEnvironment{texnote}{}{}{}
+
+\NewDocumentCommand\cs{m}{%
+ \texttt{\bfseries\color{purple3}\expandafter\string\csname#1\endcsname}%
+}
+\NewDocumentCommand\meta{m}{%
+ \RelaceChacters{#1}%
+ \textsl{$\langle$\ignorespaces\lTmpaTl\unskip$\rangle$}%
+}
+\NewDocumentCommand\Arg{m}{%
+ \RelaceChacters{#1}%
+ \texttt{\{}\textsl{$\langle$\ignorespaces\lTmpaTl\unskip$\rangle$}\texttt{\}}%
+}
+
+\let\tn=\cs
+
+\RenewDocumentCommand\emph{m}{%
+ \underline{\textsl{#1}}%
+}
+
+\usepackage{hyperref}
+\hypersetup{
+ colorlinks=true,
+ urlcolor=blue3,
+ linkcolor=blue3,
+}
+
+\usepackage{functional}
+%\Functional{scoping=false,tracing=true}
+
+\begin{document}
+
+\title{\sffamily LaTeX2 \textcolor{green3}{Functional} Interfaces to LaTeX3 Programming Layer}
+\author{Jianrui Lyu (tolvjr@163.com)\\\url{https://github.com/lvjr/functional}}
+\date{\mydate\vspace{1cm}\\\myabstract\vspace{10cm}}
+
+\newcommand\myabstract{\parbox{\linewidth}{\hrule\vspace{0.8em}\large
+LaTeX3 programming layer (\textsf{expl3}) is very powerful for advanced users,
+but it is a little complicated for normal users.
+This \textcolor{green3}{\sffamily functional} package aims to provide
+intuitive LaTeX2 functional interfaces for it.
+\par\vspace{0.5em}
+Although there are functions in LaTeX3, the evaluation of them is from outside to inside.
+With this package, the evaluation of functions is from inside to outside,
+which is the same as other programming languages such as \texttt{JavaScript} or \texttt{Lua}.
+In this way, it is rather easy to debug code too.
+\par\vspace{0.5em}
+Note that many paragraphs in this manual are copied from the documentation of \textsf{expl3}.
+\par\vspace{0.8em}\hrule}}
+
+{\let\newpage\relax\vspace{-4cm}\maketitle}
+
+\tableofcontents
+
+\chapter{Overview of Features}
+
+\section{Evaluation from Inside to Outside}
+
+We will compare our first example with a similar \verb!Lua! example:
+
+\begin{code}
+-- lua code --
+function MathSquare (arg)
+ local lTmpaInt = arg * arg
+ return lTmpaInt
+end
+print(MathSquare(5))
+print(MathSquare(MathSquare(5)))
+\end{code}
+
+\begin{codehigh}
+%% function code
+\ExplSyntaxOn
+\PrgNewFunction \MathSquare { m } {
+ \IntSet \lTmpaInt { \IntEval { #1 * #1 } }
+ \Result { \Value \lTmpaInt }
+}
+\ExplSyntaxOff
+\MathSquare{5}
+\MathSquare{\MathSquare{5}}
+\end{codehigh}
+
+%\ExplSyntaxOn
+%\PrgNewFunction \MathSquare { m }{
+% \IntSet \lTmpaInt { \IntEval { #1 * #1 } }
+% \Result { \Value \lTmpaInt }
+%}
+%\ExplSyntaxOff
+%\MathSquare{5}
+%\MathSquare{\MathSquare{5}}
+
+%\ExplSyntaxOn
+%\PrgNewFunction \MathCubic { m }
+% {
+% \IntSet \lTmpaInt { \IntEval { #1 * #1 * #1 } }
+% \Result { \Value \lTmpaInt }
+% }
+%\ExplSyntaxOff
+%\MathCubic{2}
+%\MathCubic{\MathCubic{2}}
+
+Both examples calculate first the square of $5$ and produce $25$,
+then calculate the square of $25$ and produce $625$.
+In contrast to \verb!expl3!, this \verb!functional! package
+does evaluation of functions from inside to outside,
+which means composition of functions works like othe programming languages
+such as \verb!Lua! or \verb!JavsScript!.
+
+You can define new functions with \cs{PrgNewFunction} command.
+To make composition of functions work as expected,
+every function \emph{must not} insert directly any token to the input stream.
+Instead, a function \emph{must} pass the result (if any) to \verb!functional! package
+with \cs{Result} command. And \verb!functional! package is responsible for
+inserting result tokens to the input stream at the appropriate time.
+
+To remove space tokens inside function code in defining functions,
+you'd better put function definitions inside \verb!\ExplSyntaxOn! and
+\verb!\ExplSyntaxOff! block. Within this block, \verb!~! is used to input a space.
+
+At the end of this section,
+we will compare our factorial example with a similar \verb!Lua! example:
+
+\begin{code}
+-- lua code --
+function Factorial (n)
+ if n == 0 then
+ return 1
+ else
+ return n * Factorial(n-1)
+ end
+end
+print(Factorial(4))
+\end{code}
+
+\begin{codehigh}
+\ExplSyntaxOn
+\PrgNewFunction \Factorial { m } {
+ \IntCompareTF {#1} = {0} {
+ \Result {1}
+ }{
+ \Result { \IntMathMult {#1} { \Factorial { \IntMathSub{#1}{1} } } }
+ }
+}
+\ExplSyntaxOff
+\Factorial{4}
+\end{codehigh}
+
+%\ExplSyntaxOn
+%\PrgNewFunction \Factorial { m } {
+% \IntCompareTF {#1} = {0} {
+% \Result {1}
+% }{
+% \Result { \IntMathMult {#1} { \Factorial { \IntMathSub{#1}{1} } } }
+% }
+%}
+%\ExplSyntaxOff
+%\Factorial{0}
+%\Factorial{4}
+
+\section{Group Scoping of Functions}
+
+In \verb!Lua! language, a function or a condition expression makes a block,
+and the values of local variables will be reset after a block.
+For example
+
+\begin{code}
+-- lua code --
+local a = 1
+print(a) ---- 1
+function SomeFun()
+ local a = 2
+ print(a) ---- 2
+ if 1 > 0 then
+ local a = 3
+ print(a) ---- 3
+ end
+ print(a) ---- 2
+end
+SomeFun()
+print(a) ---- 1
+\end{code}
+
+In \verb!functional! package, a condition expression is in fact a function,
+and you can make every function become a group by setting
+\verb!\Functional{scoping=true}!. For example
+
+\begin{codehigh}
+\Functional{scoping=true}
+\ExplSyntaxOn
+\IntSet \lTmpaInt {1}
+\IntLog \lTmpaInt % ---- 1
+\PrgNewFunction \SomeFun { } {
+ \IntSet \lTmpaInt {2}
+ \IntLog \lTmpaInt % ---- 2
+ \IntCompareTF {1} > {0} {
+ \IntSet \lTmpaInt {3}
+ \IntLog \lTmpaInt % ---- 3
+ }{ }
+ \IntLog \lTmpaInt % ---- 2
+}
+\SomeFun
+\IntLog \lTmpaInt % ---- 1
+\ExplSyntaxOff
+\end{codehigh}
+
+Same as \verb!expl3!, the names of local variables \emph{must} start with \verb!l!,
+while names of global variables \emph{must} start with \verb!g!.
+The difference is that \verb!functional! package provides only one function for setting
+both local and global varianbles of the same type,
+by checking leading letters of their names. So for integer variables, you can write
+\verb!\IntSet\lTmpaInt{1}! and \verb!\IntSet\gTmpbInt{2}!.
+
+The previous example will produce different result
+if we change variable from \verb!\lTmpaInt! to \verb!\gTmpaInt!.
+
+\begin{codehigh}
+\Functional{scoping=true}
+\IntSet \gTmpaInt {1}
+\IntLog \gTmpaInt % ---- 1
+\PrgNewFunction \SomeFun { } {
+ \IntSet \gTmpaInt {2}
+ \IntLog \gTmpaInt % ---- 2
+ \IntCompareTF {1} > {0} {
+ \IntSet \gTmpaInt {3}
+ \IntLog \gTmpaInt % ---- 3
+ }{ }
+ \IntLog \gTmpaInt % ---- 3
+}
+\SomeFun
+\IntLog \gTmpaInt % ---- 3
+\end{codehigh}
+
+As you can see, the values of global variables will never be reset after a group.
+
+\section{Tracing Evaluation of Functions}
+
+Since every function in \verb!functional! package will pass its return value to
+the package, it is quite easy to debug your code.
+You can turn on the tracing by setting \verb!\Functional{tracing=true}!.
+For example, the tracing log of the first example in this chapter will be the following:
+
+% FIXME: spaces at the first line will be removed
+%\begin{codehigh}[]
+% [I] \MathSquare{5}
+% [I] \IntEval{5*5}
+% [I] \Expand{\int_eval:n {5*5}}
+% [O] 25
+% [I] \Result{25}
+% [O] 25
+% [O] 25
+% [I] \IntSet\lTmpaInt {25}
+% [O]
+% [I] \Value\lTmpaInt
+% [O] 25
+% [I] \Result{25}
+% [O] 25
+% [O] 25
+%\end{codehigh}
+\begin{codehigh}[]
+[I] \MathSquare{5}
+ [I] \IntEval{5*5}
+ [I] \Expand{\int_eval:n {5*5}}
+ [O] 25
+ [I] \Result{25}
+ [O] 25
+ [O] 25
+ [I] \IntSet\lTmpaInt {25}
+ [O]
+ [I] \Value\lTmpaInt
+ [O] 25
+ [I] \Result{25}
+ [O] 25
+[O] 25
+[I] \MathSquare{25}
+ [I] \IntEval{25*25}
+ [I] \Expand{\int_eval:n {25*25}}
+ [O] 625
+ [I] \Result{625}
+ [O] 625
+ [O] 625
+ [I] \IntSet\lTmpaInt {625}
+ [O]
+ [I] \Value\lTmpaInt
+ [O] 625
+ [I] \Result{625}
+ [O] 625
+[O] 625
+\end{codehigh}
+
+\section{Definitions of Functions}
+
+Within \verb!expl3!, there are eight commands for defining new functions,
+which is good for power users.
+
+\begin{code}[language=latex/latex3]
+\cs_new:Npn
+\cs_new_nopar:Npn
+\cs_new_protected:Npn
+\cs_new_protected_nopar:Npn
+\cs_new:Nn
+\cs_new_nopar:Nn
+\cs_new_protected:Nn
+\cs_new_protected_nopar:Nn
+\end{code}
+
+Within \verb!functional! package, there is only one command (\cs{PrgNewFunction})
+for defining new functions, which is good for normal users.
+The created functions are always protected and accept \verb!\par! in their arguments.
+
+Since \verb!functional! package gets the results of functions by evaluation
+(including expansion and execution by \TeX), it is natural to protect all functions.
+
+\section{Variants of Arguments}
+
+Within \verb!expl3!, there are several expansion variants for arguments,
+and many expansion functions for expanding them, which are necessary for power users.
+
+\begin{code}[language=latex/latex3]
+\module_foo:c
+\module_bar:e
+\module_bar:x
+\module_bar:f
+\module_bar:o
+\module_bar:V
+\module_bar:v
+\end{code}
+
+\begin{code}[language=latex/latex3]
+\exp_args:Nc
+\exp_args:Ne
+\exp_args:Nx
+\exp_args:Nf
+\exp_args:No
+\exp_args:NV
+\exp_args:Nv
+\end{code}
+
+Within \verb!functional! package, there are only three variants
+(\verb!c!, \verb!e!, \verb!V!) are provided, and these variants are defined
+as functions (\cs{Name}, \cs{Expand}, \cs{Value}, respetively),
+which are easier to use for normal users.
+
+\begin{demohigh}
+\newcommand\test{uvw}
+\Name{test}
+\end{demohigh}
+
+\begin{demohigh}
+\newcommand\test{uvw}
+\Expand{111\test222}
+\end{demohigh}
+
+\begin{demohigh}
+\IntSet\lTmpaInt{123}
+\Value\lTmpaInt
+\end{demohigh}
+
+The most interesting feature is that you can compose these functions.
+For example, you can easily get the \verb!v! variant of \verb!expl3! by
+simply composing \cs{Name} and \cs{Value} functions:
+
+\begin{demohigh}
+\IntSet\lTmpaInt{123}
+\Value{\Name{lTmpaInt}}
+\end{demohigh}
+
+\chapter{Basic Definitions (\texttt{l3basics})}
+
+\section{Defining Functions and Conditionals}
+
+\begin{function}{\PrgNewFunction}
+\begin{syntax}
+\cs{PrgNewFunction} \meta{function} \Arg{argument specification} \Arg{code}
+\end{syntax}
+Creates protected \meta{function} for evaluating the \meta{code}.
+Within the \meta{code}, the parameters (\verb|#1|, \verb|#2|,
+\emph{etc.}) will be replaced by those absorbed by the function.
+The returned value \emph{must} be passed with \cs{Result} function.
+The definition is global and an error results if the
+\meta{function} is already defined.\par
+The \Arg{argument specification} in a list of letters,
+where each letter is one of the following argument specifiers
+(nearly all of them are \texttt{M} or \texttt{m} for functions provided by this package):\par
+{\centering\begin{tabular}{ll}
+%\hline
+ \texttt{M} & single-token argument, which will be manipulated first \\
+ \texttt{m} & multi-token argument, which will be manipulated first \\
+ \texttt{N} & single-token argument, which will not be manipulated first \\
+ \texttt{n} & multi-token argument, which will not be manipulated first \\
+%\hline
+\end{tabular}\par}
+The argument manipulation for argument type \texttt{M} or \texttt{m}
+is: if the argument starts with a function defined with \cs{PrgNewFunction},
+the argument will be evaluated and replaced with the returned value.
+\end{function}
+
+\begin{function}{\PrgNewConditional}
+\begin{syntax}
+\cs{PrgNewConditional} \meta{function} \Arg{argument specification} \Arg{code}
+\end{syntax}
+Creates protected conditional \meta{function} for evaluating the \meta{code}.
+The returned value of the \meta{function} \emph{must} be either \verb!\cTrueBool!
+or \verb!\cFalseBool! and be passed with \cs{Result} function..
+The definition is global and an error results if the \meta{function} is already defined.
+\par
+Assume the \meta{function} is \verb!\FooIfBar!, then another function \verb!\FooIfBarTF!
+will be created at the same time. \verb!\FooIfBarTF! function has two extra arguments
+which are \Arg{true code} and \Arg{false code}.\par
+\end{function}
+
+\begin{function}{\Result}
+\begin{syntax}
+\cs{Result} \Arg{tokens}
+\end{syntax}
+Appends \meta{tokens} to \verb!\gResultTl!, which holds the returned value of current function.
+This function is normally used in the \meta{code} of \cs{PrgNewFunction} and \cs{PrgNewConditional}.
+\end{function}
+
+\section{Expanding and Using Tokens}
+
+\begin{function}{\Name}
+\begin{syntax}
+\cs{Name} \Arg{control sequence name}
+\end{syntax}
+Expands the \meta{control sequence name} until only characters
+remain, then converts this into a control sequence and returns it.
+The \meta{control sequence name} must consist of character tokens %,
+%typically a mixture of category code $10$ (space), $11$ (letter) and $12$ (other).
+when exhaustively expanded.%
+%\begin{texnote}
+%Protected macros that appear in a \texttt{c}-type argument are
+%expanded despite being protected; \cs{exp_not:n} also has no
+%effect. An internal error occurs if non-characters or active
+%characters remain after full expansion, as the conversion to a
+%control sequence is not possible.
+%\end{texnote}
+\end{function}
+
+\begin{function}{\Value}
+\begin{syntax}
+\cs{Value} \meta{variable}
+\end{syntax}
+Recovers the content of a \meta{variable} and returns the value.
+An error is raised if the variable does not exist or if it is invalid.
+Note that it is the same as \cs{TlUse} for \meta{tl var}, or \cs{IntUse} for \meta{int var}.
+\end{function}
+
+\begin{function}{\Expand}
+\begin{syntax}
+\cs{Expand} \Arg{tokens}
+\end{syntax}
+Expands the \meta{tokens} exhaustively and returns the result.
+\end{function}
+
+\begin{function}{\ExpNot}
+\begin{syntax}
+\cs{ExpNot} \Arg{tokens}
+\end{syntax}
+Prevents expansion of the \meta{tokens} inside the argument of \cs{Expand} function.
+The argument of \cs{ExpNot} \emph{must} be surrounded by braces.
+%\begin{texnote}
+%This is the \eTeX{} \tn{unexpanded} primitive. In an
+%|x|-expanding definition (\cs{cs_new:Npx}), \cs{exp_not:n}~|{#1}|
+%is equivalent to |##1| rather than to~|#1|, namely it inserts the
+%two characters |#| and~|1|. In an |e|-type argument
+%\cs{exp_not:n}~|{#}| is equivalent to |#|, namely it inserts the
+%character~|#|.
+%\end{texnote}
+\end{function}
+
+\begin{function}{\ExpValue}
+\begin{syntax}
+\cs{ExpValue} \meta{variable}
+\end{syntax}
+Recovers the content of the \meta{variable}, then prevents expansion
+of this material inside the argument of \cs{Expand} function.
+\end{function}
+
+\begin{function}{\UseOne,\GobbleOne}
+\begin{syntax}
+\cs{UseOne} \Arg{argument}
+\cs{GobbleOne} \Arg{argument}
+\end{syntax}
+The function \cs{UseOne} absorbs one argument and returns it.
+%\begin{texnote}
+%The \cs{UseOne} function is equivalent to \LaTeXe{}'s \tn{@firstofone}.
+%\end{texnote}
+\cs{GobbleOne} absorbs one argument and returns nothing.
+%\begin{texnote}
+%These are equivalent to \LaTeXe{}'s \tn{@gobble}, \tn{@gobbbletwo},
+%\emph{etc.}
+%\end{texnote}
+For example
+\begin{demohigh}
+\UseOne{abc}\GobbleOne{ijk}\UseOne{xyz}
+\end{demohigh}
+\end{function}
+
+\begin{function}{\UseGobble,\GobbleUse}
+\begin{syntax}
+\cs{UseGobble} \Arg{arg_1} \Arg{arg_2}
+\cs{GobbleUse} \Arg{arg_1} \Arg{arg_2}
+\end{syntax}
+These functions absorb two arguments.
+The function \cs{UseGobble} discards the second argument,
+and returns the content of the first argument.
+\cs{GobbleUse} discards the first argument,
+and returns the content of the second argument.
+%\begin{texnote}
+%These are equivalent to \LaTeXe{}'s \tn{@firstoftwo} and
+%\tn{@secondoftwo}.
+%\end{texnote}
+For example
+\begin{demohigh}
+\UseGobble{abc}{uvw}\GobbleUse{abc}{uvw}
+\end{demohigh}
+\end{function}
+
+\chapter{Control Structures (\texttt{l3prg})}
+
+\section{Scratch Variables of Booleans}
+
+\begin{variable}{\lTmpaBool,\lTmpbBool,\lTmpcBool,\lTmpiBool,\lTmpjBool,\lTmpkBool}
+Scratch booleans for local assignment. These are never used by
+the \verb!functional! package, and so are safe for use with any
+function. However, they may be overwritten by other
+code and so should only be used for short-term storage.
+\end{variable}
+
+\begin{variable}{\gTmpaBool,\gTmpbBool,\gTmpcBool,\gTmpiBool,\gTmpjBool,\gTmpkBool}
+Scratch booleans for global assignment. These are never used by
+the \verb!functional! package, and so are safe for use with any
+function. However, they may be overwritten by other
+code and so should only be used for short-term storage.
+\end{variable}
+
+%\BoolIfTF\cTrueBool{\Result{true}}{\Result{false}}
+%\BoolIfTF\cFalseBool{\Result{true}}{\Result{false}}
+
+\section{Public Functions for Booleans}
+
+\begin{function}{\BoolNew}
+\begin{syntax}
+\cs{BoolNew} \meta{boolean}
+\end{syntax}
+Creates a new \meta{boolean} or raises an error if the
+name is already taken. The declaration is global. The
+\meta{boolean} is initially \texttt{false}.
+\end{function}
+
+\begin{function}{\BoolSetTrue}
+\begin{syntax}
+\cs{BoolSetTrue} \meta{boolean}
+\end{syntax}
+Sets \meta{boolean} logically \texttt{true}.
+\end{function}
+
+\begin{function}{\BoolSetFalse}
+\begin{syntax}
+\cs{BoolSetFalse} \meta{boolean}
+\end{syntax}
+Sets \meta{boolean} logically \texttt{false}.
+\end{function}
+
+\begin{function}{\BoolIf,\BoolIfTF}
+\begin{syntax}
+\cs{BoolIf} \meta{boolean}
+\cs{BoolIfTF} \meta{boolean} \Arg{true code} \Arg{false code}
+\end{syntax}
+Tests the current truth of \meta{boolean}, and continues evaluation
+based on this result. For example
+\begin{demohigh}
+\BoolSetTrue\lTmpaBool
+\BoolIfTF\lTmpaBool{\Result{True!}}{\Result{False!}}
+\BoolSetFalse\lTmpaBool
+\BoolIfTF\lTmpaBool{\Result{True!}}{\Result{False!}}
+\end{demohigh}
+\end{function}
+
+\chapter{Token Lists (\texttt{l3tl})}
+
+\section{Scratch Variables of Token Lists}
+
+\begin{variable}{\lTmpaTl,\lTmpbTl,\lTmpcTl,\lTmpiTl,\lTmpjTl,\lTmpkTl}
+Scratch token lists for local assignment. These are never used by
+the \verb!functional! package, and so are safe for use with any
+function. However, they may be overwritten by other
+code and so should only be used for short-term storage.
+\end{variable}
+
+\begin{variable}{\gTmpaTl,\gTmpbTl,\gTmpcTl,\gTmpiTl,\gTmpjTl,\gTmpkTl}
+Scratch token lists for global assignment. These are never used by
+the \verb!functional! package, and so are safe for use with any
+function. However, they may be overwritten by other
+code and so should only be used for short-term storage.
+\end{variable}
+
+\section{Public Functions for Token Lists}
+
+\begin{function}{\TlNew}
+\begin{syntax}
+\cs{TlNew} \meta{tl~var}
+\end{syntax}
+Creates a new \meta{tl~var} or raises an error if the
+name is already taken. The declaration is global. The
+\meta{tl~var} is initially empty.
+\end{function}
+
+\begin{function}{\TlUse}
+\begin{syntax}
+\cs{TlUse} \meta{tl~var}
+\end{syntax}
+Recovers the content of a \meta{tl~var} and returns the value.
+An error is raised if the variable
+does not exist or if it is invalid. Note that it is possible to use
+a \meta{tl~var} directly without an accessor function.
+\end{function}
+
+\begin{function}{\TlSet}
+\begin{syntax}
+\cs{TlSet} \meta{tl~var} \Arg{tokens}
+\end{syntax}
+Sets \meta{tl~var} to contain \meta{tokens},
+removing any previous content from the variable. For example
+\begin{demohigh}
+\TlSet\lTmpiTl{\IntMathMult{4}{5}}
+\TlUse\lTmpiTl
+\end{demohigh}
+\end{function}
+
+\begin{function}{\TlClear}
+\begin{syntax}
+\cs{TlClear} \meta{tl~var}
+\end{syntax}
+Clears all entries from the \meta{tl~var}. For example
+\begin{demohigh}
+\TlSet\lTmpjTl{One}
+\TlClear\lTmpjTl
+\TlSet\lTmpjTl{Two}
+\TlUse\lTmpjTl
+\end{demohigh}
+\end{function}
+
+\begin{function}{\TlPutLeft}
+\begin{syntax}
+\cs{TlPutLeft} \meta{tl~var} \Arg{tokens}
+\end{syntax}
+Appends \meta{tokens} to the left side of the current content of
+\meta{tl~var}. For example
+\begin{demohigh}
+\TlSet\lTmpkTl{Functional}
+\TlPutLeft\lTmpkTl{Hello}
+\TlUse\lTmpkTl
+\end{demohigh}
+\end{function}
+
+\begin{function}{\TlPutRight}
+\begin{syntax}
+\cs{TlPutRight} \meta{tl~var} \Arg{tokens}
+\end{syntax}
+Appends \meta{tokens} to the right side of the current content of
+\meta{tl~var}. For example
+\begin{demohigh}
+\TlSet\lTmpkTl{Functional}
+\TlPutRight\lTmpkTl{World}
+\TlUse\lTmpkTl
+\end{demohigh}
+\end{function}
+
+\begin{function}{\TlIfEmpty,\TlIfEmptyTF}
+\begin{syntax}
+\cs{TlIfEmpty} \meta{tl~var}
+\cs{TlIfEmptyTF} \meta{tl~var} \Arg{true code} \Arg{false code}
+\end{syntax}
+Tests if the \meta{token list variable} is entirely empty
+(\emph{i.e.}~contains no tokens at all). For example
+\begin{demohigh}
+\TlSet\lTmpaTl{abc}
+\TlIfEmptyTF\lTmpaTl{\Result{Empty}}{\Result{NonEmpty}}
+\TlClear\lTmpaTl
+\TlIfEmptyTF\lTmpaTl{\Result{Empty}}{\Result{NonEmpty}}
+\end{demohigh}
+\end{function}
+
+\begin{function}{\TlIfEq,\TlIfEqTF}
+\begin{syntax}
+\cs{TlIfEq} \meta{tl~var_1} \meta{tl~var_2}
+\cs{TlIfEqTF} \meta{tl~var_1} \meta{tl~var_2} \Arg{true code} \Arg{false code}
+\end{syntax}
+Compares the content of two \meta{token list variables} and
+is logically \texttt{true} if the two contain the same list of
+tokens (\emph{i.e.}~identical in both the list of characters they
+contain and the category codes of those characters). For example
+\begin{demohigh}
+\TlSet\lTmpaTl{abc}
+\TlSet\lTmpbTl{abc}
+\TlSet\lTmpcTl{xyz}
+\TlIfEqTF\lTmpaTl\lTmpbTl{\Result{Yes}}{\Result{No}}
+\TlIfEqTF\lTmpaTl\lTmpcTl{\Result{Yes}}{\Result{No}}
+\end{demohigh}
+%See also \cs{StrIfEqTF} for a comparison that ignores category codes.
+\end{function}
+
+\chapter{Integers (\texttt{l3int})}
+
+\section{Scratch Variables of Integers}
+
+\begin{variable}{\lTmpaInt,\lTmpbInt,\lTmpcInt,\lTmpiInt,\lTmpjInt,\lTmpkInt}
+Scratch integer for local assignment. These are never used by
+the \verb!functional! package, and so are safe for use with any
+function. However, they may be overwritten by other
+code and so should only be used for short-term storage.
+\end{variable}
+
+\begin{variable}{\gTmpaInt,\gTmpbInt,\gTmpcInt,\gTmpiInt,\gTmpjInt,\gTmpkInt}
+Scratch integer for global assignment. These are never used by
+the \verb!functional! package, and so are safe for use with any
+function. However, they may be overwritten by other
+code and so should only be used for short-term storage.
+\end{variable}
+
+\section{Public Functions for Integers}
+
+\begin{function}{\IntEval}
+\begin{syntax}
+\cs{IntEval} \Arg{integer expression}
+\end{syntax}
+Evaluates the \meta{integer expression} and returns the result:
+for positive results an
+explicit sequence of decimal digits not starting with~\texttt{0},
+for negative results \texttt{-}~followed by such a sequence, and
+\texttt{0}~for zero. For example
+\begin{demohigh}
+\IntEval{(1+4)*(2-3)/5}
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntMathAdd}
+\begin{syntax}
+\cs{IntMathAdd} \Arg{integer expression_1} \Arg{integer expression_2}
+\end{syntax}
+Adds \Arg{integer expression_1} and \Arg{integer expression_2},
+and returns the result. For example
+\begin{demohigh}
+\IntMathAdd{7}{3}
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntMathSub}
+\begin{syntax}
+\cs{IntMathSub} \Arg{integer expression_1} \Arg{integer expression_2}
+\end{syntax}
+Subtracts \Arg{integer expression_1} from \Arg{integer expression_2},
+and returns the result. For example
+\begin{demohigh}
+\IntMathSub{7}{3}
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntMathMult}
+\begin{syntax}
+\cs{IntMathMult} \Arg{integer expression_1} \Arg{integer expression_2}
+\end{syntax}
+Multiplies \Arg{integer expression_1} by \Arg{integer expression_2},
+and returns the result. For example
+\begin{demohigh}
+\IntMathMult{7}{3}
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntMathDiv}
+\begin{syntax}
+\cs{IntMathDiv} \Arg{integer expression_1} \Arg{integer expression_2}
+\end{syntax}
+Divides \Arg{integer expression_1} by \Arg{integer expression_2},
+and returns the result. For example
+\begin{demohigh}
+\IntMathDiv{7}{3}
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntNew}
+\begin{syntax}
+\cs{IntNew} \meta{integer}
+\end{syntax}
+Creates a new \meta{integer} or raises an error if the name is
+already taken. The declaration is global. The \meta{integer} is
+initially equal to $0$.
+\end{function}
+
+\begin{function}{\IntUse}
+\begin{syntax}
+\cs{IntUse} \meta{integer}
+\end{syntax}
+Recovers the content of an \meta{integer} and returns the value.
+An error is raised if the variable does
+not exist or if it is invalid. Can be omitted in places where an
+\meta{integer} is required (such as in the first and third arguments
+of \cs{IntCompareTF}).%
+%\begin{texnote}
+%\cs{IntUse} is the \TeX{} primitive \tn{the}: this is one of
+%several \verb!functional! names for this primitive.
+%\end{texnote}
+\end{function}
+
+\begin{function}{\IntSet}
+\begin{syntax}
+\cs{IntSet} \meta{integer} \Arg{integer expression}
+\end{syntax}
+Sets \meta{integer} to the value of \meta{integer expression},
+which must evaluate to an integer (as described for \cs{IntEval}).
+For example
+\begin{demohigh}
+\IntSet\lTmpaInt{3+5}
+\IntUse\lTmpaInt
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntZero}
+\begin{syntax}
+\cs{IntZero} \meta{integer}
+\end{syntax}
+Sets \meta{integer} to $0$. For example
+\begin{demohigh}
+\IntSet\lTmpaInt{5}
+\IntZero\lTmpaInt
+\IntUse\lTmpaInt
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntIncr}
+\begin{syntax}
+\cs{IntIncr} \meta{integer}
+\end{syntax}
+Increases the value stored in \meta{integer} by $1$.
+For example
+\begin{demohigh}
+\IntSet\lTmpaInt{5}
+\IntIncr\lTmpaInt
+\IntUse\lTmpaInt
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntDecr}
+\begin{syntax}
+\cs{IntDecr} \meta{integer}
+\end{syntax}
+Decreases the value stored in \meta{integer} by $1$.
+For example
+\begin{demohigh}
+\IntSet\lTmpaInt{5}
+\IntDecr\lTmpaInt
+\IntUse\lTmpaInt
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntAdd}
+\begin{syntax}
+\cs{IntAdd} \meta{integer} \Arg{integer expression}
+\end{syntax}
+Adds the result of the \meta{integer expression} to the current
+content of the \meta{integer}. For example
+\begin{demohigh}
+\IntSet\lTmpaInt{5}
+\IntAdd\lTmpaInt{2}
+\IntUse\lTmpaInt
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntSub}
+\begin{syntax}
+\cs{IntSub} \meta{integer} \Arg{integer expression}
+\end{syntax}
+Subtracts the result of the \meta{integer expression} from the
+current content of the \meta{integer}. For example
+\begin{demohigh}
+\IntSet\lTmpaInt{5}
+\IntSub\lTmpaInt{3}
+\IntUse\lTmpaInt
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntStepVariable}
+\begin{syntax}
+\cs{IntStepVariable} \Arg{initial value} \Arg{step} \Arg{final value} \meta{tl~var} \Arg{code}
+\end{syntax}
+This function first evaluates the \meta{initial value}, \meta{step}
+and \meta{final value}, all of which should be integer expressions.
+Then for each \meta{value} from the \meta{initial value} to the
+\meta{final value} in turn (using \meta{step} between each
+\meta{value}), the \meta{code} is evaluated,
+with the \meta{tl~var} defined as the current \meta{value}. Thus
+the \meta{code} should make use of the \meta{tl~var}.
+For example
+\begin{demohigh}
+\TlClear\lTmpaTl
+\IntStepVariable{1}{3}{30}\lTmpiTl{
+ \TlPutRight\lTmpaTl{\Value\lTmpiTl}
+ \TlPutRight\lTmpaTl{ }
+}
+\Result{\Value\lTmpaTl}
+\end{demohigh}
+\end{function}
+
+\begin{function}{\IntCompare,\IntCompareTF}
+\begin{syntax}
+\cs{IntCompare} \Arg{intexpr_1} \meta{relation} \Arg{intexpr_2}
+\cs{IntCompareTF} \Arg{intexpr_1} \meta{relation} \Arg{intexpr_2} \Arg{true code} \Arg{false code}
+\end{syntax}
+This function first evaluates each of the \meta{integer expressions}
+as described for \cs{IntEval}. The two results are then
+compared using the \meta{relation}:\par
+{\centering\begin{tabular}{ll}
+Equal & \texttt{=} \\
+Greater than & \texttt{>} \\
+Less than & \texttt{<} \\
+\end{tabular}\par}
+For example
+\begin{demohigh}
+\IntCompareTF{2}>{1}{\Result{Greater}}{\Result{Less}}
+\IntCompareTF{2}>{3}{\Result{Greater}}{\Result{Less}}
+\end{demohigh}
+\end{function}
+
+\chapter{The Source Code}
+
+%\CodeHigh{lite}
+\setlength\parskip{0pt}
+\dochighinput[language=latex/latex3]{functional.sty}
+
+\end{document}
+
diff --git a/macros/latex/contrib/tiscreen/README b/macros/latex/contrib/tiscreen/README
index 17f81e8592..ce974f7cbe 100644
--- a/macros/latex/contrib/tiscreen/README
+++ b/macros/latex/contrib/tiscreen/README
@@ -4,6 +4,8 @@ This package mimics the screen and buttons of older Texas instruments dot
matrix display calculators, specifically the TI-82 STATS.
Changes:
+- 2021/12/31 Added all buttons
+- 2021/12/18 Add TI-84 characters
- 2021/09/18 Added buttons
- 2021/07/22 Added bracket symbols
- 2021/06/10 Simplified example code in documentation
diff --git a/macros/latex/contrib/tiscreen/doc/tiscreen-doc.pdf b/macros/latex/contrib/tiscreen/doc/tiscreen-doc.pdf
index 3b8f41078b..577278af1d 100644
--- a/macros/latex/contrib/tiscreen/doc/tiscreen-doc.pdf
+++ b/macros/latex/contrib/tiscreen/doc/tiscreen-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/tiscreen/doc/tiscreen-doc.tex b/macros/latex/contrib/tiscreen/doc/tiscreen-doc.tex
index b1e689ba74..6e0207271e 100644
--- a/macros/latex/contrib/tiscreen/doc/tiscreen-doc.tex
+++ b/macros/latex/contrib/tiscreen/doc/tiscreen-doc.tex
@@ -1,14 +1,16 @@
-% TODO: make funciton for printing \LCDcmd
-
\documentclass[a4paper,12pt]{article}
+
\usepackage[iso,english]{isodate}
\usepackage[margin=1in]{geometry}
\usepackage[english]{babel}
+\usepackage{hyperref}
\usepackage{parskip}
+
+\usepackage{amsmath}
\usepackage[color]{tiscreen}
\usepackage{multicol}
-\usepackage{hyperref}
\usepackage{array}
+\usepackage{longtable}
\usepackage{fancyvrb-ex}
\fvset{
frame=single,
@@ -19,30 +21,46 @@
}
\newcommand{\LCDsymb}[1]{\large \textLCD{1}|{#1}~|}
-\newcommand{\printcmd}[1]{\texttt{\textbackslash #1}}
-\title{TI calculator screen (and buttons)\\{\small TI-82 STATS}}
-\author{Mustafa Ibrahim}
+\title{TI calculator screen (and buttons)\\{\small TI-82 STATS, TI-84}}
+\author{Mustafa Ibrahim, Caleb Bibb}
+\date{2021-12-31}
\begin{document}
\maketitle
\begin{center}
-\tiscreen
-|10^6*(4^7+1){rarrow}X |
-| 1.6385E10|
-|{sqrt}(X)*X/10! |
-| 577971782.1|
-|cos{ar}(cos(Ans)) |
-| 62.11246|
-|{fcur} |
-| |
+ \begin{tabular}{cc}
+ \tiscreen
+ |10^6*(4^7+1){rarrow}X |
+ | 1.6385E10|
+ |{sqrt}(X)*X/10! |
+ | 577971782.1|
+ |cos{ar}(cos(Ans)) |
+ | 62.11246|
+ |{fcur} |
+ | |
+ &
+ \tibtnextramatrix
+ \end{tabular}
-\tibtnmatrixextra
+ \dotfill
+
+ \begin{tabular}{ccccc}
+ \tibtnsecond & \tibtnmode & \tibtndel & & \\
+ \tibtnalpha & \tibtnxton & \tibtnstat & & \\
+ \tibtnmath & \tibtnmatrix & \tibtnprgm & \tibtnvars & \tibtnclear \\
+ \tibtnxnone & \tibtnsin & \tibtncos & \tibtntan & \tibtnpower \\
+ \tibtnxtwo & \tibtncomma & \tibtnleftparen & \tibtnrightparen & \tibtndiv \\
+ \tibtnlog & \tibtnseven & \tibtneight & \tibtnnine & \tibtntimes \\
+ \tibtnln & \tibtnfour & \tibtnfive & \tibtnsix & \tibtnminus \\
+ \tibtnsto & \tibtnone & \tibtntwo & \tibtnthree & \tibtnplus \\
+ \tibtnon & \tibtnzero & \tibtndot & \tibtnneg & \tibtnenter \\
+ \end{tabular}
\end{center}
-\tableofcontents\newpage
+\newpage\tableofcontents\newpage
\section{Quickstart}
@@ -59,22 +77,19 @@
| |
| |
-\tibtnmatrixextra
+Lorem \tibtnmath{} ipsum
-Lorem
-\tibtn[white]{tibtngray}{MATH}
-ipsum
-
-\tibtnextra{\tibtn[white]{tibtngray}{MATH}}{TEST}{A}
+\tibtnextramath
\end{SideBySideExample}
\section{Package option(s)}
-\subsection{Color}
-Using the \texttt{color} option will change the colors used by the
-\printcmd{LCD} command for printing the screen using \printcmd{tiscreen}. The
-colors are defined as \texttt{tiscreenfg} (foreground, i.e. font color) and
-\texttt{tiscreenbg} (background) and redefined like this:
+\subsection{Color} \label{sec:color}
+
+Using the \texttt{color} option will change the colors used by the \verb|\LCD|
+command for printing the screen using \verb|\tiscreen|. The colors are defined
+as \texttt{tiscreenfg} (foreground, i.e. font color) and \texttt{tiscreenbg}
+(background) and redefined like this:
\begin{Verbatim}
% Add this to your preamble
@@ -82,12 +97,27 @@ colors are defined as \texttt{tiscreenfg} (foreground, i.e. font color) and
\definecolor{tiscreenfg}{HTML}{FFFFFF}
\end{Verbatim}
-\part{Screen}
+\subsection{Defined colors} \label{sec:colordef}
+
+\begin{tabular}{lcl}
+ Name & Color & Usage \\ \hline
+ tiscreenfg & {\ttfamily \color{tiscreenfg}{000000}} & LCD commands \\
+ tiscreenbg & {\ttfamily \color{tiscreenbg}{5d9345}} & LCD commands \\
+ tibtngray & {\ttfamily \color{tibtngray}{494F54}} & Buttons \\
+ tibtnyellow & {\ttfamily \colorbox{tibtncaseblack}{\color{tibtnyellow}{F1E78B}}} & Buttons \\
+ tibtngreen & {\ttfamily \colorbox{tibtncaseblack}{\color{tibtngreen}{D5DE93}}} & Buttons \\
+ tibtnwhite & {\ttfamily \colorbox{tibtncaseblack}{\color{tibtnwhite}{E2E2E2}}} & Buttons \\
+ tibtnblue & {\ttfamily \colorbox{tibtncaseblack}{\color{tibtnblue}{CDE2E9}}} & Buttons \\
+ tibtncaseblack & {\ttfamily \color{tibtncaseblack}{232A32}} & Buttons \\
+\end{tabular}
+
+\clearpage\part{Screen}
+
\section{LCD size}
The default LCD size is $8 \times 16$ (the size of the TI-82 STATS). It can be
changed by redefining the variables used to determine the size of the display
-or by using the original \printcmd{LCD} command.
+or by using the original \verb|\LCD| command.
\begin{Verbatim}
% First method (For entire document)
@@ -103,68 +133,147 @@ or by using the original \printcmd{LCD} command.
|SIZE |
\end{Verbatim}
-\section{Additional defined characters} \LCDcolors{black}{white}
+\section{(Re)defined characters} \LCDcolors{black}{white}
+
\begin{center}
- \begin{tabular}{|l|l|>{\ttfamily}l|}
+ \begin{longtable}{|l|l|l|}
\multicolumn{3}{c}{\textbf{Added characters}} \\
\hline
- Name & Symbol &\textnormal{\printcmd{LCD} Code} \\
+ Name & Symbol & \verb|\LCD| \textnormal{Code} \\
\hline
- E & \LCDsymb{sciE} & \{sciE\} \\
- $\sigma$ & \LCDsymb{sigma} & \{sigma\} \\
- $x^2$ & \LCDsymb{sq} & \{sq\} \\
- $x^{-1}$ & \LCDsymb{ar} & \{ar\} \\
- $y^x$ & \LCDsymb{cx} & \{cx\} \\
- $x_1$ & \LCDsymb{sub1} & \{sub1\} \\
- $x_2$ & \LCDsymb{sub2} & \{sub2\} \\
- $x_3$ & \LCDsymb{sub3} & \{sub3\} \\
- $x_4$ & \LCDsymb{sub4} & \{sub4\} \\
- $x_5$ & \LCDsymb{sub5} & \{sub5\} \\
- $x_6$ & \LCDsymb{sub6} & \{sub6\} \\
- $\bar x$ & \LCDsymb{barx} & \{barx\} \\
- $\bar y$ & \LCDsymb{bary} & \{bary\} \\
+ E & \LCDsymb{sciE} & \verb|{sciE}| \\
+ $\sigma$ & \LCDsymb{sigma} & \verb|{sigma}| \\
+ $\Sigma$ & \LCDsymb{Sigma} & \verb|{Sigma}| \\
+ $x^2$ & \LCDsymb{sq} & \verb|{sq}| \\
+ $x^{-1}$ & \LCDsymb{ar} & \verb|{ar}| \\
+ $x^3$ & \LCDsymb{c3} & \verb|{c3}| \\
+ $y^x$ & \LCDsymb{cx} & \verb|{cx}| \\
+ $x_1$ & \LCDsymb{sub1} & \verb|{sub1}| \\
+ $x_2$ & \LCDsymb{sub2} & \verb|{sub2}| \\
+ $x_3$ & \LCDsymb{sub3} & \verb|{sub3}| \\
+ $x_4$ & \LCDsymb{sub4} & \verb|{sub4}| \\
+ $x_5$ & \LCDsymb{sub5} & \verb|{sub5}| \\
+ $x_6$ & \LCDsymb{sub6} & \verb|{sub6}| \\
+ $x_{10}$ & \LCDsymb{sub10} & \verb|{sub10}| \\
+ $\bar x$ & \LCDsymb{barx} & \verb|{barx}| \\
+ $\bar y$ & \LCDsymb{bary} & \verb|{bary}| \\
+ $-x$ & \LCDsymb{dash} & \verb|{dash}| \\
+ $\rightarrow$ & \LCDsymb{sto} & \verb|{sto}| \\
+ $\theta$ & \LCDsymb{theta} & \verb|{theta}| \\
+ $\pi$ & \LCDsymb{pi} & \verb|{pi}| \\
+ $\eta$ & \LCDsymb{eta} & \verb|{eta}| \\
+ $+$ & \LCDsymb{tick} & \verb|{tick}| \\
+ $^\circ$ & \LCDsymb{degree} & \verb|{degree}| \\
+ & \LCDsymb{square} & \verb|{square}| \\
+ & \LCDsymb{alpha} & \verb|{alpha}| \\
+ $\uparrow$ & \LCDsymb{2nd} & \verb|{2nd}| \\
+ $\geq$ & \LCDsymb{geq} & \verb|{geq}| \\
+ $\leq$ & \LCDsymb{leq} & \verb|{leq}| \\
+ $\neq$ & \LCDsymb{neq} & \verb|{neq}| \\
+ $x^3$ & \LCDsymb{c3} & \verb|{c3}| \\
+ $A^T$ & \LCDsymb{transpose} & \verb|{transpose}| \\
+ $A^r$ & \LCDsymb{upr} & \verb|{upr}| \\
+ $chi$ & \LCDsymb{chi} & \verb|{chi}| \\
+ $\triangleright$ & \LCDsymb{fwedge} & \verb|{fwedge}| \\
+ $\triangleleft$ & \LCDsymb{bwedge} & \verb|{bwedge}| \\
+ $\mathbf{N}$ & \LCDsymb{bbN} & \verb|{bbN}| \\
+ $\mathbf{/}$ & \LCDsymb{bb/} & \verb|{bb/}| \\
\hline
\multicolumn{3}{c}{\textbf{Redefined characters}} \\
\hline
- ! & \LCDsymb{!} & \{!\} \\
- \{ & \LCDsymb{lb} & \{lb\} \\
- \} & \LCDsymb{rb} & \{rb\} \\
- $[$ & \LCDsymb{rb} & \{rb\} \\
- $]$ & \LCDsymb{rb} & \{rb\} \\
- $\sqrt{x}$ & \LCDsymb{sqrt} & \{sqrt\} \\
- e & \LCDsymb{e} & e \\
- i & \LCDsymb{i} & i \\
- v & \LCDsymb{v} & v \\
- w & \LCDsymb{w} & w \\
+ ! & \LCDsymb{!} & \{!\} \\
+ \{ & \LCDsymb{lb} & \{lb\} \\
+ \} & \LCDsymb{rb} & \{rb\} \\
+ $[$ & \LCDsymb{[} & \{[\} \\
+ $]$ & \LCDsymb{]} & \{]\} \\
+ $\sqrt{x}$ & \LCDsymb{sqrt} & \{sqrt\} \\
+ e & \LCDsymb{e} & \{e\} \\
+ i & \LCDsymb{i} & \{i\} \\
+ v & \LCDsymb{v} & \{v\} \\
+ w & \LCDsymb{w} & \{w\} \\
+ Ellipses & \LCDsymb{ell} & \{ell\} \\
+ Apostrophe & \LCDsymb{'} & \{'\} \\
+ List & \LCDsymb{L} & \{L\} \\
+ Underscore & \LCDsymb{_} & \{\_\} \\
\hline
- \end{tabular}
+ \end{longtable}
\end{center}
-\part{Buttons}
-\section{Usage}
-
-Use the \printcmd{tibtn} command only prints the button and is usefull when
-needing the buttons to be displayed inline. The \printcmd{tibtnextra} takes
-extra arguments to show extra options for the button (accesed by the
-\tibtnsecond{} and \tibtnalpha{} buttons).
+\clearpage\part{Buttons}
-\begin{SideBySideExample}[xrightmargin=5.5cm]
-\tibtnextra{\tibtn[white]{tibtngray}{MATH}}{TEST}{A}
+\section{Usage}
-Lorem
-\tibtn[white]{tibtngray}{MATH}
-ipsum
-\end{SideBySideExample}
+The \verb|\tibtn<...>| commands only prints the button and are useful when
+displaying buttons inline. The \verb|\tibtnextra<...>| commands shows the extra
+functionality of the button (accessed by the \tibtnsecond{} and \tibtnalpha{}
+buttons). See secion \ref{sec:button} for defined buttons and section
+\ref{sec:buttonscustom} for how to define custom buttons.
-\section{Defined buttons}
+\section{Defined buttons} \label{sec:button}
\begin{center}
- \begin{tabular}{|>{\ttfamily}l|l|}
- \multicolumn{2}{c}{\textbf{Defined buttons}} \\ \hline
- \textnormal{Command} & Output \\ \hline
- \printcmd{tibtnmatrix} & \tibtnmatrix{} \\ \hline
- \printcmd{tibtnmatrixextra} & \tibtnmatrixextra{} \\ \hline
- \end{tabular}
+ \begin{longtable}{lrlr}
+ \verb|\tibtnsecond| & \tibtnsecond & \tibtnextrasecond & \verb|\tibtnextrasecond| \\
+ \verb|\tibtnmode| & \tibtnmode & \tibtnextramode & \verb|\tibtnextramode| \\
+ \verb|\tibtndel| & \tibtndel & \tibtnextradel & \verb|\tibtnextradel| \\
+ \verb|\tibtnalpha| & \tibtnalpha & \tibtnextraalpha & \verb|\tibtnextraalpha| \\
+ \verb|\tibtnxton| & \tibtnxton & \tibtnextraxton & \verb|\tibtnextraxton| \\
+ \verb|\tibtnstat| & \tibtnstat & \tibtnextrastat & \verb|\tibtnextrastat| \\
+ \verb|\tibtnmath| & \tibtnmath & \tibtnextramath & \verb|\tibtnextramath| \\
+ \verb|\tibtnmatrix| & \tibtnmatrix & \tibtnextramatrix & \verb|\tibtnextramatrix| \\
+ \verb|\tibtnprgm| & \tibtnprgm & \tibtnextraprgm & \verb|\tibtnextraprgm| \\
+ \verb|\tibtnvars| & \tibtnvars & \tibtnextravars & \verb|\tibtnextravars| \\
+ \verb|\tibtnclear| & \tibtnclear & \tibtnextraclear & \verb|\tibtnextraclear| \\
+ \verb|\tibtnxnone| & \tibtnxnone & \tibtnextraxnone & \verb|\tibtnextraxnone| \\
+ \verb|\tibtnsin| & \tibtnsin & \tibtnextrasin & \verb|\tibtnextrasin| \\
+ \verb|\tibtncos| & \tibtncos & \tibtnextracos & \verb|\tibtnextracos| \\
+ \verb|\tibtntan| & \tibtntan & \tibtnextratan & \verb|\tibtnextratan| \\
+ \verb|\tibtnpower| & \tibtnpower & \tibtnextrapower & \verb|\tibtnextrapower| \\
+ \verb|\tibtnxtwo| & \tibtnxtwo & \tibtnextraxtwo & \verb|\tibtnextraxtwo| \\
+ \verb|\tibtncomma| & \tibtncomma & \tibtnextracomma & \verb|\tibtnextracomma| \\
+ \verb|\tibtnleftparen| & \tibtnleftparen & \tibtnextraleftparen & \verb|\tibtnextraleftparen| \\
+ \verb|\tibtnrightparen| & \tibtnrightparen & \tibtnextrarightparen & \verb|\tibtnextrarightparen| \\
+ \verb|\tibtndiv| & \tibtndiv & \tibtnextradiv & \verb|\tibtnextradiv| \\
+ \verb|\tibtnlog| & \tibtnlog & \tibtnextralog & \verb|\tibtnextralog| \\
+ \verb|\tibtnseven| & \tibtnseven & \tibtnextraseven & \verb|\tibtnextraseven| \\
+ \verb|\tibtneight| & \tibtneight & \tibtnextraeight & \verb|\tibtnextraeight| \\
+ \verb|\tibtnnine| & \tibtnnine & \tibtnextranine & \verb|\tibtnextranine| \\
+ \verb|\tibtntimes| & \tibtntimes & \tibtnextratimes & \verb|\tibtnextratimes| \\
+ \verb|\tibtnln| & \tibtnln & \tibtnextraln & \verb|\tibtnextraln| \\
+ \verb|\tibtnfour| & \tibtnfour & \tibtnextrafour & \verb|\tibtnextrafour| \\
+ \verb|\tibtnfive| & \tibtnfive & \tibtnextrafive & \verb|\tibtnextrafive| \\
+ \verb|\tibtnsix| & \tibtnsix & \tibtnextrasix & \verb|\tibtnextrasix| \\
+ \verb|\tibtnminus| & \tibtnminus & \tibtnextraminus & \verb|\tibtnextraminus| \\
+ \verb|\tibtnsto| & \tibtnsto & \tibtnextrasto & \verb|\tibtnextrasto| \\
+ \verb|\tibtnone| & \tibtnone & \tibtnextraone & \verb|\tibtnextraone| \\
+ \verb|\tibtntwo| & \tibtntwo & \tibtnextratwo & \verb|\tibtnextratwo| \\
+ \verb|\tibtnthree| & \tibtnthree & \tibtnextrathree & \verb|\tibtnextrathree| \\
+ \verb|\tibtnplus| & \tibtnplus & \tibtnextraplus & \verb|\tibtnextraplus| \\
+ \verb|\tibtnon| & \tibtnon & \tibtnextraon & \verb|\tibtnextraon| \\
+ \verb|\tibtnzero| & \tibtnzero & \tibtnextrazero & \verb|\tibtnextrazero| \\
+ \verb|\tibtndot| & \tibtndot & \tibtnextradot & \verb|\tibtnextradot| \\
+ \verb|\tibtnneg| & \tibtnneg & \tibtnextraneg & \verb|\tibtnextraneg| \\
+ \verb|\tibtnenter| & \tibtnenter & \tibtnextraenter & \verb|\tibtnextraenter| \\
+ \end{longtable}
\end{center}
+\section{Custom buttons} \label{sec:buttonscustom}
+
+Buttons are defined using the \verb|\tibtn| and \verb|\tibtnextra|. It's often
+convenient to define a \verb|\tibtn| command then use it inside
+\verb|\tibtnextra| (See example below). See section \ref{sec:colordef} for a
+list of defined colors.
+
+\verb|\tibtn[<text color>]{<button color>}{<text>}|
+
+\verb|\tibtnextra{<middle>}{<top left>}{<top right>}|
+
+\begin{SideBySideExample}[xrightmargin=5.5cm]
+\def\tibtnfoo{\tibtn[black]{tibtnblue}{FOO}}
+\tibtnfoo{}
+
+\def\tibtnextrafoo{\tibtnextra{\tibtnfoo}{BAR}{BAZ}}
+\tibtnextrafoo
+\end{SideBySideExample}
+
\end{document}
diff --git a/macros/latex/contrib/tiscreen/tex/tiscreen.sty b/macros/latex/contrib/tiscreen/tex/tiscreen.sty
index d4219f1eb7..adf8f48f71 100644
--- a/macros/latex/contrib/tiscreen/tex/tiscreen.sty
+++ b/macros/latex/contrib/tiscreen/tex/tiscreen.sty
@@ -4,7 +4,7 @@
% version the license is at: http://www.latex-project.org/lppl.txt
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tiscreen}[2021/09/18 Ti calculator screen]
+\ProvidesPackage{tiscreen}[2021/12/31 Ti calculator screen]
\def\tiscreenX{16}
\def\tiscreenY{8}
@@ -13,8 +13,18 @@
\RequirePackage{tikz}
\RequirePackage{tcolorbox}
\RequirePackage{array}
+\RequirePackage{xcolor}
+\RequirePackage{tipa}
+\RequirePackage{textgreek}
+\RequirePackage{wasysym}
+
+%
+% SCREEN CHARACTERS
+%
-% Define screen characters
+% TODO add reverse alpha and reverse arrow
+
+% Define characters
\DefineLCDchar{barx}{11111000001000101010001000101010001}
\DefineLCDchar{bary}{11111000001000110001011110000101110}
\DefineLCDchar{ar}{00011000011100100001000010000000000}
@@ -27,7 +37,32 @@
\DefineLCDchar{sub4}{00000000000100001010011100001000010}
\DefineLCDchar{sub5}{00000000000111001000011000001001100}
\DefineLCDchar{sub6}{00000000000011001000011100101001110}
+\DefineLCDchar{sub10}{00000000001011110101101011010110111}
\DefineLCDchar{cx}{00101000100010100000000000000000000}
+\DefineLCDchar{dash}{00000000000011100000000000000000000}
+\DefineLCDchar{sto}{00000001000001011111000100010000000}
+\DefineLCDchar{theta}{00110010011000111111100011001001100}
+\DefineLCDchar{pi}{00000000001111101010010100101010011}
+\DefineLCDchar{tick}{00000000000000000100011100010000000}
+\DefineLCDchar{degree}{01100100101001001100000000000000000}
+\DefineLCDchar{square}{00000000000000001110010100111000000}
+\DefineLCDchar{alpha}{11111110111010110001101011010111111}
+\DefineLCDchar{2nd}{11111110111000101010110111101111011}
+\DefineLCDchar{geq}{10000011000001101100100000000011111}
+\DefineLCDchar{leq}{00001001101100000110000010000011111}
+\DefineLCDchar{neq}{00010000101111100100111110100001000}
+\DefineLCDchar{c3}{01100000100010000010011000000000000}
+\DefineLCDchar{transpose}{01110001000010000100001000000000000}
+\DefineLCDchar{upr}{10110110001000010000000000000000000}
+\DefineLCDchar{chi}{10000010010101000100010101001000001}
+\DefineLCDchar{fwedge}{00000010000110001110011000100000000}
+\DefineLCDchar{bwedge}{00000000010001100111000110000100000}
+\DefineLCDchar{upwedge}{000000000000100010101000111111}
+\DefineLCDchar{Fcdf}{11111100011010011100101001000010000}
+\DefineLCDchar{Sigma}{11111010000010000010001000100011111}
+\DefineLCDchar{eta}{00000000001011001001010011001010010}
+\DefineLCDchar{bbN}{10001110011110111111101111001110001}
+\DefineLCDchar{bb/}{00000000010001100110011001100010000}
% Redefine screen characters
\DefineLCDchar{sqrt}{00111001000010000100101000110000100}
\DefineLCDchar{!}{00100001000010000100000000010000100}
@@ -39,8 +74,15 @@
\DefineLCDchar{]}{01100001000010000100001000010001100}
\DefineLCDchar{lb}{00011001000010001000001000010000011}
\DefineLCDchar{rb}{11000001000010000010001000010011000}
+\DefineLCDchar{ell}{00000000000000000000000000000010101}
+\DefineLCDchar{'}{00100001000000000000000000000000000}
+\DefineLCDchar{L}{00000000000010000100001000010000111}
+\DefineLCDchar{_}{00000000000000000000000000000011111}
+
+%
+% COLORS
+%
-\RequirePackage{xcolor}
% Screen colors
\definecolor{tiscreenfg}{HTML}{000000}
\definecolor{tiscreenbg}{HTML}{5d9345}
@@ -56,11 +98,14 @@
\DeclareOption*{\PackageWarning{tiscreen}{Unknown ‘\CurrentOption’}}
\ProcessOptions\relax
-% Screen commands
+%
+% COMMANDS
+%
+
\newcommand{\tiscreen}{\LCD{\tiscreenY}{\tiscreenX}}
-% Button commands
\newcommand{\tibtn}[3][black]{\tikz{\bfseries\tiny\sffamily \node[fill=#2, draw, rounded corners, minimum height=2.5em, minimum width=4.5em, align=center] {\textcolor{#1}{#3}};}}
+
\newcommand{\tibtnextra}[3]{%
\tcbox[colback=tibtncaseblack,size=small]{%
\begin{tabular}{l@{}r}%
@@ -71,9 +116,93 @@
}%
}
-% Button definitions
-\def\tibtnsecond{\tibtn{tibtnyellow}{2nd}}
-\def\tibtnalpha{\tibtn{tibtngreen}{ALPHA}}
+%
+% BUTTON DEFINITIONS
+%
-\def\tibtnmatrix{\tibtn[white]{tibtngray}{MATRX}}
-\def\tibtnmatrixextra{\tibtnextra{\tibtnmatrix}{ANGLE}{B}}
+% Special
+\def\tibtnalpha{\tibtn{tibtngreen}{ALPHA}} % ALPHA
+\def\tibtnsecond{\tibtn{tibtnyellow}{2nd}} % EXTRA
+\def\tibtnenter{\tibtn[black]{tibtnblue}{ENTER}} % ENTER
+\def\tibtnextraalpha{\tibtnextra{\tibtnalpha}{A-LOCK}{}} % ALPHA
+\def\tibtnextrasecond{\tibtnextra{\tibtnsecond}{}{}} % EXTRA
+\def\tibtnextraenter{\tibtnextra{\tibtnenter}{ENTRY\hspace{0.25ex}}{SOLVE}} % ENTER
+% Operators
+\def\tibtndiv {\tibtn[black]{tibtnblue}{$\div$}} % division
+\def\tibtntimes{\tibtn[black]{tibtnblue}{\scriptsize\texttimes}} % times
+\def\tibtnminus{\tibtn[black]{tibtnblue}{\footnotesize --}} % minus
+\def\tibtnplus {\tibtn[black]{tibtnblue}{\footnotesize +}} % plus
+\def\tibtnextradiv {\tibtnextra{\tibtndiv} {e} {M}} % division
+\def\tibtnextratimes{\tibtnextra{\tibtntimes}{[} {R}} % times
+\def\tibtnextraminus{\tibtnextra{\tibtnminus}{]} {W}} % minus
+\def\tibtnextraplus {\tibtnextra{\tibtnplus} {MEM}{!!}} % plus
+% Numbers
+\def\tibtnzero{\tibtn[black]{tibtnwhite} {\scriptsize 0}} % 0
+\def\tibtnone {\tibtn[black]{tibtnwhite}{\scriptsize 1}} % 1
+\def\tibtntwo {\tibtn[black]{tibtnwhite}{\scriptsize 2}} % 2
+\def\tibtnthree{\tibtn[black]{tibtnwhite}{\scriptsize 3}} % 3
+\def\tibtnfour {\tibtn[black]{tibtnwhite}{\scriptsize 4}} % 4
+\def\tibtnfive {\tibtn[black]{tibtnwhite}{\scriptsize 5}} % 5
+\def\tibtnsix {\tibtn[black]{tibtnwhite}{\scriptsize 6}} % 6
+\def\tibtnseven{\tibtn[black]{tibtnwhite}{\scriptsize 7}} % 7
+\def\tibtneight{\tibtn[black]{tibtnwhite}{\scriptsize 8}} % 8
+\def\tibtnnine {\tibtn[black]{tibtnwhite}{\scriptsize 9}} % 9
+\def\tibtnextrazero {\tibtnextra{\tibtnzero} {CATALOG}{\large \textvisiblespace}} % 0
+\def\tibtnextraone {\tibtnextra{\tibtnone} {L1} {Y}} % 1
+\def\tibtnextratwo {\tibtnextra{\tibtntwo} {L2} {Z}} % 2
+\def\tibtnextrathree{\tibtnextra{\tibtnthree}{L3} {\texttheta}} % 3
+\def\tibtnextrafour {\tibtnextra{\tibtnfour} {L4} {T}} % 4
+\def\tibtnextrafive {\tibtnextra{\tibtnfive} {L5} {U}} % 5
+\def\tibtnextrasix {\tibtnextra{\tibtnsix} {L6} {V}} % 6
+\def\tibtnextraseven{\tibtnextra{\tibtnseven}{u} {O}} % 7
+\def\tibtnextraeight{\tibtnextra{\tibtneight}{v} {P}} % 8
+\def\tibtnextranine {\tibtnextra{\tibtnnine} {w} {Q}} % 9
+% Misc
+\def\tibtnmode {\tibtn[white]{tibtngray}{MODE}} % MODE
+\def\tibtndel {\tibtn[white]{tibtngray}{DEL}} % DEL
+\def\tibtnxton {\tibtn[white]{tibtngray}{X,T,\texttheta,n}} % X,T,ϴ,n
+\def\tibtnstat {\tibtn[white]{tibtngray}{STAT}} % STAT
+\def\tibtnmath {\tibtn[white]{tibtngray}{MATH}} % MATH
+\def\tibtnmatrix {\tibtn[white]{tibtngray}{MATRX}} % MATRIX
+\def\tibtnprgm {\tibtn[white]{tibtngray}{PRGM}} % PRGM
+\def\tibtnvars {\tibtn[white]{tibtngray}{VARS}} % VARS
+\def\tibtnclear {\tibtn[white]{tibtngray}{CLEAR}} % CLEAR
+\def\tibtnxnone {\tibtn[white]{tibtngray}{x\textsuperscript{-1}}} % x^-1
+\def\tibtnsin {\tibtn[white]{tibtngray}{SIN}} % SIN
+\def\tibtncos {\tibtn[white]{tibtngray}{COS}} % COS
+\def\tibtntan {\tibtn[white]{tibtngray}{TAN}} % TAN
+\def\tibtnpower {\tibtn[white]{tibtngray}{$\wedge$}} % ^
+\def\tibtnxtwo {\tibtn[white]{tibtngray}{x\textsuperscript{2}}} % x^2
+\def\tibtncomma {\tibtn[white]{tibtngray}{\large ,}} % comma
+\def\tibtnleftparen {\tibtn[white]{tibtngray}{(}} % left parenthesis
+\def\tibtnrightparen{\tibtn[white]{tibtngray}{)}} % right parenthesis
+\def\tibtnlog {\tibtn[white]{tibtngray}{LOG}} % log
+\def\tibtnln {\tibtn[white]{tibtngray}{LN}} % LN
+\def\tibtnsto {\tibtn[white]{tibtngray}{STO\RIGHTarrow}} % STO
+\def\tibtnon {\tibtn[white]{tibtngray}{ON}} % ON
+\def\tibtndot {\tibtn[black]{tibtnwhite}{\huge $\cdot$}} % dot
+\def\tibtnneg {\tibtn[black]{tibtnwhite}{(---)}} % negative
+\def\tibtnextramode {\tibtnextra{\tibtnmode} {QUIT}{}} % MODE
+\def\tibtnextradel {\tibtnextra{\tibtndel} {INS}{}} % DEL
+\def\tibtnextraxton {\tibtnextra{\tibtnxton} {LINK}{}} % X,T,ϴ,n
+\def\tibtnextrastat {\tibtnextra{\tibtnstat} {LIST}{}} % STAT
+\def\tibtnextramath {\tibtnextra{\tibtnmath} {TEST}{A}} % MATH
+\def\tibtnextramatrix {\tibtnextra{\tibtnmatrix} {ANGLE}{B}} % MATRIX
+\def\tibtnextraprgm {\tibtnextra{\tibtnprgm} {DRAW}{C}} % PRGM
+\def\tibtnextravars {\tibtnextra{\tibtnvars} {DISTR}{}} % VARS
+\def\tibtnextraclear {\tibtnextra{\tibtnclear} {}{}} % CLEAR
+\def\tibtnextraxnone {\tibtnextra{\tibtnxnone} {FINANCE\hspace{1ex}}{D}} % x^-1
+\def\tibtnextrasin {\tibtnextra{\tibtnsin} {SIN\textsuperscript{-1}}{E}} % SIN
+\def\tibtnextracos {\tibtnextra{\tibtncos} {COS\textsuperscript{-1}}{F}} % COS
+\def\tibtnextratan {\tibtnextra{\tibtntan} {TAN\textsuperscript{-1}}{G}} % TAN
+\def\tibtnextrapower {\tibtnextra{\tibtnpower} {\scriptsize\mdseries\textpi}{H}} % ^
+\def\tibtnextraxtwo {\tibtnextra{\tibtnxtwo} {$\sqrt{\phantom{x}}$}{I}} % x^2
+\def\tibtnextracomma {\tibtnextra{\tibtncomma} {EE}{J}} % comma
+\def\tibtnextraleftparen {\tibtnextra{\tibtnleftparen} {\{}{K}} % left parenthesis
+\def\tibtnextrarightparen{\tibtnextra{\tibtnrightparen}{\}}{L}} % right parenthesis
+\def\tibtnextralog {\tibtnextra{\tibtnlog} {10$^x$}{N}} % LOG
+\def\tibtnextraln {\tibtnextra{\tibtnln} {e$^x$}{S}} % LN
+\def\tibtnextrasto {\tibtnextra{\tibtnsto} {RCL}{X}} % STO
+\def\tibtnextraon {\tibtnextra{\tibtnon} {OFF}{}} % ON
+\def\tibtnextradot {\tibtnextra{\tibtndot} {\scriptsize $i$}{:}} % dot
+\def\tibtnextraneg {\tibtnextra{\tibtnneg} {ANS}{?}} % negative
diff --git a/macros/latex/contrib/verifiche/verifiche-example.pdf b/macros/latex/contrib/verifiche/verifiche-example.pdf
index 8200bf65e7..72d381a5b3 100644
--- a/macros/latex/contrib/verifiche/verifiche-example.pdf
+++ b/macros/latex/contrib/verifiche/verifiche-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/verifiche/verifiche.dtx b/macros/latex/contrib/verifiche/verifiche.dtx
index a17c536143..4172a0771f 100644
--- a/macros/latex/contrib/verifiche/verifiche.dtx
+++ b/macros/latex/contrib/verifiche/verifiche.dtx
@@ -16,7 +16,7 @@
%
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}
-%<package>\ProvidesPackage{verifiche} [2022/02/10 v4.3 .dtx verifiche file]
+%<package>\ProvidesPackage{verifiche} [2022/03/10 v4.4 .dtx verifiche file]
%<*driver>
\documentclass{ltxdoc}
\usepackage[utf8]{inputenc}
@@ -66,7 +66,7 @@
%</driver>
% \fi
%
-% \CheckSum{801}
+% \CheckSum{820}
% \changes{v1.0}{2020/06/14}{Initial version.}
% \changes{v2.0}{2020/06/26}{Better performance in exercise environment.}
% \changes{v2.1}{2020/06/30}{Introduced closedquestionitem to control |item| symbol.}
@@ -76,6 +76,7 @@
% \changes{v4.1}{2021/02/16}{Introduce ptrulerlength to change the aspect of the exercise score.}
% \changes{v4.2}{2021/08/18}{Solved truefalse issue in solutionsmode. Add noexercisept global option to hide the score of each exercise.}
% \changes{v4.3}{2022/02/10}{Move |parindent{0pt}| inside the environment.}
+% \changes{v4.4}{2022/03/10}{Minor update. Fixed labels issues.}
% \GetFileInfo{verifiche.sty}
% \DoNotIndex{\newcommand,\newenvironment,\def,\begin,\end,\par}
% \DoNotIndex{\DeclareOption,\ExecuteOptions,\ProcessOptions,\RequirePackage}
@@ -1067,40 +1068,50 @@ dell'esercizio somministrato
% \end{macrocode}
%
%\subsection{Labels}
+%\iffalse
+%%labels
+%\fi
%Some labels are define as a variable in order to leave the user the possibility of customization the predefine texts.
-% \begin{macrocode}
-\newcommand{\@durationlabeldefault}{Time:}%
-\newcommand{\@asyearlabeldefault}{School year}%
-\newcommand{\headercandidatenamelabel}{Student name}%
-\newcommand{\headerclasslabel}{Class}%
-\newcommand{\headerdatelabel}{Date}%
-\newcommand{\exerciselabel}{Exercise}%
-\newcommand{\solutionlabel}{Solution}%
-% \end{macrocode}
%If the package \textsf{babel} or \textsf{polyglossia} is loaded with the italian language specify, than the predefine labels are redefine:
% \begin{macrocode}
\@ifpackageloaded{babel}{%
\addto\captionsitalian{%
- \renewcommand{\@durationlabeldefault}{Tempo della prova:}%
- \renewcommand{\@asyearlabeldefault}{Anno scolastico}%
- \renewcommand{\headercandidatenamelabel}{Nome e Cognome}%
- \renewcommand{\headerclasslabel}{Classe}%
- \renewcommand{\headerdatelabel}{Data}%
- \renewcommand{\exerciselabel}{Quesito}%
- \renewcommand{\solutionlabel}{Soluzione}%
+ \def\@verifiche@durationlabeldefault{Tempo della prova:}%
+ \def\@verifiche@asyearlabeldefault{Anno scolastico}%
+ \def\@verifiche@headercandidatenamelabel{Nome e Cognome}%
+ \def\@verifiche@headerclasslabel{Classe}%
+ \def\@verifichhe@headerdatelabel{Data}%
+ \def\@verifiche@exerciselabel{Quesito}%
+ \def\@verifiche@solutionlabel{Soluzione}%
}}{%
\@ifpackageloaded{polyglossia}{%
\addto\captionsitalian{%
- \renewcommand{\@durationlabeldefault}{Tempo della prova:}%
- \renewcommand{\@asyearlabeldefault}{Anno scolastico}%
- \renewcommand{\headercandidatenamelabel}{Nome e Cognome}%
- \renewcommand{\headerclasslabel}{Classe}%
- \renewcommand{\headerdatelabel}{Data}%
- \renewcommand{\exerciselabel}{Quesito}%
- \renewcommand{\solutionlabel}{Soluzione}%
- }}{}
- }%
+ \def\@verifiche@durationlabeldefault{Tempo della prova:}%
+ \def\@verifiche@asyearlabeldefault{Anno scolastico}%
+ \def\@verifiche@headercandidatenamelabel{Nome e Cognome}%
+ \def\@verifiche@headerclasslabel{Classe}%
+ \def\@verifichhe@headerdatelabel{Data}%
+ \def\@verifiche@exerciselabel{Quesito}%
+ \def\@verifiche@solutionlabel{Soluzione}%
+ }}{
+ \def\@verifiche@durationlabeldefault{Time:}%
+ \def\@verifiche@asyearlabeldefault{School year}%
+ \def\@verifiche@headercandidatenamelabel{Name and Surname}%
+ \def\@verifiche@headerclasslabel{Class}%
+ \def\@verifichhe@headerdatelabel{Date}%
+ \def\@verifiche@exerciselabel{Exercise}%
+ \def\@verifiche@solutionlabel{Solution}%
+ }}%
% \end{macrocode}
+% \begin{macrocode}
+\newcommand{\@durationlabeldefault}{\@verifiche@durationlabeldefault}%
+\newcommand{\@asyearlabeldefault}{\@verifiche@asyearlabeldefault}%
+\newcommand{\headercandidatenamelabel}{\@verifiche@headercandidatenamelabel}%
+\newcommand{\headerclasslabel}{\@verifiche@headerclasslabel}%
+\newcommand{\headerdatelabel}{\@verifichhe@headerdatelabel}%
+\newcommand{\exerciselabel}{\@verifiche@exerciselabel}%
+\newcommand{\solutionlabel}{\@verifiche@solutionlabel}%
+% \end{macrocode}
%\subsection{Macro and environment}
%\iffalse
%%macro and environment
@@ -1156,18 +1167,23 @@ dell'esercizio somministrato
\hspace*{\fill}\@durationpreamble\space\bfseries #1\hspace*{\fill}}
% \end{macrocode}
% \begin{macrocode}
-\newcommand{\@header@candidatename}{\noindent\headercandidatenamelabel\space\underline{\hspace{\candidatenamerulerlength}}}
-\newcommand{\@header@class}{\headerclasslabel\space\underline{\hspace{\classrulerlength}}}
-\newcommand{\@header@date}{\headerdatelabel\space\underline{\hspace{\daterulerlength}}}
-\newcommand{\@header}{\@header@candidatename\hfill\@header@class\hfill\@header@date}
-% \end{macrocode}
-% \begin{macrocode}
-\newcommand{\eserciziolabel}{%
- Quesito}
+\newcommand{\@header@candidatename}{%
+ \noindent\headercandidatenamelabel%
+ \space\underline{\hspace{\candidatenamerulerlength}}}
+\newcommand{\@header@class}{%
+ \headerclasslabel\space%
+ \underline{\hspace{\classrulerlength}}}
+\newcommand{\@header@date}{%
+ \headerdatelabel\space%
+ \underline{\hspace{\daterulerlength}}}
+\newcommand{\@header}{%
+ \@header@candidatename\hfill\@header@class\hfill\@header@date}
% \end{macrocode}
% \begin{macrocode}
\newcommand{\solutionfont}{%
- \footnotesize\ifsolutionscolor\color{\solutionscolor}\fi\itshape}
+ \footnotesize%
+ \ifsolutionscolor\color{\solutionscolor}\fi%
+ \itshape}
% \end{macrocode}
% \begin{macrocode}
\newcommand{\diffsymb}{%
@@ -1181,7 +1197,8 @@ dell'esercizio somministrato
%%pt prefix
%\fi
% \begin{macrocode}
-\newcommand{\@ptprefix}{\underline{\hspace{\ptrulerlength}}/}
+\newcommand{\@ptprefix}{%
+ \underline{\hspace{\ptrulerlength}}/}
\newcommand{\ptprefix}[1]{%
\renewcommand{\@ptprefix}{#1}}
% \end{macrocode}
@@ -1307,13 +1324,19 @@ dell'esercizio somministrato
\define@key{esercizio}{pt}[none]{
\ifshowexercisept%
\def\pointes{#1}%
- \def\espoint{\hfill\@ptprefix\@lpt@delimiter\pointes\space\@useptlabel{\pointes}\@rpt@delimiter}
+ \def\espoint{%
+ \hfill\@ptprefix\@lpt@delimiter%
+ \pointes\space\@useptlabel{\pointes}%
+ \@rpt@delimiter}
\showmarginexercisetrue
\fi}%
\define@key{esercizio}{partialpt}[none]{%
\ifshowexercisept%
\def\@totalpartialpt{\convertreftonum{ptes@\theexercisenumber}}%
- \def\sumpartialpt{\@ptprefix\@lpt@delimiter\@totalpartialpt\space\@useptlabel{\@totalpartialpt}\@rpt@delimiter}%
+ \def\sumpartialpt{%
+ \@ptprefix\@lpt@delimiter%
+ \@totalpartialpt\space\@useptlabel{\@totalpartialpt}%
+ \@rpt@delimiter}%
\showmarginexercisetrue
\fi}%
% \end{macrocode}
@@ -1402,7 +1425,9 @@ dell'esercizio somministrato
\NewDocumentCommand{\partialpt}{m}{%
\ifshowexercisept%
\leavevmode\reversemarginpar\marginpar{%
- \hfill\@partialptprefix\@lpartialpt@delimiter#1\space\@usepartialptlabel{#1}\@rpartialpt@delimiter%
+ \hfill\@partialptprefix%
+ \@lpartialpt@delimiter#1\space\@usepartialptlabel{#1}%
+ \@rpartialpt@delimiter%
\addtocounter{partialpoints}{#1}}%
\fi}%
% \end{macrocode}
@@ -1537,8 +1562,12 @@ dell'esercizio somministrato
\begin{tikzpicture}%
\draw[step=\spacedim, \openquestionlinecolor]%
(0,0) grid (\openquestionwidth,-\openquestionheight);%
- \node[anchor=base west, align=left, text width=\openquestionwidth,%
- inner sep=0cm, font=\solutionfont, execute at begin node=\setlength{\baselineskip}{\spacedim}]%
+ \node[%
+ anchor=base west,%
+ align=left, text width=\openquestionwidth,%
+ inner sep=0cm,%
+ font=\solutionfont,%
+ execute at begin node=\setlength{\baselineskip}{\spacedim}]%
at (0, -\spacedim){\ifsol#2\fi};
\end{tikzpicture}%
\else% if lined open question
@@ -1546,8 +1575,11 @@ dell'esercizio somministrato
\pgfmathparse{int(\openquestionheight/\spacedim)}%
\foreach \y in {1, ..., \pgfmathresult}%
\draw[\openquestionlinecolor] (0, -\y*\spacedim) -- +(\openquestionwidth,0);%
- \node[anchor=base west,align=left, text width=\openquestionwidth,%
- inner sep=0cm, font=\solutionfont, execute at begin node=\setlength{\baselineskip}{\spacedim}]%
+ \node[%
+ anchor=base west,align=left,%
+ text width=\openquestionwidth,%
+ inner sep=0cm, font=\solutionfont,%
+ execute at begin node=\setlength{\baselineskip}{\spacedim}]%
at (0, -\spacedim){\ifsol#2\fi};%
\end{tikzpicture}%
\fi%
diff --git a/macros/latex/contrib/verifiche/verifiche.pdf b/macros/latex/contrib/verifiche/verifiche.pdf
index 78fa0d6757..584d9276ed 100644
--- a/macros/latex/contrib/verifiche/verifiche.pdf
+++ b/macros/latex/contrib/verifiche/verifiche.pdf
Binary files differ
diff --git a/macros/latex/contrib/xsavebox/ChangeLog b/macros/latex/contrib/xsavebox/ChangeLog
index b2097c7004..040cc92a78 100644
--- a/macros/latex/contrib/xsavebox/ChangeLog
+++ b/macros/latex/contrib/xsavebox/ChangeLog
@@ -1,3 +1,7 @@
+2022-03-10
+ * v0.17
+ * fix: content saving optimised
+
2020-03-04
* v0.16
* fix: dvisvgm-special `bbox' option `transform' added
@@ -9,7 +13,7 @@
2019-08-13
* v0.14
* fix: existing \theXXX macros, such as LaTeX counters, could accidentally
- be overwritten
+ be overwritten
2019-06-24
* v0.13
diff --git a/macros/latex/contrib/xsavebox/xsavebox.pdf b/macros/latex/contrib/xsavebox/xsavebox.pdf
index 9f8d52ba89..39e3051880 100644
--- a/macros/latex/contrib/xsavebox/xsavebox.pdf
+++ b/macros/latex/contrib/xsavebox/xsavebox.pdf
Binary files differ
diff --git a/macros/latex/contrib/xsavebox/xsavebox.sty b/macros/latex/contrib/xsavebox/xsavebox.sty
index 2f3fac684f..36aeaaa1d0 100644
--- a/macros/latex/contrib/xsavebox/xsavebox.sty
+++ b/macros/latex/contrib/xsavebox/xsavebox.sty
@@ -45,11 +45,11 @@
%
% The Current Maintainer of this work is A. Grahn.
-\RequirePackage{xparse}
+\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\RequirePackage{l3keys2e}
-\def\g@xsb@version@tl{0.16}
-\def\g@xsb@date@tl{2020/03/04}
+\def\g@xsb@version@tl{0.17}
+\def\g@xsb@date@tl{2022/03/10}
\ProvidesExplPackage{xsavebox}{\g@xsb@date@tl}{\g@xsb@version@tl}
{saveboxes for repeating content without code replication}
@@ -149,24 +149,21 @@
\DeclareDocumentCommand\xsavebox{smO{\width}O{c}+m}{
\xsb_check_box_name:n{#2}
\group_begin:
- \tl_set:Nn\l_xsb_content_grouped_tl{
- \group_begin:
- \cs_set:Nn\ocgxii_beginocg:nnnn{}\cs_set:Nn\ocgxii_endocg:{}
- #5
- \group_end:
- }
\xsb_push_props: %new, empty properties dict
\xsb_beginLTR:
- \IfBooleanTF{#1}{
- %later colour injection possible (pdfTeX, LuaTeX)
- \hbox_set:Nn\l_xsb_raw_box{\l_xsb_content_grouped_tl} %raw content
- \hbox_set:Nn\l_xsb_box{ %content re-aligned
- \makebox[#3][#4]{\l_xsb_content_grouped_tl}
+ \hbox_set:Nn\l_xsb_raw_box{ %raw content
+ \bool_lazy_and:nnF{
+ \tl_if_exist_p:c{xsb@\int_use:N\g_xsb_id_int}
+ }{
+ \bool_if_p:c{c_\tl_use:c{xsb@\int_use:N\g_xsb_id_int}_bool}
+ }{ %prevent unused boxes from creating OCGs/OCMDs
+ \DeclareDocumentEnvironment{ocg}{O{}mmm}{\ignorespaces}{\unskip}
+ \DeclareDocumentEnvironment{ocmd}{O{}m}{\ignorespaces}{\unskip}
}
- }{
- %the LaTeX way (no colour injection)
- \sbox\l_xsb_raw_box{\l_xsb_content_grouped_tl} %raw content
- \savebox\l_xsb_box[#3][#4]{\l_xsb_content_grouped_tl} %re-aligned
+ #5
+ }
+ \hbox_set:Nn\l_xsb_box{ %content re-aligned
+ \makebox[#3][#4]{\hbox_unpack:N\l_xsb_raw_box}
}
%process one of \l_xsb_raw_box or \l_xsb_box
\dim_compare:nTF{\box_wd:N\l_xsb_raw_box>\box_wd:N\l_xsb_box}{
@@ -176,31 +173,25 @@
%for colour injection
\hbox_set:Nn\l_xsb_box{
\makebox[\box_wd:N\l_xsb_raw_box][l]{
- \makebox[#3][s]{#5}
+ \makebox[#3][s]{\hbox_unpack:N\l_xsb_raw_box}
}
}
}{
%no colour injection
\savebox\l_xsb_box[\box_wd:N\l_xsb_raw_box][l]{
- \makebox[#3][s]{#5}
+ \makebox[#3][s]{\hbox_unpack:N\l_xsb_raw_box}
}
}
\xsb_process_box:nnnN{#2}{#3}{#4}\l_xsb_box
}{ % raw content
- \IfBooleanTF{#1}{
- \hbox_set:Nn\l_xsb_raw_box{#5}
- }{
- \sbox\l_xsb_raw_box{#5}
+ \IfBooleanF{#1}{
+ \sbox\l_xsb_raw_box{\hbox_unpack:N\l_xsb_raw_box}
}
\xsb_process_box:nnnN{#2}{#3}{#4}\l_xsb_raw_box
}
}{
- \IfBooleanTF{#1}{
- \hbox_set:Nn\l_xsb_box{ %content re-aligned
- \makebox[#3][#4]{#5}
- }
- }{
- \savebox\l_xsb_box[#3][#4]{#5} %re-aligned
+ \IfBooleanF{#1}{
+ \savebox\l_xsb_box[#3][#4]{\hbox_unpack:N\l_xsb_raw_box}
}
\xsb_process_box:nnnN{#2}{\width}{c}\l_xsb_box
}
@@ -219,7 +210,7 @@
\DeclareDocumentEnvironment{xlrbox*}{m}{
\xsb_check_box_name:n{#1}
- \xsb_xlrbox_star:
+ \xsb_xlrbox:
}{
\xsb_endxlrbox_star:n{#1}
}
@@ -243,27 +234,27 @@
\group_begin:
\xsb_push_props: %new, empty properties dict
\xsb_beginLTR:
- \hbox_set:Nw\l_xsb_box\group_begin:
+ \hbox_set:Nw\l_xsb_box
+ \bool_lazy_and:nnF{ %prevent unused boxes from creating OCGs/OCMDs
+ \tl_if_exist_p:c{xsb@\int_use:N\g_xsb_id_int}
+ }{
+ \bool_if_p:c{c_\tl_use:c{xsb@\int_use:N\g_xsb_id_int}_bool}
+ }{
+ \DeclareDocumentEnvironment{ocg}{O{}mmm}{\ignorespaces}{\unskip}
+ \DeclareDocumentEnvironment{ocmd}{O{}m}{\ignorespaces}{\unskip}
+ }
\ignorespaces
}
\cs_new_protected_nopar:Nn\xsb_endxlrbox:n{
\unskip
- \group_end:\hbox_set_end:
+ \hbox_set_end:
\sbox\l_xsb_box{\hbox_unpack_drop:N\l_xsb_box}
\xsb_process_box:nnnN{#1}{\width}{c}\l_xsb_box
\xsb_endLTR:
\group_end:
}
-\cs_new_protected:Nn\xsb_xlrbox_star:{
- \group_begin:
- \xsb_push_props: %new, empty properties dict
- \xsb_beginLTR:
- \hbox_set:Nw\l_xsb_box
- \ignorespaces
-}
-
\cs_new_protected_nopar:Nn\xsb_endxlrbox_star:n{
\unskip
\hbox_set_end:
diff --git a/macros/latex/contrib/xsavebox/xsavebox.tex b/macros/latex/contrib/xsavebox/xsavebox.tex
index b7d437cfb0..0c1cbc6f68 100644
--- a/macros/latex/contrib/xsavebox/xsavebox.tex
+++ b/macros/latex/contrib/xsavebox/xsavebox.tex
@@ -4,6 +4,14 @@
% http://mirrors.ctan.org/macros/latex/base/lppl.txt
% for the details of that license.
%
+\listfiles
+%%%%%%% pdfmanagement-testphase %%%%%%
+\RequirePackage{pdfmanagement-testphase} % load the package
+\DeclareDocumentMetadata % activates the PDF management interface
+{
+ %uncompress,
+}
+%%%%%% /pdfmanagement-testphase %%%%%%
\documentclass[a4paper]{article}
\frenchspacing
\usepackage[UKenglish]{babel}
@@ -33,12 +41,7 @@
pdfsubject={Documentation},
pdfauthor={Alexander Grahn},
pdfkeywords={PDF features, XObject, savebox, LaTeX, dvips, repeated content, repeated graphics, eps, PostScript, ps2pdf, XeLaTeX, pdfLaTeX, LuaLaTeX, dvipdfmx, dvisvgm},
- citebordercolor={0 0 1},
- filebordercolor={0 0 1},
- linkbordercolor={0 0 1},
- menubordercolor={0 0 1},
- pagebordercolor={0 0 1},
- urlbordercolor={0 0 1},
+ allcolors=blue,
% pdfpagelayout=SinglePage
}