summaryrefslogtreecommitdiff
path: root/macros/latex/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r--macros/latex/contrib/iexec/iexec.dtx90
-rw-r--r--macros/latex/contrib/iexec/iexec.pdfbin324986 -> 326148 bytes
-rw-r--r--macros/latex/contrib/pangram/README.md15
-rw-r--r--macros/latex/contrib/pangram/pangram.dtx430
-rw-r--r--macros/latex/contrib/pangram/pangram.ins91
-rw-r--r--macros/latex/contrib/pangram/pangram.pdfbin0 -> 100389 bytes
6 files changed, 596 insertions, 30 deletions
diff --git a/macros/latex/contrib/iexec/iexec.dtx b/macros/latex/contrib/iexec/iexec.dtx
index bdcb5609c9..30f44bdbf9 100644
--- a/macros/latex/contrib/iexec/iexec.dtx
+++ b/macros/latex/contrib/iexec/iexec.dtx
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{iexec}
%<*package>
-[2022-10-21 0.10.1 Inputable Shell Executions]
+[2022-10-22 0.11.0 Inputable Shell Executions]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -93,15 +93,16 @@
% \end{document}
% \end{docshot}
-% \DescribeMacro{\iexec} The only command provided by this package is |\iexec| \oarg{options} \marg{cmd}.
+% \DescribeMacro{\iexec} The only command provided by this package is
+% |\iexec| \oarg{options} \marg{cmd}.
% Its only mandatory argument \meta{cmd} is the command to be executed
-% through the terminal shell (bash, or whatever is set as the default one
-% on your user console).
+% through the terminal shell (|bash|, or whatever is set as the default one
+% in your console).
% You have to run |pdflatex| (or just |latex|)
% with the |--shell-escape| flag
-% in order to let |shellesc| (the package we use)
-% to execute your shell command.
+% in order to let \href{https://ctan.org/pkg/shellesc}{shellesc}
+% execute your shell command.
% \section{Options}
@@ -150,6 +151,19 @@ Today is \iexec[stderr=my.txt]{broken-command}.
%</verb>
%\fi
+% \DescribeMacro{exit}
+% The exit code of the command it saved into a file. You can change the name of it
+% using |exit| option:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+Today is \iexec[exit=code.txt]{./broken-command.sh}.
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
% \DescribeMacro{trace}
% The file specified will be deleted right after its usage. If you don't
% want this to happen, use |trace| package option: all files will remain
@@ -246,14 +260,17 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
% \end{macrocode}
% Then, we prepare to parse the options of |\iexec| command:
-% \changes{v0.10.0}{2022/10/19}{The option "ignore" suppresses the checking of "iexec.ret" value.}
-% \changes{v0.7.0}{2022/09/25}{The option "append" was introduced --- if it's turned on, stdout will be appended to the file, instead of rewriting it (this is how it was before).}
-% \changes{v0.7.0}{2022/09/25}{The option "log" was introduced, to turn on log/debug messages in TeX log (they were all visible always, which was sometimes annoying. Also, this option enables printing of the entire content of stdout to the log too (this may be pretty convenient for debugging).}
+% \changes{0.10.0}{2022/10/19}{The option "ignore" suppresses the checking of "iexec.ret" value.}
+% \changes{0.7.0}{2022/09/25}{The option "append" was introduced --- if it's turned on, stdout will be appended to the file, instead of rewriting it (this is how it was before).}
+% \changes{0.7.0}{2022/09/25}{The option "log" was introduced, to turn on log/debug messages in TeX log (they were all visible always, which was sometimes annoying. Also, this option enables printing of the entire content of stdout to the log too (this may be pretty convenient for debugging).}
+% \changes{0.11.0}{2022/10/22}{The option "exit" allows to change the name of the file with exit code.}
% \begin{macrocode}
\RequirePackage{pgfkeys}
\makeatletter\pgfkeys{
/iexec/.is family,
/iexec,
+ exit/.store in = \iexec@exit,
+ exit/.default = iexec.ret,
stdout/.store in = \iexec@stdout,
stdout/.default = iexec.tmp,
stderr/.store in = \iexec@stderr,
@@ -263,7 +280,7 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
null/.store in = \iexec@null,
quiet/.store in = \iexec@quiet,
ignore/.store in = \iexec@ignore,
- stdout
+ stdout,exit
}\makeatother
% \end{macrocode}
@@ -290,10 +307,10 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
% \begin{macro}{\iexec}
% Then, we define |\iexec| command.
% It is implemented with the help of |\ShellEscape| from |shellesc| package:
-% \changes{v0.10.0}{2022/10/19}{The file "iexec.ret" is reused for all scripts.}
+% \changes{0.10.0}{2022/10/19}{The file "iexec.ret" is reused for all scripts.}
% \begin{macrocode}
\makeatletter
-\newread\iexec@retfile
+\newread\iexec@exitfile
\newcommand\iexec[2][]{%
\begingroup%
\pgfqkeys{/iexec}{#1}%
@@ -323,15 +340,16 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
\let\}\@charrb%
% \end{macrocode}
% Then, we execute it:
-% \changes{v0.10.0}{2022/10/19}{The ability to track exit code was added. Now, the code is saved into "iexec.ret" file, which is then read and checked for zero value.}
-% \changes{v0.8.0}{2022/10/05}{The option "null" was introduced, allowing redirection of stdout to "/dev/null". Doesn't work on Windows, though.}
-% \changes{v0.9.0}{2022/10/15}{The option "stderr" was introduced, allowing redirection of stderr to a file. Without this option specified, stderr will go to stdout.}
+% \changes{0.10.0}{2022/10/19}{The ability to track exit code was added. Now, the code is saved into "iexec.ret" file, which is then read and checked for zero value.}
+% \changes{0.8.0}{2022/10/05}{The option "null" was introduced, allowing redirection of stdout to "/dev/null". Doesn't work on Windows, though.}
+% \changes{0.9.0}{2022/10/15}{The option "stderr" was introduced, allowing redirection of stderr to a file. Without this option specified, stderr will go to stdout.}
+% \changes{0.11.0}{2022/10/22}{The file with exit code now contains just numbers, without end of line.}
% \begin{macrocode}
\def\iexec@cmd{(#2)
\ifdefined\iexec@append>\fi>
\ifdefined\iexec@null/dev/null\else\iexec@stdout\fi
- \space\ifdefined\iexec@stderr2>\iexec@stderr\else2>&1\fi
- \ifdefined\iexec@ignore\else; echo $? >iexec.ret\fi}
+ \space\ifdefined\iexec@stderr2>\iexec@stderr\else2>&1\fi;
+ /bin/echo -n $? >\iexec@exit}
\ShellEscape{\iexec@cmd}%
% \end{macrocode}
% Then, a message is printed to TeX log:
@@ -350,14 +368,20 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
\message{<EOF>^^J}%
\fi\fi%
% \end{macrocode}
-% Then, we check exit code:
+% Then, we check exit code, unless there is |ignore| option:
% \begin{macrocode}
- \ifdefined\iexec@log\else%
- \immediate\openin\iexec@retfile=iexec.ret%
- \read\iexec@retfile to \iexec@ret%
- \immediate\closein\iexec@retfile%
- \ifnum\iexec@ret=0\else%
- \PackageError{iexec}{Exit code is \iexec@ret}{}%
+ \immediate\openin\iexec@exitfile=\iexec@exit%
+ \read\iexec@exitfile to \iexec@code%
+ \immediate\closein\iexec@exitfile%
+ \ifnum\iexec@code=0\else%
+ \ifdefined\iexec@ignore%
+ \ifdefined\iexec@log%
+ \message{iexec: Execution failure ignored,
+ the exit code was \iexec@code^^J}%
+ \fi%
+ \else%
+ \PackageError{iexec}{Execution failure,
+ the exit code was \iexec@code}{}%
\fi%
\fi%
% \end{macrocode}
@@ -368,13 +392,13 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
\ifdefined\iexec@log%
\message{iexec: Due to 'quiet' option we didn't read
the content of '\iexec@stdout'
- \ifdefined\pdffilesize(\pdffilesize{\iexec@stdout}
+ \ifdefined\pdffilesize (\pdffilesize{\iexec@stdout}
bytes)\fi^^J}%
\fi%
\else%
\ifdefined\iexec@log%
- \message{iexec: We include the content of
- '\iexec@stdout'\ifdefined\pdffilesize(\pdffilesize
+ \message{iexec: We are going to include the content of
+ '\iexec@stdout'\ifdefined\pdffilesize (\pdffilesize
{\iexec@stdout} bytes)\fi...^^J}%
\fi%
\input{\iexec@stdout}%
@@ -388,19 +412,25 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
\ifiexec@trace%
\ifdefined\iexec@log%
\message{iexec: Due to package option 'trace',
- the file '\iexec@stdout' was not deleted^^J}%
+ the files '\iexec@stdout' and `\iexec@exit` were
+ not deleted^^J}%
\fi%
\else%
\ifdefined\iexec@traceit%
\ifdefined\iexec@log%
- \message{iexec: Due to 'trace' option,
- the file '\iexec@stdout' was not deleted^^J}%
+ \message{iexec: Due to 'trace' package option,
+ the files '\iexec@stdout' and '\iexec@exit'
+ were not deleted^^J}%
\fi%
\else%
\ShellEscape{rm \iexec@stdout}%
\ifdefined\iexec@log%
\message{iexec: The file '\iexec@stdout' was deleted^^J}%
\fi%
+ \ShellEscape{rm \iexec@exit}%
+ \ifdefined\iexec@log%
+ \message{iexec: The file '\iexec@exit' was deleted^^J}%
+ \fi%
\fi%
\fi\fi%
\endgroup
diff --git a/macros/latex/contrib/iexec/iexec.pdf b/macros/latex/contrib/iexec/iexec.pdf
index 96f30b1582..e4633ab765 100644
--- a/macros/latex/contrib/iexec/iexec.pdf
+++ b/macros/latex/contrib/iexec/iexec.pdf
Binary files differ
diff --git a/macros/latex/contrib/pangram/README.md b/macros/latex/contrib/pangram/README.md
new file mode 100644
index 0000000000..c68863edef
--- /dev/null
+++ b/macros/latex/contrib/pangram/README.md
@@ -0,0 +1,15 @@
+# The `pangram` Package
+
+The `pangram` package aims to provide an easy way for testing fonts.
+
+See `pangram.pdf` for more. Happy TeXing!
+
+## License
+
+This work may be distributed and/or modified under the conditions of
+the [LaTeX Project Public License](http://www.latex-project.org/lppl.txt),
+either version 1.3c of this license or (at your option) any later version.
+
+------
+
+Copyright (C) 2022 by Zhang Tingxuan <alphaztx@163.com>.
diff --git a/macros/latex/contrib/pangram/pangram.dtx b/macros/latex/contrib/pangram/pangram.dtx
new file mode 100644
index 0000000000..8c33d97955
--- /dev/null
+++ b/macros/latex/contrib/pangram/pangram.dtx
@@ -0,0 +1,430 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2022 by Zhang Tingxuan <alphaztx@163.com>
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3c of this license or (at your option) any later
+% version. The latest version of this license is in:
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Zhang Tingxuan.
+%
+% This work consists of the files pangram.dtx,
+% and the derived files pangram.ins,
+% pangram.sty,
+% pangram.pdf,
+% and README.md.
+%
+%<*internal>
+\iffalse
+%</internal>
+%
+%<*readme>
+# The `pangram` Package
+
+The `pangram` package aims to provide an easy way for testing fonts.
+
+See `pangram.pdf` for more. Happy TeXing!
+
+## License
+
+This work may be distributed and/or modified under the conditions of
+the [LaTeX Project Public License](http://www.latex-project.org/lppl.txt),
+either version 1.3c of this license or (at your option) any later version.
+
+------
+
+Copyright (C) 2022 by Zhang Tingxuan <alphaztx@163.com>.
+%</readme>
+%
+%<*internal>
+\fi
+\begingroup
+ \def\NameOfLaTeXe{LaTeX2e}
+\expandafter\endgroup\ifx\NameOfLaTeXe\fmtname\else
+\csname fi\endcsname
+%</internal>
+%
+%<*install>
+\input docstrip.tex
+\keepsilent
+
+\preamble
+
+ Copyright (C) 2022 by Zhang Tingxuan <alphaztx@163.com>
+
+ This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either
+ version 1.3c of this license or (at your option) any later
+ version. The latest version of this license is in:
+
+ http://www.latex-project.org/lppl.txt
+
+ and version 1.3 or later is part of all distributions of
+ LaTeX version 2005/12/01 or later.
+
+ This work has the LPPL maintenance status `maintained'.
+
+ The Current Maintainer of this work is Zhang Tingxuan.
+
+ This work consists of the files pangram.dtx,
+ and the derived files pangram.ins,
+ pangram.sty,
+ pangram.pdf,
+ and README.md.
+
+\endpreamble
+
+\generate{
+ \usedir{tex/latex/pangram}
+ \file{\jobname.sty} {\from{\jobname.dtx}{package}}
+%</install>
+%<*internal>
+ \usedir{source/latex/pangram}
+ \file{\jobname.ins} {\from{\jobname.dtx}{install}}
+%</internal>
+%<*install>
+ \usedir{doc/latex/pangram}
+ \nopreamble\nopostamble
+ \file{README.md} {\from{\jobname.dtx}{readme}}
+}
+
+\obeyspaces
+\Msg{****************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the *}
+\Msg{* following file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* pangram.sty *}
+\Msg{* *}
+\Msg{* The recommended directory is *}
+\Msg{* TDS:tex/latex/pangram *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file *}
+\Msg{* pangram.dtx through XeLaTeX/LuaLaTeX. *}
+\Msg{* XeLaTeX and LuaLaTeX are recommended if you *}
+\Msg{* hope the PDF file to be smaller. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{****************************************************}
+
+\endbatchfile
+%</install>
+%
+%<*internal>
+\fi
+%</internal>
+%
+%<*driver>
+\ProvidesFile{pangram.dtx}[2022/10/9 (c) Copyright 2022 by Zhang Tingxuan]
+\documentclass{ltxdoc}
+
+\usepackage[letterpaper,left=5cm,right=4cm,top=4cm,bottom=4cm,
+ includeheadfoot]{geometry}
+
+\usepackage{xcolor}
+\definecolor{titlecolor}{RGB}{0,12,160}
+\usepackage{doc}
+\usepackage{fancyvrb}
+\fvset{xleftmargin=2.5em,fontsize=\small,gobble=2}
+\MakeShortVerb|
+
+\usepackage{hologo}
+\def\XeTeX{\hologo{XeTeX}}
+\def\LuaTeX{\hologo{LuaTeX}}
+
+\def\pkg{\textsf}
+\def\opt{\texttt}
+
+\title{\leavevmode\hbox to 0pt{\hss\huge The quick brown fox jumps over the lazy dog\hss}\\
+ --- The \pkg{pangram} package}
+\author{Zhang Tingxuan}
+\long\date{2022/10/9\quad Version 0.0b\thanks{\url{https://github.com/AlphaZTX/pangram}
+If you want to maintain this package, just contact me through GitHub issues or pull a
+request.}}
+
+\usepackage{hyperref}
+\hypersetup{
+ pdftitle = {The pangram Package},
+ pdfauthor = {Zhang Tingxuan},
+ pdfcreator = {XeLaTeX/LuaLaTeX},
+ linkcolor = black,
+ urlcolor = titlecolor!80!black,
+}
+\def\pkg{\textsf}
+
+\makeatletter
+\renewcommand\section{\@startsection{section}{1}{\z@}%
+ {-2.5ex plus -1ex minus -.2ex}%
+ {1ex plus .2ex}%
+ {\normalfont\Large\bfseries\color{titlecolor}}}
+\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
+ {-2ex plus -1ex minus -.2ex}%
+ {.5ex plus .2ex}%
+ {\normalfont\normalsize\bfseries\color{titlecolor}}}
+\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
+ {.8ex plus .4ex minus .2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries\color{titlecolor}}}
+\makeatother
+\usepackage{fontspec}
+\setmainfont{Latin Modern Roman}
+\setsansfont{Latin Modern Sans}
+\setmonofont{Latin Modern Mono}
+\usepackage{ragged2e}
+\usepackage{pangram}
+
+\linespread{1.05}
+\parskip12pt plus 3pt minus 2pt
+\parindent2.5em
+\RaggedRight
+
+\begin{document}
+ \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+%
+% \maketitle
+%
+% \begin{abstract}
+% Pangram is a phrase or sentence containing all letters in an alphabet,
+% usually used for testing fonts. One famous pangram is ``The quick brown
+% fox jumps over the lazy dog''. This package provide a (somewhat) simple
+% way for font designers or users to test fonts.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \newgeometry{left=1cm,right=1cm,top=1cm,bottom=1cm}
+% \pangram[
+% sizes = { 5pt, 6pt, 7pt, 8pt, 9pt,
+% 10pt, 11pt, 12pt, 14pt, 16pt,
+% 18pt, 20pt, 22pt, 24pt, 30pt,
+% 36pt, 40pt, 44pt, 48pt, 64pt,
+% 72pt, 96pt},
+% linegap = 0pt plus 1fil,
+% tagfont = \ttfamily\footnotesize\color{gray},
+% font = \fontspec{Latin Modern Roman},
+% after = \thispagestyle{empty},
+% ]
+% \restoregeometry
+%
+% \section{How to use this package}
+% To load the package, just write
+% \begin{Verbatim}
+% \usepackage{pangram}
+% \end{Verbatim}
+% in preamble.
+%
+% Then in your document, write
+% \begin{Verbatim}
+% \pangram
+% \end{Verbatim}
+% to get the result like the previous page.
+%
+% Please notice that \cs{pangram} will stay in a seperate page.
+%
+% \section{Options}
+% The \cs{pangram} command can receive an optional key-val list
+% specifying the details of the pangram page. Here are the keys:
+% \begin{itemize}
+% \item \opt{textclass} stands for the pangram text in pangram page.
+% The default value is \opt{default}, yields ``The quick brown fox
+% jumps over the lazy dog. 0123456789''. \opt{uppercase} and \opt{glass}
+% are also available, which yields ``THE QUICK BROWN FOX JUMPS OVER THE
+% LAZY DOG. 0123456789'' and ``I can eat glass and it doesn't hurt me.''
+% (although the latter one cannot be regarded as pangram).
+%
+% \item \opt{sizes} for the sizes shown in \cs{pangram}. Default value is
+% \texttt{\{5pt, 7pt, 8pt, 9pt, 10pt, 11pt, 12pt, 14pt, 16pt, 18pt, 20pt,
+% 22pt, 24pt, 36pt, 48pt, 60pt, 72pt\}}.
+%
+% \item \opt{linegap} is the line skip between two lines in \cs{pangram}.
+% Default value is \opt{5pt plus 3pt minus 2pt}.
+%
+% \item \opt{tagskip} is the skip between the tag and the pangram text.
+% Default value is \opt{5pt}.
+%
+% \item \opt{tagfont} sets the font of tag. Default value is
+% |\ttfamily\footnotesize|.
+%
+% \item \opt{font} sets the font of pangram text. Default value is empty.
+%
+% \item \opt{before} stands for the content before pangram text in pangram page.
+% Default value is empty.
+%
+% \item \opt{after} stands for the content after pangram text in pangram page.
+% Default value is empty.
+% \end{itemize}
+% If you want to set the keys globally, use \cs{PangramSetup} in your preamble,
+% the argument of \cs{PangramSetup} is the same as the one of \cs{pangram}.
+%
+% Attention! If any of the value to the keys contains an ``\opt{=}'' symbol,
+% the value should be put into a group. For example,
+% \begin{Verbatim}
+% \pangram[ font={\fontspec{Latin Modern Roman}[Mapping=tex-text]} ]
+% \end{Verbatim}
+%
+% \section{New pangram text classes}
+% Besides the three pre-defined pangram text classes, you can define your own
+% pangram text classes through \cs{NewPangramClass}:
+%
+% \cs{NewPangramClass}\marg{text class}\marg{text}
+%
+% \section{A complicated example}
+% Set the package globally (used in preamble):
+% \begin{Verbatim}
+% \PangramSetup{
+% sizes={9bp,10bp,12bp,20bp,36bp,44bp,48bp,64bp},
+% tagfont=\color{gray}\ttfamily\footnotesize,
+% }
+% \NewPangramClass{abc}{abcdefghijklmnopqrstuvwxyz}
+% \end{Verbatim}
+%
+% Get the result locally (Needs \pkg{fontspec} package and any package provides
+% \cs{color} command):
+% \begin{Verbatim}
+% \pangram[font=\fontspec{Latin Modern Roman}]
+% \pangram[textclass=glass,
+% font={\fontspec{Latin Modern Sans}[Mapping=tex-text]}]
+% \pangram[textclass=abc,font=\fontspec{Latin Modern Mono}]
+% \end{Verbatim}
+% The text class \opt{abc} here is defined in the previous paragraph.
+%
+% \section{The source code}
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}[2022/06/01]
+\ProvidesPackage{pangram}[2022/10/09 Pangram, a tool for testing fonts]
+% \end{macrocode}
+% Use a \opt{clist} to restore the sizes for \cs{pangram},
+% and an integer for its index (here we use \opt{index} instead
+% of \opt{int}).
+% \begin{macrocode}
+\ExplSyntaxOn
+\clist_new:N \l_pangram_sizes_clist
+\int_new:N \l_pangram_size_index
+\clist_set:Nn \l_pangram_sizes_clist
+ {
+ 5pt, 7pt, 8pt, 9pt, 10pt, 11pt,
+ 12pt, 14pt, 16pt, 18pt, 20pt, 22pt,
+ 24pt, 36pt, 48pt, 60pt, 72pt
+ }
+% \end{macrocode}
+% Three pre-defined text classes (token lists) for \cs{pangram}.
+% \begin{macrocode}
+\tl_const:Nn \c_pangram_text_default_tl
+ { The~quick~brown~fox~jumps~over~the~lazy~dog. ~ 0123456789 }
+\tl_const:Nn \c_pangram_text_uppercase_tl
+ { THE~QUICK~BROWN~FOX~JUMPS~OVER~THE~LAZY~DOG. ~ 0123456789 }
+\tl_const:Nn \c_pangram_text_glass_tl
+ { I~can~eat~glass~and~it~doesn't~hurt~me. }
+% \end{macrocode}
+% \DescribeMacro{\NewPangramClass}
+% Use way equivalent to \cs{csname}\dots\cs{endcsname} to define
+% new text classes.
+% \begin{macrocode}
+\NewDocumentCommand \NewPangramClass { m m }
+ {
+ \exp_after:wN \tl_const:Nn \cs:w c_pangram_text_#1_tl \cs_end: { #2 }
+ }
+% \end{macrocode}
+% Inner function for \opt{sizes} option. Here use the \pkg{xparse}'s new
+% \cs{IfBlankTF} mechanism to judge if the sizes should be reset.
+% \begin{macrocode}
+\NewDocumentCommand \pangram_resetsizes:n { m }
+ {
+ \IfBlankF {#1} { \clist_set:Nn \l_pangram_sizes_clist { #1 } }
+ }
+% \end{macrocode}
+% The keys.
+% \begin{macrocode}
+\keys_define:nn { pangram }
+ {
+ textclass.tl_set:N = \l_pangram_textclass_tl ,
+ textclass.default:n = default ,
+ textclass.initial:n = default ,
+ sizes.code:n = \pangram_resetsizes:n { #1 } ,
+ linegap.skip_set:N = \l_pangram_linegap_skip ,
+ linegap.default:n = 5pt plus 3pt minus 2pt ,
+ linegap.initial:n = 5pt plus 3pt minus 2pt ,
+ tagskip.skip_set:N = \l_pangram_tagskip_skip ,
+ tagskip.default:n = 5pt ,
+ tagskip.initial:n = 5pt ,
+ tagfont.tl_set:N = \l_pangram_tagfont_tl ,
+ tagfont.default:n = \ttfamily \footnotesize ,
+ tagfont.initial:n = \ttfamily \footnotesize ,
+ font.tl_set:N = \l_pangram_font_tl ,
+ before.tl_set:N = \l_pangram_before_tl ,
+ after.tl_set:N = \l_pangram_after_tl ,
+ }
+% \end{macrocode}
+% \DescribeMacro{\PangramSetup}
+% Set up the package in preamble.
+% \begin{macrocode}
+\NewDocumentCommand \PangramSetup { m }
+ { \keys_set:nn { pangram } { #1 } }
+% \end{macrocode}
+% \DescribeMacro{\pangram}
+% The function itself.
+% \begin{macrocode}
+\NewDocumentCommand \pangram { +O{} }
+ {
+ \group_begin:
+ \keys_set:nn { pangram } { #1 }
+ \clearpage
+ \skip_set:Nn \parskip { \c_zero_dim }
+% \end{macrocode}
+% Use a loop to get all of the entries in the sizes \opt{clist}.
+% \begin{macrocode}
+ \int_set:Nn \l_pangram_size_index { 0 }
+ \tl_use:N \l_pangram_before_tl
+ \int_do_while:nNnn
+ { \l_pangram_size_index } < { \clist_count:N \l_pangram_sizes_clist }
+ {
+ \mode_leave_vertical:
+ \int_incr:N \l_pangram_size_index % index++;
+ \hbox_to_zero:n
+ {
+ \hss
+ \tl_use:N \l_pangram_tagfont_tl
+ \clist_item:Nn \l_pangram_sizes_clist { \l_pangram_size_index }
+ \skip_horizontal:N \l_pangram_tagskip_skip
+ }
+ \hbox_to_zero:n
+ {
+ \tl_use:N \l_pangram_font_tl
+ \fontsize
+ { \clist_item:Nn \l_pangram_sizes_clist { \l_pangram_size_index } }
+ { \c_zero_dim } % \z@
+ \selectfont
+ \tl_use:c { c_pangram_text_ \tl_use:N \l_pangram_textclass_tl _tl }
+ \hss
+ }
+ \int_compare:nNnT
+ { \l_pangram_size_index } = { \clist_count:N \l_pangram_sizes_clist }
+ { \skip_set:Nn \l_pangram_linegap_skip {0pt} }
+ \par
+ \skip_vertical:N \l_pangram_linegap_skip
+ }
+% \end{macrocode}
+% The loop ends here.
+% \begin{macrocode}
+ \tl_use:N \l_pangram_after_tl
+ \clearpage
+ \group_end:
+ }
+\ExplSyntaxOff
+%</package>
+% \end{macrocode}
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/pangram/pangram.ins b/macros/latex/contrib/pangram/pangram.ins
new file mode 100644
index 0000000000..1c300da357
--- /dev/null
+++ b/macros/latex/contrib/pangram/pangram.ins
@@ -0,0 +1,91 @@
+%%
+%% This is file `pangram.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pangram.dtx (with options: `install')
+%%
+%% Copyright (C) 2022 by Zhang Tingxuan <alphaztx@163.com>
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Zhang Tingxuan.
+%%
+%% This work consists of the files pangram.dtx,
+%% and the derived files pangram.ins,
+%% pangram.sty,
+%% pangram.pdf,
+%% and README.md.
+%%
+\input docstrip.tex
+\keepsilent
+
+\preamble
+
+ Copyright (C) 2022 by Zhang Tingxuan <alphaztx@163.com>
+
+ This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either
+ version 1.3c of this license or (at your option) any later
+ version. The latest version of this license is in:
+
+ http://www.latex-project.org/lppl.txt
+
+ and version 1.3 or later is part of all distributions of
+ LaTeX version 2005/12/01 or later.
+
+ This work has the LPPL maintenance status `maintained'.
+
+ The Current Maintainer of this work is Zhang Tingxuan.
+
+ This work consists of the files pangram.dtx,
+ and the derived files pangram.ins,
+ pangram.sty,
+ pangram.pdf,
+ and README.md.
+
+\endpreamble
+
+\generate{
+ \usedir{tex/latex/pangram}
+ \file{\jobname.sty} {\from{\jobname.dtx}{package}}
+ \usedir{doc/latex/pangram}
+ \nopreamble\nopostamble
+ \file{README.md} {\from{\jobname.dtx}{readme}}
+}
+
+\obeyspaces
+\Msg{****************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the *}
+\Msg{* following file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* pangram.sty *}
+\Msg{* *}
+\Msg{* The recommended directory is *}
+\Msg{* TDS:tex/latex/pangram *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file *}
+\Msg{* pangram.dtx through XeLaTeX/LuaLaTeX. *}
+\Msg{* XeLaTeX and LuaLaTeX are recommended if you *}
+\Msg{* hope the PDF file to be smaller. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{****************************************************}
+
+\endbatchfile
+\endinput
+%%
+%% End of file `pangram.ins'.
diff --git a/macros/latex/contrib/pangram/pangram.pdf b/macros/latex/contrib/pangram/pangram.pdf
new file mode 100644
index 0000000000..008be5a8f8
--- /dev/null
+++ b/macros/latex/contrib/pangram/pangram.pdf
Binary files differ