From c65c806536b3d6b228d5d71f0e0c835968a3733a Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 22 Apr 2022 03:01:20 +0000 Subject: CTAN sync 202204220301 --- macros/latex/contrib/censor/censor.pdf | Bin 221880 -> 246320 bytes macros/latex/contrib/censor/censor.sty | 190 +- macros/latex/contrib/censor/censor.tex | 349 ++- macros/latex/contrib/colorist/colorart.cls | 2 +- macros/latex/contrib/colorist/colorbook.cls | 2 +- macros/latex/contrib/colorist/colorist-doc.pdf | Bin 101825 -> 102113 bytes macros/latex/contrib/colorist/colorist-doc.tex | 4 +- macros/latex/contrib/colorist/colorist-fancy.sty | 218 +- macros/latex/contrib/colorist/colorist.sty | 2 +- macros/latex/contrib/easybook/easybook.dtx | 8 +- macros/latex/contrib/easybook/easybook.ins | 4 +- macros/latex/contrib/easybook/easybook.pdf | Bin 591566 -> 591552 bytes macros/latex/contrib/easybook/easybook.tex | 6 +- .../contrib/minimalist/minimalist-classical.sty | 122 +- macros/latex/contrib/minimalist/minimalist-doc.pdf | Bin 103703 -> 103724 bytes macros/latex/contrib/minimalist/minimalist-doc.tex | 4 +- .../latex/contrib/minimalist/minimalist-plain.sty | 116 +- macros/latex/contrib/minimalist/minimalist.sty | 2 +- macros/latex/contrib/minimalist/minimart.cls | 2 +- macros/latex/contrib/minimalist/minimbook.cls | 2 +- macros/latex/contrib/postnotes/CHANGELOG.md | 13 + macros/latex/contrib/postnotes/DEPENDS.txt | 1 + macros/latex/contrib/postnotes/README.md | 24 + macros/latex/contrib/postnotes/postnotes-code.pdf | Bin 0 -> 804363 bytes macros/latex/contrib/postnotes/postnotes-code.tex | 53 + macros/latex/contrib/postnotes/postnotes.dtx | 2587 ++++++++++++++++++++ macros/latex/contrib/postnotes/postnotes.ins | 94 + macros/latex/contrib/postnotes/postnotes.pdf | Bin 0 -> 176458 bytes macros/latex/contrib/postnotes/postnotes.tex | 972 ++++++++ macros/latex/contrib/projlib/ProjLib.dtx | 441 ++-- macros/latex/contrib/projlib/README.md | 11 +- macros/latex/contrib/spbmark/spbmark.pdf | Bin 85057 -> 84970 bytes macros/latex/contrib/spbmark/spbmark.sty | 4 +- macros/latex/contrib/spbmark/spbmark.tex | 6 +- .../latex/beaulivre/beaulivre-doc-cn.pdf | Bin 320663 -> 320007 bytes .../latex/beaulivre/beaulivre-doc-cn.tex | 8 +- .../latex/beaulivre/beaulivre-doc-en.pdf | Bin 208770 -> 208615 bytes .../latex/beaulivre/beaulivre-doc-en.tex | 8 +- .../latex/beaulivre/beaulivre-doc-fr.pdf | Bin 213759 -> 213449 bytes .../latex/beaulivre/beaulivre-doc-fr.tex | 8 +- macros/unicodetex/latex/beaulivre/beaulivre.cls | 24 +- macros/unicodetex/latex/einfart/einfart-doc-cn.pdf | Bin 248999 -> 249232 bytes macros/unicodetex/latex/einfart/einfart-doc-cn.tex | 4 +- macros/unicodetex/latex/einfart/einfart-doc-en.pdf | Bin 154480 -> 154559 bytes macros/unicodetex/latex/einfart/einfart-doc-en.tex | 4 +- macros/unicodetex/latex/einfart/einfart-doc-fr.pdf | Bin 160964 -> 159934 bytes macros/unicodetex/latex/einfart/einfart-doc-fr.tex | 4 +- macros/unicodetex/latex/einfart/einfart.cls | 24 +- macros/unicodetex/latex/lebhart/lebhart-doc-cn.pdf | Bin 266431 -> 266891 bytes macros/unicodetex/latex/lebhart/lebhart-doc-cn.tex | 4 +- macros/unicodetex/latex/lebhart/lebhart-doc-en.pdf | Bin 146477 -> 147325 bytes macros/unicodetex/latex/lebhart/lebhart-doc-en.tex | 4 +- macros/unicodetex/latex/lebhart/lebhart-doc-fr.pdf | Bin 150602 -> 150838 bytes macros/unicodetex/latex/lebhart/lebhart-doc-fr.tex | 4 +- macros/unicodetex/latex/lebhart/lebhart.cls | 24 +- .../latex/simplivre/simplivre-doc-cn.pdf | Bin 336010 -> 335280 bytes .../latex/simplivre/simplivre-doc-cn.tex | 8 +- .../latex/simplivre/simplivre-doc-en.pdf | Bin 230392 -> 229949 bytes .../latex/simplivre/simplivre-doc-en.tex | 8 +- .../latex/simplivre/simplivre-doc-fr.pdf | Bin 231959 -> 230162 bytes .../latex/simplivre/simplivre-doc-fr.tex | 8 +- macros/unicodetex/latex/simplivre/simplivre.cls | 24 +- macros/unicodetex/latex/unisc/README.txt | 10 + macros/unicodetex/latex/unisc/unisc.dtx | 496 ++++ macros/unicodetex/latex/unisc/unisc.ins | 55 + macros/unicodetex/latex/unisc/unisc.pdf | Bin 0 -> 133592 bytes 66 files changed, 5342 insertions(+), 626 deletions(-) create mode 100644 macros/latex/contrib/postnotes/CHANGELOG.md create mode 100644 macros/latex/contrib/postnotes/DEPENDS.txt create mode 100644 macros/latex/contrib/postnotes/README.md create mode 100644 macros/latex/contrib/postnotes/postnotes-code.pdf create mode 100644 macros/latex/contrib/postnotes/postnotes-code.tex create mode 100644 macros/latex/contrib/postnotes/postnotes.dtx create mode 100644 macros/latex/contrib/postnotes/postnotes.ins create mode 100644 macros/latex/contrib/postnotes/postnotes.pdf create mode 100644 macros/latex/contrib/postnotes/postnotes.tex create mode 100644 macros/unicodetex/latex/unisc/README.txt create mode 100644 macros/unicodetex/latex/unisc/unisc.dtx create mode 100644 macros/unicodetex/latex/unisc/unisc.ins create mode 100644 macros/unicodetex/latex/unisc/unisc.pdf (limited to 'macros') diff --git a/macros/latex/contrib/censor/censor.pdf b/macros/latex/contrib/censor/censor.pdf index 16b5780ed8..637c75f820 100644 Binary files a/macros/latex/contrib/censor/censor.pdf and b/macros/latex/contrib/censor/censor.pdf differ diff --git a/macros/latex/contrib/censor/censor.sty b/macros/latex/contrib/censor/censor.sty index df38f68150..2232bc0c63 100644 --- a/macros/latex/contrib/censor/censor.sty +++ b/macros/latex/contrib/censor/censor.sty @@ -1,9 +1,9 @@ % censor.sty -\def\censorversionnumber{4.1} +\def\censorversionnumber{4.2} +\def\censorversiondate{2022/04/21} \ProvidesPackage{censor} -[2022/02/09 \censorversionnumber\ +[\censorversiondate\ \censorversionnumber\ Provides capability for redaction of sensitive information] - % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -24,11 +24,11 @@ \censorruledepth=-0.3ex% -0.3ex DEFAULT \censorruleheight=2.1ex% 2.1ex DEFAULT -\def\censordot{\censor{.}}% versus \def\censordot{ }% +\def\censordot{\censor{.}}% versus \def\censordot{.}% \newcommand\censorrule[1]{\protect\rule[\censorruledepth]{#1}{\censorruleheight}} -\newcommand\censor{\@ifstar{\@cenlen}{\@cenword}} +\DeclareRobustCommand\censor{\@ifstar{\@cenlen}{\@cenword}} \newcommand\@cenlen[1]{\censorrule{#1 ex}} \newcommand\@cenword[1]{\censorrule{\widthofpbox{#1}}} @@ -56,91 +56,163 @@ \addcytoks[1]{\expandafter\censor\expandafter{#1}}\fi\def#1{}} \def\@append#1#2{\tc@defx#1{#1#2}} -\def\spacelap{0.6ex} -\def\censpace{\rlap{\censorrule{\spacelap}} \llap{\censorrule{\spacelap}}} +\def\censpace{% + \leaders\hrule height \dimexpr\censorruleheight+\censorruledepth\relax + depth -\censorruledepth + \hskip\fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font + \mbox{}} \let\sv@censpace\censpace -\long\def\blackout#1{\blackoutenv#1\endblackoutenv} -\long\def\xblackout#1{\xblackoutenv#1\endxblackoutenv} +\long\def\blackout#1{\protect\blackoutenv#1\endblackoutenv} +\long\def\xblackout#1{\protect\xblackoutenv#1\endxblackoutenv} \newif\ifexpandarg \xtokcycleenvironment\blackoutenv {\ifx.##1\@dump\censored@word\addcytoks[1]{\censordot}\else + \ifnum\catcode`##1=3\relax\@dump\censored@word\addcytoks{##1}\else + \ifnum\catcode`##1=4\relax\@dump\censored@word\addcytoks{##1}\else + \ifnum\catcode`##1=7\relax\@dump\censored@word\addcytoks{##1}\else + \ifnum\catcode`##1=8\relax\@dump\censored@word\addcytoks{##1}\else \@append\censored@word{##1}% - \tcpeek\@next\ifx\@next\@tcEscapeptr\@dump\censored@word\fi\fi} + \tcpeek\@next\ifx\@next\@tcEscapeptr\@dump\censored@word\fi + \fi\fi\fi\fi\fi} {\tctestifcon\ifexpandarg{\expandafter\processtoks\expandafter {\expanded{##1}}\@dump\censored@word}{\groupedcytoks{\processtoks{##1}% \@dump\censored@word}}\expandargfalse} {\tctestifx{~##1}{\@append\censored@word{##1}}% {\tctestifx{\expanded##1}{\@dump\censored@word\expandargtrue}% - {\test@chars{##1}\ifchar\@append\censored@word{##1}\else - \test@accents{##1}\ifaccent\@append\censored@word{##1}\tcpop\tc@popped + {\test@chars{##1}\if@char\if@mathgreek + \@append\censored@word{\ensuremath{##1}}\else + \@append\censored@word{##1}\fi\else + \test@accents{##1}\if@accent\@append\censored@word{##1}\tcpop\tc@popped \expandafter\@append\expandafter\censored@word\expandafter{\tc@popped}% \else\@dump\censored@word\addcytoks{##1}\fi\fi}}} - {\@dump\censored@word\addcytoks{##1}} - {\stripgroupingtrue\def\censored@word{}} + {\@dump\censored@word\addcytoks{##1}} + {\stripgroupingtrue\def\censored@word{}\sloppy} {\@dump\censored@word} \xtokcycleenvironment\xblackoutenv {\ifx.##1\@dump\censored@word\addcytoks[1]{\censordot}\else + \ifnum\catcode`##1=3\relax\@dump\censored@word\addcytoks{##1}\else + \ifnum\catcode`##1=4\relax\@dump\censored@word\addcytoks{##1}\else + \ifnum\catcode`##1=7\relax\@dump\censored@word\addcytoks{##1}\else + \ifnum\catcode`##1=8\relax\@dump\censored@word\addcytoks{##1}\else \@append\censored@word{##1}% - \tcpeek\@next\ifx\@next\@tcEscapeptr\@dump\censored@word\fi\fi} + \tcpeek\@next\ifx\@next\@tcEscapeptr\@dump\censored@word\fi + \fi\fi\fi\fi\fi} {\tctestifcon\ifexpandarg{\expandafter\processtoks\expandafter {\expanded{##1}}\@dump\censored@word}{\groupedcytoks{\processtoks{##1}% \@dump\censored@word}}\expandargfalse} {\tctestifx{~##1}{\@append\censored@word{##1}}% {\tctestifx{\expanded##1}{\@dump\censored@word\expandargtrue}% - {\test@chars{##1}\ifchar\@append\censored@word{##1}\else - \test@accents{##1}\ifaccent\@append\censored@word{##1}\tcpop\tc@popped + {\test@chars{##1}\if@char\if@mathgreek + \@append\censored@word{\ensuremath{##1}}\else + \@append\censored@word{##1}\fi\else + \test@accents{##1}\if@accent\@append\censored@word{##1}\tcpop\tc@popped \expandafter\@append\expandafter\censored@word\expandafter{\tc@popped}% \else\@dump\censored@word\addcytoks{##1}\fi\fi}}} - {\@dump\censored@word\addcytoks{\censpace}} - {\stripgroupingtrue\def\censored@word{}} + {\@dump\censored@word\addcytoks{\ccenspace}} + {\stripgroupingtrue\def\censored@word{}\sloppy} {\@dump\censored@word} -\newif\ifchar -\newcommand\test@chars[1]{\charfalse - \ifx\$#1\chartrue\else - \ifx\\chartrue\else - \ifx\##1\chartrue\else - \ifx\%#1\chartrue\else - \ifx\_#1\chartrue\else - \ifx\o#1\chartrue\else - \ifx\O#1\chartrue\else - \ifx\oe#1\chartrue\else - \ifx\OE#1\chartrue\else - \ifx\aa#1\chartrue\else - \ifx\AA#1\chartrue\else - \ifx\ae#1\chartrue\else - \ifx\AE#1\chartrue\else - \ifx\l#1\chartrue\else - \ifx\L#1\chartrue +\newcommand\ccenspace{\ifhmode\ifmmode\else\censpace\fi\fi} + +\newif\if@char +\newif\if@mathgreek +\newif\if@accent + +\newcommand\test@chars[1]{\@charfalse\@mathgreekfalse + \ifx\$#1\@chartrue\else + \ifx\\@chartrue\else + \ifx\##1\@chartrue\else + \ifx\%#1\@chartrue\else + \ifx\_#1\@chartrue\else + \ifx\o#1\@chartrue\else + \ifx\O#1\@chartrue\else + \ifx\oe#1\@chartrue\else + \ifx\OE#1\@chartrue\else + \ifx\aa#1\@chartrue\else + \ifx\AA#1\@chartrue\else + \ifx\ae#1\@chartrue\else + \ifx\AE#1\@chartrue\else + \ifx\l#1\@chartrue\else + \ifx\L#1\@chartrue\else + \ifcensormathgreek\test@mathgreek{#1}\if@mathgreek\@chartrue\fi\fi% \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi } -\newif\ifaccent -\newcommand\test@accents[1]{\accentfalse - \ifx\`#1\accenttrue\else - \ifx\=#1\accenttrue\else - \ifx\'#1\accenttrue\else - \ifx\.#1\accenttrue\else - \ifx\^#1\accenttrue\else - \ifx\"#1\accenttrue\else - \ifx\u#1\accenttrue\else - \ifx\d#1\accenttrue\else - \ifx\v#1\accenttrue\else - \ifx\b#1\accenttrue\else - \ifx\H#1\accenttrue\else - \ifx\t#1\accenttrue\else - \ifx\~#1\accenttrue\else - \ifx\c#1\accenttrue +\newcommand\test@mathgreek[1]{% + \ifx\alpha#1\@mathgreektrue\else + \ifx\beta#1\@mathgreektrue\else + \ifx\gamma#1\@mathgreektrue\else + \ifx\delta#1\@mathgreektrue\else + \ifx\epsilon#1\@mathgreektrue\else + \ifx\varepsilon#1\@mathgreektrue\else + \ifx\zeta#1\@mathgreektrue\else + \ifx\eta#1\@mathgreektrue\else + \ifx\theta#1\@mathgreektrue\else + \ifx\vartheta#1\@mathgreektrue\else + \ifx\iota#1\@mathgreektrue\else + \ifx\kappa#1\@mathgreektrue\else + \ifx\lambda#1\@mathgreektrue\else + \ifx\mu#1\@mathgreektrue\else + \ifx\nu#1\@mathgreektrue\else + \ifx\xi#1\@mathgreektrue\else + \ifx\pi#1\@mathgreektrue\else + \ifx\varpi#1\@mathgreektrue\else + \ifx\rho#1\@mathgreektrue\else + \ifx\varrho#1\@mathgreektrue\else + \ifx\sigma#1\@mathgreektrue\else + \ifx\varsigma#1\@mathgreektrue\else + \ifx\tau#1\@mathgreektrue\else + \ifx\upsilon#1\@mathgreektrue\else + \ifx\phi#1\@mathgreektrue\else + \ifx\varphi#1\@mathgreektrue\else + \ifx\chi#1\@mathgreektrue\else + \ifx\psi#1\@mathgreektrue\else + \ifx\omega#1\@mathgreektrue\else + \ifx\Gamma#1\@mathgreektrue\else + \ifx\Delta#1\@mathgreektrue\else + \ifx\Theta#1\@mathgreektrue\else + \ifx\Lambda#1\@mathgreektrue\else + \ifx\Xi#1\@mathgreektrue\else + \ifx\Pi#1\@mathgreektrue\else + \ifx\Sigma#1\@mathgreektrue\else + \ifx\Upsilon#1\@mathgreektrue\else + \ifx\Phi#1\@mathgreektrue\else + \ifx\Psi#1\@mathgreektrue\else + \ifx\Omega#1\@mathgreektrue + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi +} + +\newcommand\test@accents[1]{\@accentfalse + \ifx\`#1\@accenttrue\else + \ifx\=#1\@accenttrue\else + \ifx\'#1\@accenttrue\else + \ifx\.#1\@accenttrue\else + \ifx\^#1\@accenttrue\else + \ifx\"#1\@accenttrue\else + \ifx\u#1\@accenttrue\else + \ifx\d#1\@accenttrue\else + \ifx\v#1\@accenttrue\else + \ifx\b#1\@accenttrue\else + \ifx\H#1\@accenttrue\else + \ifx\t#1\@accenttrue\else + \ifx\~#1\@accenttrue\else + \ifx\c#1\@accenttrue \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi } + +\newif\ifcensormathgreek + +\censormathgreektrue + %%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand\censorbox{\@ifstar{\censor@dim}{\censor@box}} +\DeclareRobustCommand\censorbox{\@ifstar{\censor@dim}{\censor@box}} \newcommand\censor@dim[4][]{{#1% \rule[-#4\baselineskip]{#2ex}{#3\baselineskip}}} \newcommand\censor@box[2][]{#1\setbox0\hbox{#2}% @@ -152,7 +224,6 @@ \rule{#2ex}{0ex}}}} \newcommand\un@censor@box[2][]{#1#2} -% NOTE: A \protect\censorbox{} MAY BE REQUIRED INSIDE SOME ENVIRONMENTS \endinput VERSION: @@ -175,4 +246,15 @@ VERSION: etc. and character accents such as \', etc. See \test@chars and \test@accents for details. - Fixed bug in which \expanded arguments remained inside a TeX group +4.2 - Extended capability (via switch) to autocensor Greek math (see + \test@mathgreek). + - In (x)blackout macros/environments, auto-intercepts catcode 3,4,7 + and 8 characters and passes them through unchanged, to help facilitate + general censoring of math and tabular content. + - Switched \censpace, used in \xblackout, to a leader rather than a + lapped rule, which allows automatically for glue associated with + \fontdim. + - Made \censor and \censorbox robust, which will allow censoring + to occur across, for example, section headers, tocs, etc. + - Revisited the documentation, bringing it up to date. diff --git a/macros/latex/contrib/censor/censor.tex b/macros/latex/contrib/censor/censor.tex index ef64629f13..f16ebc497b 100644 --- a/macros/latex/contrib/censor/censor.tex +++ b/macros/latex/contrib/censor/censor.tex @@ -1,5 +1,5 @@ \documentclass{article} -\usepackage{verbatimbox,xcolor} +\usepackage{verbatimbox,xcolor,mathtools} \usepackage{censor} \parindent 0in @@ -13,7 +13,7 @@ \small \rule{0in}{1em}Tools for Producing Redacted Documents\\ \large \rule{0in}{2em} Steven B. Segletes\\ SSegletes@verizon.net\\ -\rule{0em}{2em}\today\\ +\rule{0em}{2em}\censorversiondate\\ v\censorversionnumber \end{center} @@ -21,8 +21,8 @@ v\censorversionnumber The \textsf{censor} package allows a convenient redaction/censor capability to be employed, for those who need to protect restricted -information, as well as for those who are forced to work in a more -inefficient environment when dealing with restricted information. +information, as well as for those who are forced to work in a less +efficient environment when dealing with restricted information. Let us assume you have a document for internal use, containing some restricted (\textit{i.e.}, private, sensitive, proprietary or @@ -195,10 +195,11 @@ detailed in Table 1. As of version 2.0, there is provided a block-censor -capability, for redacting larger blocks of text. This new command -is \verb|\blackout|, and is used in the form -\verb|\blackout{Block of text}|. This nice thing about this command is -that it can stretch across line and paragraph boundaries conveniently. + capability, for redacting larger blocks of text. +This new command is \verb|\blackout|, and is used in the form + \verb|\blackout{Block of text}|. This nice thing about this command + is that it can stretch across line, paragraph, and page boundaries + conveniently. For example, {\addtolength{\leftskip}{2.3em} @@ -227,31 +228,50 @@ New paragraph. } Prior to V4.0, \verb|\blackout| did not conveniently work across - environment boundaries, such as math or tabular mode. -One inconvenient option had been to \verb|\censor| text in the \texttt{tabular}, - cell by cell. -Alternatively, to blackout the whole tabular environment, you should use + environment boundaries, such as math or tabular. +To blackout the whole tabular environment, one could use the \verb|\censorbox| command as has been shown. -Presently, there is a third option---to censor cell-by-cell using a - shorthand notation. +Presently, however, there is another option---to censor + cell-by-cell using a shorthand notation. The \verb|\blackout| macro now allows uncensored content to be \textit{escaped} - from its argument by delimiting it between \verb+|...|+ bars. -Thus, the censoring directive \verb+\blackout{This |is a| test}+ renders as - \blackout{This |is a| test}. - + from its argument by delimiting it between \verb+|...|+ bars (note: the + closing escape bar must be in the same grouping level). +Thus, the censoring directive {\ttfamily\detokenize + {\blackout{This |is a| test}}} + renders as \blackout{This |is a| test}. + +This escaping of text becomes essential if one wishes to execute + environments within a \verb|\blackout| argument. +Unless the environment name is escaped, it will break the command, + since the environment name itself would be replaced with censoring + commands. +As of v4.2, tokens of catcode 4 (the \verb|&| token) are intercepted + and automatically passed through to the output stream, which can + be of use in censoring \verb|tabular| expressions. +Here shows how a partial and full censor could be accomplished, with + the use of appropriate text-escaping delimiters, instead of a + \verb|\censorbox|: + \begingroup - \begin{verbatim} \blackout{ |\begin{tabular}{|c|c|} \hline Title 1 & Title 2 \\ \hline -|a| & |bbb|\\ -|cc| & dd\\ +a & |bbb\\ +cc| & dd\\ \hline \end{tabular}| +|\begin{tabular}{|c|c|}| +\hline +Title 1 & Title 2 \\ +\hline + a & bbb \\ + cc & dd\\ +\hline +|\end{tabular}| } \end{verbatim} @@ -260,12 +280,24 @@ Title 1 & Title 2 \\ \hline Title 1 & Title 2 \\ \hline -|a| & |bbb|\\ -|cc| & dd\\ +a & |bbb\\ +cc| & dd\\ \hline \end{tabular}| +|\begin{tabular}{|c|c|}| +\hline +Title 1 & Title 2 \\ +\hline + a & bbb \\ + cc & dd\\ +\hline +|\end{tabular}| } + \StopCensoring + +For comparison, the uncensored tabulars are: + \blackout{ |\begin{tabular}{|c|c|} \hline @@ -275,6 +307,14 @@ Title 1 & Title 2 \\ |cc| & dd\\ \hline \end{tabular}| +|\begin{tabular}{|c|c|}| +\hline +Title 1 & Title 2 \\ +\hline +a&bbb\\ +cc&dd\\ +\hline +|\end{tabular}| } \endgroup @@ -291,76 +331,6 @@ See section~\ref{S:A} for details on what is possible with respect to the censoring of macro content with this package. -The author received some negative feedback concerning the appearance - resulting from a \verb|\blackout| command. Generally, people did not - like the fact that spaces were not blacked out. -To this end, the \verb|\xblackout| command is introduced in V3.10, which - \textit{cosmetically} blacks out the text more completely - (note, however, that underneath the more complete blackout are still - the word-length blackouts that otherwise compose \verb|\blackout|). - -As of v4.0 of the package, - the additional blacking-out of the \verb|\xblackout| macro is controlled - by one resettable length which laps additional blacking atop the - result of \verb|\blackout|. -This length is defined in the macro \verb|\spacelap|, with - a default value of \spacelap. - -During \verb|\xblackout|, a - right- and left-lapped blacking of dimension \verb|\spacelap| is - applied before and after each space character, respectively. - -The blacking from \verb|\xblackout| is intended to be less ``choppy'' -than that of \verb|\blackout|. However, it too has some drawbacks. The -x-blacking will extend past the margin(s). It is also -possible that not all margin extensions will be uniform in size. -With all these caveats, -it may still be found preferable to the \verb|\blackout| macro, as - shown in the example below. - -{\addtolength{\leftskip}{2.3em} -UNCENSORED RESTRICTED SOURCE: \hrulefill - - -\verb|{%|\\ -\verb|The Liberty missile, with charge diameter (CD) of 80~mm,|\\ -\verb|revealed a penetration capability of 1.30, 1.19, and 1.37~CD|\\ -\verb|in recent testing here. The tests were into armor steel.}|\\ -\verb| |\\ -\verb|New paragraph} with open text.| - -UNCENSORED RESTRICTED OUTPUT: \hrulefill - -{% -The Liberty missile, with charge diameter (CD) of -80~mm, revealed a penetration capability of 1.30, 1.19, and -1.37~CD in recent testing here. The tests were into armor steel. - -New paragraph} with open text. - -CENSORED UNRESTRICTED OUTPUT (\verb|\blackout{}|): \hrulefill - -\blackout{% -The Liberty missile, with charge diameter (CD) of -80~mm, revealed a penetration capability of 1.30, 1.19, and -1.37~CD in recent testing here. The tests were into armor steel. - -New paragraph} with open text. - -CENSORED UNRESTRICTED OUTPUT (\verb|\xblackout{}|): \hrulefill - -\xblackout{% -The Liberty missile, with charge diameter (CD) of -80~mm, revealed a penetration capability of 1.30, 1.19, and -1.37~CD in recent testing here. The tests were into armor steel. - -New paragraph} with open text. - -\hrulefill - -} - -\clearpage \section{Mode II: Public/Unsecure Source (.tex file)} This mode is envisioned for users who must bear a large level of @@ -430,10 +400,11 @@ optional argument can include commands that you want in force for the affect the size of the an ex and \verb|\baselineskip|. Because the redaction width is only approximate, it is possible that the -censored and uncensored originals might have differing text -justification. In the text, the curly braces may be added after the -keyword identifiers so as to produce the proper interaction with the -surrounding whitespace and punctuation. + censored and uncensored originals might have differing text + justification. +In the text, empty braces may be added after the + keyword identifier macros so as to produce the proper interaction + with the subsequent whitespace and punctuation. Because the source (.tex) file contains no restricted information, the use of \verb|\StopCensoring| cannot (in and of itself) produce the @@ -473,7 +444,7 @@ commands to \verb|\censor| and \verb|\censorbox|, respectively. This and the addition of the \verb|\StopCensoring| command to the file will produce the uncensored, restricted result: -\clearpage{\addtolength{\leftskip}{2.3em} +{\addtolength{\leftskip}{2.3em} UNCENSORED NO-LONGER-UNRESTRICTED SOURCE: \hrulefill \verb|\StopCensoring|\\ @@ -541,10 +512,89 @@ remained unaltered. Note also that the censored, unrestricted output may also be obtained from the no-longer-unrestricted source by removing the \verb|\StopCensoring| command at the beginning of the file. -It is not envisioned that the \verb|\blackout| or \verb|\xblackout| -commands, discussed in the prior section, are used in this mode, where +It is not envisioned that the \verb|\blackout| +command, discussed in the prior section, is used in this mode, where the source file is in an unsecure environment. +\section{Contiguous Blackout} + +The author received some negative feedback concerning the appearance + resulting from the \verb|\blackout| command. Generally, people did not + like the fact that spaces were not blacked out. +To this end, the \verb|\xblackout| command is introduced in V3.10, which + \textit{cosmetically} blacks out the text more completely + (note, however, that underneath the more complete blackout are still + the word-length blackouts that otherwise compose \verb|\blackout|). + +As of v4.2 of this package, + additional blacking-out provided by the \verb|\xblackout| macro + does not make use of any tunable parameters, but merely employs + the \verb|\fontdimen| parameters already provided by each font. +% is controlled +% by one resettable length which laps additional blacking atop the +% result of \verb|\blackout|. +%This length is defined in the macro \verb|\spacelap|, with +% a default value of \spacelap. + +%During \verb|\xblackout|, a +% right- and left-lapped blacking of dimension \verb|\spacelap| is +% applied before and after each space character, respectively. + +The blacking from \verb|\xblackout| is intended to be less ``choppy'' +than that of \verb|\blackout|. However, it too has some drawbacks. +Importantly, because spaces are now subject to blackout, any + space that would otherwise be ignored by \verb|\ignorespaces| or + \verb|\ignorespacesafterend| will not be ignored during + the \verb|\xblackout|. +These will include bounding spaces in \verb|tabular| cells as well +as trailing spaces after the \verb|\end| of environments. + +With these caveats, +it may still be found preferable to the \verb|\blackout| macro, as + shown in the example below. + +{\addtolength{\leftskip}{2.3em} +UNCENSORED RESTRICTED SOURCE: \hrulefill + + +\verb|\|\textit{x}\verb|blackout{|\\ +\verb|The Liberty missile, with charge diameter (CD) of 80~mm,|\\ +\verb|revealed a penetration capability of 1.30, 1.19, and 1.37~CD|\\ +\verb|in recent testing here. The tests were into armor steel.}|\\ +\verb| |\\ +\verb|New paragraph} with open text.| + +UNCENSORED RESTRICTED OUTPUT: \hrulefill + +{ +The Liberty missile, with charge diameter (CD) of +80~mm, revealed a penetration capability of 1.30, 1.19, and +1.37~CD in recent testing here. The tests were into armor steel. + +New paragraph} with open text. + +CENSORED UNRESTRICTED OUTPUT (\verb|\blackout{}|): \hrulefill + +\blackout{ +The Liberty missile, with charge diameter (CD) of +80~mm, revealed a penetration capability of 1.30, 1.19, and +1.37~CD in recent testing here. The tests were into armor steel. + +New paragraph} with open text. + +CENSORED UNRESTRICTED OUTPUT (\verb|\xblackout{}|): \hrulefill + +\xblackout{ +The Liberty missile, with charge diameter (CD) of +80~mm, revealed a penetration capability of 1.30, 1.19, and +1.37~CD in recent testing here. The tests were into armor steel. + +New paragraph} with open text. + +\hrulefill + +} + \section{Can I Censor Control Sequences?\label{S:A}} In general, the \textsf{censor} package is designed to operate on @@ -574,12 +624,11 @@ For macros outside of these special cases, the default behavior is Consider the following line of \LaTeX{} code: -\verb|This is \textit{italic text}|\\ +\verb|\blackout{This is \textit{italic text}}|\\ \blackout{|This is \textit{italic text}|\\This is \textit{italic text}} -It would normally render as in the 2nd line. -When included as part of the \verb|\blackout| argument, it renders as the - 3rd line. +With censoring disabled, it would normally render as in the 2nd line. +When enabled, it renders as the 3rd line. The \verb|\textit| is still part of the blackout rendering, but the \textit{input} to \verb|\textit| has been censored and the censor rule does not change its presented shape under the influence @@ -589,9 +638,10 @@ Some macros, however, expand to literal text. Because macros are, by default, carried literally into the output, they will only expand into text \textit{after} the censoring has been applied. -Consider the following line of \LaTeX{} code: +Consider the following line of \LaTeX{} code, in which the macro + \verb|\today| is not rendered until after censoring is complete: -\verb|Today's date is \today.|\\ +\verb|\blackout{Today's date is \today.}|\\ \blackout{|Today's date is \today.|\\Today's date is \today.} If the macro is expandable (and not all are), the \verb|\blackout| @@ -600,7 +650,7 @@ If the macro is expandable (and not all are), the \verb|\blackout| Therefore, with one small change to the above example, the problem can be remedied: -\verb|Today's date is \expanded{\today}.|\\ +\verb|\blackout{Today's date is \expanded{\today}.}|\\ \blackout{|Today's date is \expanded{\today}.|\\% Today's date is \expanded{\today}.} @@ -615,19 +665,53 @@ In either case, however, the output of the unexpandable macro will be \verb|\ref| and its argument are escaped from the blackout. %\settcEscapechar{|} -\verb+In Section |\ref{S:A}|, we discuss censored macros+\\ +\verb+\blackout{In Section |\ref{S:A}|, we discuss censored macros}+\\ \StopCensoring \blackout{In Section |\ref{S:A}|, we discuss censored macros}\\ \RestartCensoring \blackout{In Section |\ref{S:A}|, we discuss censored macros} - -\section{Censor Marks} +\section{Can I Censor Math?} + +As of v4.2, the package makes an attempt to facilitate the + censoring of mathematical expressions, when given as part of the + argument to \verb|\blackout| and \verb|\xblackout|. +Namely, tokens with catcodes 3, 7 and 8 (typically, + \verb|$|, \verb|^|, and \verb|_|) are intercepted and passed + through to the output stream without censoring +(Note: the same is true of catcode 4, the \verb|&| token, which can + be of use in censoring \verb|tabular| as well as + \verb|amsmath| expressions.) + +Because macros are, likewise, passed through by default without + censoring, this means the expression + ``\verb|the equation $\frac{E}{m}=c^{2}$,|'' will be rendered under + \verb|\blackout| as \blackout{the equation $\frac{E}{m}=c^{2}$,}. +There are several points that \textbf{\textit{must}} be noted in + a case such as this. First, the arguments to super/sub-scripts + must be embraced, even if a single character in length. +Secondly, censored math scripts will not be reduced to script size, but + will be censored using the height and depth of the pre-defined + censor rule (this can + affect the vertical spacing of lines). +Finally, customary math spacing associated with operators, + punctuation, etc., may be lost, depending on the expression. + +As of v4.2, \verb|\blackout| will, by default, automatically + detect and censor macros of math-mode Greek letters, such as + \verb|\alpha|, \verb|\beta|, etc. +If one, however, wishes to not waste compilation time searching + for such instances, one may disable the feature with the switch + \verb|\censormathgreekfalse|. + + +\section{Censor-Rule Marks} The censor (blacking) mark is a \verb|\rule| which has a depth -\(-\)0.3ex (\textit{i.e.}, below the baseline), and a height of 2.1ex, -by default. The characteristics of that rule may be changed by setting -the following two lengths. + \(-\)0.3ex (\textit{i.e.}, below the baseline), and a total height + of 2.1ex, by default. +The characteristics of that rule may be changed by setting + the following two lengths. \itshape \verb| \censorruledepth=|length\\ @@ -659,8 +743,9 @@ height mult.\tt\}\{\it depth mult.\tt\}\\ \verb| \RestartCensoring|\\ \verb| \censorruledepth=|\it length\\ \verb| \censorruleheight=|length\\ -\verb| \renewcommand\spacelap{|\it length\tt\}\\ +%\verb| \renewcommand\spacelap{|\it length expression\tt\}\\ \verb| \renewcommand\censordot{|\it token or instruction\tt\}\\ +\verb| \censormathgreektrue| \rm(default) or \verb|\censormathgreekfalse|\\ ~\\} The star ({\tt*}) version of the commands is envisioned when the source document is being created in an unsecure environment, whereas, the @@ -704,10 +789,6 @@ While the syntax of these macros is unchanged, one has the additional the documented \textsf{tokcycle}-package commands. -\item I have found that, in certain cases (for example, with captions created -using the \textsf{boxhandler} package), the censorbox command needs to -be protected by way of \verb|\protect\blackout{...}|. - \item It is preferable not to apply \verb|\censor| to whitespace, or text justification could be adversely affected. If one wishes to censor a multi-word phrase, such as ``Little Bo Peep,'' it is recommended to do @@ -715,16 +796,25 @@ it as follows:\\ \verb| \xblackout{Little Bo Peep}|\\ If such a phrase is to be used repeatedly through a document, it is most convenient to place it as a macro:\\ -\verb| \def\Name{\xblackout{Little Bo Peep}}|\\ +\verb| \newcommand\CenName{\xblackout{Little Bo Peep}}|\\ such that subsequent reference is done indirectly:\\ -\verb| We examine the life of \Name{} in this report,|\\ -\verb| assured that \Name{} line breaks.|\\ -\def\Name{\xblackout{Little Bo Peep}} -\verb| |We examine the life of \Name{} in this report, assured that - \Name{} line breaks.\\ -(Even so, it should be noted that censoring can still affect text -justification, because censored words are never hyphenated across line -boundaries, whereas the original text may have been.) +\verb| We examine the life of \CenName{} in this report,|\\ +\verb| assured that \CenName{} line breaks.|\\ +\newcommand\CenName{\xblackout{Little Bo Peep}} +\verb| |We examine the life of \CenName{} in this report, assured that + \CenName{} line breaks. + +\item Censoring can still affect text justification, because + censored words are never hyphenated across line + boundaries, whereas the original text may have been. +For this reason, both \verb|\blackout| and \verb|\xblackout| + operate locally in \verb|\sloppy| mode, to minimize instances + of overfull \verb|\hbox|es. +(Note however, that effects of \verb|\sloppy| will take hold only + for blacked-out text that closes out a paragraph.) +If necessary, hyphenation points (\verb|\-|) or + \verb|\allowbreak| may be added to words subject to blackout + or xblackout, to facilitate manual hyphenation. \item Users have asked for color support in the package. I do not wish to hardwire color into the package---however, @@ -752,10 +842,11 @@ The value of \verb|\censorcolor| can be redefined on the fly to change \end{itemize} +\clearpage \section{Source Code} -The source code for \textsf{censor} is so short as to be included below: +The source code for \textsf{censor} is included below: -\verbatiminput{censor.sty} +\verbfilenobox[\small]{censor.sty} \end{document} diff --git a/macros/latex/contrib/colorist/colorart.cls b/macros/latex/contrib/colorist/colorart.cls index 98e55b01ae..b90308c016 100644 --- a/macros/latex/contrib/colorist/colorart.cls +++ b/macros/latex/contrib/colorist/colorart.cls @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplClass {colorart} - {2022/04/03} {} + {2022/04/17} {} {A colorful article style} \tl_const:Nn \l__colorclass_base_class_tl { article } diff --git a/macros/latex/contrib/colorist/colorbook.cls b/macros/latex/contrib/colorist/colorbook.cls index 9e43b291af..2e5bd693d2 100644 --- a/macros/latex/contrib/colorist/colorbook.cls +++ b/macros/latex/contrib/colorist/colorbook.cls @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplClass {colorbook} - {2022/04/03} {} + {2022/04/17} {} {A colorful book style} \tl_const:Nn \l__colorclass_base_class_tl { book } diff --git a/macros/latex/contrib/colorist/colorist-doc.pdf b/macros/latex/contrib/colorist/colorist-doc.pdf index 9e0720ff4c..2832b0bf7c 100644 Binary files a/macros/latex/contrib/colorist/colorist-doc.pdf and b/macros/latex/contrib/colorist/colorist-doc.pdf differ diff --git a/macros/latex/contrib/colorist/colorist-doc.tex b/macros/latex/contrib/colorist/colorist-doc.tex index 5a1e6d3955..b6b7f696fa 100644 --- a/macros/latex/contrib/colorist/colorist-doc.tex +++ b/macros/latex/contrib/colorist/colorist-doc.tex @@ -8,6 +8,8 @@ \usepackage{hologo} % more TeX logo \usetikzlibrary{calc} +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{English} @@ -91,7 +93,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \title{{\normalfont\bfseries\color{main-text}\colorist{}}\\write your articles or books in a colorful way} \author{Jinwen XU} diff --git a/macros/latex/contrib/colorist/colorist-fancy.sty b/macros/latex/contrib/colorist/colorist-fancy.sty index 5f69f0857a..f604f3ff47 100644 --- a/macros/latex/contrib/colorist/colorist-fancy.sty +++ b/macros/latex/contrib/colorist/colorist-fancy.sty @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplPackage {colorist-fancy} - {2022/04/03} {} + {2022/04/17} {} {The fancy style of colorist} \@ifpackageloaded { colorist } {} @@ -36,9 +36,22 @@ %%================================ \RequirePackage { anyfontsize } +\NewCommandCopy \colorist_original_bfseries: \bfseries +\bool_new:N \l_colorist_is_under_bfseries_bool +\bool_set_false:N \l_colorist_is_under_bfseries_bool +\RenewDocumentCommand \bfseries { } + { + \bool_if:NF \l_colorist_is_under_bfseries_bool + { + \colorlet{colorist-temp-color}{.} + \color{colorist-temp-color!90!paper} + } + \colorist_original_bfseries: + \bool_set_true:N \l_colorist_is_under_bfseries_bool + } \bool_if:NTF \l__colorist_use_boldface_bool { - \cs_new:Nn \colorist_bfseries: { \bfseries \colorlet{colorist-temp-color}{.} \color{colorist-temp-color!90!paper} } + \cs_new:Nn \colorist_bfseries: { \bfseries } } { \cs_new:Nn \colorist_bfseries: {} @@ -198,7 +211,7 @@ %%================================ %% Title format %%================================ -\RequirePackage [ explicit, newparttoc ] { titlesec } +\RequirePackage [ explicit, newparttoc, nobottomtitles ] { titlesec } \PassOptionsToPackage { normalem } { ulem } \RequirePackage { ulem } @@ -408,22 +421,22 @@ {\hspace*{-2em}} {\titlerule*[10pt]{\parbox{3pt}{\hspace*{-.25pt}\textcolor{main-text!15!paper}{.}}}\color{maintheme}\normalfont\sffamily\contentspage} \titlecontents{section} - [4em] % i.e., 2em (chapter) + 2em + [5em] % i.e., 2em (chapter) + 3em {\addvspace{.3pc}\normalfont\color{maintheme}\sffamily} - {\contentslabel{1.75em}} - {\hspace*{-1.75em}} + {\contentslabel{2.75em}} + {\hspace*{-2.75em}} {\titlerule*[10pt]{\parbox{3pt}{\textcolor{main-text!15!paper}{.}}}\color{maintheme}\contentspage} \titlecontents{subsection} - [7em] % i.e., 4em (section) + 3em + [8.75em] % i.e., 5em (section) + 3.75em {\addvspace{.15pc}\normalfont\sffamily} - {\contentslabel{2.75em}} - {\hspace*{-2.75em}} + {\contentslabel{3.50em}} + {\hspace*{-3.50em}} {\titlerule*[10pt]{\parbox{3pt}{\textcolor{main-text!15!paper}{.}}}\color{main-text!45!paper}\contentspage} \titlecontents{subsubsection} - [10em] % i.e., 7em (subsection) + 3em + [12.75em] % i.e., 8.75em (subsection) + 4em {\normalfont\sffamily} - {\contentslabel{3.25em}} - {\hspace*{-3.25em}} + {\contentslabel{3.75em}} + {\hspace*{-3.75em}} {\titlerule*[10pt]{\parbox{3pt}{\textcolor{main-text!15!paper}{.}}}\color{main-text!45!paper}\contentspage} } { @@ -451,7 +464,8 @@ %% Lists %%================================ \RequirePackage { enumitem } -\setlist{noitemsep} +\setlistdepth{10} +\setlist{noitemsep, topsep=.33\topsep} \setlist[enumerate]{labelsep=*, leftmargin=*} \setlist[enumerate,1]{label=\arabic*$)$, ref = \arabic*$)$} @@ -461,11 +475,13 @@ ref = \arabic{enumi}.\emph{\roman{enumii}}.\emph{\alph*}$)$} \setlist[description]{font=\normalfont\colorist_bfseries:} -\setlist[itemize]{leftmargin=*} +\renewlist{itemize}{itemize}{10} +\setlist[itemize]{leftmargin=*,label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\cdot$}} \AddLanguageSetting { \setlist[itemize,1]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\bullet$}} } -\AddLanguageSetting [french] { \setlist[itemize,1]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!55!paper}{---}} } +\AddLanguageSetting [french] { \setlist[itemize,1]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{---}} } \setlist[itemize,2]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{--}} -\setlist[itemize,3]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{\texttt{*}}} +\setlist[itemize,3]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\circ$}} +\setlist[itemize,4]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\ast$}} %%================================ %% Blank page @@ -555,10 +571,28 @@ heading_suffix "}\n" \par \vspace{.3\baselineskip} } + \renewcommand*{\indexspace} { \par - \vspace{2pc~plus~.5pc~minus~.3pc} + \vspace{2pc ~ plus ~ .5pc ~ minus ~ .3pc} + } + +\bool_new:N \l__colorist_if_first_subitem_bool +\renewcommand*{\@idxitem} + { + \par\hangindent40\p@ + \bool_set_true:N \l__colorist_if_first_subitem_bool + } +\renewcommand*{\subitem} + { + \par\hangindent40\p@ + \bool_if:NT \l__colorist_if_first_subitem_bool + { + \nobreak + \bool_set_false:N \l__colorist_if_first_subitem_bool + } + \hspace*{20\p@} } %%================================ @@ -621,7 +655,7 @@ heading_suffix "}\n" {\normalfont}{} {\newline} {{\thmname{#1}\nobreakspace\thmnumber{#2}} - {\color{main-text!50!paper}\thmnote{\hspace{.4em}\ensuremath{(\text{#3})}}}\smallskip} + {\color{main-text!50!paper}\thmnote{\hspace{.4em}$($#3$)$}}\smallskip} } { \newtheoremstyle{simple} @@ -630,7 +664,7 @@ heading_suffix "}\n" {\normalfont}{} {0pt} {{\thmname{#1}\nobreakspace\thmnumber{#2}} - {\color{main-text!50!paper}\thmnote{\hspace{.4em}\ensuremath{(\text{#3})}}}\nobreakspace\nobreakspace{\normalfont\textcolor{main-text!27!paper}{---}}\nobreakspace\nobreakspace} + {\color{main-text!50!paper}\thmnote{\hspace{.4em}$($#3$)$}}\nobreakspace\nobreakspace{\normalfont\textcolor{main-text!27!paper}{---}}\nobreakspace\nobreakspace} } \renewcommand{\qedsymbol}{ @@ -698,6 +732,8 @@ heading_suffix "}\n" \RequirePackage { projlib-theorem } +\tl_gset:Nn \g_crthm_combined_name_sep_tl { \textcolor{main-text}{-} } + \SetTheorem { theorem, lemma, proposition, corollary, property, axiom, definition-theorem, definition-proposition } { name style = { @@ -712,7 +748,7 @@ heading_suffix "}\n" } } -\SetTheorem { fact, example, problem, question, exercise } +\SetTheorem { application, fact, example, problem, question, exercise } { name style = { heading style = { \color{main-text}\colorist_bfseries:\g_colorist_title_font_common_tl\textsc } @@ -726,44 +762,6 @@ heading_suffix "}\n" } } -\SetTheorem { definition-proposition } - { - name = { - heading = { - , english = \color{forestgreen}Definition\color{main-text}-\color{orange}Proposition - , french = \color{forestgreen}Définition\color{main-text}-\color{orange}Proposition - , ngerman = \color{forestgreen}Definition\color{main-text}-\color{orange}Proposition - , italian = \color{forestgreen}Definizione\color{main-text}-\color{orange}Proposizione - , portuguese = \color{forestgreen}Definição\color{main-text}-\color{orange}Proposição - , brazilian = \color{forestgreen}Definição\color{main-text}-\color{orange}Proposição - , spanish = \color{forestgreen}Definición\color{main-text}-\color{orange}Proposición - , schinese = \color{forestgreen}定义\color{main-text}-\color{orange}命题 - , tchinese = \color{forestgreen}定義\color{main-text}-\color{orange}命題 - , japanese = \color{forestgreen}定義\color{main-text}-\color{orange}命題 - , russian = \color{forestgreen}Определение\color{main-text}-\color{orange}Предложение - } - } - } - -\SetTheorem { definition-theorem } - { - name = { - heading = { - , english = \color{forestgreen}Definition\color{main-text}-\color{orange}Theorem - , french = \color{forestgreen}Définition\color{main-text}-\color{orange}Théorème - , ngerman = \color{forestgreen}Definition\color{main-text}-\color{orange}Satz - , italian = \color{forestgreen}Definizione\color{main-text}-\color{orange}Teorema - , portuguese = \color{forestgreen}Definição\color{main-text}-\color{orange}Teorema - , brazilian = \color{forestgreen}Definição\color{main-text}-\color{orange}Teorema - , spanish = \color{forestgreen}Definición\color{main-text}-\color{orange}Teorema - , schinese = \color{forestgreen}定义\color{main-text}-\color{orange}定理 - , tchinese = \color{forestgreen}定義\color{main-text}-\color{orange}定理 - , japanese = \color{forestgreen}定義\color{main-text}-\color{orange}定理 - , russian = \color{forestgreen}Определение\color{main-text}-\color{orange}Теорема - } - } - } - \bool_if:NF \l__projlib_theorem_complexname_bool { \SetTheorem { theorem, lemma, proposition, corollary, property, axiom, definition-theorem, definition-proposition } @@ -784,7 +782,7 @@ heading_suffix "}\n" } } - \SetTheorem { fact, example, problem, question, exercise } + \SetTheorem { application, fact, example, problem, question, exercise } { name style = { , crefname style = { \color{main-text}\colorist_bfseries:\g_colorist_title_font_common_tl\textsc } @@ -801,70 +799,6 @@ heading_suffix "}\n" , numbering style = { \color{purple}\colorist_bfseries:\g_colorist_title_font_common_tl } } } - - \SetTheorem { definition-proposition } - { - name = { - , crefname = { - , english = {\color{forestgreen}Definition\color{main-text}-\color{orange}Proposition}{\color{forestgreen}Definition\color{main-text}-\color{orange}Proposition} - , french = [la]{\color{forestgreen}Définition\color{main-text}-\color{orange}Proposition}[les]{\color{forestgreen}Définition\color{main-text}-\color{orange}Proposition} - , ngerman = {\color{forestgreen}Definition\color{main-text}-\color{orange}Proposition}{\color{forestgreen}Definition\color{main-text}-\color{orange}Proposition} - , italian = [la]{\color{forestgreen}Definizione\color{main-text}-\color{orange}Proposizione}[le]{\color{forestgreen}Definizione\color{main-text}-\color{orange}Proposizione} - , portuguese = [a]{\color{forestgreen}Definição\color{main-text}-\color{orange}Proposição}[as]{\color{forestgreen}Definição\color{main-text}-\color{orange}Proposição} - , brazilian = [a]{\color{forestgreen}Definição\color{main-text}-\color{orange}Proposição}[as]{\color{forestgreen}Definição\color{main-text}-\color{orange}Proposição} - , spanish = [la]{\color{forestgreen}Definición\color{main-text}-\color{orange}Proposición}[las]{\color{forestgreen}Definición\color{main-text}-\color{orange}Proposición} - , schinese = {\color{forestgreen}定义\color{main-text}-\color{orange}命题}{\color{forestgreen}定义\color{main-text}-\color{orange}命题} - , tchinese = {\color{forestgreen}定義\color{main-text}-\color{orange}命題}{\color{forestgreen}定義\color{main-text}-\color{orange}命題} - , japanese = {\color{forestgreen}定義\color{main-text}-\color{orange}命題}{\color{forestgreen}定義\color{main-text}-\color{orange}命題} - , russian = {\color{forestgreen}Определение\color{main-text}-\color{orange}Предложение}{\color{forestgreen}Определение\color{main-text}-\color{orange}Предложение} - } - , Crefname = { - , english = {\color{forestgreen}Definition\color{main-text}-\color{orange}Proposition}{\color{forestgreen}Definition\color{main-text}-\color{orange}Proposition} - , french = [la]{\color{forestgreen}Définition\color{main-text}-\color{orange}Proposition}[les]{\color{forestgreen}Définition\color{main-text}-\color{orange}Proposition} - , ngerman = {\color{forestgreen}Definition\color{main-text}-\color{orange}Proposition}{\color{forestgreen}Definition\color{main-text}-\color{orange}Proposition} - , italian = [la]{\color{forestgreen}Definizione\color{main-text}-\color{orange}Proposizione}[le]{\color{forestgreen}Definizione\color{main-text}-\color{orange}Proposizione} - , portuguese = [a]{\color{forestgreen}Definição\color{main-text}-\color{orange}Proposição}[as]{\color{forestgreen}Definição\color{main-text}-\color{orange}Proposição} - , brazilian = [a]{\color{forestgreen}Definição\color{main-text}-\color{orange}Proposição}[as]{\color{forestgreen}Definição\color{main-text}-\color{orange}Proposição} - , spanish = [la]{\color{forestgreen}Definición\color{main-text}-\color{orange}Proposición}[las]{\color{forestgreen}Definición\color{main-text}-\color{orange}Proposición} - , schinese = {\color{forestgreen}定义\color{main-text}-\color{orange}命题}{\color{forestgreen}定义\color{main-text}-\color{orange}命题} - , tchinese = {\color{forestgreen}定義\color{main-text}-\color{orange}命題}{\color{forestgreen}定義\color{main-text}-\color{orange}命題} - , japanese = {\color{forestgreen}定義\color{main-text}-\color{orange}命題}{\color{forestgreen}定義\color{main-text}-\color{orange}命題} - , russian = {\color{forestgreen}Определение\color{main-text}-\color{orange}Предложение}{\color{forestgreen}Определение\color{main-text}-\color{orange}Предложение} - } - } - } - - \SetTheorem { definition-theorem } - { - name = { - , crefname = { - , english = {\color{forestgreen}Definition\color{main-text}-\color{orange}Theorem}{\color{forestgreen}Definition\color{main-text}-\color{orange}Theorem} - , french = [la]{\color{forestgreen}Définition\color{main-text}-\color{orange}Théorème}[les]{\color{forestgreen}Définition\color{main-text}-\color{orange}Théorème} - , ngerman = {\color{forestgreen}Definition\color{main-text}-\color{orange}Satz}{\color{forestgreen}Definition\color{main-text}-\color{orange}Satz} - , italian = [la]{\color{forestgreen}Definizione\color{main-text}-\color{orange}Teorema}[le]{\color{forestgreen}Definizione\color{main-text}-\color{orange}Teorema} - , portuguese = [a]{\color{forestgreen}Definição\color{main-text}-\color{orange}Teorema}[as]{\color{forestgreen}Definição\color{main-text}-\color{orange}Teorema} - , brazilian = [a]{\color{forestgreen}Definição\color{main-text}-\color{orange}Teorema}[as]{\color{forestgreen}Definição\color{main-text}-\color{orange}Teorema} - , spanish = [la]{\color{forestgreen}Definición\color{main-text}-\color{orange}Teorema}[las]{\color{forestgreen}Definición\color{main-text}-\color{orange}Teorema} - , schinese = {\color{forestgreen}定义\color{main-text}-\color{orange}定理}{\color{forestgreen}定义\color{main-text}-\color{orange}定理} - , tchinese = {\color{forestgreen}定義\color{main-text}-\color{orange}定理}{\color{forestgreen}定義\color{main-text}-\color{orange}定理} - , japanese = {\color{forestgreen}定義\color{main-text}-\color{orange}定理}{\color{forestgreen}定義\color{main-text}-\color{orange}定理} - , russian = {\color{forestgreen}Определение\color{main-text}-\color{orange}Теорема}{\color{forestgreen}Определение\color{main-text}-\color{orange}Теорема} - } - , Crefname = { - , english = {\color{forestgreen}Definition\color{main-text}-\color{orange}Theorem}{\color{forestgreen}Definition\color{main-text}-\color{orange}Theorem} - , french = [La]{\color{forestgreen}Définition\color{main-text}-\color{orange}Théorème}[Les]{\color{forestgreen}Définition\color{main-text}-\color{orange}Théorème} - , ngerman = {\color{forestgreen}Definition\color{main-text}-\color{orange}Satz}{\color{forestgreen}Definition\color{main-text}-\color{orange}Satz} - , italian = [La]{\color{forestgreen}Definizione\color{main-text}-\color{orange}Teorema}[Le]{\color{forestgreen}Definizione\color{main-text}-\color{orange}Teorema} - , portuguese = [A]{\color{forestgreen}Definição\color{main-text}-\color{orange}Teorema}[As]{\color{forestgreen}Definição\color{main-text}-\color{orange}Teorema} - , brazilian = [A]{\color{forestgreen}Definição\color{main-text}-\color{orange}Teorema}[As]{\color{forestgreen}Definição\color{main-text}-\color{orange}Teorema} - , spanish = [La]{\color{forestgreen}Definición\color{main-text}-\color{orange}Teorema}[Las]{\color{forestgreen}Definición\color{main-text}-\color{orange}Teorema} - , schinese = {\color{forestgreen}定义\color{main-text}-\color{orange}定理}{\color{forestgreen}定义\color{main-text}-\color{orange}定理} - , tchinese = {\color{forestgreen}定義\color{main-text}-\color{orange}定理}{\color{forestgreen}定義\color{main-text}-\color{orange}定理} - , japanese = {\color{forestgreen}定義\color{main-text}-\color{orange}定理}{\color{forestgreen}定義\color{main-text}-\color{orange}定理} - , russian = {\color{forestgreen}Определение\color{main-text}-\color{orange}Теорема}{\color{forestgreen}Определение\color{main-text}-\color{orange}Теорема} - } - } - } } \RequirePackage { marginnote } @@ -968,53 +902,47 @@ heading_suffix "}\n" \colorist_add_colorbox:nn { theorem, lemma, proposition, corollary, property, axiom, definition-proposition, definition-theorem } { - enhanced~jigsaw, pad~at~break*=1mm, breakable, lines~before~break=3, + enhanced~jigsaw, breakable, lines~before~break=3, left=3.5mm, right=3.5mm, - before=\par\medskip\noindent, colback=main-text!3!paper, opacityframe=0.9, colframe=orange, arc=.7mm } -\colorist_add_colorbox:nn { definition, assumption, convention, hypothesis, notation } + \colorist_add_colorbox:nn { definition, assumption, convention, hypothesis, notation, proposition-definition, theorem-definition } { - enhanced~jigsaw, pad~at~break*=1mm, breakable, lines~before~break=3, + enhanced~jigsaw, breakable, lines~before~break=3, left=4mm, right=4mm, top=1mm, bottom=1mm, - before=\par\medskip\noindent, colback=lightorange!10!paper, boxrule=0pt, frame~hidden, borderline~west={1.5mm}{0mm}{forestgreen}, arc=.7mm } -\colorist_add_colorbox:nn { fact, example } +\colorist_add_colorbox:nn { application, fact, example } { - enhanced~jigsaw, pad~at~break*=1mm, breakable, lines~before~break=3, + enhanced~jigsaw, breakable, lines~before~break=3, colback=main-text!5!paper, - before=\par\medskip\noindent, boxrule=0pt, frame~hidden, arc=.7mm } \colorist_add_colorbox:nn { conjecture } { - enhanced~jigsaw, pad~at~break*=1mm, breakable, lines~before~break=3, + enhanced~jigsaw, breakable, lines~before~break=3, left=3.5mm, right=3.5mm, - before=\par\medskip\noindent, colback=main-text!3!paper, opacityframe=0.7, colframe=purple, arc=.7mm } \colorist_add_colorbox:nn { problem } { - enhanced~jigsaw, pad~at~break*=1mm, breakable, lines~before~break=3, + enhanced~jigsaw, breakable, lines~before~break=3, colback=yellow!25!paper, - before=\par\medskip\noindent, boxrule=0pt, frame~hidden, arc=.7mm } \colorist_add_colorbox:nn { question, exercise, remark, observation } { - enhanced~jigsaw, pad~at~break*=1mm, breakable, lines~before~break=3, + enhanced~jigsaw, breakable, lines~before~break=3, oversize, top=0mm, bottom=0mm, - before=\par\medskip\noindent, opacityframe=0, opacityback=0 } @@ -1100,6 +1028,22 @@ heading_suffix "}\n" \theoremstyle{simple} +\NewDocumentEnvironment { emphasis } { } + { + \enlargethispage{2mm} + \begin{tcolorbox} + [ + enhanced ~ jigsaw, enforce~breakable, oversize, + % nobeforeafter, + left = 1em, right=0mm, top=.5mm, bottom=0mm, boxrule=0pt, + colback=maintheme!3!paper, frame ~ hidden, + borderline ~ west = {.3em} {0mm} {maintheme!90!paper}, arc = 0.2mm, + ] + } + { + \end{tcolorbox} + } + \hook_gput_code:nnn { env/quote/begin } { colorist } { \small } %%================================ diff --git a/macros/latex/contrib/colorist/colorist.sty b/macros/latex/contrib/colorist/colorist.sty index 1095910ca9..2e28c650ad 100644 --- a/macros/latex/contrib/colorist/colorist.sty +++ b/macros/latex/contrib/colorist/colorist.sty @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplPackage {colorist} - {2022/04/03} {} + {2022/04/17} {} {A colorful style for articles and books} \keys_define:nn { colorist } diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index bae091e2c1..2fab4f66fc 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -1,5 +1,5 @@ % -% Copyright (C) 2021-2022 by Qu Yi +% Copyright (C) 2021-2022 by Qu Yi % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -15,7 +15,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2022/03/18}{1.65} +\ProvidesExplClass{easybook}{2022/04/21}{1.66} {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/18}{1.65} +\ProvidesExplPackage{easybase}{2022/04/21}{1.66} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -2322,7 +2322,7 @@ } % %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2022/03/18}{1.65} +\ProvidesExplFile{eb-tcolorbox.cfg}{2022/04/21}{1.66} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \addtotcbstyle #1#2 diff --git a/macros/latex/contrib/easybook/easybook.ins b/macros/latex/contrib/easybook/easybook.ins index 0f0617f5bd..a8df3cd45a 100644 --- a/macros/latex/contrib/easybook/easybook.ins +++ b/macros/latex/contrib/easybook/easybook.ins @@ -1,5 +1,5 @@ % -% Copyright (C) 2021-2022 by Qu Yi +% Copyright (C) 2021-2022 by Qu Yi % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -19,7 +19,7 @@ \usedir{tex/latex/easybook} \preamble -Copyright (C) 2021-2022 by Qu Yi +Copyright (C) 2021-2022 by Qu Yi This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf index 0df829c25a..86dbab1d2c 100644 Binary files a/macros/latex/contrib/easybook/easybook.pdf and b/macros/latex/contrib/easybook/easybook.pdf differ diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex index b147f94983..5f76a273c6 100644 --- a/macros/latex/contrib/easybook/easybook.tex +++ b/macros/latex/contrib/easybook/easybook.tex @@ -21,11 +21,11 @@ name = easybook, color-scheme = blue, title = EASYBOOK使用手册, - version = v1.65, - date = 2022/03/18, + version = v1.66, + date = 2022/04/21, authors = 瞿毅, info = 简便地排版中文学位论文或书籍, - email = q1jx@foxmail.com, + email = toquyi@163.com, url = https://gitee.com/texl3/easybook, abstract = { diff --git a/macros/latex/contrib/minimalist/minimalist-classical.sty b/macros/latex/contrib/minimalist/minimalist-classical.sty index 8da62f16f6..5851a6b92f 100644 --- a/macros/latex/contrib/minimalist/minimalist-classical.sty +++ b/macros/latex/contrib/minimalist/minimalist-classical.sty @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplPackage {minimalist-classical} - {2022/04/03} {} + {2022/04/17} {} {The classical style of minimalist} \@ifpackageloaded { minimalist } {} @@ -36,9 +36,22 @@ %%================================ \RequirePackage { anyfontsize } +\NewCommandCopy \minimalist_original_bfseries: \bfseries +\bool_new:N \l_minimalist_is_under_bfseries_bool +\bool_set_false:N \l_minimalist_is_under_bfseries_bool +\RenewDocumentCommand \bfseries { } + { + \bool_if:NF \l_minimalist_is_under_bfseries_bool + { + \colorlet{minimalist-temp-color}{.} + \color{minimalist-temp-color!70!paper} + } + \minimalist_original_bfseries: + \bool_set_true:N \l_minimalist_is_under_bfseries_bool + } \bool_if:NTF \l__minimalist_use_boldface_bool { - \cs_new:Nn \minimalist_bfseries: { \bfseries \colorlet{minimalist-temp-color}{.} \color{minimalist-temp-color!70!paper} } + \cs_new:Nn \minimalist_bfseries: { \bfseries } } { \cs_new:Nn \minimalist_bfseries: {} @@ -54,7 +67,7 @@ \tl_new:N \g_minimalist_title_font_paragraph_tl \tl_gset:Nn \g_minimalist_title_font_part_tl { \minimalist_bfseries: \g_minimalist_title_font_common_tl } -\tl_gset:Nn \g_minimalist_title_font_chapter_tl { \minimalist_bfseries: \g_minimalist_title_font_common_tl } +\tl_gset:Nn \g_minimalist_title_font_chapter_tl { \minimalist_bfseries: \g_minimalist_title_font_common_tl \scshape } \tl_gset:Nn \g_minimalist_title_font_section_tl { \minimalist_bfseries: } \tl_gset:Nn \g_minimalist_title_font_subsection_tl { \minimalist_bfseries: } \tl_gset:Nn \g_minimalist_title_font_subsubsection_tl { \minimalist_bfseries: \itshape } @@ -251,7 +264,7 @@ %%================================ %% Title format %%================================ -\RequirePackage [ explicit, newparttoc ] { titlesec } +\RequirePackage [ explicit, newparttoc, nobottomtitles ] { titlesec } \PassOptionsToPackage { normalem } { ulem } \RequirePackage { ulem } @@ -322,17 +335,17 @@ \titleformat{\chapter} {\thispagestyle{fancy} \LocallyStopLineNumbers - \color{main-text!80!paper}\g_minimalist_title_font_chapter_tl\fontsize{16}{0}\selectfont}{}{0em} + \color{main-text!80!paper}\fontsize{16}{0}\selectfont}{}{0em} {\rlap{\hspace*{-.5em}{\color{main-text!12!paper} - \fontsize{80}{0}\selectfont\raisebox{-7pt}{\thechapter}}}#1} + \fontsize{80}{0}\selectfont\raisebox{-7pt}{\thechapter}}} \g_minimalist_title_font_chapter_tl #1} [\ResumeLineNumbers] \titleformat{name=\chapter,numberless} {\thispagestyle{fancy} \LocallyStopLineNumbers % \phantomsection\addcontentsline{toc}{chapter}{#1} - \color{main-text!80!paper}\g_minimalist_title_font_chapter_tl\fontsize{16}{0}\selectfont}{}{0em} + \color{main-text!80!paper}\fontsize{16}{0}\selectfont}{}{0em} {\rlap{\hspace*{-.5em}{\color{main-text!12!paper} - \fontsize{80}{0}\selectfont\normalfont\raisebox{-7pt}{*}}}#1} + \fontsize{80}{0}\selectfont\normalfont\raisebox{-7pt}{*}}} \g_minimalist_title_font_chapter_tl #1} [\ResumeLineNumbers] } { @@ -455,22 +468,22 @@ {\hspace*{-2em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{section} - [4em] % i.e., 2em (chapter) + 2em + [5em] % i.e., 2em (chapter) + 3em {\normalfont} - {\contentslabel[\textcolor{main-text!27!paper}{\small\g_minimalist_section_decoration_char_tl}\,\textcolor{main-text!90!paper}{ \minimalist_apply_title_numbering_style:n { \thecontentslabel } }\,\textcolor{main-text!27!paper}{\small\g_minimalist_section_decoration_char_tl}]{2em}} - {\hspace*{-2em}} + {\contentslabel[\textcolor{main-text!27!paper}{\small\g_minimalist_section_decoration_char_tl}\,\textcolor{main-text!90!paper}{ \minimalist_apply_title_numbering_style:n { \thecontentslabel } }\,\textcolor{main-text!27!paper}{\small\g_minimalist_section_decoration_char_tl}]{2.75em}} + {\hspace*{-2.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsection} - [7em] % i.e., 4em (section) + 3em + [8em] % i.e., 5em (section) + 3em {\normalfont} {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.75em}} {\hspace*{-2.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsubsection} - [9.5em] % i.e., 7em (subsection) + 3.5em + [12em] % i.e., 8em (subsection) + 4em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{3.25em}} - {\hspace*{-3.25em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{3.75em}} + {\hspace*{-3.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} } { @@ -481,16 +494,16 @@ {\hspace*{-1.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsection} - [4.5em] % i.e., 2em (section) + 2.5em + [4.75em] % i.e., 2em (section) + 2.75em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.25em}} - {\hspace*{-2.25em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.50em}} + {\hspace*{-2.50em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsubsection} - [7.5em] % i.e., 4.5em (subsection) + 3em + [8.25em] % i.e., 4.75em (subsection) + 3.5em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.75em}} - {\hspace*{-2.75em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{3.25em}} + {\hspace*{-3.25em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} } @@ -498,7 +511,8 @@ %% Lists %%================================ \RequirePackage { enumitem } -\setlist{noitemsep} +\setlistdepth{9} +\setlist{noitemsep, topsep=.33\topsep} \setlist[enumerate]{labelsep=*, leftmargin=*} \setlist[enumerate,1]{label=\arabic*$)$, ref = \arabic*$)$} @@ -515,9 +529,15 @@ \setlist[itemize]{leftmargin=*} \AddLanguageSetting { \setlist[itemize,1]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\bullet$}} } -\AddLanguageSetting [french] { \setlist[itemize,1]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!55!paper}{---}} } +\AddLanguageSetting [french] { \setlist[itemize,1]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{---}} } \setlist[itemize,2]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{--}} -\setlist[itemize,3]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{\texttt{*}}} +\setlist[itemize,3]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\circ$}} +\setlist[itemize,4]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\ast$}} +\setlist[itemize,5]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\cdot$}} +\setlist[itemize,6]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\cdot$}} +\setlist[itemize,7]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\cdot$}} + +\renewlist{itemize}{itemize}{9} %%================================ %% Blank page @@ -598,10 +618,28 @@ heading_suffix "}\n" \par \vspace{.3\baselineskip} } + \renewcommand*{\indexspace} { \par - \vspace{2pc~plus~.5pc~minus~.3pc} + \vspace{2pc ~ plus ~ .5pc ~ minus ~ .3pc} + } + +\bool_new:N \l__minimalist_if_first_subitem_bool +\renewcommand*{\@idxitem} + { + \par\hangindent40\p@ + \bool_set_true:N \l__minimalist_if_first_subitem_bool + } +\renewcommand*{\subitem} + { + \par\hangindent40\p@ + \bool_if:NT \l__minimalist_if_first_subitem_bool + { + \nobreak + \bool_set_false:N \l__minimalist_if_first_subitem_bool + } + \hspace*{20\p@} } \hook_gput_code:nnn { begindocument/before } { minimalist } @@ -631,8 +669,8 @@ heading_suffix "}\n" {\normalfont}{} {\newline} { \global\let\qedsymbol\simpleqedsymbol - {\thmname{#1}\nobreakspace\thmnumber{#2}} - \thmnote{\hspace{.4em}\textcolor{main-text!27!paper}{ \l_minimalist_sep_bar }\hspace{.4em}\color{main-text!50!paper}\ensuremath{(\text{#3})}} + {\thmname{#1}\thmnumber{\nobreakspace #2}} + \thmnote{\hspace{.4em}\textcolor{main-text!27!paper}{ \l_minimalist_sep_bar }\hspace{.4em}\color{main-text!50!paper}$($#3$)$} \smallskip \pushQED{\qed} } @@ -644,9 +682,9 @@ heading_suffix "}\n" {\normalfont}{} {0pt} { \global\let\qedsymbol\simpleqedsymbol - {\thmname{#1}\nobreakspace\thmnumber{#2}}\hspace{.4em} + {\thmname{#1}\thmnumber{\nobreakspace #2}}\hspace{.4em} \textcolor{main-text!27!paper}{ \l_minimalist_sep_bar }\hspace{.4em} - \color{main-text!50!paper}\thmnote{\ensuremath{(\text{#3})}\nobreakspace\nobreakspace} + \color{main-text!50!paper}\thmnote{$($#3$)$\nobreakspace\nobreakspace} \pushQED{\qed} } } @@ -811,12 +849,14 @@ heading_suffix "}\n" } } +\PassOptionsToPackage { many } { tcolorbox } +\RequirePackage { tcolorbox } +\bool_if:NT \l__minimalist_fast_bool { \tcbstartdraftmode } + \bool_if:NF \l__minimalist_fast_bool { \bool_if:NT \l__minimalist_theorem_in_new_line_bool { - \PassOptionsToPackage { many } { tcolorbox } - \RequirePackage { tcolorbox } \cs_new_protected:Nn \minimclass_box_environment:n { \hook_gput_code:nnn { env/#1/before } { minimalist } @@ -832,7 +872,7 @@ heading_suffix "}\n" boxrule = 0pt, boxsep = 0pt, before~skip = \parskip+\topsep+.25\baselineskip, after~skip = \parskip+\topsep+.25\baselineskip, - breakable, lines~before~break=3, + enforce~breakable, lines~before~break=3, ] } \hook_gput_code:nnn { env/#1/after } { minimalist } @@ -849,6 +889,24 @@ heading_suffix "}\n" } } +\NewDocumentEnvironment { emphasis } { } + { + \LocallyStopLineNumbers + \enlargethispage{2mm} + \begin{tcolorbox} + [ + enhanced ~ jigsaw, enforce~breakable, oversize, + % nobeforeafter, + left = .5em, right=0mm, top=0.5mm, bottom=0mm, boxrule=0pt, + colback=main-text!2!paper, frame ~ hidden, + borderline ~ west = {.3em} {0mm} {main-text!25!paper}, arc = 0.2mm, + ] + } + { + \end{tcolorbox} + \ResumeLineNumbers + } + %%================================ %% Title block style diff --git a/macros/latex/contrib/minimalist/minimalist-doc.pdf b/macros/latex/contrib/minimalist/minimalist-doc.pdf index 88711cb5f5..e79171997e 100644 Binary files a/macros/latex/contrib/minimalist/minimalist-doc.pdf and b/macros/latex/contrib/minimalist/minimalist-doc.pdf differ diff --git a/macros/latex/contrib/minimalist/minimalist-doc.tex b/macros/latex/contrib/minimalist/minimalist-doc.tex index 04283f464e..abf1a3528a 100644 --- a/macros/latex/contrib/minimalist/minimalist-doc.tex +++ b/macros/latex/contrib/minimalist/minimalist-doc.tex @@ -9,6 +9,8 @@ \usepackage{longtable} % breakable tables \usepackage{hologo} % more TeX logo +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{English} @@ -95,7 +97,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \title{\minimalist{}, write your articles or books in a simple and clear way} \author{Jinwen XU} diff --git a/macros/latex/contrib/minimalist/minimalist-plain.sty b/macros/latex/contrib/minimalist/minimalist-plain.sty index 736c26aa2f..5be7970316 100644 --- a/macros/latex/contrib/minimalist/minimalist-plain.sty +++ b/macros/latex/contrib/minimalist/minimalist-plain.sty @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplPackage {minimalist-plain} - {2022/04/03} {} + {2022/04/17} {} {The plain style of minimalist} \@ifpackageloaded { minimalist } {} @@ -36,9 +36,22 @@ %%================================ \RequirePackage { anyfontsize } +\NewCommandCopy \minimalist_original_bfseries: \bfseries +\bool_new:N \l_minimalist_is_under_bfseries_bool +\bool_set_false:N \l_minimalist_is_under_bfseries_bool +\RenewDocumentCommand \bfseries { } + { + \bool_if:NF \l_minimalist_is_under_bfseries_bool + { + \colorlet{minimalist-temp-color}{.} + \color{minimalist-temp-color!70!paper} + } + \minimalist_original_bfseries: + \bool_set_true:N \l_minimalist_is_under_bfseries_bool + } \bool_if:NTF \l__minimalist_use_boldface_bool { - \cs_new:Nn \minimalist_bfseries: { \bfseries \colorlet{minimalist-temp-color}{.} \color{minimalist-temp-color!70!paper} } + \cs_new:Nn \minimalist_bfseries: { \bfseries } } { \cs_new:Nn \minimalist_bfseries: {} @@ -237,7 +250,7 @@ %%================================ %% Title format %%================================ -\RequirePackage [ explicit, newparttoc ] { titlesec } +\RequirePackage [ explicit, newparttoc, nobottomtitles ] { titlesec } \PassOptionsToPackage { normalem } { ulem } \RequirePackage { ulem } @@ -429,22 +442,22 @@ {\hspace*{-2em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{section} - [4em] % i.e., 2em (chapter) + 2em + [5em] % i.e., 2em (chapter) + 3em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2em}} - {\hspace*{-2em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.75em}} + {\hspace*{-2.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsection} - [7em] % i.e., 4em (section) + 3em + [9em] % i.e., 5em (section) + 4em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.75em}} - {\hspace*{-2.75em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{3.75em}} + {\hspace*{-3.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsubsection} - [9.5em] % i.e., 7em (subsection) + 3.5em + [13.5em] % i.e., 9em (subsection) + 4.5em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{3.25em}} - {\hspace*{-3.25em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{4.25em}} + {\hspace*{-4.25em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} } { @@ -455,16 +468,16 @@ {\hspace*{-1.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsection} - [4.5em] % i.e., 2em (section) + 2.5em + [5em] % i.e., 2em (section) + 3em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.25em}} - {\hspace*{-2.25em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.75em}} + {\hspace*{-2.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsubsection} - [7.5em] % i.e., 4.5em (subsection) + 3em + [9em] % i.e., 5em (subsection) + 4em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.75em}} - {\hspace*{-2.75em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{3.75em}} + {\hspace*{-3.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} } @@ -472,7 +485,8 @@ %% Lists %%================================ \RequirePackage { enumitem } -\setlist{noitemsep} +\setlistdepth{9} +\setlist{noitemsep, topsep=.33\topsep} \setlist[enumerate]{labelsep=*, leftmargin=*} \setlist[enumerate,1]{label=\arabic*$)$, ref = \arabic*$)$} @@ -484,9 +498,15 @@ \setlist[itemize]{leftmargin=*} \AddLanguageSetting { \setlist[itemize,1]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\bullet$}} } -\AddLanguageSetting [french] { \setlist[itemize,1]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!55!paper}{---}} } +\AddLanguageSetting [french] { \setlist[itemize,1]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{---}} } \setlist[itemize,2]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{--}} -\setlist[itemize,3]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{\texttt{*}}} +\setlist[itemize,3]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\circ$}} +\setlist[itemize,4]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\ast$}} +\setlist[itemize,5]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\cdot$}} +\setlist[itemize,6]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\cdot$}} +\setlist[itemize,7]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\cdot$}} + +\renewlist{itemize}{itemize}{9} %%================================ %% Blank page @@ -567,10 +587,28 @@ heading_suffix "}\n" \par \vspace{.3\baselineskip} } + \renewcommand*{\indexspace} { \par - \vspace{2pc~plus~.5pc~minus~.3pc} + \vspace{2pc ~ plus ~ .5pc ~ minus ~ .3pc} + } + +\bool_new:N \l__minimalist_if_first_subitem_bool +\renewcommand*{\@idxitem} + { + \par\hangindent40\p@ + \bool_set_true:N \l__minimalist_if_first_subitem_bool + } +\renewcommand*{\subitem} + { + \par\hangindent40\p@ + \bool_if:NT \l__minimalist_if_first_subitem_bool + { + \nobreak + \bool_set_false:N \l__minimalist_if_first_subitem_bool + } + \hspace*{20\p@} } \hook_gput_code:nnn { begindocument/before } { minimalist } @@ -597,8 +635,8 @@ heading_suffix "}\n" {\normalfont}{} {\normalfont}{} {\newline} - {{\thmname{#1}\nobreakspace\thmnumber{#2}} - {\color{main-text!50!paper}\thmnote{\hspace{.4em}\ensuremath{(\text{#3})}}}\smallskip} + {{\thmname{#1}\thmnumber{\nobreakspace #2}} + {\color{main-text!50!paper}\thmnote{\hspace{.4em}$($#3$)$}}\smallskip} } { \newtheoremstyle{simple} @@ -606,8 +644,8 @@ heading_suffix "}\n" {\normalfont}{} {\normalfont}{} {0pt} - {{\thmname{#1}\nobreakspace\thmnumber{#2}} - {\color{main-text!50!paper}\thmnote{\hspace{.4em}\ensuremath{(\text{#3})}}}\nobreakspace\nobreakspace{\normalfont\textcolor{main-text!27!paper}{---}}\nobreakspace\nobreakspace} + {{\thmname{#1}\thmnumber{\nobreakspace #2}} + {\color{main-text!50!paper}\thmnote{\hspace{.4em}$($#3$)$}}\nobreakspace\nobreakspace{\normalfont\textcolor{main-text!27!paper}{---}}\nobreakspace\nobreakspace} } \theoremstyle{simple} @@ -767,12 +805,14 @@ heading_suffix "}\n" } } +\PassOptionsToPackage { many } { tcolorbox } +\RequirePackage { tcolorbox } +\bool_if:NT \l__minimalist_fast_bool { \tcbstartdraftmode } + \bool_if:NF \l__minimalist_fast_bool { \bool_if:NT \l__minimalist_theorem_in_new_line_bool { - \PassOptionsToPackage { many } { tcolorbox } - \RequirePackage { tcolorbox } \cs_new_protected:Nn \minimclass_box_environment:n { \hook_gput_code:nnn { env/#1/before } { minimalist } @@ -788,7 +828,7 @@ heading_suffix "}\n" boxrule = 0pt, boxsep = 0pt, before~skip = \parskip+\topsep+.25\baselineskip, after~skip = \parskip+\topsep+.25\baselineskip, - breakable, lines~before~break=3, + enforce~breakable, lines~before~break=3, ] } \hook_gput_code:nnn { env/#1/after } { minimalist } @@ -805,6 +845,24 @@ heading_suffix "}\n" } } +\NewDocumentEnvironment { emphasis } { } + { + \LocallyStopLineNumbers + \enlargethispage{2mm} + \begin{tcolorbox} + [ + enhanced ~ jigsaw, enforce~breakable, oversize, + % nobeforeafter, + left = .5em, right=0mm, top=0.5mm, bottom=0mm, boxrule=0pt, + colback=main-text!2!paper, frame ~ hidden, + borderline ~ west = {.3em} {0mm} {main-text!25!paper}, arc = 0.2mm, + ] + } + { + \end{tcolorbox} + \ResumeLineNumbers + } + \hook_gput_code:nnn { env/quote/begin } { minimalist } { \small } %%================================ diff --git a/macros/latex/contrib/minimalist/minimalist.sty b/macros/latex/contrib/minimalist/minimalist.sty index e8796eafdc..cb3875ea42 100644 --- a/macros/latex/contrib/minimalist/minimalist.sty +++ b/macros/latex/contrib/minimalist/minimalist.sty @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplPackage {minimalist} - {2022/04/03} {} + {2022/04/17} {} {A simple and clear style for articles and books} \keys_define:nn { minimalist } diff --git a/macros/latex/contrib/minimalist/minimart.cls b/macros/latex/contrib/minimalist/minimart.cls index 28af7fd1c3..547db8a3c5 100644 --- a/macros/latex/contrib/minimalist/minimart.cls +++ b/macros/latex/contrib/minimalist/minimart.cls @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplClass {minimart} - {2022/04/03} {} + {2022/04/17} {} {A simple and clear article style} \tl_const:Nn \l__minimclass_base_class_tl { article } diff --git a/macros/latex/contrib/minimalist/minimbook.cls b/macros/latex/contrib/minimalist/minimbook.cls index c416799745..03068626d6 100644 --- a/macros/latex/contrib/minimalist/minimbook.cls +++ b/macros/latex/contrib/minimalist/minimbook.cls @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplClass {minimbook} - {2022/04/03} {} + {2022/04/17} {} {A simple and clear book style} \tl_const:Nn \l__minimclass_base_class_tl { book } diff --git a/macros/latex/contrib/postnotes/CHANGELOG.md b/macros/latex/contrib/postnotes/CHANGELOG.md new file mode 100644 index 0000000000..dad884203a --- /dev/null +++ b/macros/latex/contrib/postnotes/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.1.1...HEAD) + +## [v0.1.1](https://github.com/gusbrs/postnotes/compare/v0.1.0...v0.1.1) (2022-04-21) + +### Fixed +- Adjusted for CTAN release requirements. + +## [v0.1.0](https://github.com/gusbrs/postnotes/releases/tag/v0.1.0) (2022-04-20) + +### Added +- Initial release. diff --git a/macros/latex/contrib/postnotes/DEPENDS.txt b/macros/latex/contrib/postnotes/DEPENDS.txt new file mode 100644 index 0000000000..78a2684770 --- /dev/null +++ b/macros/latex/contrib/postnotes/DEPENDS.txt @@ -0,0 +1 @@ +soft hyperref diff --git a/macros/latex/contrib/postnotes/README.md b/macros/latex/contrib/postnotes/README.md new file mode 100644 index 0000000000..b6b5f0334e --- /dev/null +++ b/macros/latex/contrib/postnotes/README.md @@ -0,0 +1,24 @@ +# postnotes + +**Endnotes for LaTeX** + +Author: Gustavo Barros +Maintainer: Gustavo Barros + +`postnotes` is an endnotes package for LaTeX. Its user interface provides +means to print multiple sections of notes along the document, and to subdivide +them either automatically -- by chapter, by section -- or at manually +specified places, thus being able to easily handle both numbered and +unnumbered headings. The package also provides infrastructure for setting up +contextual running headers for printed notes. The default is a simple but +useful one, in the form "Notes to pages N--M", but more elaborate ones can +be built. When `hyperref` is loaded, `postnotes` provides hyperlinked +notes, including back links. + +License: LPPL Version 1.3c + +Repository: https://github.com/gusbrs/postnotes + +Bug tracker: https://github.com/gusbrs/postnotes/issues + +CTAN: https://ctan.org/pkg/postnotes diff --git a/macros/latex/contrib/postnotes/postnotes-code.pdf b/macros/latex/contrib/postnotes/postnotes-code.pdf new file mode 100644 index 0000000000..ac1c84d450 Binary files /dev/null and b/macros/latex/contrib/postnotes/postnotes-code.pdf differ diff --git a/macros/latex/contrib/postnotes/postnotes-code.tex b/macros/latex/contrib/postnotes/postnotes-code.tex new file mode 100644 index 0000000000..cc23313f51 --- /dev/null +++ b/macros/latex/contrib/postnotes/postnotes-code.tex @@ -0,0 +1,53 @@ +% \iffalse meta-comment +% +% File: postnotes-code.tex +% +% This file is part of the LaTeX package "postnotes". +% +% Copyright (C) 2022 Gustavo Barros +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file: +% +% https://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 is "maintained" (as per LPPL maintenance status) by +% Gustavo Barros. +% +% This work consists of the files postnotes.dtx, +% postnotes.ins, +% postnotes.tex, +% postnotes-code.tex, +% and the files generated from them. +% +% The released version of this package is available from CTAN. +% +% ----------------------------------------------------------------------- +% +% The development version of the package can be found at +% +% https://github.com/gusbrs/postnotes +% +% for those people who are interested. +% +% ----------------------------------------------------------------------- +% +% \fi + +\documentclass{l3doc} + +% Have \GetFileInfo pick up date and version data and used in the +% documentation. +\usepackage{postnotes} + +\begin{document} + +\DocInput{postnotes.dtx} + +\end{document} diff --git a/macros/latex/contrib/postnotes/postnotes.dtx b/macros/latex/contrib/postnotes/postnotes.dtx new file mode 100644 index 0000000000..d817519754 --- /dev/null +++ b/macros/latex/contrib/postnotes/postnotes.dtx @@ -0,0 +1,2587 @@ +% \iffalse meta-comment +% +% File: postnotes.dtx +% +% This file is part of the LaTeX package "postnotes". +% +% Copyright (C) 2022 Gustavo Barros +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file: +% +% https://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 is "maintained" (as per LPPL maintenance status) by +% Gustavo Barros. +% +% This work consists of the files postnotes.dtx, +% postnotes.ins, +% postnotes.tex, +% postnotes-code.tex, +% and the files generated from them. +% +% The released version of this package is available from CTAN. +% +% ----------------------------------------------------------------------- +% +% The development version of the package can be found at +% +% https://github.com/gusbrs/postnotes +% +% for those people who are interested. +% +% ----------------------------------------------------------------------- +% +% \fi +% +% \iffalse +%<*driver> +\documentclass{l3doc} + +% Have \GetFileInfo pick up date and version data and used in the +% documentation. +\usepackage{postnotes} + +\begin{document} + +\DocInput{postnotes.dtx} + +\end{document} +% +% +% \fi +% +% \DoNotIndex{\\} +% +% \NewDocumentCommand\githubissue{m}{^^A +% issue~\href{https://github.com/gusbrs/postnotes/issues/#1}{\##1}} +% +% \NewDocumentCommand\githubPR{m}{^^A +% PR~\href{https://github.com/gusbrs/postnotes/pull/#1}{\##1}} +% +% ^^A Currently just for keeping semantic markup on this. +% \NewDocumentCommand\contributor{m}{#1} +% +% \NewDocumentCommand\opt{m}{\texttt{#1}} +% +% \pdfstringdefDisableCommands{^^A +% \def\opt#1{#1} +% } +% +% \AddToHook{env/macro/after}{\medskip{}} +% \AddToHook{env/variable/after}{\medskip{}} +% \AddToHook{env/function/after}{\medskip{}} +% +% +% ^^A Have the Index at 'section' level rather than 'part'. Otherwise it is +% ^^A just the same definition from 'l3doc.cls'. +% \IndexPrologue{^^A +% \section*{Index} +% \markboth{Index}{Index} +% \addcontentsline{toc}{section}{Index} +% The italic numbers denote the pages where the corresponding entry is +% described, numbers underlined point to the definition, all others indicate +% the places where it is used.^^A +% } +% +% +% \GetFileInfo{postnotes.sty} +% +% \title{^^A +% The \pkg{postnotes} package^^A +% \thanks{This file describes \fileversion, released \filedate.}^^A +% \texorpdfstring{\\{}\medskip{}}{ - }^^A +% Code documentation^^A +% \texorpdfstring{\medskip{}}{}^^A +% } +% +% \author{^^A +% Gustavo Barros^^A +% \thanks{\url{https://github.com/gusbrs/postnotes}}^^A +% } +% +% \date{\filedate} +% +% \maketitle +% +% +% \tableofcontents +% +% +% \clearpage{} +% +% \section{Initial setup} +% Start the \pkg{DocStrip} guards. +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention). +% \begin{macrocode} +%<@@=postnotes> +% \end{macrocode} +% +% +% Require the new syntax for file/package hooks (\texttt{ltnews34}, +% \texttt{ltfilehook}). +% +% \begin{macrocode} +\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} +\IfFormatAtLeastTF{2021-11-15} + {} + {% + \PackageError{postnotes}{LaTeX kernel too old} + {% + 'postnotes' requires a LaTeX kernel 2021-11-15 or newer.% + \MessageBreak Loading will abort!% + }% + \endinput + }% +% \end{macrocode} +% +% +% \begin{macrocode} +\ProvidesExplPackage {postnotes} {2022-04-21} {0.1.1} + {Endnotes for LaTeX} +% \end{macrocode} +% +% +% \section{Data} +% +% +% \begin{macro}[EXP]{\@@_data_name:n} +% Returns the name of the property list variable which stores the data of +% the \cs{postnote} with \meta{note id} number. +% \begin{syntax} +% \cs{@@_data_name:n} \Arg{note id} +% \end{syntax} +% \begin{macrocode} +\cs_new:Npn \@@_data_name:n #1 + { g_@@_ #1 _data_prop } +\cs_generate_variant:Nn \@@_data_name:n { e } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_store:nn} +% Stores the metadata and \meta{note content} of \cs{postnote} with ID +% \meta{note id}, from where it is called. The +% \texttt{postnotes/store/note} hook is intended to add further data to the +% note, when required to support packages with specific needs. +% \begin{syntax} +% \cs{@@_store:nn} \Arg{note id} \Arg{note content} +% \end{syntax} +% \begin{macrocode} +\NewHook { postnotes/store/note } +\cs_new_protected:Npn \@@_store:nn #1#2 + { + \prop_new:c { \@@_data_name:e {#1} } + \prop_gput:cnn { \@@_data_name:e {#1} } { type } { note } + \prop_gput:cnx { \@@_data_name:e {#1} } { mark } + { \l_@@_mark_tl } + \prop_gput:cnx { \@@_data_name:e {#1} } { counter } + { \int_use:N \c@postnote } + \prop_gput:cnx { \@@_data_name:e {#1} } { sortnum } + { + \bool_if:NTF \l_@@_manual_sortnum_bool + { \fp_use:N \l_@@_sort_num_fp } + { \int_use:N \c@postnote } + } + \cs_if_exist:cT { chapter } + { + \prop_gput:cnx { \@@_data_name:e {#1} } + { thechapter } { \thechapter } + } + \prop_gput:cnx { \@@_data_name:e {#1} } { thesection } + { \thesection } + \prop_gput:cnx { \@@_data_name:e {#1} } { pnsectname } + { \g_@@_section_name_tl } + \prop_gput:cnx { \@@_data_name:e {#1} } { pnsectid } + { \int_use:N \g_@@_sectid_int } + \prop_gput:cnx { \@@_data_name:e {#1} } { multibool } + { \bool_to_str:N \l_@@_maybe_multi_bool } + \prop_gput:cnn { \@@_data_name:e {#1} } { content } {#2} + \UseHook { postnotes/store/note } + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_store_section:nn} +% Stores the metadata and \meta{note content} of \cs{postnotesection} with +% ID \meta{note id}, from where it is called. +% \begin{syntax} +% \cs{@@_store_section:nn} \Arg{note id} \Arg{note content} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_store_section:nn #1#2 + { + \prop_new:c { \@@_data_name:e {#1} } + \prop_gput:cnn { \@@_data_name:e {#1} } { type } { section } + \cs_if_exist:cT { chapter } + { + \prop_gput:cnx { \@@_data_name:e {#1} } + { thechapter } { \thechapter } + } + \prop_gput:cnx { \@@_data_name:e {#1} } { thesection } + { \thesection } + \prop_gput:cnn { \@@_data_name:e {#1} } { content } {#2} + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro} +% { +% \@@_prop_get:nnN , +% \@@_prop_item:nn , +% \@@_prop_gclear:n , +% } +% Convenience functions to retrieve and clear data from a note based on the +% ID number. +% \begin{syntax} +% \cs{@@_prop_get:nnN} \Arg{note id} \Arg{property} \Arg{tl var to set} +% \cs{@@_prop_item:nn} \Arg{note id} \Arg{property} +% \cs{@@_prop_gclear:n} \Arg{note id} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_prop_get:nnN #1#2#3 + { + \prop_get:cnNF { \@@_data_name:e {#1} } {#2} #3 + { \tl_clear:N #3 } + } +\cs_new:Npn \@@_prop_item:nn #1#2 + { \prop_item:cn { \@@_data_name:e {#1} } {#2} } +\cs_new_protected:Npn \@@_prop_gclear:n #1 + { \prop_gclear:c { \@@_data_name:e {#1} } } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}[int]{\post@note} +% The \cs{newlabel} equivalent for \pkg{postnotes}. Based on the kernel's +% \cs{@newl@bel} so that we get \LaTeX{} checks for multiple and changed +% references for free (procedure learnt from \pkg{zref}). \cs{post@note}, +% when the \file{.aux} file is read, defines macros named +% \texttt{\textbackslash{}postnote@r@\meta{label name}}, according to the +% prefix set by \cs{c_@@_ref_prefix_tl}. +% \begin{syntax} +% \cs{post@note} \Arg{label name} \Arg{label content} +% \end{syntax} +% \begin{macrocode} +\tl_const:Nn \c_@@_ref_prefix_tl { postnote@r } +\cs_new_protected:Npx \post@note #1#2 + { \exp_not:N \@newl@bel { \c_@@_ref_prefix_tl } {#1} {#2} } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro} +% { +% \@@_set_mark_page_label:n , +% \@@_set_text_page_label:n , +% \@@_set_print_page_label:n , +% } +% Label setting functions for each pertinent context. They must use +% \cs{iow_shipout_x:Nn}, since the main information we are interested in is +% the \texttt{page}. +% \begin{syntax} +% \cs{@@_set_mark_page_label:n} \Arg{label name} +% \cs{@@_set_text_page_label:n} \Arg{label name} +% \cs{@@_set_print_page_label:n} \Arg{label name} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_set_mark_page_label:n #1 + { + \iow_shipout_x:Nn \@auxout + { \post@note { mark@ #1 } { \thepage } } + } +\cs_generate_variant:Nn \@@_set_mark_page_label:n { x } +\cs_new_protected:Npn \@@_set_text_page_label:n #1 + { + \iow_shipout_x:Nn \@auxout + { \post@note { text@ #1 } { \int_use:N \c@page } } + } +\cs_generate_variant:Nn \@@_set_text_page_label:n { x } +\cs_new_protected:Npn \@@_set_print_page_label:n #1 + { + \iow_shipout_x:Nn \@auxout + { \post@note { print@ #1 } { \int_use:N \c@page } } + } +\cs_generate_variant:Nn \@@_set_print_page_label:n { x } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro} +% { +% \@@_get_pageref:Nn , +% \@@_extract_pageref:n , +% } +% Reference data extraction functions. +% \begin{syntax} +% \cs{@@_get_pageref:Nn} \Arg{tl var to set} \Arg{label name} +% \cs{@@_extract_pageref:n} \Arg{label name} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_get_pageref:Nn #1#2 + { + \cs_if_exist:cTF { \c_@@_ref_prefix_tl @ #2 } + { \tl_set:Nv #1 { \c_@@_ref_prefix_tl @ #2 } } + { \tl_clear:N #1 } + } +\cs_generate_variant:Nn \@@_get_pageref:Nn { Nx } +\cs_new:Npn \@@_extract_pageref:n #1 + { + \cs_if_exist:cTF { \c_@@_ref_prefix_tl @ #1 } + { \exp_not:v { \c_@@_ref_prefix_tl @ #1 } } + { \c_empty_tl } + } +\cs_generate_variant:Nn \@@_extract_pageref:n { e } +% \end{macrocode} +% \end{macro} +% +% +% \section{Options} +% +% \subsection*{\opt{heading} option} +% +% \begin{macrocode} +\keys_define:nn { postnotes/setup } + { + heading .cs_set_protected:Np = \pnheading , + heading .value_required:n = true , + } +% \end{macrocode} +% +% \begin{macro}[int]{\pnheading} +% Provide default value for \cs{pnheading}. +% \begin{macrocode} +\cs_if_exist:cTF { chapter } + { + \cs_new_protected:Npn \pnheading + { + \chapter*{\pntitle} + \@mkboth{\pnheaderdefault}{\pnheaderdefault} + } + } + { + \cs_new_protected:Npn \pnheading + { + \section*{\pntitle} + \@mkboth{\pnheaderdefault}{\pnheaderdefault} + } + } +% \end{macrocode} +% \end{macro} +% +% +% \subsection*{\opt{format} option} +% +% \begin{macrocode} +\tl_new:N \l_@@_print_format_tl +\keys_define:nn { postnotes/setup } + { + format .tl_set:N = \l_@@_print_format_tl , + format .initial:n = { \small } , + format .value_required:n = true , + } +% \end{macrocode} +% +% +% \subsection*{\opt{listenv} option} +% +% \begin{macrocode} +\tl_new:N \l_@@_print_env_tl +\bool_new:N \l_@@_print_as_list_bool +\keys_define:nn { postnotes/setup } + { + listenv .code:n = + { + \tl_if_eq:nnTF {#1} { none } + { + \bool_set_false:N \l_@@_print_as_list_bool + \tl_set:Nn \l_@@_post_printnote_tl { \par } +% \end{macrocode} +% A sensible default just in case. It should not get to be used though. +% \begin{macrocode} + \tl_set:Nn \l_@@_print_env_tl { itemize } + } + { + \bool_set_true:N \l_@@_print_as_list_bool + \tl_set:Nn \l_@@_print_env_tl {#1} + } + } , + listenv .initial:n = { postnoteslist } , + listenv .value_required:n = true , + } +% \end{macrocode} +% +% +% A couple of built-in list environments provided for convenience, and +% \texttt{postnoteslist} as default. The horizontal setup of the label in +% these lists is based on the \texttt{description} environment of the standard +% classes (see the \emph{The \LaTeX{} Companion}). +% +% \begin{macrocode} +\NewDocumentEnvironment { postnoteslist } { } + { + \list { } + { + \setlength { \leftmargin } { 0pt } + \setlength { \labelwidth } { 0pt } + \setlength { \itemindent } { .5\parindent } + \cs_set_eq:NN \makelabel \@@_list_makelabel:n + \setlength { \rightmargin } { 0pt } + \setlength { \listparindent } { \parindent } + \setlength { \parsep } { \parskip } + \setlength { \itemsep } { 0pt } + \setlength { \topsep } { .5\topsep } + \setlength { \partopsep } { .5\partopsep } + } + } + { \endlist } +\NewDocumentEnvironment { postnoteslisthang } { } + { + \list { } + { + \setlength { \leftmargin } { 1em } + \setlength { \labelwidth } { -\leftmargin } + \setlength { \itemindent } { -2\leftmargin } + \cs_set_eq:NN \makelabel \@@_list_makelabel:n + \setlength { \rightmargin } { 0pt } + \setlength { \listparindent } { \parindent } + \setlength { \parsep } { \parskip } + \setlength { \itemsep } { 0pt } + \setlength { \topsep } { .5\topsep } + \setlength { \partopsep } { .5\partopsep } + } + } + { \endlist } +\cs_new:Npn \@@_list_makelabel:n #1 + { \hspace { \labelsep } \normalfont ~ #1 } +% \end{macrocode} +% +% +% \subsection*{\opt{makemark} and \opt{maketextmark} options} +% +% The arguments are: \texttt{\#1} is the mark, \texttt{\#2} and \texttt{\#3} +% are, respectively, the start and the end of the backlink. +% +% \begin{macrocode} +\keys_define:nn { postnotes/setup } + { + makemark .cs_set:Np = \@@_make_mark:nnn #1#2#3 , + makemark .value_required:n = true , +% \end{macrocode} +% From the default kernel definition of \cs{@makefnmark}. +% \begin{macrocode} + makemark .initial:n = + { #2 \hbox { \@textsuperscript { \normalfont #1 } } #3 } , + maketextmark .cs_set:Np = \@@_make_text_mark:nnn #1#2#3 , + maketextmark .value_required:n = true , + maketextmark .initial:n = { #2 #1 . #3 } , + } +% \end{macrocode} +% +% +% \subsection*{\opt{pretextmark}, \opt{posttextmark}, \opt{postprintnote} options} +% +% \begin{macrocode} +\tl_new:N \l_@@_pre_textmark_tl +\tl_new:N \l_@@_post_textmark_tl +\tl_new:N \l_@@_post_printnote_tl +\keys_define:nn { postnotes/setup } + { + pretextmark .tl_set:N = \l_@@_pre_textmark_tl , + pretextmark .value_required:n = true , + posttextmark .tl_set:N = \l_@@_post_textmark_tl , + posttextmark .value_required:n = true , + postprintnote .tl_set:N = \l_@@_post_printnote_tl , + postprintnote .value_required:n = true , + } +% \end{macrocode} +% +% +% \subsection*{\opt{hyperref} and \opt{backlink} options} +% +% \begin{macrocode} +\bool_new:N \l_@@_hyperlink_bool +\bool_new:N \l_@@_hyperref_warn_bool +\bool_new:N \l_@@_backlink_bool +\keys_define:nn { postnotes/setup } + { + hyperref .choice: , + hyperref / auto .code:n = + { + \bool_set_true:N \l_@@_hyperlink_bool + \bool_set_false:N \l_@@_hyperref_warn_bool + } , + hyperref / true .code:n = + { + \bool_set_true:N \l_@@_hyperlink_bool + \bool_set_true:N \l_@@_hyperref_warn_bool + } , + hyperref / false .code:n = + { + \bool_set_false:N \l_@@_hyperlink_bool + \bool_set_false:N \l_@@_hyperref_warn_bool + } , + hyperref .initial:n = auto , + hyperref .default:n = true , + backlink .bool_set:N = \l_@@_backlink_bool , + backlink .initial:n = true , + backlink .default:n = true , + } +% \end{macrocode} +% +% \begin{macrocode} +\AddToHook { begindocument } + { + \IfPackageLoadedTF { hyperref } + { } + { + \bool_if:NT \l_@@_hyperref_warn_bool + { \msg_warning:nn { postnotes } { missing-hyperref } } + \bool_set_false:N \l_@@_hyperlink_bool + } + \keys_define:nn { postnotes/setup } + { + hyperref .code:n = + { + \msg_warning:nnn { postnotes } + { option-preamble-only } { hyperref } + } , + backlink .code:n = + { + \msg_warning:nnn { postnotes } + { option-preamble-only } { backlink } + } , + } + } +\msg_new:nnn { postnotes } { option-preamble-only } + { Option~'#1'~only~available~in~the~preamble~\msg_line_context:. } +\msg_new:nnn { postnotes } { missing-hyperref } + { Missing~'hyperref'~package.~Setting~'hyperref=false'. } +% \end{macrocode} +% +% +% \subsection*{\opt{sort} option} +% +% \begin{macrocode} +\bool_new:N \l_@@_sort_bool +\keys_define:nn { postnotes/setup } + { + sort .bool_set:N = \l_@@_sort_bool , + sort .initial:n = true , + sort .default:n = true , + } +% \end{macrocode} +% +% +% \subsection*{\opt{style} option} +% +% \begin{macrocode} +\keys_define:nn { postnotes/setup } + { + style .choice: , + style / endnotes .meta:n = + { + listenv = none , + format = + { + \footnotesize + \setlength { \rightskip } { 0pt } + \setlength { \leftskip } { 0pt } + \setlength { \parindent } { 1.8em } + } , + pretextmark = { \par } , +% \end{macrocode} +% \pkg{endnotes} uses a zero width box to get the desired alignment to the +% right, but that does not play well with the backlinks, so we have a little +% more work to do to get this right. +% \begin{macrocode} + maketextmark = + { + \hbox_set:Nn \l_tmpa_box { \@textsuperscript { \normalfont ##1 } } + \skip_horizontal:n { - \box_wd:N \l_tmpa_box } + ##2 \box_use:N \l_tmpa_box ##3 + } , + } , + style / pagenote .meta:n = + { + listenv = none , + format = { } , + pretextmark = { \par\noindent } , + maketextmark = { { \normalfont ##2 ##1 . ##3 } } , + posttextmark = { ~ } , + } , + } +% \end{macrocode} +% +% +% \subsection*{\cs{postnotesetup}} +% +% +% \begin{macro}[int]{\postnotesetup} +% Provide \cs{postnotesetup}. +% \begin{syntax} +% \cs{postnotesetup}\marg{options} +% \end{syntax} +% \begin{macrocode} +\NewDocumentCommand \postnotesetup { m } + { \keys_set:nn { postnotes/setup } {#1} } +% \end{macrocode} +% \end{macro} +% +% +% \section{\cs{postnote}} +% +% Different from the traditional \cs{footnotemark} / \cs{footnotetext} system, +% in the context of end notes, the functionality which corresponds to +% \cs{footnotetext} is simply to store the data to be typeset later. Hence, +% some of the problems that afflict footnotes do not apply to end notes. +% Namely, and as far as I can tell, they can be used in ``inner horizontal +% mode'' (\cs{mbox} etc.), and in math mode, and if the ``text'' will be +% typeset in the same page as the ``mark'' is of little concern. +% +% However, the separation between ``mark'' and ``text'' is still useful in +% other contexts: floats and contexts where multiple typesetting passes are +% performed. \contributor{David Carlisle} and \contributor{Ulrike Fischer} +% shared some thoughts on the matter at the TeX.SX chat: +% \url{https://chat.stackexchange.com/transcript/message/60754383#60754383}. +% +% The interesting questions here are: if they are replaceable in their roles +% in these contexts and how much would we lose by providing them. In +% analyzing this, we have to distinguish two situations: when +% \cs{footnotemark} is called with no argument (and thus steps the counter), +% and when it is called with the optional argument (and thus refrains from +% stepping the counter). +% +% For floats, the problem they pose is that they may disturb the +% \emph{ordering} of the notes. This particular issue can be solved by using +% \cs{footnotemark} without argument, and manually adjusting the counter on +% subsequent calls to \cs{footnotetext}. A good example of the technique is +% \url{https://tex.stackexchange.com/a/43694}. True, a user may wish to +% specify the mark explicitly, but doesn't necessarily need to do it to solve +% the ordering issue. +% +% Multiple typesetting passes of content are much harder. And they abound: +% the standard classes' \cs{caption} typesets the caption once, if it is +% short, but twice if it is longer than a line; \pkg{amsmath}'s math +% environments perform a measuring pass before actually typesetting the +% equations; \pkg{amsmath}'s \cs{text} macro runs the contents through +% \cs{mathchoice} (which typesets the contents four times) when in math mode; +% \pkg{tabularx} and \pkg{tabularray} also perform measuring passes of their +% tables; so does \pkg{csquotes}' blockquotes; and certainly more that I'm +% unaware. A number of these places offer some one or another way to mitigate +% the issue: \pkg{amsmath}, \pkg{tabularx}, \pkg{csquotes} and (optionally) +% \pkg{tabularray} restore counter values after measuring steps; \pkg{amsmath} +% offers a boolean to indicate when it is a measuring pass; \pkg{csquotes} +% offers further handles. But the standard \cs{caption} offers none, and +% neither does \pkg{amsmath}'s \cs{text} macro. Well, the pkg{caption} +% package has can disable the multiple passes for \cs{caption} with the option +% \opt{singlelinecheck}, but it is not reasonable to require it for our +% purposes, so we must assume the worst case. +% +% Enrico Gregorio is categorical in stating that \cs{endnotemark} and +% \cs{endnotetext} are required for \pkg{enotez} to handle \cs{caption}, which +% apparently it didn't offer originally: ``The package should implement +% \cs{endnotemark} and \cs{endnotetext} for this case. According to the +% documentation, the author deems them to not be needed: he's wrong.'' +% (\url{https://tex.stackexchange.com/a/314937}). See also +% \url{https://tex.stackexchange.com/a/43794} and +% \url{https://tex.stackexchange.com/a/358207}. +% +% In this scenario, when there's no way around the multiple passes, +% \cs{footnotemark} can only handle the general case if used with an argument, +% precisely because it inhibits the stepping of the counter. Otherwise the +% counter is stepped multiple times, and we'd get the wrong number (and mark). +% In some circumstances, if we know the number of passes is deterministic, we +% might get away by adjusting the counter manually (\cs{caption} may be dealt +% with this way: if we know it to be two lines, we can decrement the counter +% before it and get correct results, even hyperlinked). But in cases which +% adjusting the counter is sufficient, end notes can be dealt with in the same +% way, and doesn't need the separation between ``mark'' and ``text''. So, +% what is distinctive of the kernel's footnote apparatus, which allows it as +% much flexibility as one would like, is receiving an arbitrary number as +% argument and not stepping the counter. And as far as \cs{footnotemark} and +% \cs{footnotetext}) are concerned, the main point of the optional argument is +% really to ``manually establish the relation'' between the two of them. So, +% if \emph{not stepping the counter} is what is needed to handle the general +% case, is it viable to do so? What would we loose in so doing? +% +% When receiving an arbitrary number as argument, as the kernel functionality +% for footnotes and other endnotes packages do, this value is expected to the +% printed as such, hence it must correspond to the \texttt{postnote} counter +% (in our case). But this counter is in the hands of the user, and can be +% reset along the document, thus its uniqueness cannot be ensured. But not +% stepping \texttt{postnote} is perfectly viable, as it just aims at storing +% how the mark is to be typeset. However, not stepping the ID counter would +% complicate things considerably. Not doing so implies we'd lose the +% connection we have between the ``mark'' and the corresponding ``text''. We +% might add the ``text'' to the queue, but all the metadata would be lost, +% including the \pkg{hyperref} anchor, but really the set of data without +% which the kind of functionality offered would be nonviable, or severely +% hampered. Not stepping \texttt{postnote} but stepping the ID counter also +% is not sufficient, because we'd get a note in duplicity. We could naively +% think that a gap in the ID is not a problem, and just not add the duplicate +% to the queue. But how could we tell the difference between a legitimate and +% an illegitimate step of the ID counter? +% +% I have not been able to devise a way to ``reconnect'' ``text'' and ``mark'' +% in the absence of the unique ID counter. The most promising idea was to +% have mandatory arguments to \cs{postnotemark} and \cs{postnotetext} +% receiving a \meta{label} which we could use to identify their counterparts, +% but I was not able to go through with this, and the attempts all increased +% complexity considerably. It is not just a label/ref system, there's got to +% be a one-to-one correspondence between the sets, uniqueness has to be +% ensured on both sides, and there cannot be ``lone'' marks or texts (a +% bijection). Besides, this label based system of identification would have +% to live side-by-side with the one based on the counter. So, even if we'd +% have unique IDs, we wouldn't know beforehand in what form it comes. +% Considering the ID is used to build the variable name in which we store the +% note's information, this would also complicate things. +% +% Besides, there are ways to get things working with multiple passes without +% the ``mark''/``text'' partition. As mentioned, there are a number of cases +% which offer some kind of ``handle'' or way to identify the multiple passes. +% \pkg{csquotes} has a dedicated hook that can be used. \pkg{amsmath} sets +% the \texttt{measuring@} boolean (which \pkg{hyperref} also defines). So, +% not all cases are as tricky as \cs{caption} or \cs{text}, and even that can +% be decently dealt with without a separation between ``mark'' and ``text''. +% Besides, in difficult cases, the package offers a \opt{nomark} option to +% \cs{postnote} to place a note, but typeset no mark. Than we can typeset a +% mark with \cs{postnoteref} referring to a \cs{label} in the note of +% interest. This would result in a correct mark without duplicity, and in a +% correct link from there to the note's text at \cs{printpostnotes}. The +% drawback is that the placement of \cs{postnote} would be important, and +% results sensitive to it. All the metadata is collected at the point of +% \cs{postnote}, anchor included, not at the point of \cs{postnoteref}. So +% the consequences are a slightly off backlink, possibly imprecise metadata, +% etc. Considering \pkg{hyperref} itself shies away completely from linking +% \cs{footnotemark} with an argument, I'd say there's some gain. +% +% The truth is there are some trade-offs, there's no ``ideal'' solution. +% Still, all in all, my judgment is that the unique ID counter is worth more +% than the inconveniences of an ocasional \texttt{\cs{postnote}[nomark]} +% referenced with \cs{postnoteref}, and even that should not be needed much. +% So, for the time being, until something else shakes this balance, I won't be +% offering \cs{postnotemark} and \cs{postnotetext}. +% +% \bigskip{} +% +% For the \pkg{hyperref} support for cross-references in \cs{postnote}, I've +% moved back and forth quite a lot. One of the ideas I fancied was using +% \cs{refstepcounter} and let \pkg{hyperref} do its job. But, since I want to +% have control of the anchor/destination name on both ``sides'', I'd have to +% set \cs{theHpostnote} locally before calling \cs{refstepcounter}, otherwise +% results might sensitive to user calls to \cs{counterwithin} (see +% \url{https://github.com/latex3/hyperref/issues/230}, thanks +% \contributor{Ulrike Fischer}). However, even if that worked well for the +% default case, we still had to setup things manually, in case of a manually +% supplied mark. All in all, I'm just calling \cs{stepcounter}, setting the +% relevant cross-reference variables once and setting the anchor manually. +% +% +% \bigskip{} +% +% \texttt{postnote} is the public, user facing, counter for \cs{postnote}. It +% determines how the note's mark gets to be typeset. It can be reset, set, +% and have its printed representation changed. Of course, whether those are +% meaningful is up to the user. +% +% \begin{macrocode} +\newcounter { postnote } +% \end{macrocode} +% +% \begin{macro} +% { +% \g_@@_note_id_int , +% \l_@@_note_id_tl , +% \g_@@_queue_seq , +% } +% \cs{g_@@_note_id_int} is the internal, unique counter which provides the +% ID number of each note. It ties ``mark'' and ``text'' together, is also +% the connection between each note and its data, including the content, +% which is stored in a property list named according to \cs{@@_data_name:n} +% and the ID number. \cs{l_@@_note_id_tl} is a convenience variable storing +% the counter's value. \cs{g_@@_queue_seq} stores the sequence of notes' +% IDs that to be processed by the next call of \cs{printpostnotes}. +% \begin{macrocode} +\int_new:N \g_@@_note_id_int +\tl_new:N \l_@@_note_id_tl +\tl_set:Nn \l_@@_note_id_tl { \int_use:N \g_@@_note_id_int } +\seq_new:N \g_@@_queue_seq +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}[int]{\postnote} +% Provide \cs{postnote}. +% \begin{syntax} +% \cs{postnote} \oarg{options} \marg{note text} +% \end{syntax} +% \begin{macrocode} +\NewDocumentCommand \postnote { O { } +m } + { \@@_note:nn {#1} {#2} } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_note:nn} +% The internal version of \cs{postnote}. The \texttt{postnotes/note/begin} +% hook is meant to provide a place from where some additional setup for the +% note can be performed. This is being used for adding support for some +% features/packages, but can also be used, for example, to add an extra +% local property for \pkg{zref}. +% \begin{syntax} +% \cs{@@_note:nn}\oarg{options}\marg{note content} +% \end{syntax} +% \begin{macrocode} +\NewHook { postnotes/note/begin } +\cs_new_protected:Npn \@@_note:nn #1#2 + { + \group_begin: + \keys_set:nn { postnotes/note } {#1} + \@@_inhibit_note:F + { + \int_gincr:N \g_@@_note_id_int + \tl_if_empty:NT \l_@@_mark_tl + { + \stepcounter { postnote } + \tl_set:Nx \l_@@_mark_tl { \thepostnote } + } + \seq_gput_right:Nx \g_@@_queue_seq + { \l_@@_note_id_tl } + \UseHook { postnotes/note/begin } + \cs_set:Npn \@currentcounter { postnote } + \cs_set:Npx \@currentlabel { \p@postnote \l_@@_mark_tl } + \@@_hyperref_make_currentHref:n + { postnote. \l_@@_note_id_tl .mark } + \@@_set_mark_page_label:x { \l_@@_note_id_tl } + \@@_set_user_labels: + \bool_if:NTF \l_@@_nomark_bool + { + \bool_if:NT \l_@@_hyperlink_bool + { + \@@_hyperref_set_anchor:n + { postnote. \l_@@_note_id_tl .mark } + } + } + { + \@@_typeset_mark:xV + { \l_@@_note_id_tl } \l_@@_mark_tl + } + \@@_store:nn { \l_@@_note_id_tl } {#2} + } + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% +% Options for \cs{postnote}. +% +% \begin{macrocode} +\tl_new:N \l_@@_mark_tl +\bool_new:N \l_@@_nomark_bool +\fp_new:N \l_@@_sort_num_fp +\tl_new:N \l_@@_note_label_tl +\bool_new:N \l_@@_manual_sortnum_bool +\bool_new:N \l_@@_maybe_multi_bool +\keys_define:nn { postnotes/note } + { + mark .tl_set:N = \l_@@_mark_tl , + mark .value_required:n = true , + nomark .bool_set:N = \l_@@_nomark_bool , + nomark .default:n = true , + sortnum .code:n = + { + \fp_set:Nn \l_@@_sort_num_fp {#1} + \bool_set_true:N \l_@@_manual_sortnum_bool + } , + sortnum .value_required:n = true , + label .tl_set:N = \l_@@_note_label_tl , + label .value_required:n = true , + } +% \end{macrocode} +% +% +% \begin{macro}{\@@_inhibit_note:TF} +% In contexts of multiple passes of content, it may be needed, or preferred, +% to inhibit the note altogether to avoid side effects and duplicity. This +% conditional, obviously, will always return the true branch unless +% something is done in the \texttt{postnotes/note/inhibit} hook. This hook +% is meant to handle support for packages or features which may justify note +% inhibition, and the code there should set \cs{l_@@_inhibit_note_bool} and +% \cs{l_@@_print_plain_mark_bool} as appropriate to the case. +% \begin{macrocode} +\bool_new:N \l_@@_inhibit_note_bool +\bool_new:N \l_@@_print_plain_mark_bool +\NewHook { postnotes/note/inhibit } +\prg_new_protected_conditional:Npnn \@@_inhibit_note: { F } + { + \bool_set_false:N \l_@@_inhibit_note_bool + \bool_set_false:N \l_@@_print_plain_mark_bool + \UseHook { postnotes/note/inhibit } +% \end{macrocode} +% Printing a plain mark here may be needed because, if we are inhibiting the +% note in a ``measuring context'' and omit it completely, the measuring being +% performed will be off by the size of the mark. So, to ensure the measuring +% can be done correctly, we place the mark. Since we'd only print this mark +% in case of inhibition, when we don't actually step the counter, to typeset +% correctly the mark that would be printed if the counter had been stepped, we +% increment \cs{c@postnote} locally and grouped, and smuggle \cs{thepostnote} +% out of the group. +% \begin{macrocode} + \bool_if:NT \l_@@_print_plain_mark_bool + { + \tl_if_empty:NT \l_@@_mark_tl + { + \group_begin: + \int_incr:N \c@postnote + \exp_args:NNNx + \group_end: + \tl_set:Nn \l_@@_mark_tl { \thepostnote } + } + \@@_typeset_mark_wrapper:n + { \@@_make_mark:nnn { \l_@@_mark_tl } { } { } } + } + \bool_if:NTF \l_@@_inhibit_note_bool + { \prg_return_true: } + { \prg_return_false: } + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro} +% { +% \@@_typeset_mark:nn , +% \@@_typeset_mark_wrapper:n , +% } +% Auxiliary functions for mark typesetting in \cs{@@_note:nn}. +% \cs{@@_typeset_mark_wrapper:n} is based on the definition of +% \cs{@footnotemark} in the kernel. +% \begin{syntax} +% \cs{@@_typeset_mark:nn} \Arg{note id} \Arg{mark} +% \cs{@@_typeset_mark_wrapper:n} \Arg{mark} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_typeset_mark:nn #1#2 + { + \@@_typeset_mark_wrapper:n + { + \bool_if:NTF \l_@@_hyperlink_bool + { + \@@_hyperref_set_anchor:n { postnote. #1 .mark } + \@@_make_mark:nnn {#2} + { \hyper@linkstart { link } { postnote. #1 .text } } + { \hyper@linkend } + } + { \@@_make_mark:nnn {#2} { } { } } + } + } +\cs_generate_variant:Nn \@@_typeset_mark:nn { xV } +\tl_new:N \l_@@_saved_spacefactor_tl +\cs_new_protected:Npn \@@_typeset_mark_wrapper:n #1 + { + \mode_leave_vertical: + \mode_if_horizontal:T + { + \tl_set:Nx \l_@@_saved_spacefactor_tl { \the\spacefactor } + \nobreak + } + #1 + \mode_if_horizontal:T + { \spacefactor \l_@@_saved_spacefactor_tl } + \scan_stop: + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_set_user_labels:} +% Auxiliary function for user label setting in \cs{@@_note:nn}. Supports +% the \opt{label} and \opt{zlabel} options of \cs{postnote}. +% \begin{macrocode} +\cs_new_protected:Npn \@@_set_user_labels: + { + \tl_if_empty:NF \l_@@_note_label_tl + { \exp_args:NV \label \l_@@_note_label_tl } + \tl_if_empty:NF \l_@@_note_zlabel_tl + { \exp_args:NV \zlabel \l_@@_note_zlabel_tl } + } +% \end{macrocode} +% \end{macro} +% +% +% \section{\cs{postnoteref}} +% +% \begin{macro}[int]{\postnoteref} +% Provide \cs{postnoteref}. +% \begin{syntax} +% \cs{postnoteref}\meta{*}\marg{label} +% \end{syntax} +% \begin{macrocode} +\NewDocumentCommand \postnoteref { s m } + { \@@_note_ref:nn {#1} {#2} } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_note_ref:nn} +% The internal version of \cs{postnoteref}. +% \begin{syntax} +% \cs{@@_note_ref:nn} \Arg{star bool} \Arg{label} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_note_ref:nn #1#2 + { + \group_begin: + \@@_typeset_mark_wrapper:n + { + \bool_lazy_and:nnTF + { ! #1 } + { \l_@@_hyperlink_bool } + { + \hyperref [#2] + { \@@_make_mark:nnn { \ref*{#2} } { } { } } + } + { \@@_make_mark:nnn { \@@_ref_star:n {#2} } { } { } } + } + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% +% \section{\cs{postnotesection}} +% +% \begin{macro}[int]{\postnotesection} +% Provide \cs{postnotesection}. +% \begin{syntax} +% \cs{postnotesection}\oarg{options}\marg{section content} +% \end{syntax} +% \begin{macrocode} +\NewDocumentCommand \postnotesection { O { } +m } + { \@@_section:nn {#1} {#2} } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_section:nn} +% The internal version of \cs{postnotesection}. +% \begin{syntax} +% \cs{@@_section:nn} \Arg{options} \Arg{content} +% \end{syntax} +% \begin{macrocode} +\int_new:N \g_@@_sectid_int +\cs_new_protected:Npn \@@_section:nn #1#2 + { + \group_begin: + \int_gincr:N \g_@@_sectid_int + \int_gincr:N \g_@@_note_id_int + \seq_gput_right:Nx \g_@@_queue_seq { \l_@@_note_id_tl } + \tl_gclear:N \g_@@_section_name_tl + \keys_set:nn { postnotes/section } {#1} + \@@_store_section:nn { \l_@@_note_id_tl } {#2} + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% +% Options for \cs{postnotesection}. Actually, I would have preferred to use +% ``label'' for the \opt{name} option, but I feared I might need it further +% down the road for the traditional meaning. +% +% \begin{macrocode} +\tl_new:N \g_@@_section_name_tl +\keys_define:nn { postnotes/section } + { + name .tl_gset:N = \g_@@_section_name_tl , + name .value_required:n = true , + } +% \end{macrocode} +% +% +% \section{\cs{printpostnotes}} +% +% \begin{macro}[int]{\printpostnotes} +% Provide \cs{printpostnotes}. +% \begin{syntax} +% \cs{printpostnotes} +% \end{syntax} +% \begin{macrocode} +\NewDocumentCommand \printpostnotes { } + { \@@_print_notes: } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}[int] +% { +% \pnthechapter , +% \pnthesection , +% \pnthechapternextnote , +% \pnthesectionnextnote , +% \pnthepage , +% } +% User facing variables, aimed at making available some of the notes' and +% sections' metadata for the user at specific contexts. +% \begin{macrocode} +\tl_new:N \pnthechapter +\tl_new:N \pnthesection +\tl_new:N \pnthechapternextnote +\tl_new:N \pnthesectionnextnote +\tl_new:N \pnthepage +% \end{macrocode} +% \end{macro} +% +% \begin{macro} +% { +% \g_@@_print_postnotes_int , +% \l_@@_print_note_id_tl , +% \l_@@_print_note_id_next_tl , +% \l_@@_print_counter_tl , +% \l_@@_print_mark_tl , +% \l_@@_print_type_curr_tl , +% \l_@@_print_type_next_tl , +% \l_@@_print_type_prev_tl , +% \l_@@_print_content_tl , +% \l_@@_clear_queue_seq , +% } +% Auxiliary variables for \cs{@@_print_notes:}. +% \begin{macrocode} +\int_new:N \g_@@_print_postnotes_int +\tl_new:N \l_@@_print_note_id_tl +\tl_new:N \l_@@_print_note_id_next_tl +\tl_new:N \l_@@_print_counter_tl +\tl_new:N \l_@@_print_mark_tl +\tl_new:N \l_@@_print_type_curr_tl +\tl_new:N \l_@@_print_type_next_tl +\tl_new:N \l_@@_print_type_prev_tl +\tl_new:N \l_@@_print_content_tl +\seq_new:N \l_@@_clear_queue_seq +% \end{macrocode} +% \end{macro} +% +% +% \cs{@@_print_notes:} hooks. Both meant at providing points of entry for +% additional setup, specially to add support to packages and features which +% require it. The \texttt{postnotes/print/begin} hook is run early in +% \cs{@@_print_notes:} and only once per call, after the user options have +% been processed. The \texttt{postnotes/print/eachnote} hook is run once for +% each note, at the point where environment variables are being set or +% restored, before the typesetting of either the mark or the text, but within +% a group of its own of each note. +% +% \begin{macrocode} +\NewHook { postnotes/print/begin } +\NewHook { postnotes/print/eachnote } +% \end{macrocode} +% +% +% The \texttt{postnotetext} is a counter used to restore the original value of +% \texttt{postnote} at the time of printing, for the purposes of +% cross-referencing, it should be different from \texttt{postnote} if a note +% may occur inside \cs{printpostnotes}. The \texttt{postnotesection} is a +% counter which is stepped for every postnote section which gets to be +% actually typeset. It's aim is to provide a valid ``enclosing counter'' to +% \texttt{postnote} in the context of \cs{printpostnotes}. Since we don't +% know where \texttt{postnote} may have been reset along the document, in the +% general case, we can't rely on any other preexisting counter. This means +% that the particular value of \texttt{postnotesection} is of little practical +% meaning, it really is just meant to provide recognizable ``bounds'' for +% \texttt{postnote} along the printing of the notes. Indeed, it is +% initialized to a very high value, so that ``marks'' and ``texts'' don't mix +% in the same reference list, which would occur if the enclosing counters of +% both belonged to the same range, and with somewhat arbitrary results, since +% we cannot ensure the step of the enclosing counter along the document +% matches \texttt{postnotesection}. This is actually a tricky problem from +% the cross-referencing standpoint: two different things, which should be of +% the same type, are reset along the document, but shouldn't really be mixed +% together. They are both \LaTeXe{} counters, since they may be required +% externally. Their main intended use case is to support \pkg{zref-clever}, +% but in principle they can be of general use. +% +% \begin{macrocode} +\newcounter { postnotetext } +\newcounter { postnotesection } +\setcounter { postnotesection } { 10000 } +% \end{macrocode} +% +% +% \begin{macro}{\@@_print_notes:} +% The internal version of \cs{printpostnotes}. +% \begin{syntax} +% \cs{@@_print_notes:} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_print_notes: + { + \group_begin: + \int_gincr:N \g_@@_print_postnotes_int + \seq_if_empty:NTF \g_@@_queue_seq + { \msg_warning:nn { postnotes } { empty-printpostnotes } } + { + \pnheading + \UseHook { postnotes/print/begin } + \tl_set:Nn \l_@@_print_type_prev_tl { open } + \seq_set_eq:NN \l_@@_clear_queue_seq \g_@@_queue_seq + \@@_verify_multipass:N \g_@@_queue_seq + \bool_if:NT \l_@@_sort_bool + { \@@_sort_queue:N \g_@@_queue_seq } + \bool_gset_true:N \g_@@_header_vars_next_bool + \@@_get_headers_data:N \g_@@_queue_seq + \@@_set_headers_vars_first: +% \end{macrocode} +% Ensure the first note after a heading has paragraph indentation when +% \opt{listenv} is \texttt{none}. \pkg{endnotes} uses a workaroundish +% solution in \cs{enoteheading}, setting a box and then skipping back a line. +% Enrico Gregorio is correct, though, in criticizing it at +% \url{https://tex.stackexchange.com/q/575905#comment1450213_575915}, and +% suggests the use of \cs{@afterindenttrue}, which is what \pkg{indentfirst} +% does (we do the same, just locally). +% \begin{macrocode} + \bool_if:NF \l_@@_print_as_list_bool + { + \cs_set_eq:NN \@afterindentfalse \@afterindenttrue + \@afterindenttrue + } + \bool_until_do:nn { \seq_if_empty_p:N \g_@@_queue_seq } + { + \seq_gpop_left:NN \g_@@_queue_seq + \l_@@_print_note_id_tl + \@@_prop_get:nnN { \l_@@_print_note_id_tl } + { type } \l_@@_print_type_curr_tl + \tl_if_eq:NnTF \l_@@_print_type_curr_tl { section } + { % type_curr = `section' + \seq_if_empty:NTF \g_@@_queue_seq + { + \tl_set:Nn \l_@@_print_note_id_next_tl { noid } + \tl_set:Nn \l_@@_print_type_next_tl { close } + } + { + \seq_get_left:NN \g_@@_queue_seq + \l_@@_print_note_id_next_tl + \@@_prop_get:nnN + { \l_@@_print_note_id_next_tl } + { type } \l_@@_print_type_next_tl + } +% \end{macrocode} +% We only process the entry if \texttt{type_next} is \texttt{note}: here are +% skipped empty sections. +% \begin{macrocode} + \tl_if_eq:NnT \l_@@_print_type_next_tl { note } + { + \stepcounter { postnotesection } + \group_begin: + \@@_prop_get:nnN + { \l_@@_print_note_id_tl } + { thechapter } \pnthechapter + \@@_prop_get:nnN + { \l_@@_print_note_id_tl } + { thesection } \pnthesection + \@@_prop_get:nnN + { \l_@@_print_note_id_next_tl } + { thechapter } \pnthechapternextnote + \@@_prop_get:nnN + { \l_@@_print_note_id_next_tl } + { thesection } \pnthesectionnextnote + \@@_prop_get:nnN + { \l_@@_print_note_id_tl } + { content } \l_@@_print_content_tl + \l_@@_print_content_tl + \group_end: +% \end{macrocode} +% Set \texttt{type_prev} for the next iteration. +% \begin{macrocode} + \tl_set:NV \l_@@_print_type_prev_tl + \l_@@_print_type_curr_tl + } + } + { % type_curr = `note' + \tl_if_eq:NnF \l_@@_print_type_prev_tl { note } + { + \bool_if:NTF \l_@@_print_as_list_bool + { \exp_args:Nx \begin { \l_@@_print_env_tl } } + { \group_begin: } + \l_@@_print_format_tl + } + \group_begin: + \UseHook { postnotes/print/eachnote } + \@@_get_pageref:Nx \pnthepage + { mark@ \l_@@_print_note_id_tl } + \@@_prop_get:nnN + { \l_@@_print_note_id_tl } + { mark } \l_@@_print_mark_tl + \@@_prop_get:nnN + { \l_@@_print_note_id_tl } + { counter } \l_@@_print_counter_tl + \@@_prop_get:nnN + { \l_@@_print_note_id_tl } + { content } \l_@@_print_content_tl + \cs_set:Npn \@currentcounter { postnotetext } + \int_set:Nn \c@postnotetext + { \int_eval:n { \l_@@_print_counter_tl } } + \cs_set:Npx \@currentlabel + { \p@postnote \l_@@_print_mark_tl } + \@@_hyperref_make_currentHref:n + { postnote. \l_@@_print_note_id_tl .text } + \@@_text_mark_wrapper:n + { + \@@_set_text_page_label:x + { \l_@@_print_note_id_tl } + \@@_typeset_text_mark:eV + { \l_@@_print_note_id_tl } + \l_@@_print_mark_tl + } + \l_@@_print_content_tl + \l_@@_post_printnote_tl + \group_end: +% \end{macrocode} +% For notes, query for next note's type \texttt{after} the current note was +% typeset, to handle possible nesting. Even if nesting is not a feature, this +% should avoid hard crashes related to ``lonely \cs{item}'' or ``extra +% \cs{endgroup}'' errors, in case it occurs. +% \begin{macrocode} + \seq_if_empty:NTF \g_@@_queue_seq + { + \tl_set:Nn \l_@@_print_note_id_next_tl { noid } + \tl_set:Nn \l_@@_print_type_next_tl { close } + } + { + \seq_get_left:NN \g_@@_queue_seq + \l_@@_print_note_id_next_tl + \@@_prop_get:nnN + { \l_@@_print_note_id_next_tl } + { type } \l_@@_print_type_next_tl + } + \tl_if_eq:NnF \l_@@_print_type_next_tl { note } + { + \bool_if:NTF \l_@@_print_as_list_bool + { \exp_args:Nx \end { \l_@@_print_env_tl } } + { \group_end: } + } +% \end{macrocode} +% Set \texttt{type_prev} for the next iteration. +% \begin{macrocode} + \tl_set:NV \l_@@_print_type_prev_tl + \l_@@_print_type_curr_tl + } + } + \AddToHookNext { shipout/after } + { \bool_gset_false:N \g_@@_header_vars_next_bool } +% \end{macrocode} +% We won't use the variables anymore, clear them to reduce memory usage. +% Given how we populated \cs{l_@@_clear_queue_seq}, this won't catch nested +% notes. But it's not worth to conditionally add new items along the way +% (testing it every iteration) for this. Again, not a feature. +% \begin{macrocode} + \seq_map_inline:Nn \l_@@_clear_queue_seq + { \@@_prop_gclear:n { ##1 } } + } + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\msg_new:nnn { postnotes } { empty-printpostnotes } + { Empty~'\iow_char:N\\printpostnotes'~\msg_line_context:. } +% \end{macrocode} +% +% +% \begin{macro} +% { +% \@@_typeset_text_mark:nn , +% \@@_text_mark_wrapper:n , +% } +% Auxiliary functions for mark typesetting in \cs{@@_print_notes:}. +% \begin{syntax} +% \cs{@@_typeset_text_mark:nn} \Arg{note id} \Arg{mark} +% \cs{@@_text_mark_wrapper:n} \Arg{mark} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_typeset_text_mark:nn #1#2 + { + \bool_if:NTF \l_@@_hyperlink_bool + { + \@@_hyperref_set_anchor:n { postnote. #1 .text } + \bool_if:NTF \l_@@_backlink_bool + { + \@@_make_text_mark:nnn {#2} + { \hyper@linkstart { link } { postnote. #1 .mark } } + { \hyper@linkend } + } + { \@@_make_text_mark:nnn {#2} { } { } } + } + { \@@_make_text_mark:nnn {#2} { } { } } + } +\cs_generate_variant:Nn \@@_typeset_text_mark:nn { eV } +\cs_new_protected:Npn \@@_text_mark_wrapper:n #1 + { + \bool_if:NTF \l_@@_print_as_list_bool + { + \item + [ \l_@@_pre_textmark_tl #1 \l_@@_post_textmark_tl ] + } + { \l_@@_pre_textmark_tl #1 \l_@@_post_textmark_tl } + } +% \end{macrocode} +% \end{macro} +% +% +% \subsection*{Print auxiliary} +% +% \cs{@@_verify_multipass:N} provides a general procedure for handling cases +% of multiple passes of content. Ideally, the job should be done at +% \cs{@@_inhibit_note:F}, if at all possible. But, failing that, we can rely +% on the fact that \cs{postnote}s of measuring/trial passes don't end up being +% output and hence don't generate labels in the \file{.aux} file. This is the +% equivalent for \pkg{postnotes} to the effect of write restrictions for the +% packages based on external files, which is how they actually handle these +% cases. However, despite this being a general test, and a reasonable one, +% I'd like to restrain it's use to the minimum possible. First, using this +% criterion across the board would result in large swings on the content of +% \cs{printpostnotes} and spurious warnings in an initial compilation since +% the labels are not available on the first run. Second, I'd prefer not to +% interfere with the queue, unless we really need to. Hence, we only apply +% this check for ``eligible'' items. For signaling this eligibility, the note +% must have been stored with the \cs{l_@@_maybe_multi_bool} set to +% \texttt{true}, which is then saved in the \texttt{multibool} property. One +% implication of this procedure is that, if there are any new notes marked as +% \texttt{multibool}, (at least) three rounds of compilation will be needed, +% since the labels of the printed notes will be written only on the second run +% and the document will thus require a third one to stabilize. +% +% \begin{macro}{\@@_verify_multipass:N} +% \begin{syntax} +% \cs{@@_verify_multipass:N} \meta{\cs{g_@@_queue_seq}} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_verify_multipass:N #1 + { + \group_begin: + \seq_clear:N \l_tmpa_seq + \seq_map_inline:Nn #1 + { + \@@_prop_get:nnN {##1} { multibool } \l_tmpa_tl + \tl_if_eq:NnTF \l_tmpa_tl { true } + { + \cs_if_exist:cT + { \c_@@_ref_prefix_tl @ mark@ ##1 } + { \seq_put_right:Nn \l_tmpa_seq {##1} } + } + { \seq_put_right:Nn \l_tmpa_seq {##1} } + } + \seq_gset_eq:NN #1 \l_tmpa_seq + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_sort_queue:N} +% Sorting function for \cs{@@_print_notes:}. +% \begin{syntax} +% \cs{@@_sort_queue:N} \meta{\cs{g_@@_queue_seq}} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_sort_queue:N #1 + { + \group_begin: + \seq_gsort:Nn #1 + { + \@@_prop_get:nnN {##1} { pnsectid } \l_tmpa_tl + \@@_prop_get:nnN {##2} { pnsectid } \l_tmpb_tl + \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl + { + \@@_prop_get:nnN {##1} { type } \l_tmpa_tl + \@@_prop_get:nnN {##2} { type } \l_tmpb_tl + \bool_lazy_and:nnTF + { \str_if_eq_p:Vn \l_tmpa_tl { note } } + { \str_if_eq_p:Vn \l_tmpb_tl { note } } + { + \@@_prop_get:nnN {##1} { sortnum } \l_tmpa_tl + \@@_prop_get:nnN {##2} { sortnum } \l_tmpb_tl + \fp_compare:nNnTF { \l_tmpa_tl } > { \l_tmpb_tl } + { \sort_return_swapped: } + { \sort_return_same: } + } + { \sort_return_same: } + } + { \sort_return_same: } + } + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% +% \section{Headers} +% +% The headers infrastructure of \pkg{postnotes} is comprised of three basic +% parts: +% +% \begin{enumerate} +% \item For each \cs{postnote}, labels are set storing the \texttt{page} where +% the note occurs. Each note actually generates a pair of such labels, once +% when \cs{postnote} is called (with the mark), and another where the note +% is printed (in \cs{printpostnotes}). The former ones store \cs{thepage}, +% since we want the printed representation of it for typesetting purposes, +% the latter ones store the value of the \texttt{page} counter, since we +% don't need to typeset it, but do need to perform algebraic operations with +% it. These labels are set by \cs{@@_set_mark_page_label:n}, +% \cs{@@_set_text_page_label:n}, and \cs{@@_set_print_page_label:n} at the +% appropriate places. The set of these labels provides a mapping from each +% note's ``mark'' and ``text'' to the page where it occurs. +% \item This information set is processed by \cs{@@_get_headers_data:N} at the +% beginning of \cs{@@_print_notes:} to identify the first and last note of +% each page in \cs{printpostnotes}, and to generate a mapping from these +% first and last notes on each page to the pages where their corresponding +% marks occur. We also take the opportunity to enrich this mapping with +% other metadata of each note. So we get also mappings from the first and +% last note on each page to \cs{thechapter}, \cs{thesection}, and the +% \opt{name} of the section in which they occur. These mappings are stored +% in property lists \cs[no-index]{g_@@_header_\meta{info}_first_prop} and +% \cs[no-index]{g_@@_header_\meta{info}_last_prop} where the \texttt{key} is +% the page in \cs{printpostnotes} where their note's content is typeset (or +% rather where it starts to be typeset, it is the page where the text's mark +% is printed). +% \item Based on these mappings, along the span of notes section we run +% \cs{@@_set_headers_vars_next:} at each \texttt{shipout/before} hook to set +% user facing variables for the \emph{next} page, which will be available +% when their heading gets typeset. Given that at \texttt{shipout} we can +% rely on a correct value of the \texttt{page} counter, we use it as +% \texttt{key} to query the property lists generated in the previous step. +% These user facing variables are called \cs[no-index]{pnhd\meta{info}first} +% and \cs[no-index]{pnhd\meta{info}last}. Since we cannot rely on the +% shipout hook for the first page of \cs{printpostnotes}, +% \cs{@@_set_headers_vars_first:} is run at its beginning to ensure correct +% values are in place on the first page of the notes section. +% \end{enumerate} +% +% These \cs[no-index]{pnhd\meta{info}first} and +% \cs[no-index]{pnhd\meta{info}last} variables can then be used to build +% simple functions which can be passed to mark commands to achieve rich +% contextual running headers. +% +% +% \begin{macro}[int] +% { +% \pnhdpagefirst , +% \pnhdpagelast , +% \pnhdchapfirst , +% \pnhdchaplast , +% \pnhdsectfirst , +% \pnhdsectlast , +% \pnhdnamefirst , +% \pnhdnamelast , +% } +% User facing variables, aimed at making available header data for the user. +% Setting these variables with correct values at the moment the header gets +% typeset is \emph{the} objective of the whole headers infrastructure of the +% package. +% \begin{macrocode} +\tl_new:N \pnhdpagefirst +\tl_new:N \pnhdpagelast +\tl_new:N \pnhdchapfirst +\tl_new:N \pnhdchaplast +\tl_new:N \pnhdsectfirst +\tl_new:N \pnhdsectlast +\tl_new:N \pnhdnamefirst +\tl_new:N \pnhdnamelast +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro} +% { +% \g_@@_header_page_first_prop , +% \g_@@_header_page_last_prop , +% \g_@@_header_chap_first_prop , +% \g_@@_header_chap_last_prop , +% \g_@@_header_sect_first_prop , +% \g_@@_header_sect_last_prop , +% \g_@@_header_name_first_prop , +% \g_@@_header_name_last_prop , +% \g_@@_header_prev_last_page_tl , +% \g_@@_header_prev_last_chap_tl , +% \g_@@_header_prev_last_sect_tl , +% \g_@@_header_prev_last_name_tl , +% \l_@@_prev_text_page_tl , +% \l_@@_curr_text_page_tl , +% \l_@@_prev_mark_page_tl , +% \l_@@_prev_mark_chap_tl , +% \l_@@_prev_mark_sect_tl , +% \l_@@_prev_mark_name_tl , +% } +% Auxiliary variables for the headers infrastructure. +% \begin{macrocode} +\prop_new:N \g_@@_header_page_first_prop +\prop_new:N \g_@@_header_page_last_prop +\prop_new:N \g_@@_header_chap_first_prop +\prop_new:N \g_@@_header_chap_last_prop +\prop_new:N \g_@@_header_sect_first_prop +\prop_new:N \g_@@_header_sect_last_prop +\prop_new:N \g_@@_header_name_first_prop +\prop_new:N \g_@@_header_name_last_prop +\tl_new:N \g_@@_header_prev_last_page_tl +\tl_new:N \g_@@_header_prev_last_chap_tl +\tl_new:N \g_@@_header_prev_last_sect_tl +\tl_new:N \g_@@_header_prev_last_name_tl +\tl_new:N \l_@@_prev_text_page_tl +\tl_new:N \l_@@_curr_text_page_tl +\tl_new:N \l_@@_prev_mark_page_tl +\tl_new:N \l_@@_prev_mark_chap_tl +\tl_new:N \l_@@_prev_mark_sect_tl +\tl_new:N \l_@@_prev_mark_name_tl +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_get_headers_data:N} +% Process header data for \cs{@@_set_headers_vars:n}. +% \begin{syntax} +% \cs{@@_get_headers_data:N} \meta{\cs{g_@@_queue_seq}} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_get_headers_data:N #1 + { + \group_begin: + \tl_gclear:N \pnhdpagefirst + \tl_gclear:N \pnhdpagelast + \tl_gclear:N \pnhdchapfirst + \tl_gclear:N \pnhdchaplast + \tl_gclear:N \pnhdsectfirst + \tl_gclear:N \pnhdsectlast + \tl_gclear:N \pnhdnamefirst + \tl_gclear:N \pnhdnamelast + \prop_gclear:N \g_@@_header_page_first_prop + \prop_gclear:N \g_@@_header_page_last_prop + \prop_gclear:N \g_@@_header_chap_first_prop + \prop_gclear:N \g_@@_header_chap_last_prop + \prop_gclear:N \g_@@_header_sect_first_prop + \prop_gclear:N \g_@@_header_sect_last_prop + \prop_gclear:N \g_@@_header_name_first_prop + \prop_gclear:N \g_@@_header_name_last_prop + \tl_gclear:N \g_@@_header_prev_last_page_tl + \tl_gclear:N \g_@@_header_prev_last_chap_tl + \tl_gclear:N \g_@@_header_prev_last_sect_tl + \tl_gclear:N \g_@@_header_prev_last_name_tl + \tl_clear:N \l_@@_prev_text_page_tl + \tl_clear:N \l_@@_curr_text_page_tl + \tl_clear:N \l_@@_prev_mark_page_tl + \tl_clear:N \l_@@_prev_mark_chap_tl + \tl_clear:N \l_@@_prev_mark_sect_tl + \tl_clear:N \l_@@_prev_mark_name_tl + \seq_map_inline:Nn #1 + { + \exp_args:Nx \tl_if_eq:nnT + { \@@_prop_item:nn {##1} { type } } + { note } + { + \@@_get_pageref:Nn + \l_@@_curr_text_page_tl { text@ ##1 } + \tl_if_empty:NF \l_@@_curr_text_page_tl + { + \tl_if_eq:NNTF + \l_@@_prev_text_page_tl + \l_@@_curr_text_page_tl + { +% \end{macrocode} +% We are on the same page as the previous note, just update the +% \texttt{prev_mark} data. +% \begin{macrocode} + \@@_get_pageref:Nn + \l_@@_prev_mark_page_tl { mark@ ##1 } + \@@_prop_get:nnN {##1} { thechapter } + \l_@@_prev_mark_chap_tl + \@@_prop_get:nnN {##1} { thesection } + \l_@@_prev_mark_sect_tl + \@@_prop_get:nnN {##1} { pnsectname } + \l_@@_prev_mark_name_tl + } + { +% \end{macrocode} +% We are on the transition between two pages, current ID is the first note of +% the new page (or on the very first note of \cs{printpostnotes}, given +% \cs{l_@@_prev_text_page_tl} is initialized to empty). +% +% Set `last' values for previous page, based on the last valid +% \texttt{prev_mark} stored ones. There is no previous page to the first one +% of \cs{printpostnotes}, so we don't set `last' values for it (conditioning +% on \cs{l_@@_prev_text_page_tl} being empty, which only occurs on the first +% note). +% \begin{macrocode} + \tl_if_empty:NF \l_@@_prev_text_page_tl + { + \prop_gput:Nxx \g_@@_header_page_last_prop + { \l_@@_prev_text_page_tl } + { \l_@@_prev_mark_page_tl } + \prop_gput:Nxx \g_@@_header_chap_last_prop + { \l_@@_prev_text_page_tl } + { \l_@@_prev_mark_chap_tl } + \prop_gput:Nxx \g_@@_header_sect_last_prop + { \l_@@_prev_text_page_tl } + { \l_@@_prev_mark_sect_tl } + \prop_gput:Nxx \g_@@_header_name_last_prop + { \l_@@_prev_text_page_tl } + { \l_@@_prev_mark_name_tl } + } +% \end{macrocode} +% +% Set `first' values for current page, based on the current note ID. +% \begin{macrocode} + \prop_gput:Nxx \g_@@_header_page_first_prop + { \l_@@_curr_text_page_tl } + { \@@_extract_pageref:n { mark@ ##1 } } + \prop_gput:Nxx \g_@@_header_chap_first_prop + { \l_@@_curr_text_page_tl } + { \@@_prop_item:nn {##1} { thechapter } } + \prop_gput:Nxx \g_@@_header_sect_first_prop + { \l_@@_curr_text_page_tl } + { \@@_prop_item:nn {##1} { thesection } } + \prop_gput:Nxx \g_@@_header_name_first_prop + { \l_@@_curr_text_page_tl } + { \@@_prop_item:nn {##1} { pnsectname } } +% \end{macrocode} +% +% Store \texttt{prev_mark} data for the first note on the page. +% \begin{macrocode} + \@@_get_pageref:Nn + \l_@@_prev_mark_page_tl { mark@ ##1 } + \@@_prop_get:nnN {##1} { thechapter } + \l_@@_prev_mark_chap_tl + \@@_prop_get:nnN {##1} { thesection } + \l_@@_prev_mark_sect_tl + \@@_prop_get:nnN {##1} { pnsectname } + \l_@@_prev_mark_name_tl +% \end{macrocode} +% +% Set \cs{l_@@_prev_text_page_tl} for the next page +% (\cs{l_@@_curr_text_page_tl} is never empty at this point, since we +% conditioned to it). +% \begin{macrocode} + \tl_set:NV \l_@@_prev_text_page_tl + \l_@@_curr_text_page_tl + } + } + } + } +% \end{macrocode} +% We can't catch the transition from the last page of \cs{printpostnotes} to +% the following one through the mapping above, but the \texttt{prev_mark} +% values of the last note in the loop are the ones we want, so we set `last' +% values for the last page based on them. +% \begin{macrocode} + \tl_if_empty:NF \l_@@_prev_text_page_tl + { + \prop_gput:Nxx \g_@@_header_page_last_prop + { \l_@@_prev_text_page_tl } + { \l_@@_prev_mark_page_tl } + \prop_gput:Nxx \g_@@_header_chap_last_prop + { \l_@@_prev_text_page_tl } + { \l_@@_prev_mark_chap_tl } + \prop_gput:Nxx \g_@@_header_sect_last_prop + { \l_@@_prev_text_page_tl } + { \l_@@_prev_mark_sect_tl } + \prop_gput:Nxx \g_@@_header_name_last_prop + { \l_@@_prev_text_page_tl } + { \l_@@_prev_mark_name_tl } + } + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% +% The sequence of pages processed in \cs{@@_get_headers_data:N} is not ensured +% to be continuous, since not every page of \cs{printpostnotes} starts a note. +% There may be notes that fill whole pages, or the last page of the notes may +% end with a note that started on the penultimate page. We must handle this +% case at \cs{@@_set_headers_vars:n}. For every page for which there is +% information provided by \cs{@@_get_headers_data:N} we store a +% \texttt{header_prev_last} (the last value of the previous header) for each +% of the variables of interest. If the next page is skipped in the sequence +% (no notes starting on it), we can use these stored values to set both +% `first' and `last' variables based on them for that page. +% +% +% \begin{macro}{\@@_set_headers_vars:n} +% Set user facing variables based on data generated by +% \cs{@@_get_headers_data:N}. +% \begin{syntax} +% \cs{@@_set_headers_vars:n} \Arg{page number} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_set_headers_vars:n #1 + { + \group_begin: + \prop_get:NnNTF \g_@@_header_page_first_prop + {#1} \l_tmpa_tl + { \tl_gset:NV \pnhdpagefirst \l_tmpa_tl } + { \tl_gset:NV \pnhdpagefirst \g_@@_header_prev_last_page_tl } + \prop_get:NnNTF \g_@@_header_page_last_prop + {#1} \l_tmpa_tl + { + \tl_gset:NV \pnhdpagelast \l_tmpa_tl + \tl_gset:NV \g_@@_header_prev_last_page_tl \l_tmpa_tl + } + { \tl_gset:NV \pnhdpagelast \g_@@_header_prev_last_page_tl } + \prop_get:NnNTF \g_@@_header_chap_first_prop + {#1} \l_tmpa_tl + { \tl_gset:NV \pnhdchapfirst \l_tmpa_tl } + { \tl_gset:NV \pnhdchapfirst \g_@@_header_prev_last_chap_tl } + \prop_get:NnNTF \g_@@_header_chap_last_prop + {#1} \l_tmpa_tl + { + \tl_gset:NV \pnhdchaplast \l_tmpa_tl + \tl_gset:NV \g_@@_header_prev_last_chap_tl \l_tmpa_tl + } + { \tl_gset:NV \pnhdchaplast \g_@@_header_prev_last_chap_tl } + \prop_get:NnNTF \g_@@_header_sect_first_prop + {#1} \l_tmpa_tl + { \tl_gset:NV \pnhdsectfirst \l_tmpa_tl } + { \tl_gset:NV \pnhdsectfirst \g_@@_header_prev_last_sect_tl } + \prop_get:NnNTF \g_@@_header_sect_last_prop + {#1} \l_tmpa_tl + { + \tl_gset:NV \pnhdsectlast \l_tmpa_tl + \tl_gset:NV \g_@@_header_prev_last_sect_tl \l_tmpa_tl + } + { \tl_gset:NV \pnhdsectlast \g_@@_header_prev_last_sect_tl } + \prop_get:NnNTF \g_@@_header_name_first_prop + {#1} \l_tmpa_tl + { \tl_gset:NV \pnhdnamefirst \l_tmpa_tl } + { \tl_gset:NV \pnhdnamefirst \g_@@_header_prev_last_name_tl } + \prop_get:NnNTF \g_@@_header_name_last_prop + {#1} \l_tmpa_tl + { + \tl_gset:NV \pnhdnamelast \l_tmpa_tl + \tl_gset:NV \g_@@_header_prev_last_name_tl \l_tmpa_tl + } + { \tl_gset:NV \pnhdnamelast \g_@@_header_prev_last_name_tl } + \group_end: + } +\cs_generate_variant:Nn \@@_set_headers_vars:n { x } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro} +% { +% \@@_set_headers_vars_next: , +% \@@_set_headers_vars_first: , +% } +% The functions that actually call \cs{@@_set_headers_vars:n} at the +% appropriate contexts with appropriate page values. Though we set +% \cs{@@_set_headers_vars_next:} to run at every \texttt{shipout/before} +% hook of the document, it is made no-op by \cs{g_@@_header_vars_next_bool} +% which only has a \texttt{true} value inside \cs{printpostnotes}. +% \cs{@@_set_headers_vars_first:} must set a label and retrieve its value to +% be able to have a reliable value of its own page. +% \begin{macrocode} +\AddToHook { shipout/before } [ postnotes/header ] + { \@@_set_headers_vars_next: } +\bool_new:N \g_@@_header_vars_next_bool +\cs_new_protected:Npn \@@_set_headers_vars_next: + { + \bool_if:NT \g_@@_header_vars_next_bool + { \@@_set_headers_vars:x { \int_eval:n { \c@page + 1 } } } + } +\cs_new_protected:Npn \@@_set_headers_vars_first: + { + \@@_set_print_page_label:x + { \int_use:N \g_@@_print_postnotes_int } + \@@_set_headers_vars:x + { + \@@_extract_pageref:e + { print@ \int_use:N \g_@@_print_postnotes_int } + } + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}[int]{\pnheaderdefault} +% A basic header function to be used as default in the \opt{heading} option. +% It produces a header in the form ``Notes to pages N--M'', with a text +% which can be localized (see Section~\ref{sec:languages}). +% \begin{syntax} +% \cs{pnheaderdefault} +% \end{syntax} +% \begin{macrocode} +\NewDocumentCommand \pnheaderdefault {} + { + \tl_if_eq:NNTF \pnhdpagefirst \pnhdpagelast + { \pnhdnotes{} ~ \pnhdtopage{} ~ \pnhdpagefirst } + { \pnhdnotes{} ~ \pnhdtopages{} ~ \pnhdpagefirst -- \pnhdpagelast } + } +% \end{macrocode} +% \end{macro} +% +% +% \section{Compatibility} +% +% \subsection*{\cs{caption}} +% +% For \cs{caption}'s possible two passes. This catches more than just +% captions, of course, but is not overkill. +% +% From the user's perspective, one-line captions will just work. For two-line +% captions, there are two alternatives: i) decrement the counter by 1 +% \texttt{\textbackslash{}addtocounter\{postnote\}\{-1\}} before the caption, +% then call \cs{postnote} inside the caption; or ii) call +% \texttt{\textbackslash{}postnote[nomark]\{\textbackslash{}label\{mynote\}...\}} +% right before the caption, then use +% \texttt{\textbackslash{}postnoteref\{mynote\}} inside the caption. +% +% \begin{macrocode} +\AddToHook { postnotes/note/begin } [ postnotes ] + { + \cs_if_exist:NT \@captype + { \bool_set_true:N \l_@@_maybe_multi_bool } + } +% \end{macrocode} +% +% +% \subsection*{\pkg{hyperref}} +% +% \begin{macrocode} +\bool_new:N \g_@@_hyperref_loaded_bool +\AddToHook { package/hyperref/after } + { \bool_gset_true:N \g_@@_hyperref_loaded_bool } +% \end{macrocode} +% +% \begin{macro} +% { +% \@@_hyperref_make_currentHref:n , +% \@@_hyperref_set_anchor:n , +% \@@_ref_star:n , +% } +% Auxiliary functions for \pkg{hyperref} support. +% \begin{syntax} +% \cs{@@_hyperref_make_currentHref:n} \Arg{anchor/destination} +% \cs{@@_hyperref_set_anchor:n} \Arg{anchor/destination} +% \cs{@@_ref_star:n} \Arg{label} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_hyperref_make_currentHref:n #1 + { + \bool_if:NT \g_@@_hyperref_loaded_bool + { \Hy@MakeCurrentHref {#1} } + } +\cs_new_protected:Npn \@@_hyperref_set_anchor:n #1 + { + \bool_if:NT \g_@@_hyperref_loaded_bool + { \Hy@raisedlink { \hyper@anchor {#1} } } + } +\cs_new_protected:Npn \@@_ref_star:n #1 + { + \bool_if:NTF \g_@@_hyperref_loaded_bool + { \ref*{#1} } + { \ref{#1} } + } +% \end{macrocode} +% \end{macro} +% +% +% \subsection*{\pkg{biblatex}} +% +% Thanks \contributor{Moritz Wemheuer}: +% \url{https://tex.stackexchange.com/q/597359#comment1594585_597389}. +% +% We can make \pkg{biblatex}'s \texttt{refsegment}s and \texttt{refcontext}s +% work, but \texttt{refsection}s are more complicated. Currently, +% \texttt{refsection}s are only supported if \cs{printpostnotes} is called +% within each \texttt{refsection}, one cannot ``accumulate'' the notes from +% all \texttt{refsection}s and print them at the end. Well, one can, but they +% will be considered part of the current \texttt{refsection} of wherever +% \cs{printpostnotes} is placed (unless they were also cited in the original +% \texttt{refsection} out of a \cs{postnote} which, of course, is not +% something to rely on). +% +% Note that support for these features of \pkg{biblatex} is +% \emph{experimental}. +% +% \begin{macrocode} +\AddToHook { package/biblatex/after } + { +% \end{macrocode} +% Store \pkg{biblatex} variables for each note. +% \begin{macrocode} + \AddToHook { postnotes/store/note } [ postnotes ] + { + \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + { biblatex@refsection } { \int_use:N \c@refsection } + \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + { biblatex@refsegment } { \int_use:N \c@refsegment } + \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + { biblatex@refcontextbool } + { \iftoggle { blx@refcontext } { true } { false } } + \prop_gput:cnV { \@@_data_name:e { \l_@@_note_id_tl } } + { biblatex@refcontext } \blx@refcontext@context + } +% \end{macrocode} +% \pkg{biblatex} setup, once for \cs{printpostnotes} call. +% \begin{macrocode} + \AddToHook { postnotes/print/begin } [ postnotes ] + { + \@@_biblatex_endrefcontext_local: + \@@_biblatex_citereset_local: +% \end{macrocode} +% Let \pkg{biblatex} know we are in a ``notes'' context. See +% \url{https://tex.stackexchange.com/a/304464}, including comments. +% \begin{macrocode} + \toggletrue { blx@footnote } + } +% \end{macrocode} +% Restore \pkg{biblatex} variables for each note. +% \begin{macrocode} + \tl_new:N \l_@@_biblatex_restore_tl + \AddToHook { postnotes/print/eachnote } [ postnotes ] + { + \@@_prop_get:nnN { \l_@@_print_note_id_tl } + { biblatex@refsection } \l_@@_biblatex_restore_tl + \int_set:Nn \c@refsection { \l_@@_biblatex_restore_tl } + \@@_prop_get:nnN { \l_@@_print_note_id_tl } + { biblatex@refsegment } \l_@@_biblatex_restore_tl + \int_set:Nn \c@refsegment { \l_@@_biblatex_restore_tl } + \@@_prop_get:nnN { \l_@@_print_note_id_tl } + { biblatex@refcontextbool } \l_@@_biblatex_restore_tl + \use:c { toggle \l_@@_biblatex_restore_tl } { blx@refcontext } + \@@_prop_get:nnN { \l_@@_print_note_id_tl } + { biblatex@refcontext } \l_@@_biblatex_restore_tl + \blx@edef@refcontext { \l_@@_biblatex_restore_tl } + } +% \end{macrocode} +% Make \pkg{biblatex}'s \cs{mkbibendnote} use \cs{postnote}. This is very +% likely desired in most cases, but may occasionally not be, so we add it to +% an individually labeled hook, which can be disabled with +% \texttt{\textbackslash{}RemoveFromHook\{begindocument/before\}[postnotes/mkbibendnote]} +% in the preamble. +% \begin{macrocode} + \AddToHook { begindocument/before } [ postnotes/mkbibendnote ] + { + \cs_set_nopar:Npn \blx@theendnote { \postnote } + \cs_set_nopar:Npn \blx@theendnotetext + { \blx@err@endnote \footnotetext } + } +% \end{macrocode} +% Auxiliary functions. +% +% \begin{macro}{\@@_biblatex_endrefcontext_local:} +% Replicate the job of \cs{endrefcontext}, but with local effects, +% restrained to the group of \cs{printpostnotes}. +% \begin{macrocode} + \cs_new_protected:Npn \@@_biblatex_endrefcontext_local: + { + \togglefalse { blx@refcontext } + \tl_clear:N \blx@refcontext@labelprefix + \tl_clear:N \blx@refcontext@labelprefix@real + \tl_set:Nx \blx@refcontext@sortingtemplatename { \blx@sorting } + \tl_set:Nn \blx@refcontext@sortingnamekeytemplatename { global } + \tl_set:Nn \blx@refcontext@uniquenametemplatename { global } + \tl_set:Nn \blx@refcontext@labelalphanametemplatename { global } + \blx@edef@refcontext + { + \blx@refcontext@sortingtemplatename / + \blx@refcontext@sortingnamekeytemplatename / + / + \blx@refcontext@uniquenametemplatename / + \blx@refcontext@labelalphanametemplatename + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_biblatex_citereset_local:} +% Replicate the job of \cs{citereset}, but with local effects, restrained to +% the group of \cs{printpostnotes}. +% \begin{macrocode} + \cs_new_protected:Npn \@@_biblatex_citereset_local: + { +% \end{macrocode} +% \noindent +% {\em\scriptsize\verb|\global\cslet{blx@bsee@\the\c@refsection}\@empty|} \\ +% {\em\scriptsize\verb|\global\cslet{blx@fsee@\the\c@refsection}\@empty|} +% \begin{macrocode} + \tl_clear:c { blx@bsee@ \int_use:N \c@refsection } + \tl_clear:c { blx@fsee@ \int_use:N \c@refsection } +% \end{macrocode} +% {\em\scriptsize\verb|\blx@ibidreset@force|} +% \begin{macrocode} + \undef \blx@lastkey@text + \undef \blx@lastkey@foot +% \end{macrocode} +% {\em\scriptsize\verb|\blx@idemreset@force|} +% \begin{macrocode} + \undef \blx@lasthash@text + \undef \blx@lasthash@foot +% \end{macrocode} +% {\em\scriptsize\verb|\blx@opcitreset@force|} +% \begin{macrocode} + \clist_map_inline:Nn \blx@trackhash@text + { \csundef { blx@lastkey@text@ ##1 } } + \tl_clear:N \blx@trackhash@text + \clist_map_inline:Nn \blx@trackhash@foot + { \csundef { blx@lastkey@foot@ ##1 } } + \tl_clear:N \blx@trackhash@foot +% \end{macrocode} +% {\em\scriptsize\verb|\blx@loccitreset@force|} +% \begin{macrocode} + \clist_map_inline:Nn \blx@trackkeys@text + { \csundef { blx@lastnote@text@ ##1 } } + \tl_clear:N \blx@trackkeys@text + \clist_map_inline:Nn \blx@trackkeys@foot + { \csundef { blx@lastnote@foot@ ##1 } } + \tl_clear:N \blx@trackkeys@foot +% \end{macrocode} +% {\em\scriptsize{}and all of them do:} +% \begin{macrocode} + \cs_set_eq:NN \blx@lastmpfn \z@ + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} + } +% \end{macrocode} +% +% \pkg{biblatex}'s \texttt{refsections}, contrary to \texttt{refsegment}s and +% \texttt{refcontext}s which are handled in the \LaTeX{} side of things (as +% far as I can tell), need to go through \texttt{biber}, and must have correct +% corresponding citation data written to the \file{.bcf} file. And the way +% \cs{refsection} is implemented presumes each section is only ever begun once +% (fair\dots{}), thus making it difficult to ``reopen'' it, or append new +% citations to it later on, when the notes are printed. Given the complexity +% of this machinery, it would be madness not to use \pkg{biblatex}'s +% infrastructure directly, and try to ``emulate'' it. The start of a +% \texttt{refsection} must be registered on the \file{.bcf} file, and this is +% done by \cs{refsection} (and its auxiliary functions). However, a number of +% its characteristics make things particularly difficult for the purpose at +% hand: i) it unconditionally sets a label for the section which, of course, +% cannot be done twice; and, critically, ii) the optional argument of the +% environment (which receives the \meta{resources}) is used to set a local +% assignment to \cs{blx@bibfiles}, based on which the relevant information is +% written to the \file{.bcf} file, and when the group closes the information +% is gone. My best attempt is below (excluded from the package) but it is not +% good. It feels a wrong approach to ``go around'' the intended use of +% \cs{refsection} so much, and it can't handle at all its optional argument, +% for the reasons above. It's also incomplete, since it does not handle +% restoring \cs{l_@@_biblatex_orig_refsection_tl}. +% +% \begin{macrocode} +%<*gobble> +\AddToHook { package/biblatex/after } + { + \tl_new:N \l_@@_biblatex_orig_refsection_tl + \tl_new:N \g_@@_biblatex_prev_refsection_tl + \AddToHook { postnotes/print/begin } [ postnotes ] + { + \tl_set:Nx \l_@@_biblatex_orig_refsection_tl + { \int_use:N \c@refsection } + \tl_gset:Nx \g_@@_biblatex_prev_refsection_tl + \l_@@_biblatex_orig_refsection_tl + } + \AddToHook { postnotes/print/eachnote } [ postnotes ] + { + \@@_prop_get:nnN { \l_@@_print_note_id_tl } + { biblatex@refsection } \l_@@_biblatex_restore_tl + \tl_if_eq:NNF + \l_@@_biblatex_restore_tl + \g_@@_biblatex_prev_refsection_tl + { + \int_set:Nn \c@blx@maxsection + { \l_@@_biblatex_restore_tl - 1 } + \tl_gset_eq:NN \g_@@_biblatex_prev_refsection_tl + \l_@@_biblatex_restore_tl + \group_begin: + \cs_set_eq:NN \label \use_none:n + \cs_set_eq:NN \blx@info \use_none:n + \blx@endrefsection + \refsection + \group_end: + } + } + } +% +% \end{macrocode} +% +% +% \subsection*{\pkg{zref-user}} +% +% \begin{macro}{\l_@@_note_zlabel_tl} +% Even though the \opt{zlabel} option is provided only when \pkg{zref-user} +% is loaded, \cs{l_@@_note_zlabel_tl} must be unconditionally defined, since +% it is presumed to exist by \cs{@@_set_user_labels:}. +% \begin{macrocode} +\tl_new:N \l_@@_note_zlabel_tl +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\AddToHook { package/zref-user/after } + { +% \end{macrocode} +% Provide \opt{zlabel} option. +% \begin{macrocode} + \keys_define:nn { postnotes/note } + { + zlabel .tl_set:N = \l_@@_note_zlabel_tl , + zlabel .value_required:n = true , + } +% \end{macrocode} +% +% \begin{macro}[int]{\postnotezref} +% Provide \cs{postnotezref}. +% \begin{syntax} +% \cs{postnotezref}\meta{*}\marg{label} +% \end{syntax} +% \begin{macrocode} + \NewDocumentCommand \postnotezref { s m } + { \@@_note_zref:nn {#1} {#2} } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_note_zref:nn} +% The internal version of \cs{postnotezref}. +% \begin{syntax} +% \cs{@@_note_zref:nn} \Arg{star bool} \Arg{label} +% \end{syntax} +% \begin{macrocode} + \cs_new_protected:Npn \@@_note_zref:nn #1#2 + { + \group_begin: + \@@_typeset_mark_wrapper:n + { + \bool_lazy_and:nnTF + { ! #1 } + { \l_@@_hyperlink_bool } + { + \hyperlink + { \zref@extractdefault {#2} { anchor } { } } + { \@@_make_mark:nnn { \zref{#2} } { } { } } + } + { \@@_make_mark:nnn { \zref{#2} } { } { } } + } + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} + } +% \end{macrocode} +% +% +% \subsection*{\pkg{zref-clever}} +% +% \begin{macrocode} +\AddToHook { package/zref-clever/after } + { + \zcsetup + { + countertype = { postnote = endnote } , + countertype = { postnotetext = endnote } , + } + \AddToHook { postnotes/print/begin } [ postnotes ] + { \zcsetup { counterresetby = { postnotetext = postnotesection } } } + } +% \end{macrocode} +% +% +% \subsection*{\pkg{amsmath}} +% +% \begin{macrocode} +\AddToHook { package/amsmath/after } + { +% \end{macrocode} +% Testing for \cs{ifmeasuring@} is sufficient to get things right for the +% measuring passes in math environments. +% \begin{macrocode} + \AddToHook { postnotes/note/inhibit } [ postnotes ] + { + \legacy_if:nT { measuring@ } + { + \bool_set_true:N \l_@@_inhibit_note_bool + \bool_set_true:N \l_@@_print_plain_mark_bool + } + } +% \end{macrocode} +% However, the \cs{text} macro, defined by \pkg{amstext} (required by +% \pkg{amsmath}), poses problems if its own. Despite my best efforts, I could +% not salvage things from the use of \cs{mathchoice} and the redefinitions of +% \cs{setcounter} and \cs{addtocounter} performed by \pkg{amstext}. Setting +% \cs{l_@@_maybe_multi_bool} when \texttt{firstchoice@} is \texttt{false} +% grants us a working situation for display style. But the use of +% \cs{postnote} inside \cs{text} (and, if \pkg{amsmath} is loaded, +% \cs{textnormal}, \cs{textup}, etc.) in inline math environments is not +% supported. If a note really needs to be there, one can use the \opt{nomark} +% option and \cs{postnoteref}. Things should work in text mode and in display +% style. +% \begin{macrocode} + \AddToHook { postnotes/note/begin } [ postnotes ] + { + \legacy_if:nF { firstchoice@ } + { \bool_set_true:N \l_@@_maybe_multi_bool } + } + } +% \end{macrocode} +% +% +% \subsection*{\pkg{csquotes}} +% +% \begin{macrocode} +\AddToHook { package/csquotes/after } + { + \bool_new:N \l_@@_csquotes_measuring_bool + \BlockquoteDisable + { \bool_set_true:N \l_@@_csquotes_measuring_bool } + \AddToHook { postnotes/note/inhibit } [ postnotes ] + { + \bool_if:NT \l_@@_csquotes_measuring_bool + { + \bool_set_true:N \l_@@_inhibit_note_bool + \bool_set_true:N \l_@@_print_plain_mark_bool + } + } + } +% \end{macrocode} +% +% +% \subsection*{\pkg{tabularx}} +% +% For the identification of the trial passes in \pkg{tabularx}, see +% \url{https://tex.stackexchange.com/a/640035} (including discussion in the +% comments, thanks \contributor{David Carlisle}), and also +% \url{https://tex.stackexchange.com/a/227155} and +% \url{https://tex.stackexchange.com/a/352134}. +% +% \begin{macrocode} +\AddToHook { package/tabularx/after } + { + \bool_new:N \l_@@_tabularx_inside_env_bool + \AddToHook { env/tabularx/begin } [ postnotes ] + { + \bool_set_true:N \l_@@_tabularx_inside_env_bool + \cs_set_eq:NN \@@_tabularx_saved_write:Nn \write + } + \AddToHook { postnotes/note/inhibit } [ postnotes ] + { + \bool_lazy_and:nnT + { \l_@@_tabularx_inside_env_bool } + { ! \cs_if_eq_p:NN \write \@@_tabularx_saved_write:Nn } + { + \bool_set_true:N \l_@@_inhibit_note_bool + \bool_set_true:N \l_@@_print_plain_mark_bool + } + } + } +% \end{macrocode} +% +% +% \subsection*{\pkg{tabularray}} +% +% I've tried, but I could not find any ``handle'' to distinguish in +% \pkg{tabularray} a trial/measure pass from the final one. So we use +% \cs{@@_verify_multipass:N} for it. +% +% \begin{macrocode} +\AddToHook { package/tabularray/after } + { + \clist_map_inline:nn + { tblr , longtblr , talltblr , booktabs , longtabs , talltabs , +array } + { + \AddToHook { env/#1/begin } [ postnotes ] + { \bool_set_true:N \l_@@_maybe_multi_bool } + } + } +% \end{macrocode} +% +% +% \section{Languages} +% \label{sec:languages} +% +% \begin{macro}[int] +% { +% \pntitle , +% \pnhdnotes , +% \pnhdtopage , +% \pnhdtopages , +% } +% Set of language specific user variables. They are used in the default +% value of the \opt{heading} option and in \cs{pnheaderdefault} which, +% ultimately, is also used in the same place. +% \begin{macrocode} +\tl_new:N \pntitle +\tl_new:N \pnhdnotes +\tl_new:N \pnhdtopage +\tl_new:N \pnhdtopages +\tl_set:Nn \pntitle { Notes } +\tl_set:Nn \pnhdnotes { Notes } +\tl_set:Nn \pnhdtopage { to~page } +\tl_set:Nn \pnhdtopages { to~pages } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_define_language:nn} +% Defines language specific values for \meta{postnote language} by storing a +% set of assignments for the language specific variables in \meta{setup}. +% \meta{postnote language} is an internal name, typically the ``main'' name +% of the language, based on which we can set specific \pkg{babel} or +% \pkg{polyglossia} languages or variants. +% \begin{syntax} +% \cs{@@_define_language:nn} \Arg{postnote language} \Arg{setup} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_define_language:nn #1#2 + { + \tl_new:c { g_@@_language_ #1 _tl } + \tl_gset:cn { g_@@_language_ #1 _tl } {#2} + } +% \end{macrocode} +% \end{macro} +% +% +% For \pkg{babel} we use the new hook system, it's clean, and avoids the +% \cs{addto} pitfalls. The appropriate hook to use is +% \texttt{babel/\meta{language}/beforeextras} so that users can override it +% with a traditional +% \texttt{\textbackslash{}addto\textbackslash{}extras\meta{language}}. +% +% Note that, for \pkg{babel}, the captions are currently handled in two +% different ways -- the ``old way'' and the ``new way'' -- and which of them +% is used depends on the language. Most still use the ``old way'', but the +% problem is that it is not universal. And the ``new way'' uses a different +% naming scheme -- \texttt{\textbackslash{}\meta{language}\meta{caption}}, +% which is meant to be set with \cs{setlocalecaption}, and not suitable for +% our needs. The \texttt{\textbackslash{}extras\meta{language}} macros are +% meant for ``arbitrary'' code to be run when the language is selected, which +% is what we want. The captions used to work in the same way, but no longer +% for languages which use the ``new way''. +% +% Note also that there seems to exist some qualms about \pkg{babel}'s +% \cs{addto}. A number of packages define their own versions of it. Do so at +% least \pkg{varioref} (probably the original), \pkg{backref}, and +% \pkg{cleveref}. The latter comments that \cs{addto} is ``flawed''. +% \pkg{babel} itself comments the definition recognizing that there is an +% ``inconsistency'': depending on the case, the operation will be either local +% or global. This is documented in the manual, which explains this +% inconsistent behavior is preserved for backward compatibility, and +% recommends \pkg{etoolbox}'s facilities if available. \pkg{polyglossia} also +% recommends \pkg{etoolbox}'s \cs{gappto}. All in all, if there's need to use +% the traditional way instead of the new hooks, just rely on \texttt{expl3} +% and use \cs{tl_gput_right:Nn}. +% +% \begin{macro}{\@@_set_babel_language:nn} +% Sets \meta{babel language} to execute the setup defined by +% \cs{@@_define_language:nn} for \meta{postnote language} at the +% \texttt{babel/\meta{language}/beforeextras} hook. +% \begin{syntax} +% \cs{@@_set_babel_language:nn} \Arg{babel language} \Arg{postnote language} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_set_babel_language:nn #1#2 + { + \ActivateGenericHook { babel/#1/beforeextras } + \exp_args:Nnv \AddToHook { babel/#1/beforeextras } + { g_@@_language_ #2 _tl } + } +% \end{macrocode} +% \end{macro} +% +% +% \pkg{polyglossia} uses a similar set of macros for setting up languages as +% \pkg{babel} does. However, the +% \texttt{\textbackslash{}blockextras@\meta{language}} macros are +% unfortunately internal (despite what the manual says, that's what the code +% does), thus requiring \cs{makeatletter}/\cs{makeatother} for user +% configuration, which would be an inconvenience. On the other hand, +% \pkg{polyglossia}'s \texttt{\textbackslash{}captions\meta{language}} works +% as in \pkg{babel}'s ``old way'', meaning it is just a ``hook'' to which we +% can append some code. So we use +% \texttt{\textbackslash{}captions\meta{language}} for \pkg{polyglossia}. +% Things may complicate here if there's need to set up different values for +% different language variants, since the hooks available are all necessarily +% internal, but I doubt we'll ever need variants for these simple strings. +% +% \begin{macro}{\@@_set_polyglossia_language:nn} +% Sets \meta{polyglossia language} to execute the setup defined by +% \cs{@@_define_language:nn} for \meta{postnote language} at the +% \pkg{polyglossia} \texttt{\textbackslash{}captions\meta{language}} hook. +% \begin{syntax} +% \cs{@@_set_polyglossia_language:nn} \Arg{polyglossia language} +% ~~\Arg{postnote language} +% \end{syntax} +% \begin{macrocode} +\cs_new_protected:Npn \@@_set_polyglossia_language:nn #1#2 + { + \AddToHook { package/polyglossia/after } + { + \exp_args:Nnv \csgappto { captions #1 } + { g_@@_language_ #2 _tl } + } + } +% \end{macrocode} +% \end{macro} +% +% +% \subsection*{English} +% +% \begin{macrocode} +\@@_define_language:nn { english } + { + \tl_set:Nn \pntitle { Notes } + \tl_set:Nn \pnhdnotes { Notes } + \tl_set:Nn \pnhdtopage { to~page } + \tl_set:Nn \pnhdtopages { to~pages } + } +\@@_set_babel_language:nn { english } { english } +\@@_set_babel_language:nn { british } { english } +\@@_set_babel_language:nn { american } { english } +\@@_set_babel_language:nn { canadian } { english } +\@@_set_babel_language:nn { australian } { english } +\@@_set_babel_language:nn { newzealand } { english } +\@@_set_babel_language:nn { UKenglish } { english } +\@@_set_babel_language:nn { USenglish } { english } +\@@_set_polyglossia_language:nn { english } { english } +% \end{macrocode} +% +% +% \subsection*{Portuguese} +% +% \begin{macrocode} +\@@_define_language:nn { portuguese } + { + \tl_set:Nn \pntitle { Notas } + \tl_set:Nn \pnhdnotes { Notas } + \tl_set:Nn \pnhdtopage { da~página } + \tl_set:Nn \pnhdtopages { das~páginas } + } +\@@_set_babel_language:nn { portuguese } { portuguese } +\@@_set_babel_language:nn { brazilian } { portuguese } +\@@_set_babel_language:nn { portuges } { portuguese } +\@@_set_babel_language:nn { brazil } { portuguese } +\@@_set_polyglossia_language:nn { portuguese } { portuguese } +% \end{macrocode} +% +% +% \begin{macrocode} +% +% \end{macrocode} +% +% +% \PrintIndex +% +% diff --git a/macros/latex/contrib/postnotes/postnotes.ins b/macros/latex/contrib/postnotes/postnotes.ins new file mode 100644 index 0000000000..e8c217a13b --- /dev/null +++ b/macros/latex/contrib/postnotes/postnotes.ins @@ -0,0 +1,94 @@ +% \iffalse meta-comment +% +% File: postnotes.ins +% +% This file is part of the LaTeX package "postnotes". +% +% Copyright (C) 2022 Gustavo Barros +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file: +% +% https://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 is "maintained" (as per LPPL maintenance status) by +% Gustavo Barros. +% +% This work consists of the files postnotes.dtx, +% postnotes.ins, +% postnotes.tex, +% postnotes-code.tex, +% and the files generated from them. +% +% The released version of this package is available from CTAN. +% +% ----------------------------------------------------------------------- +% +% The development version of the package can be found at +% +% https://github.com/gusbrs/postnotes +% +% for those people who are interested. +% +% ----------------------------------------------------------------------- +% +% \fi + +\input l3docstrip.tex + +\keepsilent + +\askforoverwritefalse + +\preamble + +This file was generated from file(s) of the LaTeX package "postnotes". + +Copyright (C) 2022 Gustavo Barros + +It may be distributed and/or modified under the conditions of the +LaTeX Project Public License (LPPL), either version 1.3c of this +license or (at your option) any later version. The latest version +of this license is in the file: + + https://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 is "maintained" (as per LPPL maintenance status) by + Gustavo Barros. + +This work consists of the files postnotes.dtx, + postnotes.ins, + postnotes.tex, + postnotes-code.tex, + and the files generated from them. + +The released version of this package is available from CTAN. + +----------------------------------------------------------------------- + +The development version of the package can be found at + + https://github.com/gusbrs/postnotes + +for those people who are interested. + +----------------------------------------------------------------------- + +\endpreamble + +\postamble +\endpostamble + +\generate{\file{postnotes.sty}{\from{postnotes.dtx}{package}}} + +\endbatchfile diff --git a/macros/latex/contrib/postnotes/postnotes.pdf b/macros/latex/contrib/postnotes/postnotes.pdf new file mode 100644 index 0000000000..56441582f2 Binary files /dev/null and b/macros/latex/contrib/postnotes/postnotes.pdf differ diff --git a/macros/latex/contrib/postnotes/postnotes.tex b/macros/latex/contrib/postnotes/postnotes.tex new file mode 100644 index 0000000000..eab8f438ed --- /dev/null +++ b/macros/latex/contrib/postnotes/postnotes.tex @@ -0,0 +1,972 @@ +% \iffalse meta-comment +% +% File: postnotes.tex +% +% This file is part of the LaTeX package "postnotes". +% +% Copyright (C) 2022 Gustavo Barros +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file: +% +% https://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 is "maintained" (as per LPPL maintenance status) by +% Gustavo Barros. +% +% This work consists of the files postnotes.dtx, +% postnotes.ins, +% postnotes.tex, +% postnotes-code.tex, +% and the files generated from them. +% +% The released version of this package is available from CTAN. +% +% ----------------------------------------------------------------------- +% +% The development version of the package can be found at +% +% https://github.com/gusbrs/postnotes +% +% for those people who are interested. +% +% ----------------------------------------------------------------------- +% +% \fi + +\documentclass{l3doc} + +% The package itself *must* be loaded so that \GetFileInfo can pick up date +% and version data. +\usepackage{postnotes} +\postnotesetup{ + heading={ + \section*{\pntitle} + \markright{\pnheaderdefault} + \addcontentsline{toc}{section}{\pntitle} + } , +} + +\usepackage[T1]{fontenc} + +\usepackage[sc]{mathpazo} +\linespread{1.05} +\usepackage[scale=.88]{tgheros} % sans +\usepackage[varqu,scaled=1.03]{inconsolata} % tt +\usepackage{microtype} + +\hypersetup{hidelinks} + +\usepackage{zref-clever} +\zcsetup{ + cap, + check, + titleref, + countertype = { pnexample = example } , +} + +\usepackage{listings} +\lstdefinestyle{code}{ + language=[LaTeX]TeX, + alsoletter = {_:}, + moretexcs={ + \chapter , + \@mkboth , + \@textsuperscript , + \AddToHook , + \counterwithin , + \tableofcontents , + \ExplSyntaxOn , + \ExplSyntaxOff , + \NewDocumentCommand , + \tl_if_eq:NNTF , + \bool_case_true:nF , + \str_if_eq_p:ee , + \prg_replicate:nn , + \lipsum , + \addto , + \gappto , + \extras , + \captions , + } +} +\lstdefinestyle{postnotes}{ + style=code, + moretexcs={ + \postnote , + \postnoteref , + \postnotesection , + \printpostnotes , + \postnotesetup , + \pntitle , + \pnhdnotes , + \pnhdtopage , + \pnhdtopages , + \pnheaderdefault , + \pnthechapter , + \pnthesection , + \pnthechapternextnote , + \pnthesectionnextnote , + \pnhdpagefirst , + \pnhdpagelast , + \pnhdchapfirst , + \pnhdchaplast , + \pnhdsectfirst , + \pnhdsectlast , + \pnhdnamefirst , + \pnhdnamelast , + \mypnheader , + \demochapter , + } +} +\lstset{ + style=postnotes, + basicstyle=\ttfamily\small, + columns=fullflexible, + keepspaces, + xleftmargin=\leftmargin, + xrightmargin=.5\leftmargin, +} +% Setup inspired by https://tex.stackexchange.com/a/4068. For how to use these +% environments in a .dtx context see https://tex.stackexchange.com/a/31026. +\newcounter{pnexample} +\lstnewenvironment{pnexample}[1][]{% + \renewcommand{\lstlistingname}{Example}% + \renewcommand*\theHlstlisting{ht.\thelstlisting}% + \lstset{#1}% + \setcounter{lstlisting}{\value{pnexample}}% +}{} +\lstnewenvironment{pnsnippet}[1][]{% + \renewcommand{\lstlistingname}{Example}% + \lstset{#1}% +}{} +\ExplSyntaxOn +\makeatletter +\lst@AddToHook { PreInit } + { + \cs_if_exist:cT { c@ \lstenv@name } + { \exp_args:Nx \refstepcounter { \lstenv@name } } + } +\makeatother +\ExplSyntaxOff + +\NewDocumentCommand\opt{m}{\texttt{#1}} + +\begin{document} + +\GetFileInfo{postnotes.sty} + +\title{% + The \pkg{postnotes} package% + \thanks{This file describes \fileversion, released \filedate.}% + \texorpdfstring{\\{}\medskip{}}{ - }% + User manual% + \texorpdfstring{\medskip{}}{}% +} + +\author{% + Gustavo Barros% + \thanks{\url{https://github.com/gusbrs/postnotes}}% +} + +\date{\filedate} + +\maketitle + +\begin{center} + {\bfseries \abstractname\vspace{-.5em}\vspace{0pt}} +\end{center} + +\begin{quotation} + \pkg{postnotes} is an endnotes package for \LaTeX{}. Its user interface + provides means to print multiple sections of notes along the document, and + to subdivide them either automatically -- by chapter, by section -- or at + manually specified places, thus being able to easily handle both numbered + and unnumbered headings. The package also provides infrastructure for + setting up contextual running headers for printed notes. The default is a + simple but useful one, in the form ``Notes to pages N--M'', but more + elaborate ones can be built. When \pkg{hyperref} is loaded, \pkg{postnotes} + provides hyperlinked notes, including back links. +\end{quotation} + +\clearpage{} + +\tableofcontents + +\clearpage{} + +\section{Introduction} + +\pkg{postnotes} is an endnotes package for \LaTeX{}. Its user interface +provides means to print multiple sections of notes along the document, and to +subdivide them either automatically -- by chapter, by section -- or at +manually specified places, thus being able to easily handle both numbered and +unnumbered headings. The package also provides infrastructure for setting up +contextual running headers for printed notes. The default is a simple but +useful one, in the form ``Notes to pages N--M'', but more elaborate ones can +be built. When \pkg{hyperref} is loaded, \pkg{postnotes} provides hyperlinked +notes, including back links. + +Though this feature set is mostly (albeit not completely) available in one or +another of the existing endnotes packages for \LaTeX{}, subsets of it exist in +individual packages, not necessarily compatible with each other. +\pkg{postnotes} brings these features together in one place, with no external +dependencies except an up-to-date kernel. + +On the technical side, \pkg{postnotes} is peculiar among existing \LaTeX{} +packages in this area of functionality by the fact that it does not use an +external file to store the notes. Both the notes' contents and its metadata +are stored in variables which are later retrieved at the time of printing. In +particular, the content of the note is stored and retrieved with ``no +manipulation'' (as in \texttt{expl3}'s \texttt{N}/\texttt{n} function +signatures) and only gets to be expanded at the time it is meant to be +typeset. The \file{.aux} file is leveraged to set page labels for the notes, +since that particular information has to be retrieved asynchronously but, +other than that, variables are employed to pass information around. + +This has some advantages. First, as is well known, sending arbitrary content +to a file to be read later is not a noiseless process in \LaTeX{}. Thus, not +doing so makes things smoother. Second, the external file approach is +strictly linear: the notes which were written to the file get printed as such, +in the order they were written. Having the notes available as a set of +variables allows for some more flexibility than that, through the possibility +of pre-processing the notes before printing. It also brings some extra +degrees of freedom in storing note metadata, and in restoring part of the +environment where the note is called to where the note's content is printed. + + +\section{Loading the package} + +\pkg{postnotes} can be loaded with the usual: + +\begin{pnsnippet} +\usepackage{postnotes} +\end{pnsnippet} + +The package does not accept load-time options, package options must be set +using \cs{postnotesetup} (see \zcref{sec:options}, +\zcref[ref=title,noname]{sec:package-options}). + +\section{User interface} + +\begin{function}{\postnote} + \begin{syntax} + \cs{postnote}\oarg{options}\marg{text} + \end{syntax} +\end{function} +Sets a postnote with content \meta{text}. A note ``mark'' is typeset at the +place \cs{postnote} is called, and \meta{text} is stored to be typeset later, +on the next call to \cs{printpostnotes}. The mark is usually determined by +the printed representation of the main counter, \texttt{postnote}, but can be +manually set too. \cs{postnote} can receive a number of \meta{options}, which +are presented in \zcref{sec:options}, +\zcref[ref=title,noname]{sec:note-options}. + +\begin{function}{\postnotesection} + \begin{syntax} + \cs{postnotesection}\oarg{options}\marg{text} + \end{syntax} +\end{function} +Sets a postnote section with content \meta{text}. This is the basic interface +for making notes subdivisions, and it places \meta{text} between the notes +where it occurs, at the point the notes are printed by \cs{printpostnotes}. +For more details and some examples, see \zcref{sec:notes-sections}. Its +\meta{options} are presented in \zcref{sec:options}, +\zcref[ref=title,noname]{sec:section-options}. + +\begin{function}{\printpostnotes} + \begin{syntax} + \cs{printpostnotes} + \end{syntax} +\end{function} +Prints the \cs{postnotes} set since the last call of \cs{printpostnotes}, or +since the beginning of the document. For two basic usage illustrations, see +\zcref{ex:sect:basic,ex:x:multi-print}. + +\begin{function}{\postnoteref} + \begin{syntax} + \cs{postnoteref}\meta{*}\marg{label} + \end{syntax} +\end{function} +Typesets a postnote reference to \meta{label}. Of course, \meta{label} must +have been set to a particular postnote, which can be done by the standard +\cs{label} command. The starred version of the command inhibits hyperlinking. +When the \pkg{zref-user} package is loaded, a corresponding \cs{postnotezref} +is also provided. + + +\section{Options} +\zlabel{sec:options} + +\subsection*{Package options} +\zlabel{sec:package-options} + +\begin{function}{\postnotesetup} + \begin{syntax} + \cs{postnotesetup}\oarg{options} + \end{syntax} +\end{function} +Package options can be configured by means of \cs{postnotesetup}, which +receives options and values in \texttt{key=value} fashion. + +\bigskip{} + +\DescribeOption{heading} % +\DescribeOption{\cs{pnheading}} % +The \opt{heading} option sets the heading for the printed notes or, more +generally put, that which is printed at the beginning of \cs{printpostnotes}. +Its default value depends on the document class in use. If \cs{chapter} is +defined, the default is: +\begin{pnsnippet} +\chapter*{\pntitle} +\@mkboth{\pnheaderdefault}{\pnheaderdefault} +\end{pnsnippet} +but otherwise, it is: +\begin{pnsnippet} +\section*{\pntitle} +\@mkboth{\pnheaderdefault}{\pnheaderdefault} +\end{pnsnippet} +where \cs{pntitle} is localizable string, which by default contains ``Notes'' +(see \zcref{sec:localization}), and \cs{pnheaderdefault} is a function which +takes no arguments, but processes a number of variables, to set a contextual +running header for the printed notes (see \zcref{sec:headers}). +\cs{pnheaderdefault} produces a header in the form ``Notes to pages N--M'', +according to the notes in each page. If you prefer, you can redefine +\cs{pnheading} instead of using the \opt{heading} option, to the same effect. + +\DescribeOption{format} % +The \opt{format} option stores formatting instructions for printing the +notes. It is called at \cs{printpostnotes}, every time a block of notes is +about to start. The default value is \cs{small}. + +\DescribeOption{listenv} % +The \opt{listenv} option sets the list environment inside which the notes are +printed in \cs{printpostnotes}. This must be the name of an existing list +environment, and \pkg{postnotes} provides two suitable ones for convenience: +\env{postnoteslist}, which is the default, and \env{postnoteslisthang} which +typesets the notes with a hanging indent. You can also create your own, with +\pkg{enumitem} or otherwise, of course. \opt{listenv} can also receive the +special value \texttt{none}, in which case the notes blocks are not wrapped in +a list environment, but rather typeset as plain paragraphs. +\texttt{\opt{listenv}=none} already sets \opt{postprintnote} to \cs{par} for +that reason but, when using \texttt{none}, you'll probably also want to set +\opt{maketextmark}, \opt{pretextmark}, or \opt{posttextmark} to values +different than the defaults. + +\DescribeOption{makemark} % +\DescribeOption{maketextmark} % +\DescribeOption{\cs{pnthepage}} % +The \opt{makemark} and \opt{maketextmark} options control how the mark is to +be typeset, at the point \cs{postnote} is called and at the point the note's +text is printed at \cs{printpostnotes}, respectively. They both can receive +three arguments: \texttt{\#1} is the mark itself, and arguments \texttt{\#2} +and \texttt{\#3} are, respectively, the start and the end of the hyperlink +(hence they must be used in this order, and always in pair). Their default +values are: +\begin{pnsnippet} +makemark = {#2\hbox{\@textsuperscript{\normalfont#1}}#3} , +maketextmark = {#2#1.#3} , +\end{pnsnippet} +At the point \opt{maketextmark} gets typeset, the \cs{pnthepage} variable +contains the value of \cs{thepage} where its corresponding note was set. + +\DescribeOption{pretextmark} % +\DescribeOption{posttextmark} % +\DescribeOption{postprintnote} % +The options \opt{pretextmark}, \opt{posttextmark}, and \opt{postprintnote} +allow to insert additional material in \cs{printpostnotes}, respectively, +right before the mark, right after the mark, and after the note's content. +All in all, when \opt{listenv} is not \texttt{none}, each note in the list is +laid out in the form: +\begin{pnsnippet}[escapeinside=`'] +\item[`\meta{pretextmark}'`\meta{mark}'`\meta{posttextmark}']`\meta{note content}'`\meta{postprintnote}' +\end{pnsnippet} +and when \opt{listenv} is \texttt{none}, each note is laid out in the form: +\begin{pnsnippet}[escapeinside=`'] +`\meta{pretextmark}'`\meta{mark}'`\meta{posttextmark}'`\meta{note content}'`\meta{postprintnote=\textbackslash{}\textbf{par}}' +\end{pnsnippet} + +\DescribeOption{style} % +\opt{style} is just a convenience ``meta'' option which sets a number of +``base'' options -- such as \opt{listenv}, \opt{format}, \opt{maketextmark}, +etc.\ -- in order to emulate known styles of printing the notes. It accepts +the values \texttt{endnotes} or \texttt{pagenote} so that \cs{printpostnotes} +works as its counterparts in each of these packages. + +\DescribeOption{hyperref} % +\DescribeOption{backlink} % +The \opt{hyperref} option controls the use of \pkg{hyperref} by +\pkg{postnotes} and takes values \opt{auto}, \opt{true} or \opt{false}. The +default value, \opt{auto}, makes \pkg{postnotes} use \pkg{hyperref} if it is +loaded. \opt{true} does the same thing, but warns if \pkg{hyperref} is not +loaded (\pkg{hyperref} is never loaded for you). \opt{false} means not to use +\pkg{hyperref} regardless of its availability. The \opt{backlink} option +controls whether only a link from the note to is respective text at +\cs{printpostnotes} is created, or if a back link from the text at +\cs{printpostnotes} back to where the note's mark is placed is also made +available. It is a boolean option, defaults to \texttt{true}, and is only +operational if \opt{hyperref} is not \texttt{false}. These are both preamble +only options. + +\DescribeOption{sort} % +The \opt{sort} option controls whether the notes queue is sorted or not at +\cs{printpostnotes}. Normally, the order the notes should be printed is the +one in which the notes were placed along the document. However, in cases +where some manual intervention was required, sorting the notes can be quite +useful, and difficult to handle in its absence. Two typical examples are: a +note inside a float which disturbed the sequence of the \texttt{postnote} +counter (see \zcref{ex:x:float} in \zcref{sec:further-examples} for an +illustration) and a manually set mark, in which case \pkg{postnotes} also +allows to manually set a sort value with the \opt{sortnum} option of +\cs{postnote}. Sorting does not cross boundaries of notes sections, as set by +\cs{postnotesection}, in other words, if notes sections exist, sorting is only +ever carried out within the boundaries of each section. This may be a +restriction for cases in which floats cross sections' boundaries, but it's the +only reasonable thing to do. \opt{sort} is a boolean option, and defaults to +\texttt{true}. + + +\subsection*{Note options} +\zlabel{sec:note-options} + +The options accepted by \cs{postnote}\oarg{options}\marg{text} are the +following: + +\bigskip{} + +\DescribeOption{mark} % +By default, the mark generated by \cs{postnote} is determined by the printed +representation of the \texttt{postnote} counter, \cs{thepostnote}, which is +stepped when \cs{postnote} is called. But the \opt{mark} option allows you to +manually set it, in case you want, or need, to do so. When \opt{mark} is +manually set, the \texttt{postnote} counter is not stepped. Note that, +differently from the optional argument of \cs{footnote}, this does not need to +be a number, it can receive some text as value, which is directly used as the +mark. + +\DescribeOption{sortnum} % +Normally, the sort value used for sorting the notes queue (see the \opt{sort} +package option above) is determined by the value of the \texttt{postnote} +counter (that is, by \cs{the}\cs{c@postnote}, and not by its printed +representation, \cs{thepostnote}). But you may specify this sort value +manually with the \opt{sortnum} option, typically, when you have also manually +specified the mark. It receives a floating point number as value. So, for +example, if one needed to insert a note between notes 2 and 3, without +disturbing the numbering of other notes, one could use +\texttt{\cs{postnote}[mark=2*,sortnum=2.5]\marg{text}}. + +\DescribeOption{nomark} % +The \opt{nomark} option makes \cs{postnote} inhibit the typesetting of the +mark. Of course, normally, we do want the visual cue of the mark, but the +intended use case for this option is for a \cs{postnote} with \opt{nomark} to +be paired with a \cs{postnoteref}, so as to be able to typeset a note in +places where doing so directly may be problematic. For a practical example +and an illustration on how to use it, see \zcref{ex:x:caption} in +\zcref{sec:further-examples}. + +\DescribeOption{label} % +The \opt{label} option sets a standard \cs{label} named with the value given +to the option. When the \pkg{zref-user} package is loaded, a corresponding +\opt{zlabel} option is also provided. See \zcref{sec:cross-references} for +details about cross-referencing. + + +\subsection*{Section options} +\zlabel{sec:section-options} + +The options accepted by \cs{postnotesection}\oarg{options}\marg{text} are the +following: + +\bigskip{} + +\DescribeOption{name} % +For the purposes of building running headers, each \cs{postnotesection} can be +identified by its \opt{name}. This is mainly intended to support unnumbered +headings, but its mechanism is general. The name of a note section is made +available for the first and last note on a given page through the variables +\cs{pnhdnamefirst} and \cs{pnhdnamelast} at the moment the header of the page +is typeset. For details on how to use these variables, see +\zcref{sec:headers}. + + +\section{Notes sections} +\zlabel{sec:notes-sections} + +As mentioned above, \cs{postnotesection} is the basic interface for +subdividing the notes when printed. For those familiar with it, this command +is \pkg{postnotes}'s equivalent to \pkg{endnotes}' \cs{addtoendnotes}. It has +the same intended use -- to add text or commands along the notes' sequence at +the point it is called -- and the way it works is quite similar to +\cs{addtoendnotes}. But there are some differences, prominently a +\cs{postnotesection} is skipped at \cs{printpostnotes} if it contains no +notes. In other words, if two (or more) calls of \cs{postnotesection} occur +in immediate sequence, with no \cs{postnote} in between, the latter call takes +precedence over the former, instead of being accumulated in the queue. This +is intended to facilitate the automation of the subdivision of the notes. So, +one can, for example, use a hook to \cs{chapter} and not have to worry if a +chapter with no notes will generate an empty section inside +\cs{printpostnotes}, e.g., by the call to \cs{chapter*} at the table of +contents, and so on. Or, one can use the heading number for the automated +case, but be able to override it manually for an occasional unnumbered one. +For this reason, a more semantic name was chosen for it, instead of the +generic ``add to''. + +\DescribeOption{\cs{pnthechapter}} % +\DescribeOption{\cs{pnthesection}} % +\DescribeOption{\cs{pnthechapternextnote}} % +\DescribeOption{\cs{pnthesectionnextnote}} % +Just like with \cs{postnote}, the contents of \cs{postnotesection} are not +expanded in place, but rather stored with ``no manipulation'' to be typeset +later at \cs{printpostnotes}. For this reason, some contextual information is +stored at the place \cs{postnotesection} is called, and made available at the +point it's content gets expanded by means of some variables. When the content +of a notes section gets typeset, \cs{pnthechapter} contains the value of +\cs{thechapter} where \cs{postnotesection} was originally called. Similarly, +\cs{pnthesection} contains the value of \cs{thesection}. +\cs{pnthechapternextnote} and \cs{pnthesectionnextnote} are meant to support +the automation of the notes subdivision by using hooks to sectioning commands, +which is a quite natural way to do this. However, since it may be problematic +to hook \emph{after} sectioning commands -- \cs{section}, for example, figures +prominently in the documentation of \pkg{ltcmdhooks} as a case of ``look +ahead'' command for which the \texttt{after} hook is not supported -- we will +typically want to hook \emph{before} them. But, at this point the values of +the \texttt{chapter} or \texttt{section} counters have not yet been stepped, +therefore \cs{thechapter} and \cs{thesection} do not correspond to what we +would like to refer to. For this reason, \cs{pnthechapternextnote} contains +the value of \cs{thechapter} at the point the ``next note'' is placed (a +\cs{postnote}, that is), the first in the chapter, and already inside it, thus +with an expected value of the \texttt{chapter} counter. Similarly, +\cs{pnthesectionnextnote} contains the value of \cs{thesection} for the ``next +note''. Of course, the ``next note'' variables are \emph{proxies}, but they +are meant to support the automation of the subdivision of the notes through +the use of \texttt{before} hooks to the document's sectioning commands, in +which case the subdivision of the notes will correspond to the document's +structure and, given empty notes sections are skipped, the values will be the +ones we are interested in. But more complex use cases may require something +different. Either way, it is up to the user to judge whether the \emph{proxy} +is a good one for their use case, the variables just do what they say, and +contain the values of interest for the ``next note''. + +This is meant to be simple. Some examples might make things more concrete. +At its most basic, \cs{postnotesection} can just be set manually: + +\begin{pnexample}[caption={Basic usage},label={ex:sect:basic}] +\documentclass{book} +\usepackage{postnotes} +\usepackage{hyperref} +\begin{document} +\chapter{First chapter} +\postnotesection{\section*{Notes to chapter \pnthechapter}} +Foo.\postnote{Foo note.} +Bar.\postnote{Bar note.} +\chapter{Second chapter} +\postnotesection{\section*{Notes to chapter \pnthechapter}} +\setcounter{postnote}{0} +Baz.\postnote{Baz note.} +Boo.\postnote{Boo note.} +\printpostnotes +\end{document} +\end{pnexample} + +The document in \zcref{ex:sect:basic} resets the \texttt{postnote} counter for each +chapter, and manually sets notes sections by chapter, which results in +\cs{printpostnotes} being correspondingly subdivided. But it is easy to make +this automatic: + +\begin{pnexample}[caption={Automating notes subdivision with a hook},label={ex:sect:auto}] +\documentclass{book} +\usepackage{postnotes} +\AddToHook{cmd/chapter/before}{% + \postnotesection{\section*{Notes to chapter \pnthechapternextnote}}} +\counterwithin*{postnote}{chapter} +\usepackage{hyperref} +\begin{document} +\tableofcontents +\chapter{First chapter} +Foo.\postnote{Foo note.} +Bar.\postnote{Bar note.} +\chapter{Second chapter} +Baz.\postnote{Baz note.} +Boo.\postnote{Boo note.} +\printpostnotes +\end{document} +\end{pnexample} + +\zcref{ex:sect:auto} uses the \texttt{cmd/chapter/before} hook, and thus +\cs{pnthechapternextnote} to retrieve the correct chapter number for +\cs{postnotesection}, as explained above. The counter is reset every chapter +by means of \cs{counterwithin*}. Note that the call to \cs{chapter*} inside +\cs{tableofcontents} does not generate a spurious notes section at +\cs{printpostnotes} (as long as you don't place a note in a sectioning command +with no short argument, which you shouldn't do anyway). But what if we have, +among mostly numbered chapters, an ocasional unnumbered one? +\cs{pnthechapternextnote} wouldn't possibly work in this case. Since +immediately successive calls to \cs{postnotesection} override the previous +ones, it is straightforward to just manually adjust the exception: + +\begin{pnexample}[caption={Fine-tuning automation},label={ex:sect:fine-auto}] +\documentclass{book} +\usepackage{postnotes} +\AddToHook{cmd/chapter/before}{% + \postnotesection{\section*{Notes to chapter \pnthechapternextnote}}} +\counterwithin*{postnote}{chapter} +\usepackage{hyperref} +\begin{document} +\tableofcontents +\chapter*{Introduction} +\postnotesection{\section*{Notes to the introduction}} +Intro.\postnote{Intro note.} +\chapter{First chapter} +Foo.\postnote{Foo note.} +Bar.\postnote{Bar note.} +\chapter{Second chapter} +Baz.\postnote{Baz note.} +Boo.\postnote{Boo note.} +\printpostnotes +\end{document} +\end{pnexample} + +\section{Headers} +\zlabel{sec:headers} + +\pkg{postnotes}' support for running headers comprises a basic header, enabled +by default, generating headers in the form ``Notes to pages N--M'', but also +some infrastructure for users to build more elaborate ones. + +The default headers are generated by the function \cs{pnheaderdefault} which, +as we saw in \zcref{sec:section-options} is used to set the headers in option +\opt{heading} (with \cs{@mkboth}). So, the default headers are enabled +through that particular setting. + +Examining the definition of \cs{pnheaderdefault} is possibly the most direct +way to explore how the feature is meant to work. + +\begin{pnsnippet} +\ExplSyntaxOn +\NewDocumentCommand \pnheaderdefault {} + { + \tl_if_eq:NNTF \pnhdpagefirst \pnhdpagelast + { \pnhdnotes{} ~ \pnhdtopage{} ~ \pnhdpagefirst } + { \pnhdnotes{} ~ \pnhdtopages{} ~ \pnhdpagefirst -- \pnhdpagelast } + } +\ExplSyntaxOff +\end{pnsnippet} + +\cs{pnhdnotes}, \cs{pnhdtopage}, and \cs{pnhdtopages} are localizable strings, +which by default respectively contain ``Notes'', ``to page'', and ``to pages'' +(see \zcref{sec:localization}). Let's replace them to examine the interesting +part of the definition: + +\begin{pnsnippet} +\ExplSyntaxOn +\NewDocumentCommand \pnheaderdefault {} + { + \tl_if_eq:NNTF \pnhdpagefirst \pnhdpagelast + { Notes~to~page~ \pnhdpagefirst } + { Notes~to~pages~ \pnhdpagefirst -- \pnhdpagelast } + } +\ExplSyntaxOff +\end{pnsnippet} + +\DescribeOption{\cs{pnhdpagefirst}} % +\DescribeOption{\cs{pnhdpagelast}} % +\DescribeOption{\cs{pnhdchapfirst}} % +\DescribeOption{\cs{pnhdchaplast}} % +\DescribeOption{\cs{pnhdsectfirst}} % +\DescribeOption{\cs{pnhdsectlast}} % +\DescribeOption{\cs{pnhdnamefirst}} % +\DescribeOption{\cs{pnhdnamelast}} % +\cs{pnhdpagefirst} and \cs{pnhdpagelast} store the value of \cs{thepage} for +the first and the last notes (where these notes were originally placed) of the +current page (at the point they are being printed). These variables are +updated every page along the span of \cs{printpostnotes} to the values +corresponding to their respective first and last note (which start on that +page), so that these values are available at the moment the headers get to be +typeset. Hence, what the definition of \cs{pnheaderdefault} does is to use +these variables to build a rule in the form: ``if the page of the first and +last notes are equal, write a singular form and just one value but, if they +are different, write a plural form and a range of both values''. +\cs{pnhdchapfirst}, \cs{pnhdchaplast}, \cs{pnhdsectfirst}, and +\cs{pnhdsectfirst} provide the same for \cs{thechapter} and \cs{thesection}. +\cs{pnhdnamefirst} and \cs{pnhdnamelast} contain the name of the notes +section, the one given with the \opt{name} option of \cs{postnotesection} (and +are empty in case no \opt{name} was provided). + +With that in hand, fancier headers can be built. For example, if we'd like +headers in the form ``Notes to chapters A--C, pages N--M'', we could define: +\begin{pnsnippet} +\ExplSyntaxOn +\NewDocumentCommand \mypnheader {} + { + \tl_if_eq:NNTF \pnhdchapfirst \pnhdchaplast + { Notes~to~chapter~\pnhdchapfirst,~ } + { Notes~to~chapters~\pnhdchapfirst -- \pnhdchaplast,~ } + \tl_if_eq:NNTF \pnhdpagefirst \pnhdpagelast + { page~\pnhdpagefirst } + { pages~\pnhdpagefirst -- \pnhdpagelast } + } +\ExplSyntaxOff +\end{pnsnippet} +and then set \opt{heading} to use \cs{mypnheader} instead of +\cs{pnheaderdefault}. This definition should work well as long as all the +chapters (containing notes) are numbered, but if unnumbered ones come into +play, again we can fine-tune the automation, adjusting for the exception. +That's the purpose of the \opt{name} option for \cs{postnotesection}, and of +\cs{pnhdnamefirst} and \cs{pnhdnamelast}. \zcref{ex:hd:fancy} illustrates +their use (of course, the use of \pkg{lipsum} is just for demonstration): + +\begin{pnexample}[caption={Fancy headers},label={ex:hd:fancy}] +\documentclass{book} +\usepackage{postnotes} +\postnotesetup{ + heading = {% + \chapter*{\pntitle} + \markboth{\mypnheader}{\mypnheader}% + } , +} +\counterwithin*{postnote}{chapter} +\AddToHook{cmd/chapter/before}{% + \postnotesection{\section*{Notes to chapter \pnthechapternextnote}}% +} +\ExplSyntaxOn +\NewDocumentCommand \mypnheader {} + { + \bool_case_true:nF + { + { + \str_if_eq_p:ee { \pnhdnamefirst } { intro } && + \str_if_eq_p:ee { \pnhdnamelast } { intro } + } + { Notes~to~the~introduction,~ } + { + \str_if_eq_p:ee { \pnhdnamefirst } { intro } && + ! \str_if_eq_p:ee { \pnhdnamelast } { intro } + } + { Notes~to~the~introduction~and~chapter~\pnhdchaplast{},~ } + } + { + \tl_if_eq:NNTF \pnhdchapfirst \pnhdchaplast + { Notes~to~chapter~\pnhdchapfirst{},~ } + { Notes~to~chapters~\pnhdchapfirst{} -- \pnhdchaplast{},~ } + } + \tl_if_eq:NNTF \pnhdpagefirst \pnhdpagelast + { page~\pnhdpagefirst{} } + { pages~\pnhdpagefirst{} -- \pnhdpagelast{} } + } +\ExplSyntaxOff +\usepackage{hyperref} +\usepackage{lipsum} +\ExplSyntaxOn +\NewDocumentCommand \demochapter { m } + { \prg_replicate:nn { #1 } { \lipsum[1-2]\postnote{\lipsum[3]}\par } } +\ExplSyntaxOff +\begin{document} +\tableofcontents +\chapter*{Introduction} +\postnotesection[name=intro]{\section*{Notes to the introduction}} +\demochapter{12} +\chapter{Chapter 1} +\demochapter{15} +\chapter{Chapter 2} +\demochapter{15} +\printpostnotes +\end{document} +\end{pnexample} + + +\section{Cross-references} +\zlabel{sec:cross-references} + +Cross-referencing with \pkg{postnotes} works in a pretty standard way: set a +label, make references to it. However, there are two ways to set a label to a +note. One can either set a label with the \opt{label} option of +\cs{postnote}, or one can directly set it with the standard \cs{label} as part +of the note's content. They are both valid, but they are not equivalent, they +have different meanings and, accordingly, behave differently. + +The label set with the \opt{label} option is set at the place where +\cs{postnote} is. The label set with \cs{label} in the note's content, is +just stored, and only gets expanded when this content gets to be typeset, at +\cs{printpostnotes}. In short, the \opt{label} option belongs to the +``mark'', while the \cs{label} set in the content belongs to the ``text''. + +Of course, the data stored in each label will correspond to this difference. +Even if the plain \cs{ref} to both will get the same value (the mark), a +\cs{pageref} will be different, the links to either will point to different +places, etc. + + +\section{Localization} +\zlabel{sec:localization} + +\DescribeOption{\cs{pntitle}} % +\DescribeOption{\cs{pnhdnotes}} % +\DescribeOption{\cs{pnhdtopage}} % +\DescribeOption{\cs{pnhdtopages}} % +\pkg{postnotes} uses a few localized strings, stored in the variables +\cs{pntitle}, \cs{pnhdnotes}, \cs{pnhdtopage}, and \cs{pnhdtopages}. The +first one is used in the default value of the \opt{heading} option and +defaults to ``Notes''. The remaining three are used in \cs{pnheaderdefault} +(and thus, indirectly also in the \opt{heading} option) and their respective +defaults are: ``Notes'', ``to page'', and ``to pages''. So, if you changed +the default value of \opt{heading} and is not using \cs{pnheaderdefault}, you +don't have to worry about them. + +These strings will automatically adjust to the document language, set either +by \pkg{babel} or by \pkg{polyglossia}, \emph{if} the language is supported by +\pkg{postnotes}. Currently supported are English and Portuguese, and their +variants. Either way, you can always change these variables to the values of +your preference. If you are not using either \pkg{babel} or +\pkg{polyglossia}, you can do so directly, for example, with: +\begin{pnsnippet} +\renewcommand*{\pntitle}{My title} +\end{pnsnippet} +However, with \pkg{babel} or \pkg{polyglossia}, and specially in a multi +language document, you must use the appropriate hooks of your language package +for this, otherwise, the next call to \cs{selectlanguage} will override your +settings. For \pkg{babel} you should use: +\begin{pnsnippet}[escapeinside=`'] +\addto\extras`\meta{language}'{\renewcommand*{\pntitle}{My title}} +\end{pnsnippet} +and for \pkg{polyglossia}: +\begin{pnsnippet}[escapeinside=`'] +\gappto\captions`\meta{language}'{\renewcommand*{\pntitle}{My title}} +\end{pnsnippet} + + +\section{Further examples} +\zlabel{sec:further-examples} + +This section collects some further usage examples which did not fit into the +previous sections, but might still be of interest. + +\bigskip{} + +\zcref{ex:x:multi-print} illustrates a basic procedure of how to obtain a note +section for each chapter of a book, by calling \cs{printpostnotes} at the end +of each chapter: + +\begin{pnexample}[caption={Notes for each chapter},label={ex:x:multi-print}] +\documentclass{book} +\usepackage{postnotes} +\postnotesetup{heading={\section*{\pntitle}}} +\usepackage{hyperref} +\begin{document} +\chapter{First chapter} +Foo.\postnote{Foo note.} +Bar.\postnote{Bar note.} +\printpostnotes +\chapter{Second chapter} +\setcounter{postnote}{0} +Baz.\postnote{Baz note.} +Boo.\postnote{Boo note.} +\printpostnotes +\end{document} +\end{pnexample} + +\zcref{ex:x:float} shows a case of a float which disturbs the order of the +notes. It demonstrates a (traditional) technique to deal with the situation, +by setting a manual mark and adjusting the counter where appropriate. It also +illustrates the role the sorting of notes can have, by producing not only +correctly ordered note marks (as a result of the manual adjustments), but also +correctly ordered printed notes (as a result of sorting): + +\begin{pnexample}[caption={Sorting and floats},label={ex:x:float}] +\documentclass{book} +\usepackage{postnotes} +\usepackage{hyperref} +\begin{document} +\chapter{First chapter} +\postnote{1} +\postnote{2} +\begin{table}[p] + \caption{Table} + Table.\postnote[mark=5,sortnum=5]{3} +\end{table} +\postnote{4} +\postnote{5} +\stepcounter{postnote} +\clearpage +\postnote{6} +\printpostnotes +\end{document} +\end{pnexample} + +\zcref{ex:x:caption} illustrates a couple of techniques to handle long +captions. Captions pose a problem to \cs{postnote} because, if you set a +\cs{postnote} inside a standard caption, whose text is long enough to require +two lines, the content of the caption ends up being typeset twice: once to +check if it would have fitted in a single line, the second to typeset the two +lines since it didn't fit in one. This triggers the \texttt{postnote} counter +to be stepped twice (and any other counter that happens to be there too). One +way to handle the situation is, if you know(!) that the caption takes two +lines, you can decrement the counter just before it, and place the note +directly in the caption, this will get you a correctly numbered note. Another +way is to use the pairing between a \opt{nomark} \cs{postnote} and +\cs{postnoteref}: place a note outside the caption (but close to it, since its +position will determine the anchor for the backlink) with the \opt{nomark} +option, set a label inside it and, inside the caption make a \cs{postnoteref} +to the label. In practice: + +\begin{pnexample}[caption={Long caption},label={ex:x:caption}] +\documentclass{article} +\usepackage[textwidth=8cm]{geometry} +\usepackage{postnotes} +\usepackage{hyperref} +\begin{document} +\begin{figure} + Figure. + \addtocounter{postnote}{-1} + \caption[Caption for LOF]{A long caption, long enough to require two + lines\postnote{A note.}} +\end{figure} +\begin{figure} + Figure. + \postnote[nomark]{\label{en:1}A note.}% + \caption[Caption for LOF]{A long caption, long enough to require two + lines\postnoteref{en:1}} +\end{figure} +\printpostnotes +\end{document} +\end{pnexample} + + +\section{Acknowledgments} + +Some people have kindly contributed to \pkg{postnotes}. Suggestions, ideas, +insightful comments, solutions to problems, bug reports were generously +provided by (in chronological order): + Ulrike Fischer, + % 2022-03-22: https://chat.stackexchange.com/transcript/message/60708390#60708390 + % 2022-03-28: https://chat.stackexchange.com/transcript/message/60754383#60754383 + % 2022-03-31: https://github.com/latex3/hyperref/issues/230 + % 2022-04-09: https://github.com/latex3/hyperref/issues/229 + David Carlisle, + % 2022-03-28: https://chat.stackexchange.com/transcript/message/60754383#60754383 + % 2022-04-08: https://tex.stackexchange.com/a/640035 (comments) + and Moritz Wemheuer. + % 2022-04-05: https://tex.stackexchange.com/q/597359#comment1594585_597389 + +If I have inadvertently left anyone off the list I apologize, and please let +me know, so that I can correct the oversight. + +Thank you all very much! + + +\section{Change history} + +A change log with relevant changes for each version, eventual upgrade +instructions, and upcoming changes, is maintained in the package's repository, +at \url{https://github.com/gusbrs/postnotes/blob/main/CHANGELOG.md}. The +change log is also distributed with the package's documentation through CTAN +upon release so, most likely, \texttt{texdoc postnotes/changelog} should +provide easy local access to it. An archive of historical versions of the +package is also kept at \url{https://github.com/gusbrs/postnotes/releases}. + +\end{document} diff --git a/macros/latex/contrib/projlib/ProjLib.dtx b/macros/latex/contrib/projlib/ProjLib.dtx index 03de30a0d0..c9d214f9e1 100644 --- a/macros/latex/contrib/projlib/ProjLib.dtx +++ b/macros/latex/contrib/projlib/ProjLib.dtx @@ -20,77 +20,77 @@ %<*ProjLib> \ProvidesExplPackage {ProjLib} - {2022/04/03} {} + {2022/04/18} {} {Collective interface of the ProjLib toolkit} % % %<*projlib-author> \ProvidesExplPackage {projlib-author} - {2022/04/03} {} + {2022/04/18} {} {Enhanced author information block} % % %<*projlib-datetime> \ProvidesExplPackage {projlib-datetime} - {2022/04/03} {} + {2022/04/18} {} {Convert numeric date-time string to natural language} % % %<*projlib-draft> \ProvidesExplPackage {projlib-draft} - {2022/04/03} {} + {2022/04/18} {} {Useful commands during draft stage} % % %<*projlib-font> \ProvidesExplPackage {projlib-font} - {2022/04/03} {} + {2022/04/18} {} {Font selection and configuration} % % %<*projlib-language> \ProvidesExplPackage {projlib-language} - {2022/04/03} {} + {2022/04/18} {} {Multi-language configuration} % % %<*projlib-logo> \ProvidesExplPackage {projlib-logo} - {2022/04/03} {} + {2022/04/18} {} {The ProjLib logo} % % %<*projlib-math> \ProvidesExplPackage {projlib-math} - {2022/04/03} {} + {2022/04/18} {} {Efficient math setup} % % %<*projlib-paper> \ProvidesExplPackage {projlib-paper} - {2022/04/03} {} + {2022/04/18} {} {Configuration of the paper style} % % %<*projlib-theorem> \ProvidesExplPackage {projlib-theorem} - {2022/04/03} {} + {2022/04/18} {} {Configuration of theorem-like environments} % % %<*projlib-titlepage> \ProvidesExplPackage {projlib-titlepage} - {2022/04/03} {} + {2022/04/18} {} {Commands for rendering the title page} % @@ -264,7 +264,7 @@ \bool_if:NT \l__projlib_author_amsfashion_bool { - \RequirePackage{ projlib-language } + \RequirePackage { projlib-language } \tl_const:Nn \c_projlib_author_dot_tl { . } @@ -354,9 +354,8 @@ \bool_new:N \g__projlib_author_abstract_before_maketitle_bool \bool_gset_false:N \g__projlib_author_abstract_before_maketitle_bool - \msg_redirect_name:nnn { scontents } { unsupported-verbatim } { info } - \RequirePackage{ scontents } - \newenvsc{abstract}[store-env=projlib-author-abstract,print-env=false] + \RequirePackage { scontents } + \newenvsc { abstract } [ store-env = projlib-author-abstract, print-env = false ] \hook_gput_code:nnn { env/abstract/after } { projlib-author } { @@ -851,7 +850,7 @@ \group_begin: \tl_if_blank:eF { #1 } { \keys_set:nn { projlib-datetime-command } { #1 } } \tl_if_blank:eF { #3 } { \keys_set:nn { projlib-datetime-command } { #3 } } - \tl_set:Nx \l_tmpa_tl { #2 } + \tl_set:Nx \l_tmpa_tl { \exp_args:Ne \tl_trim_spaces:n { #2 } } \regex_replace_all:nnN { \D } { - } \l_tmpa_tl \exp_args:Ne \__projlib_datetime_display_date_according_to_format:nn { \l_tmpa_tl } {} \group_end: @@ -862,7 +861,7 @@ \group_begin: \tl_if_blank:eF { #1 } { \keys_set:nn { projlib-datetime-command } { #1 } } \tl_if_blank:eF { #3 } { \keys_set:nn { projlib-datetime-command } { #3 } } - \tl_set:Nx \l_tmpa_tl { #2 } + \tl_set:Nx \l_tmpa_tl { \exp_args:Ne \tl_trim_spaces:n { #2 } } \regex_replace_all:nnN { \D } { - } \l_tmpa_tl \exp_args:Ne \__projlib_datetime_display_date_according_to_format:nn { \l_tmpa_tl } { _uppercase } \group_end: @@ -2239,6 +2238,11 @@ \group_begin: \projlib_draft_DNF_font \stepcounter { projlib_draft_DNF_counter } + \raisebox{\baselineskip}{ + \hypertarget { DNF. \arabic { projlib_draft_DNF_counter } } {} + \label { DNF. \arabic { projlib_draft_DNF_counter } } + } + \nobreak \projlib_draft_plain_box:nn { projlib_draft_DNF_color } { \projlib_draft_DNF_text @@ -2248,26 +2252,38 @@ \tl_trim_spaces:n { #1 } } \group_end: - \tl_gput_right:Nx \g__projlib_draft_DNF_report_tl + \tl_gput_right:Nn \g__projlib_draft_DNF_report_tl { \noindent \# \, + } + \tl_gput_right:Nx \g__projlib_draft_DNF_report_tl + { \int_value:w \theprojlib_draft_DNF_counter + } + \tl_gput_right:Nn \g__projlib_draft_DNF_report_tl + { \c_space_tl \c_space_tl $\langle$ \skip_horizontal:n { 0.1em } + } + \tl_gput_right:Nx \g__projlib_draft_DNF_report_tl + { \cs_if_exist:cTF { hyperlink } { - \exp_not:N \hyperlink { page.\thepage } { \thepage } + \exp_not:N \hyperlink { DNF. \int_value:w \theprojlib_draft_DNF_counter } { \exp_not:N \pageref* { DNF. \int_value:w \theprojlib_draft_DNF_counter } } } { - \thepage + \exp_not:N \pageref* { DNF. \int_value:w \theprojlib_draft_DNF_counter } } + } + \tl_gput_right:Nn \g__projlib_draft_DNF_report_tl + { \skip_horizontal:n { 0.1em } $\rangle$ \nobreakspace - \exp_not:n { \tl_if_blank:nF { #1 } { : ~ } } - \exp_not:n { \tl_trim_spaces:n { #1 } } + \tl_if_blank:nF { #1 } { : ~ } + \tl_trim_spaces:n { #1 } \par \skip_vertical:n { -\parskip } \skip_vertical:n { .15\baselineskip } } @@ -2280,6 +2296,7 @@ \tl_if_blank:VF \g__projlib_draft_DNF_report_tl { \clearpage + \addtocounter{page}{-1} \pagestyle { empty } \color { projlib_draft_DNF_color } \noindent @@ -2678,7 +2695,7 @@ \cs_new:Nn \projlib_language_str_to_languagename:n { - \str_case_e:nnF { \str_foldcase:n { #1 } } + \str_case_e:nnF { \exp_args:Ne \str_foldcase:n { \tl_trim_spaces:n { #1 } } } { { all } { common } { common } { common } @@ -2716,7 +2733,7 @@ \cs_new:Nn \projlib_language_str_to_languagetype:n { - \str_case_e:nn { \str_foldcase:n { #1 } } + \str_case_e:nnF { \exp_args:Ne \str_foldcase:n { \tl_trim_spaces:n { #1 } } } { { cn } { cjk } { chinese } { cjk } @@ -2747,6 +2764,7 @@ { ru } { latin } { russian } { latin } } + { latin } } \sys_if_engine_pdftex:T @@ -2814,9 +2832,9 @@ } } + \tl_gput_right:Nn \g_projlib_language_settings_schinese_tl { - \g_projlib_language_settings_common_tl \tl_set:Nn \languagename { schinese } \tl_set:cn { abstractname } { 摘要 } \tl_set:cn { proofname } { 证明 } @@ -2830,10 +2848,22 @@ \tl_set:cn { refname } { 参考文献 } \tl_set:cn { bibname } { 参考文献 } } +\cs_new_protected:Nn \projlib_language_apply_settings_globally_schinese: + { + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_schinese_tl + } +\cs_new_protected:Nn \projlib_language_apply_settings_locally_schinese:n + { + \group_begin: + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_schinese_tl + #1 + \group_end: + } \tl_gput_right:Nn \g_projlib_language_settings_tchinese_tl { - \g_projlib_language_settings_common_tl \tl_set:Nn \languagename { tchinese } \tl_set:cn { abstractname } { 摘要 } \tl_set:cn { proofname } { 證明 } @@ -2847,60 +2877,157 @@ \tl_set:cn { refname } { 參考文獻 } \tl_set:cn { bibname } { 參考文獻 } } +\cs_new_protected:Nn \projlib_language_apply_settings_globally_tchinese: + { + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_tchinese_tl + } +\cs_new_protected:Nn \projlib_language_apply_settings_locally_tchinese:n + { + \group_begin: + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_tchinese_tl + #1 + \group_end: + } -\tl_gput_right:Nn \g_projlib_language_settings_japanese_tl +\cs_new_protected:Nn \projlib_language_apply_settings_globally_japanese: { \selectlanguage { japanese } \g_projlib_language_settings_common_tl + \g_projlib_language_settings_japanese_tl + } +\cs_new_protected:Nn \projlib_language_apply_settings_locally_japanese:n + { + \group_begin: + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_japanese_tl + \foreignlanguage { japanese } { #1 } + \group_end: } -\tl_gput_right:Nn \g_projlib_language_settings_english_tl +\cs_new_protected:Nn \projlib_language_apply_settings_globally_english: { \selectlanguage { english } \g_projlib_language_settings_common_tl + \g_projlib_language_settings_english_tl + } +\cs_new_protected:Nn \projlib_language_apply_settings_locally_english:n + { + \group_begin: + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_english_tl + \foreignlanguage { english } { #1 } + \group_end: } \tl_gput_right:Nn \g_projlib_language_settings_french_tl + { + \tl_gset:cn { frenchpartname } { Partie } + } +\cs_new_protected:Nn \projlib_language_apply_settings_globally_french: { \selectlanguage { french } \g_projlib_language_settings_common_tl - \tl_gset:cn { frenchpartname } { Partie } + \g_projlib_language_settings_french_tl + } +\cs_new_protected:Nn \projlib_language_apply_settings_locally_french:n + { + \group_begin: + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_french_tl + \foreignlanguage { french } { #1 } + \group_end: } -\tl_gput_right:Nn \g_projlib_language_settings_ngerman_tl +\cs_new_protected:Nn \projlib_language_apply_settings_globally_ngerman: { \selectlanguage { ngerman } \g_projlib_language_settings_common_tl + \g_projlib_language_settings_ngerman_tl + } +\cs_new_protected:Nn \projlib_language_apply_settings_locally_ngerman:n + { + \group_begin: + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_ngerman_tl + \foreignlanguage { ngerman } { #1 } + \group_end: } -\tl_gput_right:Nn \g_projlib_language_settings_italian_tl +\cs_new_protected:Nn \projlib_language_apply_settings_globally_italian: { \selectlanguage { italian } \g_projlib_language_settings_common_tl + \g_projlib_language_settings_italian_tl + } +\cs_new_protected:Nn \projlib_language_apply_settings_locally_italian:n + { + \group_begin: + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_italian_tl + \foreignlanguage { italian } { #1 } + \group_end: } -\tl_gput_right:Nn \g_projlib_language_settings_portuguese_tl +\cs_new_protected:Nn \projlib_language_apply_settings_globally_portuguese: { \selectlanguage { portuguese } \g_projlib_language_settings_common_tl + \g_projlib_language_settings_portuguese_tl + } +\cs_new_protected:Nn \projlib_language_apply_settings_locally_portuguese:n + { + \group_begin: + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_portuguese_tl + \foreignlanguage { portuguese } { #1 } + \group_end: } -\tl_gput_right:Nn \g_projlib_language_settings_brazilian_tl +\cs_new_protected:Nn \projlib_language_apply_settings_globally_brazilian: { \selectlanguage { brazilian } \g_projlib_language_settings_common_tl + \g_projlib_language_settings_brazilian_tl + } +\cs_new_protected:Nn \projlib_language_apply_settings_locally_brazilian:n + { + \group_begin: + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_brazilian_tl + \foreignlanguage { brazilian } { #1 } + \group_end: } -\tl_gput_right:Nn \g_projlib_language_settings_spanish_tl +\cs_new_protected:Nn \projlib_language_apply_settings_globally_spanish: { \selectlanguage { spanish } \g_projlib_language_settings_common_tl + \g_projlib_language_settings_spanish_tl + } +\cs_new_protected:Nn \projlib_language_apply_settings_locally_spanish:n + { + \group_begin: + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_spanish_tl + \foreignlanguage { spanish } { #1 } + \group_end: } -\tl_gput_right:Nn \g_projlib_language_settings_russian_tl +\cs_new_protected:Nn \projlib_language_apply_settings_globally_russian: { \selectlanguage { russian } \g_projlib_language_settings_common_tl + \g_projlib_language_settings_russian_tl + } +\cs_new_protected:Nn \projlib_language_apply_settings_locally_russian:n + { + \group_begin: + \g_projlib_language_settings_common_tl + \g_projlib_language_settings_russian_tl + \foreignlanguage { russian } { #1 } + \group_end: } \NewDocumentCommand \AddLanguageSetting { O{} m } @@ -2914,7 +3041,6 @@ } } - \RequirePackage { setspace } \tl_new:N \g_projlib_language_linespacing_latin_tl @@ -2995,24 +3121,34 @@ \use:c { projlib_language_set_ #1 _ #2 :n } { #3 } } +\msg_new:nnn { projlib-language } + { language-not-support } + { The~language~"#1"~is~not~supported. } -\cs_new:Nn \projlib_language_use_language_pure:n +\cs_new:Nn \projlib_language_use_language_locally:nn { - \tl_use:c { g_projlib_language_settings_ \projlib_language_str_to_languagename:n { #1 } _tl } + \cs_if_exist_use:cF { projlib_language_apply_settings_locally_ \projlib_language_str_to_languagename:n { #1 } :n } + { + \msg_warning:nnn { projlib-language } { language-not-support } { #1 } + } + { #2 } } -\cs_generate_variant:Nn \projlib_language_use_language_pure:n { e } +\cs_generate_variant:Nn \projlib_language_use_language_locally:nn { e } \cs_new:Nn \projlib_language_use_language:n { - \projlib_language_use_language_pure:n { #1 } - \tl_use:c { g_projlib_language_linespacing_ \projlib_language_str_to_languagetype:n { #1 } _tl } - \tl_use:c { g_projlib_language_parindent_ \projlib_language_str_to_languagetype:n { #1 } _tl } + \cs_if_exist_use:cF { projlib_language_apply_settings_globally_ \projlib_language_str_to_languagename:n { #1 } : } + { + \msg_warning:nnn { projlib-language } { language-not-support } { #1 } + } + \cs_if_exist_use:c { g_projlib_language_linespacing_ \projlib_language_str_to_languagetype:n { #1 } _tl } + \cs_if_exist_use:c { g_projlib_language_parindent_ \projlib_language_str_to_languagetype:n { #1 } _tl } } \cs_generate_variant:Nn \projlib_language_use_language:n { e } \NewDocumentCommand \UseLanguage { m } { - \hook_gput_code:nnn { begindocument } { projlib-language } + \hook_gput_code:nnn { begindocument/end } { projlib-language } { \projlib_language_use_language:e { #1 } } @@ -3020,8 +3156,7 @@ \NewDocumentCommand \UseOtherLanguage { m m } { \group_begin: - \projlib_language_use_language_pure:e { #1 } - #2 + \projlib_language_use_language_locally:en { #1 } { #2 } \group_end: } @@ -3288,7 +3423,7 @@ } \cs_generate_variant:Nn \__projlib_math_define_operator:nnn { nee } -\NewDocumentCommand \DefineOperator { s O{} m O{} } +\NewDocumentCommand \DefineMathOperator { s O{} m O{} } { \tl_if_blank:nTF { #2 } { @@ -3298,15 +3433,16 @@ \projlib_math_define_operator:nnn { #1 } { #3 } { #2 } } } +\NewCommandCopy \DefineOperator \DefineMathOperator \msg_new:nnn { projlib-math } { shortcut-not-define } - { The~shortcut~"\iow_char:N \\#1"~cannot~be~defined,~a~command~with~the~same~name~has~already~existed. } + { The~symbol~/~shortcut~"\iow_char:N \\#1"~cannot~be~defined,~a~command~with~the~same~name~has~already~existed. } \msg_new:nnn { projlib-math } { shortcut-type-not-define } - { The~shortcut~type~"#1"~is~not~available,~a~command~with~the~same~name~has~already~existed. } + { The~symbol~/~shortcut~type~"#1"~is~not~available,~a~command~with~the~same~name~has~already~existed. } \keys_define:nn { projlib-math-shortcut } { @@ -3381,7 +3517,7 @@ { \cs_if_exist:cTF { #1 } { - \msg_warning:nnn { projlib-math } { shortcut-type-not-define } { #1 } + \msg_warning:nnn { projlib-math } { shortcut-not-define } { #1 } } { \exp_args:Nno \use:n @@ -3391,7 +3527,7 @@ } \cs_generate_variant:Nn \__projlib_math_define_shortcut:nn { ee } -\NewDocumentCommand \DefineShortcut { s O{} m O{} } +\NewDocumentCommand \DefineMathSymbol { s O{} m O{} } { \tl_if_blank:nTF { #2 } { @@ -3401,6 +3537,7 @@ \projlib_math_define_shortcut:nnn { #1 } { #3 } { #2 } } } +\NewCommandCopy \DefineShortcut \DefineMathSymbol \cs_new:Nn \__projlib_math_list_of_symbols_entry:nnnn @@ -3595,6 +3732,7 @@ \clist_const:Nn \c_projlib_theorem_supported_clist { + application , assertion , assumption , axiom , @@ -3619,6 +3757,8 @@ theorem , definition-proposition , definition-theorem , + proposition-definition , + theorem-definition , } \@ifclassloaded { beamer } @@ -3692,6 +3832,67 @@ } +\tl_new:N \l_projlib_theorem_name_of_theorem_with_name_tl +\CreateTheorem { theorem-with-name_inner } { name = { heading = { \l_projlib_theorem_name_of_theorem_with_name_tl } }, create-starred-version } + +\NewDocumentEnvironment { theorem-with-name } { m O{} } + { + \tl_set:Nn \l_projlib_theorem_name_of_theorem_with_name_tl { #1 } + \begin { theorem-with-name_inner } [ #2 ] + } + { + \end { theorem-with-name_inner } + } +\NewDocumentEnvironment { theorem-with-name* } { m O{} } + { + \tl_set:Nn \l_projlib_theorem_name_of_theorem_with_name_tl { #1 } + \begin { theorem-with-name_inner* } [ #2 ] + } + { + \end { theorem-with-name_inner* } + } + + +\cs_new_protected:Nn \projlib_theorem_disable_theorem_numbering:n + { + \clist_map_inline:nn { #1 } + { + \__projlib_theorem_disable_theorem_numbering_do:n { ##1 } + } + } +\cs_new_protected:Nn \__projlib_theorem_disable_theorem_numbering_do:n + { + \CreateTheorem { #1 } { copy-existed = #1* } + } + +\NewDocumentCommand \DisableTheoremNumbering { m } + { + \projlib_theorem_disable_theorem_numbering:n { #1 } + } + + +\cs_new_protected:Nn \projlib_theorem_switch_theorem_numbering:n + { + \clist_map_inline:nn { #1 } + { + \__projlib_theorem_switch_theorem_numbering_do:n { ##1 } + } + } +\cs_new_protected:Nn \__projlib_theorem_switch_theorem_numbering_do:n + { + \CreateTheorem { #1_projlib_theorem_temp } { copy-existed = #1* } + \CreateTheorem { #1* } { copy-existed = #1 } + \CreateTheorem { #1 } { copy-existed = #1_projlib_theorem_temp } + } + +\NewDocumentCommand \SwitchTheoremNumbering { m } + { + \projlib_theorem_switch_theorem_numbering:n { #1 } + } + +\SwitchTheoremNumbering { theorem-with-name } + + \AddLanguageSetting [ schinese ] { \crefname { equation } { 式 } { 式 } @@ -3791,6 +3992,48 @@ \bool_if:NF \l__projlib_theorem_presetname_bool { \endinput } \bool_if:NT \l__projlib_theorem_complexname_bool { \endinput } +\NameTheorem { application } + { + , heading = { + , english = Application + , french = Application + , ngerman = Anwendung + , italian = Applicazione + , portuguese = Aplicação + , brazilian = Aplicação + , spanish = Aplicación + , schinese = 应用 + , tchinese = 應用 + , japanese = 応用 + , russian = Применение + } + , crefname = { + , english = {Application}{Application} + , french = [l']{Application}[les]{Application} + , ngerman = {Anwendung}{Anwendung} + , italian = [l']{Applicazione}[le]{Applicazione} + , portuguese = [a]{Aplicação}[as]{Aplicação} + , brazilian = [a]{Aplicação}[as]{Aplicação} + , spanish = [la]{Aplicación}[las]{Aplicación} + , schinese = {应用}{应用} + , tchinese = {應用}{應用} + , japanese = {応用}{応用} + , russian = {Применение}{Применение} + } + , Crefname = { + , english = {Application}{Application} + , french = [L']{Application}[Les]{Application} + , ngerman = {Anwendung}{Anwendung} + , italian = [L']{Applicazione}[Le]{Applicazione} + , portuguese = [A]{Aplicação}[As]{Aplicação} + , brazilian = [A]{Aplicação}[As]{Aplicação} + , spanish = [La]{Aplicación}[Las]{Aplicación} + , schinese = {应用}{应用} + , tchinese = {應用}{應用} + , japanese = {応用}{応用} + , russian = {Применение}{Применение} + } + } \NameTheorem { assertion } { @@ -4738,91 +4981,11 @@ } } -\NameTheorem { definition-proposition } - { - , heading = { - , english = Definition-Proposition - , french = Définition-Proposition - , ngerman = Definition-Proposition - , italian = Definizione-Proposizione - , portuguese = Definição-Proposição - , brazilian = Definição-Proposição - , spanish = Definición-Proposición - , schinese = 定义-命题 - , tchinese = 定義-命題 - , japanese = 定義-命題 - , russian = Определение-Предложение - } - , crefname = { - , english = {Definition-Proposition}{Definition-Proposition} - , french = [la]{Définition-Proposition}[les]{Définition-Proposition} - , ngerman = {Definition-Proposition}{Definition-Proposition} - , italian = [la]{Definizione-Proposizione}[le]{Definizione-Proposizione} - , portuguese = [a]{Definição-Proposição}[as]{Definição-Proposição} - , brazilian = [a]{Definição-Proposição}[as]{Definição-Proposição} - , spanish = [la]{Definición-Proposición}[las]{Definición-Proposición} - , schinese = {定义-命题}{定义-命题} - , tchinese = {定義-命題}{定義-命題} - , japanese = {定義-命題}{定義-命題} - , russian = {Определение-Предложение}{Определение-Предложение} - } - , Crefname = { - , english = {Definition-Proposition}{Definition-Proposition} - , french = [La]{Définition-Proposition}[Les]{Définition-Proposition} - , ngerman = {Definition-Proposition}{Definition-Proposition} - , italian = [La]{Definizione-Proposizione}[Le]{Definizione-Proposizione} - , portuguese = [A]{Definição-Proposição}[As]{Definição-Proposição} - , brazilian = [A]{Definição-Proposição}[As]{Definição-Proposição} - , spanish = [La]{Definición-Proposición}[Las]{Definición-Proposición} - , schinese = {定义-命题}{定义-命题} - , tchinese = {定義-命題}{定義-命題} - , japanese = {定義-命題}{定義-命題} - , russian = {Определение-Предложение}{Определение-Предложение} - } - } +\NameTheorem { definition-proposition } { combined = { definition ; proposition } } +\NameTheorem { definition-theorem } { combined = { definition ; theorem } } -\NameTheorem { definition-theorem } - { - , heading = { - , english = Definition-Theorem - , french = Définition-Théorème - , ngerman = Definition-Satz - , italian = Definizione-Teorema - , portuguese = Definição-Teorema - , brazilian = Definição-Teorema - , spanish = Definición-Teorema - , schinese = 定义-定理 - , tchinese = 定義-定理 - , japanese = 定義-定理 - , russian = Определение-Теорема - } - , crefname = { - , english = {Definition-Theorem}{Definition-Theorem} - , french = [la]{Définition-Théorème}[les]{Définition-Théorème} - , ngerman = {Definition-Satz}{Definition-Satz} - , italian = [la]{Definizione-Teorema}[le]{Definizione-Teorema} - , portuguese = [a]{Definição-Teorema}[as]{Definição-Teorema} - , brazilian = [a]{Definição-Teorema}[as]{Definição-Teorema} - , spanish = [la]{Definición-Teorema}[las]{Definición-Teorema} - , schinese = {定义-定理}{定义-定理} - , tchinese = {定義-定理}{定義-定理} - , japanese = {定義-定理}{定義-定理} - , russian = {Определение-Теорема}{Определение-Теорема} - } - , Crefname = { - , english = {Definition-Theorem}{Definition-Theorem} - , french = [La]{Définition-Théorème}[Les]{Définition-Théorème} - , ngerman = {Definition-Satz}{Definition-Satz} - , italian = [La]{Definizione-Teorema}[Le]{Definizione-Teorema} - , portuguese = [A]{Definição-Teorema}[As]{Definição-Teorema} - , brazilian = [A]{Definição-Teorema}[As]{Definição-Teorema} - , spanish = [La]{Definición-Teorema}[Las]{Definición-Teorema} - , schinese = {定义-定理}{定义-定理} - , tchinese = {定義-定理}{定義-定理} - , japanese = {定義-定理}{定義-定理} - , russian = {Определение-Теорема}{Определение-Теорема} - } - } +\NameTheorem { proposition-definition } { combined = { proposition ; definition } } +\NameTheorem { theorem-definition } { combined = { theorem ; definition } } % % %<*projlib-titlepage> @@ -4900,8 +5063,8 @@ \fill [color=titlepage-main] ($(current~page.north~west)$) rectangle ($(current~page.north~west)+(.125\paperwidth,-.3\paperheight)$); \fill [color=titlepage-back] ($(current~page.north~east)$) rectangle ($(current~page.north~west)+(.125\paperwidth,-.3\paperheight)$); \node[text~width=.3\paperwidth,text~height=.2\paperheight] at ($(current~page.north~west)+(.32\paperwidth,-.17\paperheight)$) { \l_projlib_titlepage_logo_tl }; - \node[text~width=.4\paperwidth,text~height=.3\paperheight,scale=2.5] at ($(current~page.north~west)+(.67\paperwidth,-.15\paperheight)$) {\textcolor{titlepage-back}{\sffamily\textsc{ \l_projlib_titlepage_title_tl }\\[.5em]\footnotesize{ \l_projlib_titlepage_subtitle_tl }}}; - \node[text~width=.3\paperwidth,text~height=.3\paperheight] at ($(current~page.south)+(.2\paperwidth,.3\paperheight)$) {\color{titlepage-back}\begin{flushright}\fontsize{16pt}{0pt}\selectfont\textsc{ \l_projlib_titlepage_author_tl }\\[1em]\fontsize{12pt}{0pt}\selectfont \l_projlib_titlepage_date_tl \end{flushright} }; + \node[text~width=.8\paperwidth,text~height=.4\paperheight] at ($(current~page.north~west)+(.57\paperwidth,-.33\paperheight)$) {\textcolor{titlepage-back}{\fontsize{24pt}{28pt}\selectfont\sffamily\textsc{ \l_projlib_titlepage_title_tl }\\[1.5em]\fontsize{18pt}{22pt}\selectfont{ \l_projlib_titlepage_subtitle_tl }}}; + \node[text~width=.3\paperwidth,text~height=.3\paperheight] at ($(current~page.south)+(.2\paperwidth,.3\paperheight)$) {\color{titlepage-back}\begin{flushright}\fontsize{16pt}{18pt}\selectfont\textsc{ \l_projlib_titlepage_author_tl }\\[1em]\fontsize{12pt}{14pt}\selectfont \l_projlib_titlepage_date_tl \end{flushright} }; \end{tikzpicture} } @@ -4909,9 +5072,9 @@ { \begin{tikzpicture}[overlay,remember~picture] \fill[color=titlepage-main] ($(current~page.south~west)$) rectangle ($(current~page.north~east)+(0,-.3\paperheight)$); - \node[text~width=.3\paperwidth,text~height=.2\paperheight] at ($(current~page.north~west)+(.28\paperwidth,-.15\paperheight)$) { \l_projlib_titlepage_logo_tl }; - \node[text~width=.4\paperwidth,text~height=.3\paperheight,scale=2.5] at ($(current~page.north~west)+(.63\paperwidth,-.15\paperheight)$) {\textcolor{paper}{\sffamily\textsc{ \l_projlib_titlepage_title_tl }\\[.5em]\footnotesize{ \l_projlib_titlepage_subtitle_tl }}}; - \node[text~width=.3\paperwidth,text~height=.3\paperheight] at ($(current~page.south)+(.2\paperwidth,.3\paperheight)$) {\color{paper}\begin{flushright}\fontsize{16pt}{0pt}\selectfont\textsc{ \l_projlib_titlepage_author_tl }\\[1em]\fontsize{12pt}{0pt}\selectfont \l_projlib_titlepage_date_tl \end{flushright} }; + \node[text~width=.3\paperwidth,text~height=.2\paperheight] at ($(current~page.north~west)+(.27\paperwidth,-.15\paperheight)$) { \l_projlib_titlepage_logo_tl }; + \node[text~width=.8\paperwidth,text~height=.4\paperheight] at ($(current~page.north~west)+(.52\paperwidth,-.33\paperheight)$) {\textcolor{paper}{\fontsize{24pt}{28pt}\selectfont\sffamily\textsc{ \l_projlib_titlepage_title_tl }\\[1.5em]\fontsize{18pt}{22pt}\selectfont{ \l_projlib_titlepage_subtitle_tl }}}; + \node[text~width=.3\paperwidth,text~height=.3\paperheight] at ($(current~page.south)+(.2\paperwidth,.3\paperheight)$) {\color{paper}\begin{flushright}\fontsize{16pt}{18pt}\selectfont\textsc{ \l_projlib_titlepage_author_tl }\\[1em]\fontsize{12pt}{14pt}\selectfont \l_projlib_titlepage_date_tl \end{flushright} }; \end{tikzpicture} } % diff --git a/macros/latex/contrib/projlib/README.md b/macros/latex/contrib/projlib/README.md index ab478f4771..5e01250d23 100644 --- a/macros/latex/contrib/projlib/README.md +++ b/macros/latex/contrib/projlib/README.md @@ -6,7 +6,7 @@ > **ProjLib** can be interpreted as "***Proj**ect **Lib**rary*" (in English), or as "***Proj**et **Lib**re*" (in French, meaning "*Free Project*"). -**This bundle is dated 2022/04/03. Please note that the documentations are not yet up-to-date.** +**This bundle is dated 2022/04/18. Please note that the documentations are not yet up-to-date.** ## Introduction @@ -46,12 +46,15 @@ The modules include: - Draw the `ProjLib` logo in colorful or colorless fashion. 1. module `math` - *Efficient math setup* - `\DefineOperator` and `\DefineShortcut` for setting up math macros efficiently - - `\ListOfSymbols` for printing list of symboks + - `\ListOfSymbols` for printing list of symbols 1. module `paper` - *Configuration of the paper style* - Paper style configuration, with the themes `yellow`, `green`, `light gray`, `gray`, `dark`, etc. 1. module `theorem` - *Configuration of theorem-like environments* - - `\CreateTheorem`, `\SetTheorem` and more: setting up theorem-like environments based on the package `create-theorem`, and in particular, supporting the modes `name as is` and `name as context` for referencing names - - Support options `simple name` and `complex name` for referencing names + - Setting up theorem-like environments based on the package `create-theorem` + - `\CreateTheorem`, `\SetTheorem` and more... + - In particular, supporting the modes `name as is` and `name as context` for referencing names. + - Supporting the modes `simple name` and `complex name` for the referencing names. + - `\SwitchTheoremNumbering` and `\DisableTheoremNumbering` for manipulating the numbering. - Preset environments include: `assertion`, `assumption`, `axiom`, `conclusion`, `conjecture`, `convention`, `corollary`, `definition`, `definition-proposition`, `definition-theorem`, `example`, `exercise`, `fact`, `hypothesis`, `lemma`, `notation`, `observation`, `postulate`, `problem`, `property`, `proposition`, `question`, `remark`, `theorem`, and the corresponding unnumbered version with an asterisk `*` in the name. 1. module `titlepage` - *Commands for rendering the title page* - Currently support two title page styles: `default` and `simple`. diff --git a/macros/latex/contrib/spbmark/spbmark.pdf b/macros/latex/contrib/spbmark/spbmark.pdf index 16a9936fff..8737f0e9b2 100644 Binary files a/macros/latex/contrib/spbmark/spbmark.pdf and b/macros/latex/contrib/spbmark/spbmark.pdf differ diff --git a/macros/latex/contrib/spbmark/spbmark.sty b/macros/latex/contrib/spbmark/spbmark.sty index 86ebb2a100..e6989d3ada 100644 --- a/macros/latex/contrib/spbmark/spbmark.sty +++ b/macros/latex/contrib/spbmark/spbmark.sty @@ -1,7 +1,7 @@ % % ***************** THE SPBMARK PACKAGE ***************** % -% Copyright (C) 2021-2022 by Qu Yi +% Copyright (C) 2021-2022 by Qu Yi % % This work may be distributed and/or modified under the % conditions of the CC-BY 4.0 License. @@ -9,7 +9,7 @@ % https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2018/12/31] \RequirePackage{xparse,l3keys2e} -\ProvidesExplPackage{spbmark}{2022/03/05}{1.4} +\ProvidesExplPackage{spbmark}{2022/04/21}{1.41} {Customize superscripts and subscripts} \cs_generate_variant:Nn \box_set_ht:Nn { cv } diff --git a/macros/latex/contrib/spbmark/spbmark.tex b/macros/latex/contrib/spbmark/spbmark.tex index 4405722a19..5892473fd9 100644 --- a/macros/latex/contrib/spbmark/spbmark.tex +++ b/macros/latex/contrib/spbmark/spbmark.tex @@ -6,11 +6,11 @@ { package = spbmark, title = the spbmark package, - version = v1.4, - date = 2022/03/05, + version = v1.41, + date = 2022/04/21, authors = Qu Yi, info = Customize superscript and subscript, - email = q1jx@foxmail.com, + email = toquyi@163.com, url = https://github.com/texl3/spbmark, abstract = { diff --git a/macros/unicodetex/latex/beaulivre/beaulivre-doc-cn.pdf b/macros/unicodetex/latex/beaulivre/beaulivre-doc-cn.pdf index 5a1335922a..9e199dd5e0 100644 Binary files a/macros/unicodetex/latex/beaulivre/beaulivre-doc-cn.pdf and b/macros/unicodetex/latex/beaulivre/beaulivre-doc-cn.pdf differ diff --git a/macros/unicodetex/latex/beaulivre/beaulivre-doc-cn.tex b/macros/unicodetex/latex/beaulivre/beaulivre-doc-cn.tex index d33c948560..d44da9d6cb 100644 --- a/macros/unicodetex/latex/beaulivre/beaulivre-doc-cn.tex +++ b/macros/unicodetex/latex/beaulivre/beaulivre-doc-cn.tex @@ -8,6 +8,8 @@ \usepackage{hologo} % more TeX logo \usetikzlibrary{calc} +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{Chinese} @@ -91,7 +93,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \frontmatter @@ -99,8 +101,8 @@ { , title = \beaulivre{} , subtitle = { - \textsc{以多彩的方式排版你的图书}\\[10pt] - \tiny 对应版本. \texttt{\beaulivre{} \PackageVersion} + \textsc{以多彩的方式排版你的图书}\\[20pt] + \smaller[3] 对应版本. \texttt{\beaulivre{} \PackageVersion} } , author = 许锦文 , date = {\TheDate{\PackageVersion}[only-year-month],巴黎} diff --git a/macros/unicodetex/latex/beaulivre/beaulivre-doc-en.pdf b/macros/unicodetex/latex/beaulivre/beaulivre-doc-en.pdf index 8de496a03e..4b939ca03e 100644 Binary files a/macros/unicodetex/latex/beaulivre/beaulivre-doc-en.pdf and b/macros/unicodetex/latex/beaulivre/beaulivre-doc-en.pdf differ diff --git a/macros/unicodetex/latex/beaulivre/beaulivre-doc-en.tex b/macros/unicodetex/latex/beaulivre/beaulivre-doc-en.tex index 8b674f7985..bb8b9fcae2 100644 --- a/macros/unicodetex/latex/beaulivre/beaulivre-doc-en.tex +++ b/macros/unicodetex/latex/beaulivre/beaulivre-doc-en.tex @@ -8,6 +8,8 @@ \usepackage{hologo} % more TeX logo \usetikzlibrary{calc} +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{English} @@ -91,7 +93,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \frontmatter @@ -99,8 +101,8 @@ { , title = \beaulivre{} , subtitle = { - \textsc{Write your books in \\a colorful way}\\[10pt] - \tiny Corresponding to: \texttt{\beaulivre{} \PackageVersion} + \textsc{Write your books in \\a colorful way}\\[20pt] + \smaller[3] Corresponding to: \texttt{\beaulivre{} \PackageVersion} } , author = Jinwen XU , date = {\TheDate{\PackageVersion}[only-year-month], in Paris} diff --git a/macros/unicodetex/latex/beaulivre/beaulivre-doc-fr.pdf b/macros/unicodetex/latex/beaulivre/beaulivre-doc-fr.pdf index 1bd8eebfd4..4aa7267de0 100644 Binary files a/macros/unicodetex/latex/beaulivre/beaulivre-doc-fr.pdf and b/macros/unicodetex/latex/beaulivre/beaulivre-doc-fr.pdf differ diff --git a/macros/unicodetex/latex/beaulivre/beaulivre-doc-fr.tex b/macros/unicodetex/latex/beaulivre/beaulivre-doc-fr.tex index e1b2e630b0..b6fad0dc0b 100644 --- a/macros/unicodetex/latex/beaulivre/beaulivre-doc-fr.tex +++ b/macros/unicodetex/latex/beaulivre/beaulivre-doc-fr.tex @@ -8,6 +8,8 @@ \usepackage{hologo} % more TeX logo \usetikzlibrary{calc} +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{French} @@ -91,7 +93,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \frontmatter @@ -99,8 +101,8 @@ { , title = \beaulivre{} , subtitle = { - \textsc{Écrivez vos livres \\de manière colorée}\\[10pt] - \tiny Correspondant à : \texttt{\beaulivre{} \PackageVersion} + \textsc{Écrivez vos livres \\de manière colorée}\\[20pt] + \smaller[3] Correspondant à : \texttt{\beaulivre{} \PackageVersion} } , author = Jinwen XU , date = {\TheDate{\PackageVersion}[only-year-month], à Paris} diff --git a/macros/unicodetex/latex/beaulivre/beaulivre.cls b/macros/unicodetex/latex/beaulivre/beaulivre.cls index 7a7ba60d6d..57a4938e1d 100644 --- a/macros/unicodetex/latex/beaulivre/beaulivre.cls +++ b/macros/unicodetex/latex/beaulivre/beaulivre.cls @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplClass {beaulivre} - {2022/04/03} {} + {2022/04/17} {} {A colorful book style} \tl_const:Nn \l__colorclass_base_class_tl { book } @@ -258,7 +258,7 @@ } \setsansfont { SourceSansPro-Regular.otf } [ - Scale = MatchLowercase , + Scale = 1.05 , BoldFont = SourceSansPro-Bold.otf , ItalicFont = SourceSansPro-RegularIt.otf , BoldItalicFont = SourceSansPro-BoldIt.otf , @@ -554,20 +554,15 @@ [ range = { \sum, \prod, \coprod } ] - \__colorclass_if_font_exist:nnn { Neo~Euler } - { - \setmathfont { Neo~Euler } - [ - range = { up / { Latin, latin, Greek, greek }, - bfup / { Latin, latin, Greek, greek }, - `(, `), `[, `], `\{, `\} - }, - Scale = 1.05, - ] - }{} \setmathfont { latinmodern-math.otf } [ - range = { cal, bfcal, frak, bffrak } + range = { frak, bffrak } + ] + \DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n} + \setmathfont { texgyrepagella-math.otf } + [ + range = { `(, `) } , + Scale = 1.10 ] \setmathfont { texgyrepagella-math.otf } [ @@ -585,6 +580,7 @@ } \RequirePackage { tikz-cd } + \tikzcdset { arrow~style = tikz, diagrams = { >={Stealth[round,length=3.4pt,width=6.15pt,inset=2.25pt]} } } \box_new:N \l__colorclass_xarrows_above_box \box_new:N \l__colorclass_xarrows_below_box diff --git a/macros/unicodetex/latex/einfart/einfart-doc-cn.pdf b/macros/unicodetex/latex/einfart/einfart-doc-cn.pdf index 248a122a8c..3877b73e5a 100644 Binary files a/macros/unicodetex/latex/einfart/einfart-doc-cn.pdf and b/macros/unicodetex/latex/einfart/einfart-doc-cn.pdf differ diff --git a/macros/unicodetex/latex/einfart/einfart-doc-cn.tex b/macros/unicodetex/latex/einfart/einfart-doc-cn.tex index 8338f4c417..a3fcb883e0 100644 --- a/macros/unicodetex/latex/einfart/einfart-doc-cn.tex +++ b/macros/unicodetex/latex/einfart/einfart-doc-cn.tex @@ -9,6 +9,8 @@ \usepackage{longtable} % breakable tables \usepackage{hologo} % more TeX logo +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{Chinese} @@ -95,7 +97,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \title{\einfart{},以极简主义风格排版你的文章} \author{许锦文} diff --git a/macros/unicodetex/latex/einfart/einfart-doc-en.pdf b/macros/unicodetex/latex/einfart/einfart-doc-en.pdf index 8a0aa6c4db..b57037cb41 100644 Binary files a/macros/unicodetex/latex/einfart/einfart-doc-en.pdf and b/macros/unicodetex/latex/einfart/einfart-doc-en.pdf differ diff --git a/macros/unicodetex/latex/einfart/einfart-doc-en.tex b/macros/unicodetex/latex/einfart/einfart-doc-en.tex index 43fc9cebbb..e60c80e7ba 100644 --- a/macros/unicodetex/latex/einfart/einfart-doc-en.tex +++ b/macros/unicodetex/latex/einfart/einfart-doc-en.tex @@ -9,6 +9,8 @@ \usepackage{longtable} % breakable tables \usepackage{hologo} % more TeX logo +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{English} @@ -95,7 +97,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \title{\einfart{}, write your articles in a simple and clear way} \author{Jinwen XU} diff --git a/macros/unicodetex/latex/einfart/einfart-doc-fr.pdf b/macros/unicodetex/latex/einfart/einfart-doc-fr.pdf index f22cd43c74..ddd0cd56b4 100644 Binary files a/macros/unicodetex/latex/einfart/einfart-doc-fr.pdf and b/macros/unicodetex/latex/einfart/einfart-doc-fr.pdf differ diff --git a/macros/unicodetex/latex/einfart/einfart-doc-fr.tex b/macros/unicodetex/latex/einfart/einfart-doc-fr.tex index ca40ea64b6..44fa5340c3 100644 --- a/macros/unicodetex/latex/einfart/einfart-doc-fr.tex +++ b/macros/unicodetex/latex/einfart/einfart-doc-fr.tex @@ -9,6 +9,8 @@ \usepackage{longtable} % breakable tables \usepackage{hologo} % more TeX logo +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{French} @@ -95,7 +97,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \title{\einfart{}, écrivez vos articles de manière simple et claire} \author{Jinwen XU} diff --git a/macros/unicodetex/latex/einfart/einfart.cls b/macros/unicodetex/latex/einfart/einfart.cls index ab1be42047..b1a2280ebb 100644 --- a/macros/unicodetex/latex/einfart/einfart.cls +++ b/macros/unicodetex/latex/einfart/einfart.cls @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplClass {einfart} - {2022/04/03} {} + {2022/04/17} {} {A simple and clear article style} \tl_const:Nn \l__minimclass_base_class_tl { article } @@ -279,7 +279,7 @@ } \setsansfont { SourceSansPro-Regular.otf } [ - Scale = MatchLowercase , + Scale = 1.05 , BoldFont = SourceSansPro-Bold.otf , ItalicFont = SourceSansPro-RegularIt.otf , BoldItalicFont = SourceSansPro-BoldIt.otf , @@ -577,20 +577,15 @@ [ range = { \sum, \prod, \coprod } ] - \__minimclass_if_font_exist:nnn { Neo~Euler } - { - \setmathfont { Neo~Euler } - [ - range = { up / { Latin, latin, Greek, greek }, - bfup / { Latin, latin, Greek, greek }, - `(, `), `[, `], `\{, `\} - }, - Scale = 1.05, - ] - }{} \setmathfont { latinmodern-math.otf } [ - range = { cal, bfcal, frak, bffrak } + range = { frak, bffrak } + ] + \DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n} + \setmathfont { texgyrepagella-math.otf } + [ + range = { `(, `) } , + Scale = 1.10 ] \setmathfont { texgyrepagella-math.otf } [ @@ -608,6 +603,7 @@ } \RequirePackage { tikz-cd } + \tikzcdset { arrow~style = tikz, diagrams = { >={Stealth[round,length=3.4pt,width=6.15pt,inset=2.25pt]} } } \box_new:N \l__minimclass_xarrows_above_box \box_new:N \l__minimclass_xarrows_below_box diff --git a/macros/unicodetex/latex/lebhart/lebhart-doc-cn.pdf b/macros/unicodetex/latex/lebhart/lebhart-doc-cn.pdf index fbc8a1cc54..efd8e1b69c 100644 Binary files a/macros/unicodetex/latex/lebhart/lebhart-doc-cn.pdf and b/macros/unicodetex/latex/lebhart/lebhart-doc-cn.pdf differ diff --git a/macros/unicodetex/latex/lebhart/lebhart-doc-cn.tex b/macros/unicodetex/latex/lebhart/lebhart-doc-cn.tex index 7b5b014c2e..4cc85f17de 100644 --- a/macros/unicodetex/latex/lebhart/lebhart-doc-cn.tex +++ b/macros/unicodetex/latex/lebhart/lebhart-doc-cn.tex @@ -8,6 +8,8 @@ \usepackage{hologo} % more TeX logo \usetikzlibrary{calc} +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{Chinese} @@ -91,7 +93,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \title{{\normalfont\bfseries\color{main-text}\lebhart{}}\\以多彩的方式排版你的文章} \author{许锦文} diff --git a/macros/unicodetex/latex/lebhart/lebhart-doc-en.pdf b/macros/unicodetex/latex/lebhart/lebhart-doc-en.pdf index 12dfd4d9cd..7af3bb629c 100644 Binary files a/macros/unicodetex/latex/lebhart/lebhart-doc-en.pdf and b/macros/unicodetex/latex/lebhart/lebhart-doc-en.pdf differ diff --git a/macros/unicodetex/latex/lebhart/lebhart-doc-en.tex b/macros/unicodetex/latex/lebhart/lebhart-doc-en.tex index b9de98ea01..e13c8e65ce 100644 --- a/macros/unicodetex/latex/lebhart/lebhart-doc-en.tex +++ b/macros/unicodetex/latex/lebhart/lebhart-doc-en.tex @@ -8,6 +8,8 @@ \usepackage{hologo} % more TeX logo \usetikzlibrary{calc} +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{English} @@ -91,7 +93,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \title{{\normalfont\bfseries\color{main-text}\lebhart{}}\\write your articles in a colorful way} \author{Jinwen XU} diff --git a/macros/unicodetex/latex/lebhart/lebhart-doc-fr.pdf b/macros/unicodetex/latex/lebhart/lebhart-doc-fr.pdf index 0d6d5ed374..c6be48c674 100644 Binary files a/macros/unicodetex/latex/lebhart/lebhart-doc-fr.pdf and b/macros/unicodetex/latex/lebhart/lebhart-doc-fr.pdf differ diff --git a/macros/unicodetex/latex/lebhart/lebhart-doc-fr.tex b/macros/unicodetex/latex/lebhart/lebhart-doc-fr.tex index fa5a1e40e4..a6e2da39c3 100644 --- a/macros/unicodetex/latex/lebhart/lebhart-doc-fr.tex +++ b/macros/unicodetex/latex/lebhart/lebhart-doc-fr.tex @@ -8,6 +8,8 @@ \usepackage{hologo} % more TeX logo \usetikzlibrary{calc} +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{French} @@ -91,7 +93,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \title{{\normalfont\bfseries\color{main-text}\lebhart{}}\\écrivez vos articles de manière colorée} \author{Jinwen XU} diff --git a/macros/unicodetex/latex/lebhart/lebhart.cls b/macros/unicodetex/latex/lebhart/lebhart.cls index 314e8dff23..835bceca4a 100644 --- a/macros/unicodetex/latex/lebhart/lebhart.cls +++ b/macros/unicodetex/latex/lebhart/lebhart.cls @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplClass {lebhart} - {2022/04/03} {} + {2022/04/17} {} {A colorful article style} \tl_const:Nn \l__colorclass_base_class_tl { article } @@ -258,7 +258,7 @@ } \setsansfont { SourceSansPro-Regular.otf } [ - Scale = MatchLowercase , + Scale = 1.05 , BoldFont = SourceSansPro-Bold.otf , ItalicFont = SourceSansPro-RegularIt.otf , BoldItalicFont = SourceSansPro-BoldIt.otf , @@ -554,20 +554,15 @@ [ range = { \sum, \prod, \coprod } ] - \__colorclass_if_font_exist:nnn { Neo~Euler } - { - \setmathfont { Neo~Euler } - [ - range = { up / { Latin, latin, Greek, greek }, - bfup / { Latin, latin, Greek, greek }, - `(, `), `[, `], `\{, `\} - }, - Scale = 1.05, - ] - }{} \setmathfont { latinmodern-math.otf } [ - range = { cal, bfcal, frak, bffrak } + range = { frak, bffrak } + ] + \DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n} + \setmathfont { texgyrepagella-math.otf } + [ + range = { `(, `) } , + Scale = 1.10 ] \setmathfont { texgyrepagella-math.otf } [ @@ -585,6 +580,7 @@ } \RequirePackage { tikz-cd } + \tikzcdset { arrow~style = tikz, diagrams = { >={Stealth[round,length=3.4pt,width=6.15pt,inset=2.25pt]} } } \box_new:N \l__colorclass_xarrows_above_box \box_new:N \l__colorclass_xarrows_below_box diff --git a/macros/unicodetex/latex/simplivre/simplivre-doc-cn.pdf b/macros/unicodetex/latex/simplivre/simplivre-doc-cn.pdf index 23c6001784..a2293752a4 100644 Binary files a/macros/unicodetex/latex/simplivre/simplivre-doc-cn.pdf and b/macros/unicodetex/latex/simplivre/simplivre-doc-cn.pdf differ diff --git a/macros/unicodetex/latex/simplivre/simplivre-doc-cn.tex b/macros/unicodetex/latex/simplivre/simplivre-doc-cn.tex index 4121fadf9e..ac8f6322ba 100644 --- a/macros/unicodetex/latex/simplivre/simplivre-doc-cn.tex +++ b/macros/unicodetex/latex/simplivre/simplivre-doc-cn.tex @@ -9,6 +9,8 @@ \usepackage{longtable} % breakable tables \usepackage{hologo} % more TeX logo +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{Chinese} @@ -95,7 +97,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \frontmatter \LocallyStopLineNumbers @@ -104,8 +106,8 @@ { , title = \simplivre{} , subtitle = { - \textsc{以极简主义风格排版你的图书}\\[10pt] - \tiny 对应版本. \texttt{\simplivre{} \PackageVersion} + \textsc{以极简主义风格排版你的图书}\\[20pt] + \smaller[3] 对应版本. \texttt{\simplivre{} \PackageVersion} } , author = 许锦文 , date = {\TheDate{\PackageVersion}[only-year-month],巴黎} diff --git a/macros/unicodetex/latex/simplivre/simplivre-doc-en.pdf b/macros/unicodetex/latex/simplivre/simplivre-doc-en.pdf index 0b2522cc78..55f1f02fa6 100644 Binary files a/macros/unicodetex/latex/simplivre/simplivre-doc-en.pdf and b/macros/unicodetex/latex/simplivre/simplivre-doc-en.pdf differ diff --git a/macros/unicodetex/latex/simplivre/simplivre-doc-en.tex b/macros/unicodetex/latex/simplivre/simplivre-doc-en.tex index e54d796b84..d0ec9b11e3 100644 --- a/macros/unicodetex/latex/simplivre/simplivre-doc-en.tex +++ b/macros/unicodetex/latex/simplivre/simplivre-doc-en.tex @@ -9,6 +9,8 @@ \usepackage{longtable} % breakable tables \usepackage{hologo} % more TeX logo +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{English} @@ -95,7 +97,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \LocallyStopLineNumbers @@ -105,8 +107,8 @@ { , title = \simplivre{} , subtitle = { - \textsc{Write your books in \\a simple and clear way}\\[10pt] - \tiny Corresponding to: \texttt{\simplivre{} \PackageVersion} + \textsc{Write your books in \\a simple and clear way}\\[20pt] + \smaller[3] Corresponding to: \texttt{\simplivre{} \PackageVersion} } , author = Jinwen XU , date = {\TheDate{\PackageVersion}[only-year-month], in Paris} diff --git a/macros/unicodetex/latex/simplivre/simplivre-doc-fr.pdf b/macros/unicodetex/latex/simplivre/simplivre-doc-fr.pdf index 3e3fe8b650..76a4071843 100644 Binary files a/macros/unicodetex/latex/simplivre/simplivre-doc-fr.pdf and b/macros/unicodetex/latex/simplivre/simplivre-doc-fr.pdf differ diff --git a/macros/unicodetex/latex/simplivre/simplivre-doc-fr.tex b/macros/unicodetex/latex/simplivre/simplivre-doc-fr.tex index f75a5e8179..5a24f45074 100644 --- a/macros/unicodetex/latex/simplivre/simplivre-doc-fr.tex +++ b/macros/unicodetex/latex/simplivre/simplivre-doc-fr.tex @@ -9,6 +9,8 @@ \usepackage{longtable} % breakable tables \usepackage{hologo} % more TeX logo +\usepackage{relsize} + \usepackage{blindtext} \UseLanguage{French} @@ -95,7 +97,7 @@ %%================================ \begin{document} -\def\PackageVersion{2022/04/03} +\def\PackageVersion{2022/04/17} \frontmatter \LocallyStopLineNumbers @@ -104,8 +106,8 @@ { , title = \simplivre{} , subtitle = { - \textsc{Écrivez vos livres \\de manière simple et claire}\\[10pt] - \tiny Correspondant à : \texttt{\simplivre{} \PackageVersion} + \textsc{Écrivez vos livres \\de manière simple et claire}\\[20pt] + \smaller[3] Correspondant à : \texttt{\simplivre{} \PackageVersion} } , author = Jinwen XU , date = {\TheDate{\PackageVersion}[only-year-month], à Paris} diff --git a/macros/unicodetex/latex/simplivre/simplivre.cls b/macros/unicodetex/latex/simplivre/simplivre.cls index 7dd6f4b592..0e719bb849 100644 --- a/macros/unicodetex/latex/simplivre/simplivre.cls +++ b/macros/unicodetex/latex/simplivre/simplivre.cls @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplClass {simplivre} - {2022/04/03} {} + {2022/04/17} {} {A simple and clear book style} \tl_const:Nn \l__minimclass_base_class_tl { book } @@ -279,7 +279,7 @@ } \setsansfont { SourceSansPro-Regular.otf } [ - Scale = MatchLowercase , + Scale = 1.05 , BoldFont = SourceSansPro-Bold.otf , ItalicFont = SourceSansPro-RegularIt.otf , BoldItalicFont = SourceSansPro-BoldIt.otf , @@ -577,20 +577,15 @@ [ range = { \sum, \prod, \coprod } ] - \__minimclass_if_font_exist:nnn { Neo~Euler } - { - \setmathfont { Neo~Euler } - [ - range = { up / { Latin, latin, Greek, greek }, - bfup / { Latin, latin, Greek, greek }, - `(, `), `[, `], `\{, `\} - }, - Scale = 1.05, - ] - }{} \setmathfont { latinmodern-math.otf } [ - range = { cal, bfcal, frak, bffrak } + range = { frak, bffrak } + ] + \DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n} + \setmathfont { texgyrepagella-math.otf } + [ + range = { `(, `) } , + Scale = 1.10 ] \setmathfont { texgyrepagella-math.otf } [ @@ -608,6 +603,7 @@ } \RequirePackage { tikz-cd } + \tikzcdset { arrow~style = tikz, diagrams = { >={Stealth[round,length=3.4pt,width=6.15pt,inset=2.25pt]} } } \box_new:N \l__minimclass_xarrows_above_box \box_new:N \l__minimclass_xarrows_below_box diff --git a/macros/unicodetex/latex/unisc/README.txt b/macros/unicodetex/latex/unisc/README.txt new file mode 100644 index 0000000000..74fb043a2c --- /dev/null +++ b/macros/unicodetex/latex/unisc/README.txt @@ -0,0 +1,10 @@ +------------------------------------------------------- +Package: unisc +Version: v0.1 (21 April, 2022) +Author: निरंजन +Description: Unicode small caps with Xe/LuaLaTeX. +Repository: https://puszcza.gnu.org.ua/projects/unisc +License: GPLv3+, GFDLv1.3+ +------------------------------------------------------- + + diff --git a/macros/unicodetex/latex/unisc/unisc.dtx b/macros/unicodetex/latex/unisc/unisc.dtx new file mode 100644 index 0000000000..676bcf4a2d --- /dev/null +++ b/macros/unicodetex/latex/unisc/unisc.dtx @@ -0,0 +1,496 @@ +% \iffalse meta-comment +% +% File: unisc.dtx +% ------------------------------------------------------- +% Package: unisc +% Version: v0.1 (21 April, 2022) +% Author: निरंजन +% Description: Unicode small caps with Xe/LuaLaTeX. +% Repository: https://puszcza.gnu.org.ua/projects/unisc +% License: GPLv3+, GFDLv1.3+ +% ------------------------------------------------------- +% +% LaTeX Package unisc v0.1 +% Copyright © 2022 निरंजन +% +% This program is free software: you can redistribute it +% and/or modify it under the terms of the GNU General Public +% License as published by the Free Software Foundation, +% either version 3 of the License, or (at your option) any +% later version. +% +% This program is distributed in the hope that it will be +% useful, but WITHOUT ANY WARRANTY; without even the implied +% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +% PURPOSE. See the GNU General Public License for more +% details. +% +% You should have received a copy of the GNU General Public +% License along with this program. If not, see +% . +% +% The current maintainer of this work is निरंजन. +% +% This work consists of the files unisc.dtx +% unisc.ins +% and the derived file unisc.sty. +% \fi +% \iffalse +%<*internal> +\iffalse +% +%<*readme> +------------------------------------------------------- +Package: unisc +Version: v0.1 (21 April, 2022) +Author: निरंजन +Description: Unicode small caps with Xe/LuaLaTeX. +Repository: https://puszcza.gnu.org.ua/projects/unisc +License: GPLv3+, GFDLv1.3+ +------------------------------------------------------- +% +%<*internal> +\fi +% +%<*driver|package> +\def\uniscname{unisc} +\def\uniscversion{0.1} +\def\uniscdate{2022-04-21} +\def\uniscdescription{% + Unicode small caps with Xe/LuaLaTeX.% +} +% +%<*driver> +\documentclass{l3doc} +\usepackage{xcolor} +\usepackage{fontawesome5} +\usepackage{hologo} +\DeclareRobustCommand\XeLaTeX{\hologo{XeLaTeX}} +\usepackage{unisc} +\usepackage{hyperref} +\hypersetup{% + unicode,% + colorlinks,% + urlcolor=blue!60!black,% + linkcolor=red!60!black,% + citecolor=green!60!black,% + pdftitle={The unisc package},% + pdfauthor={निरंजन},% + pdfsubject={\uniscdescription} +}% +\usepackage{mdframed} +\usepackage{fontspec} +\newfontfamily\charissil{CharisSIL} +\newfontfamily\devanagari[% + Script=Devanagari,% + Scale=0.8% +]% +{Shobhika} +\NewCommandCopy\oldamp\& +\def\&{\textit{\oldamp}} + +\begin{document} + \DocInput{\uniscname.dtx} +\end{document} +% +% \fi +% \title{The \pkg{\uniscname} package} +% \author{^^A +% {\devanagari निरंजन}\thanks{^^A +% \href{mailto:hi.niranjan@pm.me}^^A +% {\faIcon{envelope} \texttt{hi.niranjan@pm.me}}^^A +% }^^A +% } +% \date{^^A +% Version \uniscversion\ --- \uniscdate\\[1ex]^^A +% {^^A +% \small +% \faIcon{globe}^^A +% \quad +% \url{https://puszcza.gnu.org.ua/projects/unisc}\\[0.5ex]^^A +% \faIcon{bug}^^A +% \quad +% \url{https://puszcza.gnu.org.ua/bugs/?group=unisc}^^A +% }^^A +% } +% +% \maketitle +% +% \begin{documentation} +% \begin{abstract} +% \LaTeX\ produces small caps with +% \cs{textsc}\marg{text} or \cs{scshape}. Both of these +% commands don't produce small caps in Unicode. If the +% output text is copied and pasted somewhere it shows +% the same characters used in the input. This package +% aims to internally convert all the characters provided +% to the commands mentioned above. It assumes that the +% file using this package is compiled with Lua/\XeLaTeX\ +% \& a good Unicode font which has the small caps +% characters, e.g., +% \href{https://ctan.org/pkg/charissil}{Charis +% SIL}. Please note that as there are no Unicode slots +% allotted to upper case small caps, both the lower case +% and upper case input will be converted to only one +% relevant Unicode character in the output, e.g., +% \verb|\textsc{Hh}| will produce the same character +% twice unlike \verb|\oldtextsc{Hh}|. +% \end{abstract} +% +% \tableofcontents +% +% \vfill +% +% {^^A +% \setlength{\parindent}{0pt} +% \LaTeX\ package \pkg{unisc} +% +% Copyright © 2022 {\devanagari निरंजन} +% +% Permission is granted to copy, distribute and/or +% modify this document under the terms of the GNU Free +% Documentation License, Version 1.3 or any later +% version published by the Free Software Foundation; +% with no Invariant Sections, no Front-Cover Texts, and +% no Back-Cover Texts. A copy of the license is included +% in the section entitled ``GNU Free Documentation +% License''.^^A +% }^^A +% +% \newpage +% +% \section{Documentation} +% +% This package provides the following two macros. +% +% \subsection{Macros} +% +% This package renews two basic \LaTeX\ commands, i.e., +% \cs{scshape} \& \cs{textsc}. To keep the original +% definitions available for the users, I have copied the +% old commands \& provided two of the following macros +% which behave exactly like their old variants. +% +% \begin{function}{\oldscshape} +% \begin{syntax} +% \{\cs{oldscshape} \meta{text}\} +% \end{syntax} +% \end{function} +% +% \begin{function}{\oldtextsc} +% \begin{syntax} +% \cs{oldtextsc}\marg{text} +% \end{syntax} +% \end{function} +% +% \subsection{The \enquote*{x} factor} +% +% This package doesn't support the small capital shape +% of the character \enquote*{x} as there is no Unicode +% number allotted for a \enquote*{small capital x} as of +% now. The package simply prints the small x (for both +% \verb|\textsc{x}| \& \verb|\textsc{X}|) as it is of +% the same height of the other small capital letters +% along with a warning message that warns the users +% about this deviation. +% +% \subsection{Example} +% +% \begin{mdframed} +% \begin{verbatim} +% \documentclass{article} +% \usepackage{unisc} +% \usepackage{fontspec} +% \setmainfont{CharisSIL}% https://ctan.org/pkg/charissil + +% \begin{document} +% \noindent\textbf{Fake small caps:} +% {\oldscshape hello world} \oldtextsc{hello world}. + +% \noindent\textbf{Unicode small caps:} +% {\scshape hello world} \textsc{hello world}. +% \end{document} +% \end{verbatim} +% \end{mdframed} +% +% This produces the following: +% +% \begin{mdframed} +% \charissil +% \noindent\textbf{Fake small caps:} +% {\oldscshape hello world} \oldtextsc{hello world}. +% +% \noindent\textbf{Unicode small caps:} +% {\scshape hello world} \textsc{hello world}. +% \end{mdframed} +% \end{documentation} +% +% \newpage +% +% \begin{implementation} +% \section{Implementation} +% Provide package with its basic information. +% \begin{macrocode} +%<@@=unisc> +%<*package> +\ProvidesPackage{unisc}[2022/04/21 v0.1 +Unicode small caps with Lua/XeLaTeX.] +% \end{macrocode} +% Load the necessary packages. +% \begin{macrocode} +\RequirePackage{pgfparser} +\RequirePackage{xpatch} +% \end{macrocode} +% Make copies of old commands. +% \begin{macrocode} +\NewCommandCopy\oldtextsc\textsc +\NewCommandCopy\oldscshape\scshape +% \end{macrocode} +% As pointed out by Florent Rougon in +% \href{https://topanswers.xyz/transcript?room=2050&id=138859#c138859}% +% {this} comment; the definition of \cs{oldtextsc} uses +% \cs{scshape} twice which needs to be replaced with +% \cs{oldscshape}. For that the following patching is done +% \& the old definition is retained. +% \begin{macrocode} +\xpatchcmd{\oldtextsc}{\scshape}{\oldscshape}{}{\ERROR} +\xpatchcmd{\oldtextsc}{\scshape}{\oldscshape}{}{\ERROR} +% \end{macrocode} +% The following code is kindly provided by Jonathan P.\ +% Spratte on the following thread: +% \url{https://topanswers.xyz/tex?q=2005}. I have modified +% it a bit as per my needs and my indentation style. +% \begin{macrocode} +\protected\long\def\unisc@output#1{% + \xdef\unisc@outputcontainer{% + \unexpanded\expandafter{% + \unisc@outputcontainer\unexpanded{#1}% + }% + }% +} +\protected\long\def\unisc@outputexpanded#1{% + \xdef\unisc@outputcontainer{% + \unexpanded\expandafter{\unisc@outputcontainer#1% + }% + }% +} +\providecommand\@gobbletwo[2]{} +\pgfparserdefunknown{scparser}{initial}{% + \let\unisc@initiated\@empty + \pgfparserswitch{initiated}% + \pgfparserreinsert +} +\pgfparserset{scparser/silent=true} +\pgfparserdefunknown{scparser}{all}{% + \expandafter\unisc@output\expandafter{\pgfparserletter}% +} +\newcommand*\unisc@bgroup{\expandafter{\iffalse}\fi} +\newcommand*\unisc@egroup{\iffalse{\fi}} +\pgfparserdef{scparser}{all}\begingroup + {\begingroup\unisc@outputexpanded\begingroup} +\pgfparserdef{scparser}{all}\endgroup + {\unisc@checkend\endgroup} +\pgfparserdef{scparser}{all}{\meaning\bgroup}{% + \unisc@bgroup\unisc@outputexpanded\unisc@bgroup +} +\pgfparserdef{scparser}{all}{\meaning\egroup} + {\unisc@checkend\unisc@egroup} +\newcommand\unisc@savedefinition[1] + {\unexpanded{\def#1}{\unexpanded\expandafter{#1}}} +\protected\def\unisc@checkend#1{% + \expanded{% + \unexpanded{#1}% + \unexpanded{\ifdefined\unisc@initiated}% + \unisc@savedefinition\pgfparserstate + \unexpanded{\unisc@outputexpanded#1}% + \unexpanded{\else}% + \unexpanded{\pgfparserswitch{final}}% + \unisc@savedefinition\pgfparser@current + \unisc@savedefinition\pgfparser@usersname + \unexpanded{\fi}% + }% +} +% \end{macrocode} +% Following is the code for the replacements of the +% regular characters with the Unicode ones. +% \begin{macrocode} +%% LATIN LETTER SMALL CAPITAL A +\pgfparserdef{scparser}{initiated}a% + {\unisc@outputexpanded{\symbol{"1D00}}} +\pgfparserdef{scparser}{initiated}A% + {\unisc@outputexpanded{\symbol{"1D00}}} +%% LATIN LETTER SMALL CAPITAL B +\pgfparserdef{scparser}{initiated}b% + {\unisc@outputexpanded{\symbol{"0299}}} +\pgfparserdef{scparser}{initiated}B% + {\unisc@outputexpanded{\symbol{"0299}}} +%% LATIN LETTER SMALL CAPITAL C +\pgfparserdef{scparser}{initiated}c% + {\unisc@outputexpanded{\symbol{"1D04}}} +\pgfparserdef{scparser}{initiated}C% + {\unisc@outputexpanded{\symbol{"1D04}}} +%% LATIN LETTER SMALL CAPITAL D +\pgfparserdef{scparser}{initiated}d% + {\unisc@outputexpanded{\symbol{"1D05}}} +\pgfparserdef{scparser}{initiated}D% + {\unisc@outputexpanded{\symbol{"1D05}}} +%% LATIN LETTER SMALL CAPITAL E +\pgfparserdef{scparser}{initiated}e% + {\unisc@outputexpanded{\symbol{"1D07}}} +\pgfparserdef{scparser}{initiated}E% + {\unisc@outputexpanded{\symbol{"1D07}}} +%% LATIN LETTER SMALL CAPITAL F +\pgfparserdef{scparser}{initiated}f% + {\unisc@outputexpanded{\symbol{"A730}}} +\pgfparserdef{scparser}{initiated}F% + {\unisc@outputexpanded{\symbol{"A730}}} +%% LATIN LETTER SMALL CAPITAL G +\pgfparserdef{scparser}{initiated}g% + {\unisc@outputexpanded{\symbol{"0262}}} +\pgfparserdef{scparser}{initiated}G% + {\unisc@outputexpanded{\symbol{"0262}}} +%% LATIN LETTER SMALL CAPITAL H +\pgfparserdef{scparser}{initiated}h% + {\unisc@outputexpanded{\symbol{"029C}}} +\pgfparserdef{scparser}{initiated}H% + {\unisc@outputexpanded{\symbol{"029C}}} +%% LATIN LETTER SMALL CAPITAL I +\pgfparserdef{scparser}{initiated}i% + {\unisc@outputexpanded{\symbol{"026A}}} +\pgfparserdef{scparser}{initiated}I% + {\unisc@outputexpanded{\symbol{"026A}}} +%% LATIN LETTER SMALL CAPITAL J +\pgfparserdef{scparser}{initiated}j% + {\unisc@outputexpanded{\symbol{"1D0A}}} +\pgfparserdef{scparser}{initiated}J% + {\unisc@outputexpanded{\symbol{"1D0A}}} +%% LATIN LETTER SMALL CAPITAL K +\pgfparserdef{scparser}{initiated}k% + {\unisc@outputexpanded{\symbol{"1D0B}}} +\pgfparserdef{scparser}{initiated}K% + {\unisc@outputexpanded{\symbol{"1D0B}}} +%% LATIN LETTER SMALL CAPITAL L +\pgfparserdef{scparser}{initiated}l% + {\unisc@outputexpanded{\symbol{"029F}}} +\pgfparserdef{scparser}{initiated}L% + {\unisc@outputexpanded{\symbol{"029F}}} +%% LATIN LETTER SMALL CAPITAL M +\pgfparserdef{scparser}{initiated}m% + {\unisc@outputexpanded{\symbol{"1D0D}}} +\pgfparserdef{scparser}{initiated}M% + {\unisc@outputexpanded{\symbol{"1D0D}}} +%% LATIN LETTER SMALL CAPITAL N +\pgfparserdef{scparser}{initiated}n% + {\unisc@outputexpanded{\symbol{"0274}}} +\pgfparserdef{scparser}{initiated}N% + {\unisc@outputexpanded{\symbol{"0274}}} +%% LATIN LETTER SMALL CAPITAL O +\pgfparserdef{scparser}{initiated}o% + {\unisc@outputexpanded{\symbol{"1D0F}}} +\pgfparserdef{scparser}{initiated}O% + {\unisc@outputexpanded{\symbol{"1D0F}}} +%% LATIN LETTER SMALL CAPITAL P +\pgfparserdef{scparser}{initiated}p% + {\unisc@outputexpanded{\symbol{"1D18}}} +\pgfparserdef{scparser}{initiated}P% + {\unisc@outputexpanded{\symbol{"1D18}}} +%% LATIN LETTER SMALL CAPITAL Q +\pgfparserdef{scparser}{initiated}q% + {\unisc@outputexpanded{\symbol{"A7AF}}} +\pgfparserdef{scparser}{initiated}Q% + {\unisc@outputexpanded{\symbol{"A7AF}}} +%% LATIN LETTER SMALL CAPITAL R +\pgfparserdef{scparser}{initiated}r% + {\unisc@outputexpanded{\symbol{"0280}}} +\pgfparserdef{scparser}{initiated}R% + {\unisc@outputexpanded{\symbol{"0280}}} +%% LATIN LETTER SMALL CAPITAL S +\pgfparserdef{scparser}{initiated}s% + {\unisc@outputexpanded{\symbol{"A731}}} +\pgfparserdef{scparser}{initiated}S% + {\unisc@outputexpanded{\symbol{"A731}}} +%% LATIN LETTER SMALL CAPITAL T +\pgfparserdef{scparser}{initiated}t% + {\unisc@outputexpanded{\symbol{"1D1B}}} +\pgfparserdef{scparser}{initiated}T% + {\unisc@outputexpanded{\symbol{"1D1B}}} +%% LATIN LETTER SMALL CAPITAL U +\pgfparserdef{scparser}{initiated}u% + {\unisc@outputexpanded{\symbol{"1D1C}}} +\pgfparserdef{scparser}{initiated}U% + {\unisc@outputexpanded{\symbol{"1D1C}}} +%% LATIN LETTER SMALL CAPITAL V +\pgfparserdef{scparser}{initiated}v% + {\unisc@outputexpanded{\symbol{"1D20}}} +\pgfparserdef{scparser}{initiated}V% + {\unisc@outputexpanded{\symbol{"1D20}}} +%% LATIN LETTER SMALL CAPITAL W +\pgfparserdef{scparser}{initiated}w% + {\unisc@outputexpanded{\symbol{"1D21}}} +\pgfparserdef{scparser}{initiated}W% + {\unisc@outputexpanded{\symbol{"1D21}}} +%% LATIN LETTER X +\pgfparserdef{scparser}{initiated}x{% + \unisc@outputexpanded{\symbol{"0078}}% + \PackageWarning{unisc}{% + You have used the unsupported character `x' in the\MessageBreak + argument of \string\textsc + }% +} +\pgfparserdef{scparser}{initiated}X{% + \unisc@outputexpanded{\symbol{"0078}}% + \PackageWarning{unisc}{% + You have used the unsupported character `X' in the\MessageBreak + argument of \string\textsc + }% +} +%% No Unicode number for small capital x as of now. +%% \textsc{X} == \textsc{x} for size-consistency. +%% LATIN LETTER SMALL CAPITAL Y +\pgfparserdef{scparser}{initiated}y% + {\unisc@outputexpanded{\symbol{"028F}}} +\pgfparserdef{scparser}{initiated}Y% + {\unisc@outputexpanded{\symbol{"028F}}} +%% LATIN LETTER SMALL CAPITAL Z +\pgfparserdef{scparser}{initiated}z% + {\unisc@outputexpanded{\symbol{"1D22}}} +\pgfparserdef{scparser}{initiated}Z% + {\unisc@outputexpanded{\symbol{"1D22}}} +%% BLANK SPACE +\pgfparserdef{scparser}{initiated}{blank space}% + {\unisc@outputexpanded{ }} +%% END OF INPUT CHARACTERS +\pgfparserdeffinal{scparser}% + {\expanded{\unisc@outputcontainer}} +% \end{macrocode} +% Renew the definitions of \cs{textsc} \& \cs{scshape} +% commands. +% \begin{macrocode} +\AddToHook{begindocument/end}{% + \RenewDocumentCommand\scshape{ }{% + \ifdefined\unisc@initiated + \PackageError{unisc}{Nested use not allowed}{% + You somehow made \string\nirshape\space expand inside + the parser. This isn't supported.% + }% + \expandafter\@gobbletwo + \else + \global\let\unisc@outputcontainer\@empty + \fi + \pgfparserparse{scparser}% + } + \RenewDocumentCommand\textsc{ m }{% + \begingroup\scshape #1\endgroup + }% +} +% \end{macrocode} +% \begin{macrocode} +% +% \end{macrocode} +% \end{implementation} +% \newpage +% \addcontentsline{toc}{section}{^^A +% GNU Free Documentation License^^A +% } +% \include{gfdl-tex.tex} +% \Finale diff --git a/macros/unicodetex/latex/unisc/unisc.ins b/macros/unicodetex/latex/unisc/unisc.ins new file mode 100644 index 0000000000..f9024a665b --- /dev/null +++ b/macros/unicodetex/latex/unisc/unisc.ins @@ -0,0 +1,55 @@ +% File: unisc.ins +\input l3docstrip.tex + +\keepsilent +\askforoverwritefalse + +\preamble +---------------------------------------------------------- +Package: unisc +Version: v0.1 (21 April, 2022) +Author: निरंजन +Description: Unicode small caps with Lua/XeLaTeX. +Repository: https://puszcza.gnu.org.ua/projects/unisc +License: GPLv3+, GFDLv1.3+ +---------------------------------------------------------- + +LaTeX Package unisc v0.1 +Copyright © 2022 निरंजन + +This program is free software: you can redistribute it +and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation, either +version 3 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be +useful, but WITHOUT ANY WARRANTY; without even the implied +warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public +License along with this program. If not, see +. + +The current maintainer of this work is निरंजन. + +This work consists of the files unisc.dtx + unisc.ins +and the derived file unisc.sty. +---------------------------------------------------------- +\endpreamble + +\usedir{tex/latex/\jobname} +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} + +\nopreamble\nopostamble +\usedir{doc/latex/\jobname} +\generate{ + \file{README.txt}{\from{\jobname.dtx}{readme}} +} + +\endbatchfile diff --git a/macros/unicodetex/latex/unisc/unisc.pdf b/macros/unicodetex/latex/unisc/unisc.pdf new file mode 100644 index 0000000000..97b1df006c Binary files /dev/null and b/macros/unicodetex/latex/unisc/unisc.pdf differ -- cgit v1.2.3