summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-02-18 03:01:32 +0000
committerNorbert Preining <norbert@preining.info>2023-02-18 03:01:32 +0000
commit4ff14bd6227f033e0d226f68a153f4a8c6458d16 (patch)
tree7ec4972c299f416960bd8426facbb245545d05e7 /macros
parentcb7cbc1f98cedde266389c64619b6dbfaec14f87 (diff)
CTAN sync 202302180301
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/algpseudocodex/README.md9
-rw-r--r--macros/latex/contrib/algpseudocodex/algpseudocodex.pdfbin355364 -> 356253 bytes
-rw-r--r--macros/latex/contrib/algpseudocodex/algpseudocodex.sty302
-rw-r--r--macros/latex/contrib/algpseudocodex/algpseudocodex.tex30
-rw-r--r--macros/latex/contrib/changelog/README.md14
-rw-r--r--macros/latex/contrib/changelog/changelog.pdfbin46523 -> 54725 bytes
-rw-r--r--macros/latex/contrib/changelog/changelog.sty386
-rw-r--r--macros/latex/contrib/changelog/changelog.tex55
-rw-r--r--macros/latex/contrib/changelog/example.pdfbin16679 -> 17624 bytes
-rw-r--r--macros/latex/contrib/changelog/example.tex11
-rw-r--r--macros/latex/contrib/recorder-fingering/README.md9
-rw-r--r--macros/latex/contrib/recorder-fingering/RecorderInCchart.pngbin0 -> 65144 bytes
-rw-r--r--macros/latex/contrib/recorder-fingering/recorder-fingering.pdfbin0 -> 68489 bytes
-rw-r--r--macros/latex/contrib/recorder-fingering/recorder-fingering.sty355
-rw-r--r--macros/latex/contrib/recorder-fingering/recorder-fingering.tex276
-rw-r--r--macros/latex/contrib/thmtools/doc/changes.txt10
-rw-r--r--macros/latex/contrib/thmtools/doc/thmtools-manual.pdfbin251469 -> 251351 bytes
-rw-r--r--macros/latex/contrib/thmtools/doc/thmtools-manual.tex253
-rw-r--r--macros/latex/contrib/thmtools/source/VERSION.tex2
-rw-r--r--macros/latex/contrib/thmtools/source/thm-kv.dtx15
-rw-r--r--macros/xetex/latex/xduts/README.md2
-rw-r--r--macros/xetex/latex/xduts/xduts.dtx31
-rw-r--r--macros/xetex/latex/xduts/xduts.ins8
-rw-r--r--macros/xetex/latex/xduts/xduts.pdfbin329958 -> 330023 bytes
24 files changed, 1383 insertions, 385 deletions
diff --git a/macros/latex/contrib/algpseudocodex/README.md b/macros/latex/contrib/algpseudocodex/README.md
index 67a4fe8a71..cfa9d2e7ac 100644
--- a/macros/latex/contrib/algpseudocodex/README.md
+++ b/macros/latex/contrib/algpseudocodex/README.md
@@ -1,4 +1,11 @@
# algpseudocodex
+## Overview
This package allows typesetting pseudocode in LaTeX. It is based on algpseudocode from the algorithmicx package and uses the same syntax, but adds several new features and improvements. Notable features include customizable indent guide lines and the ability to draw boxes around parts of the code for highlighting differences. This package also has better support for long code lines spanning several lines and improved comments.
-This material is subject to the LATEX Project Public License 1.3c.
+The package documentation can be found in the file algpseudocodex.tex.
+
+## Author and Contact
+The package is authored and maintained by Christian Matt. For bug reports and other issues please visit the official repository at <https://github.com/chrmatt/algpseudocodex>.
+
+## License
+This material is subject to the LaTeX Project Public License (LPPL), version 1.3c.
diff --git a/macros/latex/contrib/algpseudocodex/algpseudocodex.pdf b/macros/latex/contrib/algpseudocodex/algpseudocodex.pdf
index 1f7c2faa6a..e2e416f52b 100644
--- a/macros/latex/contrib/algpseudocodex/algpseudocodex.pdf
+++ b/macros/latex/contrib/algpseudocodex/algpseudocodex.pdf
Binary files differ
diff --git a/macros/latex/contrib/algpseudocodex/algpseudocodex.sty b/macros/latex/contrib/algpseudocodex/algpseudocodex.sty
index 4deb0c80d2..fc0b8d8aef 100644
--- a/macros/latex/contrib/algpseudocodex/algpseudocodex.sty
+++ b/macros/latex/contrib/algpseudocodex/algpseudocodex.sty
@@ -1,32 +1,33 @@
%% algpseudocodex.sty
-%% Copyright 2017, 2020-2022 Christian Matt
+%% Copyright 2017, 2020-2023 Christian Matt
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008-05-04 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Christian Matt.
%
-% This work consists of the files algpseudocodex.sty and documentation.tex.
+% This work consists of the files algpseudocodex.sty and algpseudocodex.tex.
% Pseudocodex algorithmic style
% Based on Szasz Janos' algpseudocode.sty
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{algpseudocodex}[2022-10-07 v1.0.2 pseudocode typesetting]
+\ProvidesPackage{algpseudocodex}[2023-02-17 v1.1.0 pseudocode typesetting]
\RequirePackage{kvoptions}
\RequirePackage{algorithmicx}
\RequirePackage{etoolbox}
\RequirePackage{fifo-stack}
\RequirePackage{varwidth}
\RequirePackage{tabto}
+\RequirePackage{totcount}
\RequirePackage{tikz}
\usetikzlibrary{calc,fit,tikzmark}
@@ -77,25 +78,37 @@
\newlength{\algpx@codeBoxInnerSep}% distance between box and its content
\newlength{\algpx@codeBoxSep}% distance between nested boxes
\newlength{\algpx@codeBoxOuterSep}% additional space before and after box
+
+% the following lengths related to indent lines are set when opening an algorithmic environment to reflect to current font size
+\newlength{\algpx@indShiftX}% indent line shifted right by that amount from beginning of line
+\newlength{\algpx@indStartShiftY}% start of indent line shifted up by that amount from beginning of line
+\newlength{\algpx@indEndShiftY}% end of indent line shifted up by that amount from beginning of line (only if noEnd=false, otherwise no shift)
+\newlength{\algpx@indXLineLength}% length of horizonal line drawn at end when noEnd=true
\newlength{\algpx@minIndDist}% minimum distance between start and end of indent line to draw line
\newlength{\algpx@oldPos}
\newlength{\algpx@newPos}
\newlength{\algpx@tmpLen}% length to be used for various things
-\newlength{\algpx@tmpLenA}% another tmp length
\newlength{\algpx@indStartY}
\newlength{\algpx@indEndY}
\newlength{\algpx@indStartX}% x coordinate of indent line
+\newlength{\algpx@extraShiftX}% current line is shifted by this amount right
+\newlength{\algpx@minTopPageHeight}% minimum for setting height of first line on page (used, e.g., to draw indent lines on page break)
+\newlength{\algpx@minBotPageDepth}% minimum for setting depth of last line on page (used, e.g., to draw indent lines on page break)
\setlength{\algpx@codeBoxInnerSep}{2pt}
\setlength{\algpx@codeBoxSep}{3pt}
\setlength{\algpx@codeBoxOuterSep}{1pt}
+\settoheight{\algpx@minTopPageHeight}{\footnotesize9}% account for line numbers, which use \footnotesize
+\settodepth{\algpx@minBotPageDepth}{\footnotesize9}% account for line numbers, which use \footnotesize
\newbool{algpx@firstLine}
-\newbool{algpx@setNorth}
+\newbool{algpx@setNorth}% whether codeBoxNorth should be set
\newbool{algpx@executeEndVarwidth}
\newbool{algpx@adjustHeight}
\newbool{algpx@restorePrevdepth}
+\newbool{algpx@hasCheckedPageBreak}% whether checkPageBreak has been executed in current environment
\newbool{algpx@indJustEnded}% true after end with noend
+\newbool{algpx@pageJustBroken}%
\newcounter{algpx@codeBoxCount}% number of already created code boxes. Used to fill algpx@startNewCodeBoxQueue
\newcounter{algpx@nestedCBoxCount}
@@ -104,12 +117,15 @@
\newcounter{algpx@nestedBoxedStringCount}
\newcounter{algpx@nestedBoxedStringMaxCount}
\newcounter{algpx@indentCount}
-\newcounter{algpx@justUsedIndentCount}
+\newcounter{algpx@lastIndentEnded}
+\newcounter{algpx@pageCount}% counter of "pages" (columns in multi column format); incremented when page break is detected
+\newcounter{algpx@tmpCount}% temporary counter
\FSCreate{algpx@startNewCodeBoxQueue}{0}% queue of code boxes to be created on next \State, \If etc. Only stores index of box (0 is value of top if empty; should not be relevant)
\FSCreate{algpx@codeBoxStack}{0}
\FSCreate{algpx@codeBoxStackTmp}{0}
\FSCreate{algpx@indentStack}{0}
+\FSCreate{algpx@indentStackTmp}{0}
\newsavebox{\algpx@boxedStringBox}
@@ -132,32 +148,37 @@
% execute before printing end if etc.
\newcommand{\algpx@startEndBlockCommand}{%
% add space for indentation because of how ALG@nested is computed
- \algpx@startCodeCommandX{}{\hspace*{\algorithmicindent}}%
+ \algpx@startCodeCommandX[1]{}{\hspace*{\algorithmicindent}}%
}
% extended version of \algpx@startCodeCommand
-% first argument is printed before content
-% second argument is used to reserve space after contents (for end symbol of long comments)
-\newcommand{\algpx@startCodeCommandX}[2]{%
+% first argument 1 if executed in \algpx@startEndBlockCommand
+% second argument is printed before content
+% third argument is used to reserve space after contents (for end symbol of long comments)
+\newcommand{\algpx@startCodeCommandX}[3][0]{%
\setbool{algpx@indJustEnded}{false}%
\setcounter{algpx@startedBoxesCount}{0}%
\setcounter{algpx@endedBoxesCount}{0}%
\setcounter{algpx@nestedBoxedStringMaxCount}{0}%
\whileboolexpr{test{\ifnumcomp{0}{<}{\FSSize{algpx@startNewCodeBoxQueue}}}}{%
\FSPush{algpx@codeBoxStack}{\FSTop{algpx@startNewCodeBoxQueue}}%
- \algpx@drawCodeBox{algpx@codeBoxStyle\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxNorth-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxWest-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxEast-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxSouth-\FSTop{algpx@startNewCodeBoxQueue}}%
+ \algpx@drawCodeBox{algpx@codeBoxStyle-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxNorth-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxWest-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxEast-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxSouth-\FSTop{algpx@startNewCodeBoxQueue}}%
\FSPop{algpx@startNewCodeBoxQueue}%
\setbool{algpx@setNorth}{true}%
\stepcounter{algpx@startedBoxesCount}%
}%
\algpx@setCodeBoxWest%
+ % check for page break only if indent line is open because page breaks are only used for this
+ \ifboolexpr{test{\ifnumcomp{0}{<}{\FSSize{algpx@indentStack}}}}{%
+ \algpx@checkPageBreak[#1]%
+ }{}%
\setbool{algpx@firstLine}{false}%
\setbool{algpx@executeEndVarwidth}{true}%
- #1%
- % create box from here to end of line, leaving space for #2
- \settowidth{\algpx@tmpLen}{#1}%
- \settowidth{\algpx@tmpLenA}{#2}%
- \begin{varwidth}[t]{\dimexpr \linewidth - \algpx@tmpLen - \algpx@tmpLenA - \algorithmicindent * \numexpr \value{ALG@nested} - 1 \relax \relax}%
+ #2%
+ % create box from here to end of line, leaving space for #3
+ \settowidth{\algpx@extraShiftX}{#2}% remember that line actually starts further right than last box
+ \settowidth{\algpx@tmpLen}{#3}%
+ \begin{varwidth}[t]{\dimexpr \linewidth - \algpx@extraShiftX - \algpx@tmpLen - \algorithmicindent * \numexpr \value{ALG@nested} - 1 \relax \relax}%
}
% executed before \State, \If etc., i.e., at end of previous line
@@ -176,6 +197,11 @@
\setbool{algpx@setNorth}{false}%
}{}%
\algpx@setCodeBoxEast%
+ % remember position of ending line and possibly set north of page
+ % not necessary if no indent lines are open or just ended (because EndIf with noEnd cannot break page)
+ \ifboolexpr{test{\ifnumcomp{0}{<}{\FSSize{algpx@indentStack}}} and not bool{algpx@indJustEnded}}{%
+ \algpx@setLineEndPos%
+ }{}%
\ifbool{algpx@adjustHeight}{%
% todo: if highest or deepest element in current line is BoxedString, \ht0 or \dp0 should be adjusted for different sep values
\algpx@addBoxSpacing{\value{algpx@startedBoxesCount}}{\the\ht0}{\value{algpx@endedBoxesCount}}{\the\dp0}%
@@ -187,6 +213,66 @@
}{}%
}
+% Checks whether current line starts on new page (or column) by comparing y position with previous line.
+% If so, draws indent lines neither starting nor ending on this page.
+% Optional argument is 1 if executed on end block with noEnd=false.
+%
+% Note: We do not rely on \iftikzmarkonpage because, e.g., in double-column format, lines can be on the same page,
+% but we want to consider them to be on different pages.
+\newcommand{\algpx@checkPageBreak}[1][0]{%
+ \ifbool{algpx@hasCheckedPageBreak}{% first line of code cannot be on new page
+ % extract y positions of previous line
+ \tikz[overlay,remember picture]{%
+ \pgfextracty{\algpx@oldPos}{\pgfpointanchor{algpx@currentStartYPos}{center}}%
+ \global\algpx@oldPos=\algpx@oldPos%
+ }%
+ % current pos is 0, so if last pos is less than that, we are on new page
+ \ifdimcomp{\algpx@oldPos}{<}{0ex}{%
+ % set south of previous page to y pos last saved in \algpx@setLineEndPos
+ \tikz[overlay,remember picture]{%
+ \tikzmark{algpx@pageSouth-\thealgpx@pageCount}{(algpx@currentEndYPos)}%
+ }%
+ \stepcounter{algpx@pageCount}%
+ \setbool{algpx@pageJustBroken}{true}%
+ % all currently open indent lines have started on earlier page.
+ % Draw full line from top to bottom for all of those not ending on this page either
+ \algpx@drawIndentLinesOnPageBreak[#1]%
+ }{%
+ \tikz[overlay,remember picture]{}% dummy to keep in sync
+ \tikz[overlay,remember picture]{}% dummy to keep in sync (inside drawIndentLinesOnPageBreak)
+ }%
+ }{}%
+ \@tikzmarkNow{algpx@currentStartYPos}% save y position of current line to compare next time
+ \setbool{algpx@hasCheckedPageBreak}{true}%
+}
+
+% Remember current position as south of page and set north of current page if page was just broken.
+\newcommand{\algpx@setLineEndPos}{%
+ % save y position of current line shifted down the depth of current line to later use for pageSouth coordinate in \algpx@checkPageBreak
+ % shift down at least by \algpx@minBotPageDepth
+ \ifdimcomp{\the\dp0}{<}{\algpx@minBotPageDepth}{%
+ \@tikzmarkNow[yshift=-\algpx@minBotPageDepth]{algpx@currentEndYPos}%
+ }{%
+ \@tikzmarkNow[yshift=-\the\dp0]{algpx@currentEndYPos}%
+ }%
+ % right after pagebreak, set north of current page
+ \ifbool{algpx@pageJustBroken}{%
+ % shift to beginning of line and also shift up by height of current line, but last least \algpx@minTopPageHeight
+ % also shift to left by \wd0 (width of last box, i.e., of line in varwidth) + \algpx@extraShiftX to get x position at beginning of line
+ \tikz[overlay,remember picture]{%
+ \ifdimcomp{\the\ht0}{<}{\algpx@minTopPageHeight}{%
+ \coordinate (algpx@pageNorth) at (-\wd0 - \algpx@extraShiftX,\algpx@minTopPageHeight);%
+ }{%
+ \coordinate (algpx@pageNorth) at (-\wd0 - \algpx@extraShiftX,\the\ht0);%
+ }%
+ \tikzmark{algpx@pageNorth-\thealgpx@pageCount}{(algpx@pageNorth)}%
+ }%
+ \setbool{algpx@pageJustBroken}{false}%
+ }{%
+ \tikz[overlay,remember picture]{}% dummy to keep in sync
+ }%
+}
+
% set algpx@codeBoxNorthMax of current box and all ancestors; argument is amount to shift up from current baseline
\newcommand{\algpx@setCodeBoxNorth}[1]{%
\setcounter{algpx@nestedCBoxCount}{0}%
@@ -358,7 +444,7 @@
%globally set tikz style (https://tex.stackexchange.com/a/47918)
\begingroup%
\globaldefs=1\relax%
- \pgfqkeys{/tikz}{algpx@codeBoxStyle\thealgpx@codeBoxCount/.style={#1}}%
+ \pgfqkeys{/tikz}{algpx@codeBoxStyle-\thealgpx@codeBoxCount/.style={#1}}%
\endgroup%
\stepcounter{algpx@codeBoxCount}%
\ignorespaces%
@@ -448,48 +534,57 @@
% start indented block
\newcommand{\algpx@startIndent}{%
\ifbool{algpx@indLines}{%
- \@tikzmarkNow{algpx@indentStart-\thealgpx@indentCount}%
+ % Define counter for the page on which this indent line ends.
+ % The use of totcount ensures the last value is preserved during compilations and thus can be used before setting it.
+ % expansion is needed because name contains variable, see
+ % https://tex.stackexchange.com/questions/517559/why-cant-the-name-of-a-totcounter-be-defined-with-a-variable
+ \expanded{\noexpand\newtotcounter{algpx@indentEndPage-\thealgpx@indentCount}}%
+ % set start coordinate here and draw indent line
+ % Note: Draw already here because endIndent could already be called on next page if end is at last line of page.
+ \tikz[overlay,remember picture]{%
+ \coordinate (startPos) at (\algpx@indShiftX,\algpx@indStartShiftY);
+ \algpx@drawIndentLine{\thealgpx@indentCount}{startPos}%
+ }%
\FSPush{algpx@indentStack}{\thealgpx@indentCount}%
\stepcounter{algpx@indentCount}%
}{}%
}
-% end of indented block; optional argument 1 means that only interrupted by else, 2 means ended with until
+% end of indented block
+% optional argument 1 means that only interrupted by else, 2 means ended with until
\newcommand{\algpx@endIndent}[1][0]{%
\ifbool{algpx@indLines}{%
- \ifboolexpr{bool{algpx@noEnd} and test{\ifstrequal{#1}{0}}}{%
- \setlength{\algpx@minIndDist}{1ex}% set mininum drawing distance to 1ex if ending without text
- }{% otherwise, factor in additional line for end, else, or until
- \setlength{\algpx@minIndDist}{\dimexpr \baselineskip + 1ex \relax}%
- }%
- \@tikzmarkNow{algpx@indentEnd-\FSTop{algpx@indentStack}}%
+ % remember on which page indent line ends (remembered through compiliations because we use totcount)
+ \setcounter{algpx@indentEndPage-\FSTop{algpx@indentStack}}{\value{algpx@pageCount}}%
\tikz[overlay,remember picture]{%
- \pgfextractx{\algpx@indStartX}{\pgfpointanchor{algpx@indentStart-\FSTop{algpx@indentStack}}{center}}%
\ifboolexpr{bool{algpx@indJustEnded} and test{\ifstrequal{#1}{0}}}{%
- % use same coordinates as for previous end
- \pgfextracty{\algpx@indEndY}{\pgfpointanchor{algpx@indentEnd-\thealgpx@justUsedIndentCount}{center}}%
- \draw[algpxIndentLine] ($(algpx@indentStart-\FSTop{algpx@indentStack})+(0.12em,-0.8ex)$) -- ($(\algpx@indStartX,\algpx@indEndY)+(0.12em,0ex)$) -- +(0.5em,0);%
+ % if another line has just ended, use same coordinates as for previous end
+ % to this end, remember index of previous end to use
+ \expanded{\noexpand\newtotcounter{algpx@indentEndCoordIndex-\FSTop{algpx@indentStack}}}%
+ \setcounter{algpx@indentEndCoordIndex-\FSTop{algpx@indentStack}}{\thealgpx@lastIndentEnded}%
}{%
- % only draw if at least one line between start and end
- \pgfextracty{\algpx@indStartY}{\pgfpointanchor{algpx@indentStart-\FSTop{algpx@indentStack}}{center}}%
- \pgfextracty{\algpx@indEndY}{\pgfpointanchor{algpx@indentEnd-\FSTop{algpx@indentStack}}{center}}%
- \ifdimcomp{\algpx@indStartY-\algpx@minIndDist}{>}{\algpx@indEndY}{%
- \ifboolexpr{bool{algpx@noEnd} and test{\ifstrequal{#1}{0}}}{%
- % x of end is at end of line, extract x of start and use that instead
- \pgfextractx{\algpx@indStartX}{\pgfpointanchor{algpx@indentStart-\FSTop{algpx@indentStack}}{center}}%
- % draw additional line to right if noend and line is not interrupted
- \draw[algpxIndentLine] ($(algpx@indentStart-\FSTop{algpx@indentStack})+(0.12em,-0.8ex)$) -- ($(\algpx@indStartX,\algpx@indEndY)+(0.12em,0ex)$) -- +(0.5em,0);%
- }{%
- \draw[algpxIndentLine] ($(algpx@indentStart-\FSTop{algpx@indentStack})+(0.12em,-0.8ex)$) -- ($(algpx@indentEnd-\FSTop{algpx@indentStack})+(0.12em,2.0ex)$);%
- }%
- }{}%
+ % if not just ended, use current position (0,0) as end
+ \ifboolexpr{bool{algpx@noEnd} and test{\ifstrequal{#1}{0}}}{%
+ % Draw additional line to right if noend and line is not interrupted and move down by current line depth.
+ % Note: we are now at the end of the line, so the x position is too far right.
+ % We solve this in \algpx@drawIndentLine by going at most \algpx@indShiftX to the right.
+ % Adjusting here would require access to the start position and thus an additional compilation.
+ \coordinate (algpx@indentEndCoord) at (\algpx@indShiftX+\algpx@indXLineLength,-\the\dp0);%
+ }{%
+ % if using end or interrupted by else etc., use current position shifted by default values
+ \coordinate (algpx@indentEndCoord) at (\algpx@indShiftX,\algpx@indEndShiftY);%
+ }%
+ % remember end position using \tikzmark so it can be accessed by \algpx@startIndent before
+ \tikzmark{algpx@indentEnd-\FSTop{algpx@indentStack}}{(algpx@indentEndCoord)}%
}%
}%
}{}%
% set indJustEnded even if indLines are not drawn; also used for EndBox
\ifboolexpr{not bool{algpx@indJustEnded} and bool{algpx@noEnd} and test{\ifstrequal{#1}{0}}}{%
\setbool{algpx@indJustEnded}{true}%
- \setcounter{algpx@justUsedIndentCount}{\FSTop{algpx@indentStack}}%
+ \ifbool{algpx@indLines}{%
+ \setcounter{algpx@lastIndentEnded}{\FSTop{algpx@indentStack}}%
+ }{}%
}{}%
\ifbool{algpx@indLines}{%
\FSPop{algpx@indentStack}%
@@ -499,6 +594,62 @@
}{}%
}
+% Draw indent line with index #1 and start coordinate (#2).
+% To be called inside a TikZ picture.
+\newcommand{\algpx@drawIndentLine}[2]{%
+ \ifnumcomp{\totvalue{algpx@indentEndPage-#1}}{>}{\value{algpx@pageCount}}{%
+ % if indentation does not end on the same page, draw line to end of page with x position of start
+ \coordinate (algpx@indentEndCoord) at (#2 |- {pic cs:algpx@pageSouth-\thealgpx@pageCount});%
+ }{%
+ % otherwise, indentation ends on same page
+ \@ifundefined{c@algpx@indentEndCoordIndex-#1@totc}{%
+ % if no indentEndCoordIndex is stored, just use stored end position
+ \coordinate (algpx@indentEndCoord) at (pic cs:algpx@indentEnd-#1);%
+ }{%
+ % if indentEndCoordIndex is defined, another line has just ended and we use the same y coordinates as for previous end
+ \coordinate (algpx@indentEndCoord) at (pic cs:algpx@indentEnd-\the\totvalue{algpx@indentEndCoordIndex-#1});%
+ }%
+ }{}%
+ % Only draw if there is minimum distance between start and end
+ \pgfextracty{\algpx@indStartY}{\pgfpointanchor{#2}{center}}%
+ \pgfextracty{\algpx@indEndY}{\pgfpointanchor{algpx@indentEndCoord}{center}}%
+ \ifdimcomp{\algpx@indStartY - \algpx@indEndY}{>}{\algpx@minIndDist}{%
+ % draw in straight lines from start position (#2) to end coordinate, but with x position at most start + \algpx@indXLineLength since end position is set at end of line in \algpx@endIndent
+ \draw[algpxIndentLine] let \p1=(#2), \p2=(algpx@indentEndCoord) in (#2) |- ({min(\x2, \x1 + \algpx@indXLineLength)}, \y2);%
+ }{}%
+}
+
+% For all open indent lines not ending on current page, draw from top to bottom of page
+% Optional argument is 1 if executed on end block with noEnd=false.
+\newcommand{\algpx@drawIndentLinesOnPageBreak}[1][0]{%
+ \tikz[overlay,remember picture]{%
+ % iterate over all open indent lines
+ \ifstrequal{#1}{0}{%
+ \setcounter{algpx@tmpCount}{0}% tmp counter to count interations
+ }{%
+ % if ending block here, the last indentation has already ended and line won't be drawn
+ % start counting at -1 to get correct indentation of later ending lines.
+ \setcounter{algpx@tmpCount}{-1}%
+ }%
+ \whileboolexpr{test{\ifnumcomp{0}{<}{\FSSize{algpx@indentStack}}}}{%
+ \FSPush{algpx@indentStackTmp}{\FSTop{algpx@indentStack}}% copy stack to tmp
+ \stepcounter{algpx@tmpCount}%
+ % draw line to bottom of page
+ % set beginning of line to north of page (with x set to beginning of line, see \algpx@checkPageBreak)
+ % shifted by the number indentations
+ \coordinate (startPos) at ($(pic cs:algpx@pageNorth-\thealgpx@pageCount) - (\dimexpr \algorithmicindent * \value{algpx@tmpCount} - \algpx@indShiftX \relax, 0ex)$);%
+ \algpx@drawIndentLine{\FSTop{algpx@indentStack}}{startPos}%
+ % finally remove top element
+ \FSPop{algpx@indentStack}%
+ }%
+ % restore stack from tmp
+ \whileboolexpr{test{\ifnumcomp{0}{<}{\FSSize{algpx@indentStackTmp}}}}{%
+ \FSPush{algpx@indentStack}{\FSTop{algpx@indentStackTmp}}%
+ \FSPop{algpx@indentStackTmp}%
+ }%
+ }%
+}
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Keywords
@@ -527,48 +678,48 @@
% Loops, conditional statements, and functions
%
\algdef{SE}[WHILE]{While}{EndWhile}[1]{%
- \algpx@startIndent\algpx@startCodeCommand\algorithmicwhile\ #1\ \algorithmicdo%
+ \algpx@startCodeCommand\algpx@startIndent\algorithmicwhile\ #1\ \algorithmicdo%
}{%
- \algpx@endIndent\algpx@startEndBlockCommand\algorithmicend\ \algorithmicwhile%
+ \algpx@startEndBlockCommand\algpx@endIndent\algorithmicend\ \algorithmicwhile%
}
\algdef{SE}[FOR]{For}{EndFor}[1]{%
- \algpx@startIndent\algpx@startCodeCommand\algorithmicfor\ #1\ \algorithmicdo%
+ \algpx@startCodeCommand\algpx@startIndent\algorithmicfor\ #1\ \algorithmicdo%
}{%
- \algpx@endIndent\algpx@startEndBlockCommand\algorithmicend\ \algorithmicfor%
+ \algpx@startEndBlockCommand\algpx@endIndent\algorithmicend\ \algorithmicfor%
}
\algdef{S}[FOR]{ForAll}[1]{%
- \algpx@startIndent\algpx@startCodeCommand\algorithmicforall\ #1\ \algorithmicdo%
+ \algpx@startCodeCommand\algpx@startIndent\algorithmicforall\ #1\ \algorithmicdo%
}
\algdef{SE}[LOOP]{Loop}{EndLoop}{%
- \algpx@startIndent\algpx@startCodeCommand\algorithmicloop%
+ \algpx@startCodeCommand\algpx@startIndent\algorithmicloop%
}{%
- \algpx@endIndent\algpx@startEndBlockCommand\algorithmicend\ \algorithmicloop%
+ \algpx@startEndBlockCommand\algpx@endIndent\algorithmicend\ \algorithmicloop%
}
\algdef{SE}[REPEAT]{Repeat}{Until}{%
- \algpx@startIndent\algpx@startCodeCommand\algorithmicrepeat%
+ \algpx@startCodeCommand\algpx@startIndent\algorithmicrepeat%
}[1]{%
- \algpx@endIndent[2]\algpx@startEndBlockCommand\algorithmicuntil\ #1%
+ \algpx@startEndBlockCommand\algpx@endIndent[2]\algorithmicuntil\ #1%
}
\algdef{SE}[IF]{If}{EndIf}[1]{%
- \algpx@startIndent\algpx@startCodeCommand\algorithmicif\ #1\ \algorithmicthen%
+ \algpx@startCodeCommand\algpx@startIndent\algorithmicif\ #1\ \algorithmicthen%
}{%
- \algpx@endIndent\algpx@startEndBlockCommand\algorithmicend\ \algorithmicif%
+ \algpx@startEndBlockCommand\algpx@endIndent\algorithmicend\ \algorithmicif%
}
\algdef{C}[IF]{IF}{ElsIf}[1]{%
- \algpx@endIndent[1]\algpx@startCodeCommand\algorithmicelse\ \algorithmicif\ #1\ \algorithmicthen%
+ \algpx@startCodeCommand\algpx@endIndent[1]\algorithmicelse\ \algorithmicif\ #1\ \algorithmicthen%
}
\algdef{Ce}[ELSE]{IF}{Else}{EndIf}{%
- \algpx@endIndent[1]\algpx@startCodeCommand\algorithmicelse%
+ \algpx@startCodeCommand\algpx@endIndent[1]\algorithmicelse%
}
\algdef{SE}[PROCEDURE]{Procedure}{EndProcedure}[2]{%
- \algpx@startIndent\algpx@startCodeCommand\algorithmicprocedure\ \textproc{#1}\ifstrempty{#2}{}{(#2)}%
+ \algpx@startCodeCommand\algpx@startIndent\algorithmicprocedure\ \textproc{#1}\ifstrempty{#2}{}{(#2)}%
}{%
- \algpx@endIndent\algpx@startEndBlockCommand\algorithmicend\ \algorithmicprocedure%
+ \algpx@startEndBlockCommand\algpx@endIndent\algorithmicend\ \algorithmicprocedure%
}
\algdef{SE}[FUNCTION]{Function}{EndFunction}[2]{%
- \algpx@startIndent\algpx@startCodeCommand\algorithmicfunction\ \textproc{#1}\ifstrempty{#2}{}{(#2)}%
+ \algpx@startCodeCommand\algpx@startIndent\algorithmicfunction\ \textproc{#1}\ifstrempty{#2}{}{(#2)}%
}{%
- \algpx@endIndent\algpx@startEndBlockCommand\algorithmicend\ \algorithmicfunction%
+ \algpx@startEndBlockCommand\algpx@endIndent\algorithmicend\ \algorithmicfunction%
}
\ifbool{algpx@noEnd}{%
@@ -579,13 +730,13 @@
\algtext*{EndProcedure}%
\algtext*{EndFunction}%
%
- % end indent line after (not before), to get correct y position for multiline text in last command
- \apptocmd{\EndWhile}{\algpx@endIndent}{}{}%
- \apptocmd{\EndFor}{\algpx@endIndent}{}{}%
- \apptocmd{\EndLoop}{\algpx@endIndent}{}{}%
- \apptocmd{\EndIf}{\algpx@endIndent}{}{}%
- \apptocmd{\EndProcedure}{\algpx@endIndent}{}{}%
- \apptocmd{\EndFunction}{\algpx@endIndent}{}{}%
+ % end indent line before end command
+ \pretocmd{\EndWhile}{\algpx@endIndent}{}{}%
+ \pretocmd{\EndFor}{\algpx@endIndent}{}{}%
+ \pretocmd{\EndLoop}{\algpx@endIndent}{}{}%
+ \pretocmd{\EndIf}{\algpx@endIndent}{}{}%
+ \pretocmd{\EndProcedure}{\algpx@endIndent}{}{}%
+ \pretocmd{\EndFunction}{\algpx@endIndent}{}{}%
}{}%
% execute \algpx@endCodeCommand before \State, \If etc.
@@ -633,7 +784,7 @@
\item[%
\whileboolexpr{test{\ifnumcomp{0}{<}{\FSSize{algpx@startNewCodeBoxQueue}}}}{%
\FSPush{algpx@codeBoxStack}{\FSTop{algpx@startNewCodeBoxQueue}}%
- \algpx@drawCodeBox{algpx@codeBoxStyle\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxNorth-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxWest-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxEast-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxSouth-\FSTop{algpx@startNewCodeBoxQueue}}%
+ \algpx@drawCodeBox{algpx@codeBoxStyle-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxNorth-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxWest-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxEast-\FSTop{algpx@startNewCodeBoxQueue}}{algpx@codeBoxSouth-\FSTop{algpx@startNewCodeBoxQueue}}%
\FSPop{algpx@startNewCodeBoxQueue}%
\stepcounter{algpx@startedBoxesCount}%
}%
@@ -728,8 +879,17 @@
\setbool{algpx@executeEndVarwidth}{false}%
\setbool{algpx@adjustHeight}{false}%
\setbool{algpx@restorePrevdepth}{false}%
+ \setbool{algpx@hasCheckedPageBreak}{false}%
+ \setbool{algpx@pageJustBroken}{false}%
\setcounter{algpx@startedBoxesCount}{0}%
\setcounter{algpx@endedBoxesCount}{0}%
+ %
+ % Set lengths here to use correct font sizes
+ \setlength{\algpx@indShiftX}{0.12em}%
+ \setlength{\algpx@indStartShiftY}{-0.8ex}%
+ \setlength{\algpx@indEndShiftY}{2.0ex}%
+ \setlength{\algpx@indXLineLength}{0.5em}%
+ \setlength{\algpx@minIndDist}{0.7ex}%
}
\AtEndEnvironment{algorithmic}{%
diff --git a/macros/latex/contrib/algpseudocodex/algpseudocodex.tex b/macros/latex/contrib/algpseudocodex/algpseudocodex.tex
index dce6c95ac7..4a134d9ddf 100644
--- a/macros/latex/contrib/algpseudocodex/algpseudocodex.tex
+++ b/macros/latex/contrib/algpseudocodex/algpseudocodex.tex
@@ -1,19 +1,19 @@
-%% documentation.tex
-%% Copyright 2020-2022 Christian Matt
+%% algpseudocodex.tex
+%% Copyright 2020-2023 Christian Matt
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008-05-04 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Christian Matt.
%
-% This work consists of the files algpseudocodex.sty and documentation.tex.
+% This work consists of the files algpseudocodex.sty and algpseudocodex.tex.
\documentclass[11pt,a4paper,USenglish]{article}
\usepackage[T1]{fontenc}
@@ -29,7 +29,7 @@
\title{\bf{Algpseudocodex Package Documentation}}
\author{Christian Matt \\ \url{https://github.com/chrmatt/algpseudocodex}}
-\date{\today\\v1.0.2}
+\date{\today\\v1.1.0}
\begin{document}
@@ -384,11 +384,18 @@ If \verb|false|, the end of blocks are marked with the expression ``end'' follow
\begin{minipage}[t]{0.45\textwidth}
\verb|noEnd=false|:
\begin{algorithmic}
+ % redefine if commands here to handle noEnd = false
\makeatletter
\setbool{algpx@noEnd}{false}%
- \algtext{EndIf}{\algpx@endIndent\algpx@startCodeCommand\algorithmicend\ \algorithmicif%
- \algpx@startIndent% \EndIf ends another indent. Start fake one here to handle that.
+ \let\If\undefined%
+ \let\EndIf\undefined%
+ \algdef{SE}[IF]{If}{EndIf}[1]{%
+ \algpx@startCodeCommand\algpx@startIndent\algorithmicif\ #1\ \algorithmicthen%
+ }{%
+ \algpx@startEndBlockCommand\algpx@endIndent\algorithmicend\ \algorithmicif%
}
+ \pretocmd{\If}{\algpx@endCodeCommand}{}{}%
+ \pretocmd{\EndIf}{\algpx@endCodeCommand[0]}{}{}%
\makeatother
\If{$x > 0$}
\State $x \gets x - 1$
@@ -681,6 +688,11 @@ The following keywords can be customized:
\section{Revision History}
+\subsection*{v1.1.0 (2023-02-17)}
+\begin{itemize}
+ \item Added support for indent guide lines spanning multiple pages.
+\end{itemize}
+
\subsection*{v1.0.2 (2022-10-07)}
\begin{itemize}
\item Fixed bug with incorrectly ended indent block for nested statements.
diff --git a/macros/latex/contrib/changelog/README.md b/macros/latex/contrib/changelog/README.md
index 93e7c2834e..ab16196d1e 100644
--- a/macros/latex/contrib/changelog/README.md
+++ b/macros/latex/contrib/changelog/README.md
@@ -19,5 +19,19 @@ screenshot.png | Sample screenshot
README.md | This file
LICENSE.txt | LPPL v1.3c
+## Development
+
+Sources for this package are [available on GitHub.][github]
+This package is built with the [Nix][nix] package manager.
+
+- Build a release directory with rendered PDFs:
+ `nix build .#changelog`
+- Build a release tarball:
+ `nix build .#changelog-tar`, or just `nix build`
+- Enter a development shell with `latexmk` and fonts available:
+ `nix develop`
+
[keepachangelog.com]: https://keepachangelog.com/
[changelog]: https://ctan.org/pkg/changelog
+[github]: https://github.com/9999years/latex-changelog
+[nix]: https://zero-to-nix.com/
diff --git a/macros/latex/contrib/changelog/changelog.pdf b/macros/latex/contrib/changelog/changelog.pdf
index 800b2ac365..c80cec01db 100644
--- a/macros/latex/contrib/changelog/changelog.pdf
+++ b/macros/latex/contrib/changelog/changelog.pdf
Binary files differ
diff --git a/macros/latex/contrib/changelog/changelog.sty b/macros/latex/contrib/changelog/changelog.sty
index 6c329e9a18..4c95edd805 100644
--- a/macros/latex/contrib/changelog/changelog.sty
+++ b/macros/latex/contrib/changelog/changelog.sty
@@ -1,4 +1,5 @@
-\ProvidesPackage{changelog}[2020/08/26 2.4.0 Typesetting changelogs]
+\RequirePackage{expl3}
+\ProvidesExplPackage{changelog}{2023/02/16}{2.5.0}{Typesetting changelogs}
% Description: Provides the changelog environment for typesetting changelogs
% License: LPPL 1.3c
% Homepage: https://github.com/9999years/latex-changelog
@@ -19,8 +20,6 @@
%
% This work consists of the files changelog.sty and changelog.tex.
-\RequirePackage{xparse}
-\RequirePackage{xkeyval}
\RequirePackage{translations}
% See https://github.com/olivierlacan/keep-a-changelog/issues/195
@@ -95,148 +94,247 @@
\DeclareTranslation{Japanese}{changelog-Unreleased}{未公開}
\DeclareTranslation{Japanese}{changelog-Yanked}{緊急変更}
-\newif\ifchangelog@versionfirst
-\newcommand{\changelog@item}[1]{%
- \noindent
- \ifchangelog@versionfirst
- \changelog@versionfirstfalse
- \else
- \end{changelogitemize}
- \fi
- \textbf{#1}%
- \begin{changelogitemize}%
-}
-
-\newcommand{\changelogyanked}{\fbox{\textbf{\GetTranslation{changelog-Yanked}}}}
-
-\newcommand{\changelog@sectioncmds}{
- \newcommand{\added} {\changelog@item{\GetTranslation{changelog-Added}}}
- \newcommand{\changed} {\changelog@item{\GetTranslation{changelog-Changed}}}
- \newcommand{\deprecated}{\changelog@item{\GetTranslation{changelog-Deprecated}}}
- \newcommand{\removed} {\changelog@item{\GetTranslation{changelog-Removed}}}
- \newcommand{\fixed} {\changelog@item{\GetTranslation{changelog-Fixed}}}
- \newcommand{\security} {\changelog@item{\GetTranslation{changelog-Security}}}
- \newcommand{\misc} {\changelog@item{\GetTranslation{changelog-Miscellaneous}}}
-}
-
-\define@cmdkeys{version}{author, version, date, changes}
-\define@key{version}{v}{\def\cmdKV@version@version{#1}}
-\define@boolkey{version}{yanked}[true]{}
-\define@boolkey{version}{simple}[true]{}
-\define@boolkey{version}{short}[true]{}
-
-\define@cmdkeys{changelog}{sectioncmd, title, label}
-\define@boolkey{changelog}{section}[true]{}
-\presetkeys{changelog}{sectioncmd=\section, title=\GetTranslation{changelog},
- label=sec:changelog, section}{}
+\msg_new:nnnn { changelog } { missing_section }
+ {
+ Something's~wrong~in~version~environment;~perhaps~a~missing~
+ \protect\added,~\protect\changed,~\protect\deprecated,~
+ \protect\removed,~\protect\fixed,~\protect\security,~
+ or~\protect\misc?
+ }
+ {
+ A~version~environment~needs~to~introduce~its~
+ \protect\item-ized~lists~with~one~of~the~provided~section~commands;~
+ maybe~you~meant~to~use~the~[simple]~option?
+ }
+
+\msg_new:nnnn { changelog } { missing_version }
+ {
+ No~versions~listed~in~changelog~environment~body.
+ }
+ {
+ A~changelog~environment~must~have~at~least~one~version~environment~or~
+ \protect\shortversion~command~in~it.
+ }
+
+\bool_new:N \g__changelog_version_first_bool
+\cs_set:Npn \changelog__item:n #1
+ {
+ \noindent
+ \bool_if:NTF \g__changelog_version_first_bool
+ {
+ \bool_gset_false:N \g__changelog_version_first_bool
+ }
+ {
+ \end{changelogitemize}
+ }
+ \textbf{#1}
+ \begin{changelogitemize}
+ }
+
+\cs_set:Npn \changelogremark #1
+ {
+ \fbox{\textbf{#1}}
+ }
+
+\cs_set:Npn \changelogyanked
+ {
+ \changelogremark{\GetTranslation{changelog-Yanked}}
+ }
+
+\tl_new:N \g__changelog_extra_section_cmds
+\cs_set:Npn \changelog__define_section_cmds
+ {
+ \cs_set:Npn \added {\changelog__item:n{\GetTranslation{changelog-Added}}}
+ \cs_set:Npn \changed {\changelog__item:n{\GetTranslation{changelog-Changed}}}
+ \cs_set:Npn \deprecated {\changelog__item:n{\GetTranslation{changelog-Deprecated}}}
+ \cs_set:Npn \removed {\changelog__item:n{\GetTranslation{changelog-Removed}}}
+ \cs_set:Npn \fixed {\changelog__item:n{\GetTranslation{changelog-Fixed}}}
+ \cs_set:Npn \security {\changelog__item:n{\GetTranslation{changelog-Security}}}
+ \cs_set:Npn \misc {\changelog__item:n{\GetTranslation{changelog-Miscellaneous}}}
+ \tl_use:N \g__changelog_extra_section_cmds
+ }
+
+\NewDocumentCommand{\newchangelogsection}{m m}
+ {
+ \tl_gput_right:Nn \g__changelog_extra_section_cmds
+ {
+ \cs_set:Npn #1
+ {
+ \changelog__item:n { #2 }
+ }
+ }
+ }
+
+\keys_define:nn { changelog_version }
+ {
+ author .tl_set:N = \g__changelog_author_tl ,
+ v .tl_set:N = \g__changelog_version_tl ,
+ version .tl_set:N = \g__changelog_version_tl ,
+ date .tl_set:N = \g__changelog_date_tl ,
+ changes .tl_set:N = \g__changelog_changes_tl ,
+ yanked .bool_set:N = \g__changelog_yanked_bool ,
+ simple .bool_set:N = \g__changelog_simple_bool ,
+ short .bool_set:N = \g__changelog_short_bool ,
+ remark .tl_set:N = \g__changelog_remark_tl ,
+ remarks .clist_set:N = \g__changelog_remarks_clist ,
+ }
+
+\keys_define:nn { changelog_changelog }
+ {
+ sectioncmd .tl_set:N = \g__changelog_sectioncmd_tl ,
+ sectioncmd .initial:n = \section ,
+ title .tl_set:N = \g__changelog_title_tl ,
+ title .initial:n = \GetTranslation{changelog} ,
+ label .tl_set:N = \g__changelog_label_tl ,
+ label .initial:n = sec:changelog ,
+ section .bool_gset:N = \g__changelog_section_bool ,
+ section .initial:n = true ,
+ }
+
+\keys_define:nn { } { changelog_changelog .inherit:n = changelog_version }
\newenvironment{changelogdescription}
- {\begin{description}}
- {\end{description}}
+ {\begin{description}}
+ {\end{description}}
\newenvironment{changelogitemize}
- {\begin{itemize}}
- {\end{itemize}}
-
-\newcommand{\changelog@section@maybe}{%
- \ifKV@changelog@section
- \expandafter\cmdKV@changelog@sectioncmd{\cmdKV@changelog@title}%
- \expandafter\label{\cmdKV@changelog@label}%
- \fi
-}
-
-\newcommand{\changelog@shortversion@definedate}{%
- \@ifundefined{cmdKV@version@version}{
- \@ifundefined{cmdKV@version@date}{
- \newcommand{\cmdKV@version@version}{\GetTranslation{changelog-Unreleased}}
- \let\cmdKV@version@date\today
- }{%
- \let\cmdKV@version@version\cmdKV@version@date
- \let\cmdKV@version@date\undefined
- }%
- }{}%
-}
-
-\newcommand{\changelog@yanked@maybe}
- {\ifKV@version@yanked\ \changelogyanked\fi}
-
-\newcommand{\changelog@shortversion@item}
- {\cmdKV@version@version
- \changelog@yanked@maybe}
-
-
-\newcommand{\changelog@shortversion@authordate}{%
- \@ifundefined{cmdKV@version@author}{}{\cmdKV@version@author}
- \@ifundefined{cmdKV@version@date}{%
- % if both undefined, add a linebreak
- \@ifundefined{cmdKV@version@author}{\hspace{0pt}}{}%
- }{(\cmdKV@version@date)}%
-}
-
-\newcommand{\changelog@version@pre}{%
- \par
- \changelog@versionfirsttrue
- \changelog@sectioncmds
- \ifKV@version@simple
- \begin{changelogitemize}
- \fi
-}
-\newcommand{\changelog@version@post}{%
- \ifchangelog@versionfirst
- \ifKV@version@simple
- \else
- \PackageError{changelog}{Something's wrong in version environment;
- perhaps a missing \protect\added, \protect\changed,
- \protect\deprecated, \protect\removed, \protect\fixed,
- \protect\security, or \protect\misc}{A version environment needs to
- introduce its \protect\item-ized lists with one of the provided
- section commands; maybe you meant to use the [simple] option?}
- \fi
- \fi
- \end{changelogitemize}%
-}
-
-\newif\ifchangelog@hadversion
+ {\begin{itemize}}
+ {\end{itemize}}
+
+\cs_set:Npn \changelog__section_maybe
+ {
+ \bool_if:NTF \g__changelog_section_bool
+ {
+ \exp_after:wN \g__changelog_sectioncmd_tl { \g__changelog_title_tl }
+ \exp_after:wN \label { \g__changelog_label_tl }
+ }
+ {}
+ }
+
+\cs_set:Npn \changelog__short_version_define_date
+ {
+ \tl_if_empty:NT \g__changelog_version_tl
+ {
+ \tl_if_empty:NTF \g__changelog_date_tl
+ {
+ \tl_set:Nn \g__changelog_version_tl { \GetTranslation{changelog-Unreleased} }
+ \tl_set:Nn \g__changelog_date_tl { \today }
+ }
+ {
+ \tl_set_eq:NN \g__changelog_version_tl \g__changelog_date_tl
+ }
+ }
+ }
+
+\cs_set:Npn \changelog__short_version_item
+ {
+ \tl_use:N \g__changelog_version_tl
+ \bool_if:NT \g__changelog_yanked_bool
+ {
+ \ \changelogyanked
+ }
+ \tl_if_empty:NF \g__changelog_remark_tl
+ {
+ \ \changelogremark{\tl_use:N \g__changelog_remark_tl}
+ }
+ \clist_if_empty:NF \g__changelog_remarks_clist
+ {
+ \clist_map_variable:NNn \g__changelog_remarks_clist \l__changelog_remark_tl
+ {
+ \ \changelogremark{\tl_use:N \l__changelog_remark_tl}
+ }
+ }
+ }
+
+\cs_set:Npn \changelog__short_version_author_date
+ {
+ \tl_use:N \g__changelog_author_tl
+ \tl_if_empty:NF \g__changelog_date_tl
+ {
+ \tl_if_empty:NF \g__changelog_author_tl
+ { ~ }
+ (\tl_use:N \g__changelog_date_tl)
+ }
+ }
+
+\cs_set:Npn \changelog__version_pre
+ {
+ \par
+ \bool_gset_true:N \g__changelog_version_first_bool
+ \changelog__define_section_cmds
+ \bool_if:NT \g__changelog_simple_bool
+ {
+ \begin{changelogitemize}
+ }
+ }
+
+\cs_set:Npn \changelog__version_post
+ {
+ \bool_if:NT \g__changelog_version_first_bool
+ {
+ \bool_if:NF \g__changelog_simple_bool
+ {
+ \msg_error:nn { changelog } { missing_section }
+ }
+ }
+ \end{changelogitemize}
+ }
+
+\bool_new:N \g__changelog_seen_version_bool
\NewDocumentEnvironment{changelog}{o}
- {\global\changelog@hadversionfalse
- \IfValueT{#1}{\setkeys{changelog, version}{#1}}%
- \changelog@section@maybe
- %\today
- % version environment; wraps a list
- \NewDocumentEnvironment{version}{ O{} }%
- {\setkeys{version}{##1}%
- \@shortversion
- \ifKV@version@short
- \else
- \changelog@version@pre
- \fi}
- {\ifKV@version@short
- \else
- \changelog@version@post
- \fi}%
-
- % doesn't set keys so this can share code with the version
- % environment
- \NewDocumentCommand{\@shortversion}{}{%
- \changelog@shortversion@definedate
- \global\changelog@hadversiontrue
- \item[\changelog@shortversion@item]%
- \changelog@shortversion@authordate
- \ifKV@version@short
- \ ---
- \@ifundefined{cmdKV@version@changes}{}{\cmdKV@version@changes}%
- \fi
- }%
-
- % short version; "like" a 1-bullet list
- % extra braces keep command definitions local
- \NewDocumentCommand{\shortversion}{m}{{%
- \setkeys{version}{##1, short}%
- \@shortversion
- }}%
- \begin{changelogdescription}}
- {\ifchangelog@hadversion
- \else
- \PackageError{changelog}{No versions in changelog environment body}{A
- changelog environment must have at least one version or shortversion in
- it.}%
- \fi\end{changelogdescription}}
+ {
+ \bool_gset_false:N \g__changelog_seen_version_bool
+ \IfValueT{#1}{\keys_set:nn{changelog_changelog}{#1}}
+ \changelog__section_maybe
+
+ % Define the version environment, which wraps an `itemize`-style list.
+ \NewDocumentEnvironment{version}{ O{} }
+ {
+ \keys_set:nn { changelog_version } { ##1 }
+ \changelog__short_version
+
+ \bool_if:NF \g__changelog_short_bool
+ {
+ \changelog__version_pre
+ }
+ }
+ {
+ \bool_if:NF \g__changelog_short_bool
+ {
+ \changelog__version_post
+ }
+ }
+
+ % doesn't set keys so this can share code with the version
+ % environment
+ \cs_set:Npn \changelog__short_version
+ {
+ \changelog__short_version_define_date
+ \bool_gset_true:N \g__changelog_seen_version_bool
+
+ \item[\changelog__short_version_item]
+ \changelog__short_version_author_date
+
+ \bool_if:NT \g__changelog_short_bool
+ {
+ \ ---\ \tl_use:N \g__changelog_changes_tl
+ }
+ }
+
+ % A short version; "like a 1-bullet list.
+ \NewDocumentCommand{\shortversion}{m}
+ % The extra braces here keep the keys we set local.
+ {{
+ \keys_set:nn{changelog_version}{##1, short}
+ \changelog__short_version
+ }}
+
+ \begin{changelogdescription}
+ }
+ {
+ \bool_if:NF \g__changelog_seen_version_bool
+ {
+ \msg_error:nn { changelog } { missing_version }
+ }
+
+ \end{changelogdescription}
+ }
diff --git a/macros/latex/contrib/changelog/changelog.tex b/macros/latex/contrib/changelog/changelog.tex
index 3e5611dd5d..f4d0706350 100644
--- a/macros/latex/contrib/changelog/changelog.tex
+++ b/macros/latex/contrib/changelog/changelog.tex
@@ -17,14 +17,7 @@
}
\makeatother
-\setmainfont{Charter}[
- Path = /nix/store/8ylkcs5xw8b3glvgp5l66md6hvxdk098-charter-200512/share/fonts/opentype/,
- Extension = .otf,
- UprightFont = * Regular,
- ItalicFont = * Italic,
- BoldFont = * Bold,
- BoldItalicFont = * Bold Italic,
-]
+\setmainfont{Charter}
\usepackage{FiraSans}
\usepackage{FiraMono}
\lstset{basewidth=0.6em}
@@ -35,9 +28,9 @@
\begin{description}}
{\end{description}}
-\author{Rebecca Turner\thanks{Brandeis University; \email{rbt@sent.as}}}
+\author{Rebecca Turner\thanks{\email{rbt@sent.as}}}
\title{The \cl\ Package}
-\date{2020/08/26 2.4.0}
+\date{2.5.0 (2023/02/16)}
\begin{document}
\maketitle
@@ -159,6 +152,7 @@ versions have the same author.
What to \cs{label} the section?
\end{keys}
+\pagebreak
\begin{desc}
|\begin{version}[<options>]...\end{version}|
\end{desc}
@@ -192,6 +186,10 @@ of the other solutions here.}}
\key{yanked}[\bool][false]
Indicates that the release was revoked due to a ``serious bug or
security issue''; prints a visible notice next to the version number
+ \key{remark}[\m{remark}]
+ Adds a remark in the style of the |yanked| key.
+ \key{remarks}[\m{comma-separated list of remarks}]
+ Adds multiple remarks in the style of the |yanked| key.
\key{simple}[\bool][false]
Indicates this version isn't split up into \cs{added}, \cs{changed},
etc.\ categories; if this option is given, a |version| environment acts
@@ -235,6 +233,21 @@ the \option{simple} option!
\begin{desc}|\security|\end{desc}Introduces a list of \cs{item}s that represent
security-fixes and closed security holes
+\begin{desc}|\newchangelogsection{<command>}{<description>}|\end{desc}
+ Creates a new command like \cs{added}, \cs{changed}, etc., that can be
+ used in the |version| environment.
+
+\begin{LTXexample}
+\newchangelogsection
+ {\critical}{Critical}
+\begin{changelog}[section=false]
+ \begin{version}[v=1.0.0, date=2023-02-16]
+ \critical
+ \item Features!
+ \end{version}
+\end{changelog}
+\end{LTXexample}
+
\subsection{Customization}
The |changelog| environment wraps |changelogdescription| (which is
@@ -257,6 +270,12 @@ Prints the ``revoked release'' notice:
\href{https://keepachangelog.com/en/1.0.0/#yanked}{yanked releases on
\texttt{keepachangelog.com}}.
+\begin{desc}
+|\changelogremark{<remark>}|
+\end{desc}
+Prints a ``remark.'' This is used to implement |\changelogyanked| and the
+|remark| and |remarks| keys of the |version| environment.
+
\section{Translations}
Want to use \cl\ in a non-English document? Great! \cl\ comes with
@@ -327,6 +346,22 @@ an email} and I'll incorporate the translation into \cl's next release!
This is this package's actual changelog --- not an example!
\begin{changelog}[author=Rebecca Turner <\email{rbt@sent.as}>, section=false]
+\begin{version}[v=2.5.0, date=2023-02-16]
+\added
+ \item Added the \cs{newchangelogsection} command to support custom
+ sections.
+ \item Added the |remark| and |remarks| keys to support custom remarks (like
+ ``YANKED'') on versions.
+ \item Added the |\changelogremark| command, which renders the ``YANKED''
+ remark and other custom remarks.
+\end{version}
+\begin{version}[v=2.4.1, date=2023-02-14]
+\changed
+ \item Converted the |changelog.sty| implementation to use the \ctan{expl3}
+ package. \ctan{expl3} provides a reasonable and well-defined programming
+ environment. I believe \ctan{expl3} is the future of programming in
+ \LaTeX, despite its verbosity.
+\end{version}
\begin{version}[v=2.4.0, date=2020-09-02,
author={cmplstofB <\https{github.com/cmplstofB}>}]
\added
diff --git a/macros/latex/contrib/changelog/example.pdf b/macros/latex/contrib/changelog/example.pdf
index 6cb7383b02..110ae72c38 100644
--- a/macros/latex/contrib/changelog/example.pdf
+++ b/macros/latex/contrib/changelog/example.pdf
Binary files differ
diff --git a/macros/latex/contrib/changelog/example.tex b/macros/latex/contrib/changelog/example.tex
index ad2272c5b8..9db61a2ea7 100644
--- a/macros/latex/contrib/changelog/example.tex
+++ b/macros/latex/contrib/changelog/example.tex
@@ -1,10 +1,13 @@
\documentclass{article}
\usepackage{changelog}
+\newchangelogsection{\critical}{Critical}
\begin{document}
\begin{changelog}[author=Rebecca Turner,
sectioncmd=\subsection,
title=Example changelog]
\begin{version}
+\critical
+ \item A critical new feature
\added
\item Really cool features
\end{version}
@@ -17,6 +20,14 @@
\item A version with no date
\end{version}
+\begin{version}[v=1.0.3, remark=Remark, simple]
+ \item A version with a remark.
+\end{version}
+
+\begin{version}[v=1.0.2, remarks={Remark 1, Remark 2}, simple]
+ \item A version with multiple remarks.
+\end{version}
+
\begin{version}[v=1.0.1, yanked, simple]
\item A version with a terrible bug
\end{version}
diff --git a/macros/latex/contrib/recorder-fingering/README.md b/macros/latex/contrib/recorder-fingering/README.md
new file mode 100644
index 0000000000..d0d5179023
--- /dev/null
+++ b/macros/latex/contrib/recorder-fingering/README.md
@@ -0,0 +1,9 @@
+# recorder-fingering
+
+Version 1.0 February 17, 2023
+
+LaTeX package for recorder fingering diagrams. Support for all standard F and C recorder fingerings, with the ability to add new fingerings as needed.
+
+# Sample of what you can do with it:
+
+![Fingering chart](RecorderInCchart.png)
diff --git a/macros/latex/contrib/recorder-fingering/RecorderInCchart.png b/macros/latex/contrib/recorder-fingering/RecorderInCchart.png
new file mode 100644
index 0000000000..2dc30ed9f3
--- /dev/null
+++ b/macros/latex/contrib/recorder-fingering/RecorderInCchart.png
Binary files differ
diff --git a/macros/latex/contrib/recorder-fingering/recorder-fingering.pdf b/macros/latex/contrib/recorder-fingering/recorder-fingering.pdf
new file mode 100644
index 0000000000..a513c2c860
--- /dev/null
+++ b/macros/latex/contrib/recorder-fingering/recorder-fingering.pdf
Binary files differ
diff --git a/macros/latex/contrib/recorder-fingering/recorder-fingering.sty b/macros/latex/contrib/recorder-fingering/recorder-fingering.sty
new file mode 100644
index 0000000000..6c5f447f72
--- /dev/null
+++ b/macros/latex/contrib/recorder-fingering/recorder-fingering.sty
@@ -0,0 +1,355 @@
+%%
+%% This is file `recorder-fingerings.sty'
+% Copyright 2023 by Alan Munn
+%
+% This package provides a single command to produce a fingering
+% diagram for any not in the playable range of the recorder.
+%
+% This package may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This package has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this package is Alan Munn.
+%
+% This package consists of the file
+%
+% recorder-fingering.sty
+%
+% and documentation files:
+%
+% recorder-fingering.tex, recorder-fingering.pdf
+%
+% Version 1.0 2023/02/17
+\NeedsTeXFormat{LaTeX2e}[2022/11/01]
+\ProvidesPackage{recorder-fingering}[2023/02/17 v1.0 Recorder fingering diagrams]
+\RequirePackage{tikz}
+\usetikzlibrary{calc}
+\RequirePackage{graphicx}
+% Split node code from
+% https://tex.stackexchange.com/a/657282/2693
+% These styles are local to the package
+\pgfkeys{/fingering/.style={
+ node split radius/.initial=1,
+ node split color 1/.initial=white,
+ node split color 2/.initial=black,
+ node split color 3/.initial=blue,
+ node split half/.style={node split={##1,##1+180}},
+ node split/.style args={##1,##2}{
+ path picture={
+ \tikzset{
+ x=($(path picture bounding box.east)-(path picture bounding box.center)$),
+ y=($(path picture bounding box.north)-(path picture bounding box.center)$),
+ radius=\pgfkeysvalueof{/tikz/node split radius}}
+ \foreach \ang[count=\iAng, remember=\ang as \prevAng (initially ##1)] in {##2,360+##1}
+ \fill[line join=round, draw, fill=\pgfkeysvalueof{/tikz/node split color \iAng}]
+ (path picture bounding box.center)
+ --++(\prevAng:\pgfkeysvalueof{/tikz/node split radius})
+ arc[start angle=\prevAng, end angle=\ang] --cycle;
+} },
+hole/.style={circle,draw,##1},
+1/.style={fill=black}, % closed hole
+0/.style={fill=none}, % open hole
+t/.style={node split half=0}, % thumb half hole
+h/.style={node split half=-90}, % finger half hole
+top double/.style={circle,minimum size=7pt,inner sep=0pt,draw,##1},
+bottom double/.style={circle,minimum size=6pt,inner sep=0pt,draw,##1},
+}}
+\ExplSyntaxOn
+
+
+% Error messages
+\msg_new:nnnn {recorder-fingering}{too-few}{\\You\ haven't\ provided\ enough\ holes!}{Fingerings\ must\ specify\ all\ 8\ holes\ (thumb\ +\ all\ 7\ fingers)}
+\msg_new:nnnn {recorder-fingering}{key-exists}{\\This\ fingering\ is\ already\ defined!}{Use\ the\ starred\ version\ of\ the\ command\ or\ \token_to_str:N \AddFingerings\ instead\ to\ override\ existing\ fingerings.}
+\msg_new:nnnn {recorder-fingering}{wrong-instrument}{\\This\ command\ only\ permits\ F\ and\ C\ fingerings!}{}
+\msg_new:nnnn {recorder-fingering}{deprecated}{\\This\ command\ is\ deprecated.\ Please\ use\ \token_to_str:N \alto\ or\ \token_to_str:N \soprano\ instead.}{}
+
+% Command parameters
+\keys_define:nn {fingering}{
+ thumboffset.bool_set:N = \g_fingering_thumboffset_bool,
+ width.dim_set:N = \g_fingering_size_dim,
+ thumboffset.initial:n = {true},
+ width.initial:n = {20pt}
+}
+\keys_define:nn {fingering / command}{
+ thumboffset.bool_set:N = \g_fingering_command_thumboffset_bool,
+ width.dim_set:N = \l_fingering_command_size_dim,
+}
+\NewDocumentCommand{\fingeringSetup}{m}{
+ \keys_set:nn {fingering} {#1}
+}
+
+% Manage the thumb offset parameters
+\tl_set:Nn \g_fingering_thumboffset_x {-.5}
+\tl_set:Nn \g_fingering_thumboffset_y {-.25}
+\cs_new:Nn \fingering_offset_reset:
+{\tl_gset:Nn \g_fingering_thumboffset_x {-.5}
+\tl_gset:Nn \g_fingering_thumboffset_y {-.25}
+}
+\cs_new:Nn \fingering_offset_zero:
+{\tl_gset:Nn \g_fingering_thumboffset_x {0}
+\tl_gset:Nn \g_fingering_thumboffset_y {0}
+}
+\cs_new:Nn \fingering_set_thumboffset: {
+\bool_if:nTF {\g_fingering_command_thumboffset_bool}
+ {\fingering_offset_reset:}
+ {\fingering_offset_zero:}
+}
+
+% Set up the property lists for F and C fingerings
+\prop_new:N \l_fingering_F_prop
+\prop_new:N \l_fingering_C_prop
+% Set up transposition tables for later
+\prop_new:N \l_fingering_C_to_F_prop
+\prop_new:N \l_fingering_F_to_C_prop
+
+% Set up the clists for the fingering vectors themselves
+\clist_new:N \l_fingering_fing_clist
+\clist_new:N \l_fingering_topholes_clist
+
+
+% Generic fingering generator: takes a clist, splits it between top holes and bottom holes
+% and produces the corresponding diagram
+% basic idea for splitting the clist using step_inline and pop from Jonathan P. Spratte (Skillmon)
+
+\cs_new_protected:Nn \fingering_generate_fingering:n
+{
+\clist_set:Nn \l_fingering_holes_clist {#1}
+ \clist_clear:N \l_fingering_topholes_clist
+ \int_step_inline:nn { 6 } {
+ \clist_pop:NNF \l_fingering_holes_clist \l_tmpa_tl { \msg_error:nn { recorder-fingering } { too-few }}
+ \clist_put_right:NV \l_fingering_topholes_clist \l_tmpa_tl }
+ \resizebox{\l_fingering_command_size_dim}{!}{
+ \begin{tikzpicture}[/fingering]
+% display the topholes
+ \fingering_set_thumboffset:
+ \foreach[expand~list]~\x~[count=\xi]~in~\l_fingering_topholes_clist {
+ \node[hole=\x]~at~(0+\g_fingering_thumboffset_x,-\xi/2+\g_fingering_thumboffset_y)~{};
+ \fingering_offset_zero:}
+% display the bottom two paired holes
+ \clist_pop:NN \l_fingering_holes_clist \l_tmpa_tl
+ \int_case:nnTF {\l_tmpa_tl}{
+ {0} {\node[top~double=0]~at~(.15,-7/2)~{};
+ \node[bottom~double=0]~at~(-.15,-7.15/2)~{};}
+ {2} {\node[top~double=1,]~at~(.15,-7/2)~{};
+ \node[bottom~double=1]~at~(-.15,-7.15/2)~{};}
+ {1} {\node[top~double=1]~at~(.15,-7/2)~{};
+ \node[bottom~double=0]~at~(-.15,-7.15/2)~{};}
+ }
+ {}
+ {}
+ \clist_pop:NN \l_fingering_holes_clist \l_tmpa_tl
+ \int_case:nnTF {\l_tmpa_tl}{
+ {0} {\node[top~double=0,]~at~(.15,-8/2)~{};
+ \node[bottom~double=0]~at~(-.15,-8.15/2)~{};}
+ {2} {\node[top~double=1,]~at~(.15,-8/2)~{};
+ \node[bottom~double=1]~at~(-.15,-8.15/2)~{};}
+ {1} {\node[top~double=1,]~at~(.15,-8/2)~{};
+ \node[bottom~double=0]~at~(-.15,-8.15/2)~{};}
+ }
+ {}
+ {}
+% display the bell hole if present
+ \clist_if_empty:NTF \l_fingering_holes_clist
+ {}
+ {\clist_pop:NN \l_fingering_holes_clist \l_tmpa_tl
+ \node[hole=\l_tmpa_tl]~at~(0,-9/2)~{};}
+ \end{tikzpicture}}
+ }
+
+% create variable version of the command
+\cs_generate_variant:Nn \fingering_generate_fingering:n { V }
+
+
+% Main user commands and synonyms
+% First basic commands to display the fingering for any note
+\NewDocumentCommand{\Alto}{om}{
+\IfNoValueTF{#1}
+ {\keys_set:nn {fingering / command} {width = \g_fingering_size_dim}
+ \bool_set_eq:NN {\g_fingering_command_thumboffset_bool}{\g_fingering_thumboffset_bool}}
+ {\bool_set_eq:NN {\g_fingering_command_thumboffset_bool}{\g_fingering_thumboffset_bool}
+ \keys_set:nn {fingering /command } {#1}}
+ \prop_get:NnN \l_fingering_F_prop {#2} \l_tmpa_tl
+ \fingering_generate_fingering:V \l_tmpa_tl
+}
+\cs_set_eq:NN \Sopranino \Alto
+\cs_set_eq:NN \Bass \Alto
+
+\NewDocumentCommand{\Soprano}{om}{
+\IfNoValueTF{#1}
+ {\keys_set:nn {fingering / command} {width = \g_fingering_size_dim}
+ \bool_set_eq:NN {\g_fingering_command_thumboffset_bool}{\g_fingering_thumboffset_bool}}
+ {\bool_set_eq:NN {\g_fingering_command_thumboffset_bool}{\g_fingering_thumboffset_bool}
+ \keys_set:nn {fingering /command } {#1}}
+ \prop_get:NnN \l_fingering_C_prop {#2} \l_tmpa_tl
+ \fingering_generate_fingering:V \l_tmpa_tl
+}
+\cs_set_eq:NN \Tenor \Soprano
+
+% Now commands to add new fingerings:
+% First, a note = { } version for multiple fingerings
+% This command will override existing fingerings
+\NewDocumentCommand{\AddFingerings}{mm}{
+ \str_case:nnTF {#1}{
+ {F} {\prop_put_from_keyval:Nn \l_fingering_F_prop {#2}}
+ {C}{\prop_put_from_keyval:Nn \l_fingering_C_prop {#2}}
+ }
+ {}
+ {\msg_error:nn { recorder-fingering }{ wrong-instrument}}
+}
+
+% Second individual fingerings for alto and soprano
+% These commands will throw an error if the note is already defined
+\NewDocumentCommand{\NewFfingering}{smm}{
+\IfBooleanTF{#1}
+ {\prop_put:Nnn \l_fingering_F_prop {#2} {#3}}
+ {\prop_get:NnNTF \l_fingering_F_prop {#2} \tl_tmpa_tl
+ {\msg_error:nn { recorder-fingering } { key-exists }}
+ {\prop_put:Nnn \l_fingering_F_prop {#2} {#3}}
+ }}
+
+\NewDocumentCommand{\NewCfingering}{smm}{
+\IfBooleanTF{#1}
+ {\prop_put:Nnn \l_fingering_C_prop {#2} {#3}}
+ {\prop_get:NnNTF \l_fingering_C_prop {#2} \tl_tmpa_tl
+ {\msg_error:nn { recorder-fingering } { key-exists }}
+ {\prop_put:Nnn \l_fingering_C_prop {#2} {#3}}
+ }}
+
+% Now add all of the basic fingerings
+\AddFingerings{F}{
+ F = {1,1,1,1,1,1,2,2},
+ Gb = {1,1,1,1,1,1,2,1},
+ G = {1,1,1,1,1,1,2,0},
+ Ab = {1,1,1,1,1,1,0,0},
+ A = {1,1,1,1,1,1,0,0},
+ Bb = {1,1,1,1,1,0,2,2},
+ B = {1,1,1,1,0,1,2,0},
+ C = {1,1,1,1,0,0,0,0},
+ Db = {1,1,1,0,1,1,1,0},
+ D = {1,1,1,0,0,0,0,0},
+ Eb = {1,1,0,1,1,0,0,0},
+ E = {1,1,0,0,0,0,0,0},
+ f = {1,0,1,0,0,0,0,0},
+ gb = {0,1,1,0,0,0,0,0},
+ g = {0,0,1,0,0,0,0,0},
+ ab = {0,0,1,1,1,1,2,0},
+ a = {t,1,1,1,1,1,0,0},
+ bb = {t,1,1,1,1,0,2,0},
+ b = {t,1,1,1,0,1,0,0},
+ c = {t,1,1,1,0,0,0,0},
+ db = {t,1,1,0,1,0,0,0},
+ d = {t,1,1,0,0,0,0,0},
+ eb = {t,1,1,0,0,1,2,1},
+ e = {t,1,1,0,1,1,0,0},
+ f' = {t,1,0,0,1,1,0,0},
+ gb' = {t,1,0,1,1,0,2,2,1},
+ g' = {t,1,0,1,1,0,2,2},
+ ab' = {t,0,1,1,0,1,2,0}
+ }
+\AddFingerings{C}{
+ C = {1,1,1,1,1,1,2,2},
+ Db = {1,1,1,1,1,1,2,1},
+ D = {1,1,1,1,1,1,2,0},
+ Eb = {1,1,1,1,1,1,1,0},
+ E = {1,1,1,1,1,1,0,0},
+ F = {1,1,1,1,1,0,2,2},
+ Gb = {1,1,1,1,0,1,1,0},
+ G = {1,1,1,1,0,0,0,0},
+ Ab = {1,1,1,0,1,1,0,0},
+ A = {1,1,1,0,0,0,0,0},
+ Bb = {1,1,0,1,1,0,0,0},
+ B = {1,1,0,0,0,0,0,0},
+ c = {1,0,1,0,0,0,0,0},
+ db = {0,1,1,0,0,0,0,0},
+ d = {0,0,1,0,0,0,0,0},
+ eb = {0,0,1,1,1,1,2,0},
+ e = {t,1,1,1,1,1,0,0},
+ f = {t,1,1,1,1,0,2,0},
+ gb = {t,1,1,1,0,1,0,0},
+ g = {t,1,1,1,0,0,0,0},
+ ab = {t,1,1,0,1,0,0,0},
+ a = {t,1,1,0,0,0,0,0},
+ bb = {t,1,1,0,0,1,2,1},
+ b = {t,1,1,0,1,1,0,0},
+ c' = {t,1,0,0,1,1,0,0},
+ db' = {t,1,0,1,1,0,2,2,1},
+ d' = {t,1,0,1,1,0,2,2},
+ eb' = {t,0,1,1,0,1,2,0}
+}
+
+% Transposition tables (may be useful; currently not used)
+\prop_set_from_keyval:Nn \l_fingering_F_to_C_prop {
+ F = {C},
+ Gb = {Db},
+ G = {D},
+ Ab = {Eb},
+ A = {E},
+ Bb = {F},
+ B = {Gb},
+ C = {G},
+ Db = {Ab},
+ D = {A},
+ Eb = {Bb},
+ E = {B},
+ f = {c},
+ gb = {db},
+ g = {d},
+ ab = {eb},
+ a = {e},
+ bb = {f},
+ b = {gb},
+ c = {g},
+ db = {ab},
+ d = {a},
+ eb = {bb},
+ e = {b},
+ f' = {c'},
+ gb' = {db'},
+ g' = {d'},
+ ab' = {eb'}
+ }
+
+\prop_set_from_keyval:Nn \l_fingering_C_to_F_prop {
+ C = {F},
+ Db = {Gb},
+ D = {G},
+ Eb = {Ab},
+ E = {A},
+ F = {Bb},
+ Gb = {B},
+ G = {C},
+ Ab = {Db},
+ A = {D},
+ Bb = {Eb},
+ B = {E},
+ c = {f},
+ db = {gb},
+ d = {g},
+ eb = {ab},
+ e = {a},
+ f = {bb},
+ gb = {b},
+ g = {c},
+ ab = {db},
+ a = {d},
+ bb = {eb},
+ b = {e},
+ c' = {f'},
+ db' = {gb'},
+ d' = {g'},
+ eb' = {ab'}
+ }
+
+
+% Backwards (in)compatibility with the initial version of the package
+
+\NewDocumentCommand{\fingering}{}{
+ \msg_error:nn {recorder-fingering}{deprecated}}
+\ExplSyntaxOff
+\endinput
diff --git a/macros/latex/contrib/recorder-fingering/recorder-fingering.tex b/macros/latex/contrib/recorder-fingering/recorder-fingering.tex
new file mode 100644
index 0000000000..c2cfbe9cae
--- /dev/null
+++ b/macros/latex/contrib/recorder-fingering/recorder-fingering.tex
@@ -0,0 +1,276 @@
+% !TEX TS-program = LuaLaTeXmk
+
+\documentclass[11pt]{article}
+\usepackage{calc}
+\usepackage{fontspec}
+\usepackage[lmargin=.75in,rmargin=.75in,tmargin=1in,bmargin=1in]{geometry}
+\usepackage{titling}
+\usepackage{array, booktabs,tabularx}
+\usepackage{enumitem}
+\usepackage{fancyvrb}
+\usepackage{listings}
+\usepackage{url}
+\usepackage[sf,small]{titlesec}
+\usepackage[section]{placeins}
+\usepackage[colorlinks=true]{hyperref}
+\setmonofont{Inconsolatazi4}
+\usepackage{recorder-fingering}
+\usepackage{parskip}
+\usepackage{musixtex}
+\input musixlyr
+\usetikzlibrary{tikzmark}
+\usetikzlibrary{positioning}
+\NewDocumentCommand{\addf}{m}{\tikz[remember picture]{\node[overlay,above=of pic cs:#1]{\Soprano{#1}};}}
+\DefineShortVerb{\|}
+\title{The \texttt{recorder-fingering} package}
+\author{Alan Munn\\amunn@msu.edu}
+\date{Version 1.0\\February 17, 2023}
+
+\lstset{%
+ basicstyle=\ttfamily\small,
+ commentstyle=\itshape\ttfamily\small,
+ showspaces=false,
+ showstringspaces=false,
+ breaklines=true,
+ breakautoindent=true,
+ frame=single
+ captionpos=t
+ language=TeX
+}
+
+\newcommand*{\pkg}[1]{\texttt{#1}}
+\newcolumntype{t}{>{\ttfamily}r}
+\newcolumntype{T}{>{\ttfamily}c}
+\newcommand*{\bs}{\textbackslash}
+\setlength{\droptitle}{-1in}
+\renewcommand{\abstractname}{\sffamily Abstract}
+
+
+
+\begin{document}
+\maketitle
+\thispagestyle{empty}
+\begin{abstract}{\noindent
+The |recorder-fingering| package provides support for generating fingering diagrams for baroque fingering recorders. Standard fingerings are provided for recorders in both C and F, along with methods to create and display alternate fingerings for trills, etc.
+}
+\end{abstract}
+
+
+\section{Display commands}
+This package provides five commands (|\Sopranino|, |\Soprano|, |\Alto|, |\Tenor|, and |\Bass|)\footnote{Because \pkg{musixtex} defines commands \pkg{\bs alto} and \pkg{\bs bass} the fingering display commands are capitalized.} which will produce a fingering diagram for any note in the playable range of that recorder. At present, there are no differences between the three F recorders (sopranino, alto, and bass) and the two C recorders (soprano and tenor), so the different command names are simply there for convenience.
+
+
+\begin{table}[htpb]
+\centering
+\begin{tabularx}{.8\textwidth}{tX}
+\toprule
+\bs Sopranino [<parameters>]\{<note>\} & Display a fingering diagram for note in F\\
+\bs Soprano [<parameters>]\{<note>\} & Display a fingering diagram for note in C\\
+\bs Alto [<parameters>]\{<note>\} & Display a fingering diagram for note in F\\
+\bs Tenor [<parameters>]\{<note>\} & Display a fingering diagram for note in C\\
+\bs Bass [<parameters>]\{<note>\} & Display a fingering diagram for note in F\\
+\bottomrule
+\end{tabularx}
+\caption{Display commands}
+\end{table}
+\subsection{Note ranges and notation\label{Notes}}
+The notes range from C–Eb for recorders in C (|\Soprano| and |\Tenor|) or F–Ab for recorders in F (|\Sopranino| and |\Alto|).
+
+Notes are noted as C-B (first octave) c-b (second octave) and c'–eb' (third octave) with an equivalent scheme starting at F for the recorders in F.
+\subsection{Display parameters}
+Each display command allows two display parameters to be set.
+
+\begin{table}[htpb]
+\centering
+\begin{tabularx}{.9\textwidth}{tX}
+\toprule
+thumboffset = <true/false> & Display the thumb hole offset or not (default = \pkg{true})\\
+width = <length> & Width of the diagram (default = \pkg{20pt}). Height adjusts proportionally\\
+\bottomrule
+\end{tabularx}
+\caption{Display parameters}
+\end{table}
+
+The |width| parameter sets the width of the diagram; it defaults to |20pt| for the default thumb offset diagrams. If you set |thumboffset=false| you will probably want to choose a smaller value e.g. |10pt|.
+
+You can set the parameters individually for any particular display command, but most likely you'll want global settings. To set the parameters globally use the command |\fingeringSetup|
+
+e.g. |\fingeringSetup{width=12pt,thumboffset=false}| makes all diagrams use an inline thumb hole and 12pt width.
+\begin{table}[htpb]
+\centering
+\begin{tabular}{TT}
+\pkg{\bs Alto\{c\}} & \pkg{\bs Soprano[width=10pt,thumboffset=false]\{f\}}\\
+\\
+\Alto{c} & \Soprano[width=10pt,thumboffset=false]{f}
+\end{tabular}
+\caption{Example fingering commands}
+\end{table}
+\section{Producing new fingerings}
+
+There are three commands to add new fingerings to the predefined list, or in fact, to change the existing defaults.
+\subsection{Note names}
+Although the basic predefined fingerings use the note naming schema outlined in section \ref{Notes}, the note names themselves are arbitrary. This allows you to add trill fingerings or alternate fingerings with meaningful names, e.g. |ftrill| or |altF| are possible names for new fingerings.
+\subsection{Fingering vectors}
+Fingerings are specified using an 8 (and possibly 9) element comma separated list. Each position in the list denotes a hole starting from the thumb (position 0) to the bell (position 8). Each hole position is indicated by a hole state according to the following scheme:
+
+\begin{table}[htpb]
+\centering
+\begin{tabularx}{.8\textwidth}{tX}
+\toprule
+0 & open hole\\
+1 & closed hole (positions 0-5); single closed hole (positions 6,7)\\
+2 & double closed hole (positions 6,7 only)\\
+t & half hole (thumb)\\
+h & half hole (positions 1-5)\\
+\bottomrule
+\end{tabularx}
+\caption{Hole states}
+\end{table}
+\subsection{New fingering commands}
+
+Two commands |\NewFfingering| and |\NewCfingering| are designed to add a single fingering. They check whether the name for the fingering is already used and produce an error if so. To overwrite an existing fingering, use |\NewFfingering*| and |\NewCfingering*|.
+
+The third command is designed to enter a set of new fingerings at once. It will override any existing note names. It takes two arguments, a key, and a key value list consisting of note names plus fingering vectors.
+
+\begin{table}[htpb]
+\centering
+\begin{tabularx}{.8\textwidth}{X}
+\toprule
+\texttt{\bs NewFfingering\{<notename>\}\{<fingering vector>\}} \\\rule{3em}{0pt}Add a new note and fingering to the F recorder set\\
+\texttt{\bs NewCfingering\{<notename>\}\{<fingering vector>\}} \\\rule{3em}{0pt} Add a new note and fingering to the C recorder set\\
+\texttt{\bs AddFingerings\{<key>\}\{<note = \{<fingering vector>\}\}} \\\rule{3em}{0pt} Add a set of new fingerings to the F or C recorder set\\
+\bottomrule
+\end{tabularx}
+\caption{Commands for adding new fingerings}
+\end{table}
+%\clearpage
+\subsection{New fingering examples}
+\NewFfingering{ABbtrill}{0,1,1,1,1,1,0,0}
+\AddFingerings{C}{
+ EFtrill = {0,1,1,1,1,1,0,0},
+ altd = {0,1,1,1,1,1,2,2}
+}
+\begin{lstlisting}
+\NewFfingering{ABbtrill}{0,1,1,1,1,1,0,0}
+\Alto{ABbtrill}
+\end{lstlisting}
+\Alto{ABbtrill}
+
+\begin{lstlisting}
+\AddFingerings{C}{
+ EFtrill = {0,1,1,1,1,1,0,0},
+ altd = {0,1,1,1,1,1,2,2}
+}
+\Soprano{EFtrill}
+\Soprano{altd}
+\end{lstlisting}
+
+\Soprano{EFtrill}
+\Soprano{altd}
+
+\section{Version History}
+Version 0.5 of this package (the initial version) was in response to a \href{https://tex.stackexchange.com/q/674847/2693}{TeX.se question} and used a substantially different set of user commands. The current version (1.0) is more flexible and has a more useable user interface. Bug reports and feature requests are welcome at the \href{https://github.com/amunn/recorder-fingering/issues}{GitHub bug tracker}.
+\section{Acknowledgements}
+This is my first attempt to write a package using |expl3|. Thanks to Jonathan P. Spratte for suggesting how to split fingering vectors and the various LaTeX development team members (David Carlisle, Ulrike Fischer, Phelype Olenik and Joseph Wright) who have answered random |expl3| questions in the TeX.se chat. Thanks also to all the TeX.se users who have both asked and answered questions on the site. Your questions encourage new packages like this one and your answers help make the code better.
+\clearpage
+\section{Samples} The chart below shows all of the possible fingerings.
+
+\section*{Recorder in C soprano chart}
+\begin{tabular}{cccccccccccc}
+\toprule
+C & Db & D & Eb & E & F & Gb & G & Ab & A & Bb & B\\
+\midrule
+\Soprano{C} &
+\Soprano{Db} &
+\Soprano{D} &
+\Soprano{Eb} &
+\Soprano{E} &
+\Soprano{F} &
+\Soprano{Gb} &
+\Soprano{G} &
+\Soprano{Ab} &
+\Soprano{A} &
+\Soprano{Bb} &
+\Soprano{B}\\
+\bottomrule
+\end{tabular}
+
+\bigskip
+\begin{tabular}{cccccccccccc}
+\toprule
+c & db & d & eb & e & f & gb & g & ab & a & bb & b\\
+\midrule
+\Soprano{c} &
+\Soprano{db} &
+\Soprano{d} &
+\Soprano{eb} &
+\Soprano{e} &
+\Soprano{f} &
+\Soprano{gb} &
+\Soprano{g} &
+\Soprano{ab} &
+\Soprano{a} &
+\Soprano{bb} &
+\Soprano{b}\\
+\bottomrule
+\end{tabular}
+
+\fingeringSetup{width=10pt,thumboffset=false}
+\bigskip
+
+Here's what the fingering diagrams look like with |thumboffset=false|:
+
+
+\begin{tabular}{cccc}
+\toprule
+c' & db' & d' & eb'\\
+\midrule
+\Soprano{c'} &
+\Soprano{db'} &
+\Soprano{d'} &
+\Soprano{eb'}\\
+\bottomrule
+\end{tabular}
+\clearpage
+\section{Using in conjunction with \texttt{musixtex}}
+\fingeringSetup{thumboffset=true,width=12pt}
+It's simple to add fingerings on top of musical excerpts created with |musixtex| using the |tikzmark| library to place the fingerings. Here's a sample of what you can do, with the code below.
+
+\subsection*{C Maj scale Soprano/Tenor recorder fingerings}
+\vspace{\heightof{\Soprano{C}}+\baselineskip}
+\begin{music}
+\setlyrics{scale}{C D E F G A B C}
+\lyrraise{1}{b-2ex}
+\assignlyrics{1}{scale}
+\startextract
+\NOTEs
+\tikzmark{C}\wh{c}\tikzmark{D}\wh{d}\tikzmark{E}\wh{e}\tikzmark{F}\wh{f}
+\tikzmark{G}\wh{g}\tikzmark{A}\wh{h}\tikzmark{B}\wh{i}\tikzmark{c}\wh{j}
+\en
+\zendextract
+\end{music}
+\addf{C}\addf{D}\addf{E}\addf{E}\addf{F}\addf{G}\addf{A}\addf{B}\addf{c}
+\begin{lstlisting}
+%\usetikzlibrary{tikzmark} % in document premable
+%\usetikzlibrary{positioning} % in document preamble
+%\usepackage{calc} % in document preamble
+% Helper command to place each fingering
+\NewDocumentCommand{\addf}{m}{\tikz[remember picture]{\node[overlay,above=of pic cs:#1]{\Soprano{#1}};}}
+% add vertical space for the height of the diagram
+\vspace{\heightof{\Soprano{C}}+\baselineskip}
+\begin{music}
+\setlyrics{scale}{C D E F G A B C}
+\lyrraise{1}{b-2ex}
+\assignlyrics{1}{scale}
+\startextract
+\NOTEs
+% add \tikzmark for before each note
+\tikzmark{C}\wh{c}\tikzmark{D}\wh{d}\tikzmark{E}\wh{e}\tikzmark{F}\wh{f}
+\tikzmark{G}\wh{g}\tikzmark{A}\wh{h}\tikzmark{B}\wh{i}\tikzmark{c}\wh{j}
+\en
+\zendextract
+\end{music}
+% use the helper function to add the fingerings (requires two compilations)
+\addf{C}\addf{D}\addf{E}\addf{E}\addf{F}\addf{G}\addf{A}\addf{B}\addf{c}
+\end{lstlisting}
+\end{document}
diff --git a/macros/latex/contrib/thmtools/doc/changes.txt b/macros/latex/contrib/thmtools/doc/changes.txt
index 0acc0b7c62..97bbbfdcdc 100644
--- a/macros/latex/contrib/thmtools/doc/changes.txt
+++ b/macros/latex/contrib/thmtools/doc/changes.txt
@@ -59,3 +59,13 @@
* thmdef-thmbox.dtx:
canceled thmbox's modification to \\proof, #32
+
+2023-02-18 Yukai Chou <muzimuzhi@gmail.com>
+
+ * thmtools-manual.tex:
+ fell back to `doc` v2 to not overwrite redefinition of `\DescribeMacro`,
+ hence not typeset in marginal notes #33
+ adjusted pagination
+
+ * thm-kv.dtx:
+ wrapped long code lines to avoid exceeding the page margin
diff --git a/macros/latex/contrib/thmtools/doc/thmtools-manual.pdf b/macros/latex/contrib/thmtools/doc/thmtools-manual.pdf
index f7bf297494..7e1bd87645 100644
--- a/macros/latex/contrib/thmtools/doc/thmtools-manual.pdf
+++ b/macros/latex/contrib/thmtools/doc/thmtools-manual.pdf
Binary files differ
diff --git a/macros/latex/contrib/thmtools/doc/thmtools-manual.tex b/macros/latex/contrib/thmtools/doc/thmtools-manual.tex
index 93e8942556..fb7e950d39 100644
--- a/macros/latex/contrib/thmtools/doc/thmtools-manual.tex
+++ b/macros/latex/contrib/thmtools/doc/thmtools-manual.tex
@@ -1,6 +1,6 @@
% !TeX program = pdflatex
\documentclass[paper=a4, pagesize, DIV=20,
- english,
+ english,
headings=small,11pt,
titlepage=false,
numbers=noendperiod
@@ -14,13 +14,16 @@
\usepackage[dvipsnames]{xcolor}
-\usepackage{doc,shortvrb,xspace}
+\usepackage{doc}[=v2] % to achieve max backward compatibility
+\usepackage{shortvrb,xspace}
\makeatletter
% to be fixed at some point...
-\let\PrintDescribeMacro\@gobble
-\let \PrintDescribeEnv\@gobble
-\let \PrintMacroName\@gobble
-\let \PrintEnvName\@gobble
+\AtBeginDocument{% prepare for doc v3
+ \let\PrintDescribeMacro\@gobble
+ \let \PrintDescribeEnv\@gobble
+ \let \PrintMacroName\@gobble
+ \let \PrintEnvName\@gobble
+}
\makeatother
\CodelineNumbered
@@ -172,29 +175,29 @@
\begin{document}
\maketitle
\section*{\abstractname}
-
+
The \thmtools bundle is a collection of packages that is designed to
provide an easier interface to theorems, and to facilitate some more
advanced tasks.
-
+
If you are a first-time user and you don't think your requirements are out
of the ordinary, browse the examples in \autoref{cha:impatient}. If you're
here because the other packages you've tried so far just can't do what you
want, take inspiration from \autoref{cha:extravagant}. If you're a repeat
customer, you're most likely to be interested in the refence section in
\autoref{cha:reference}.
-
+
\begin{multicols}{2}[\section*{\contentsname}]
\makeatletter
\let\chapter\@gobbletwo
\tableofcontents
\end{multicols}
\clearpage
-
+
\chapter{\Thmtools for the impatient}\label{cha:impatient}
-
+
\section*{How to use this document}
-
+
This guide consists mostly of examples and their output, sometimes with a
few additional remarks. Since theorems are defined in the preamble and
used in the document, the snippets are two-fold:
@@ -234,16 +237,16 @@
is infinite.
\end{restatable}
\end{result}
-
+
Note that in all cases, you will need a \emph{backend} to provide the
command |\newtheorem| with the usual behaviour. The \LaTeX\
kernel has a built-in backend which cannot do very much; the most common
- backends these days are the \pkg{amsthm} and \pkg{ntheorem} packages.
+ backends these days are the \pkg{amsthm} and \pkg{ntheorem} packages.
Throughout this document, we'll use \pkg{amsthm}, and some of the features
won't work with \pkg{ntheorem}.
-
+
\section{Elementary definitions}
-
+
As you have seen above, the new command to define theorems is
|\declaretheorem|, which in its most basic form just takes the
name of the environment. All other options can be set through a key-val
@@ -267,15 +270,15 @@
In particular, there are infinitely many primes.
\end{restatable}
\end{result}
-
+
Instead of |numberwithin=|, you can also use |parent=| and
|within=|. They're all the same, use the one you find easiest to
remember.
-
- Note the example above looks somewhat bad: sometimes, the name of the environment,
+
+ Note the example above looks somewhat bad: sometimes, the name of the environment,
with the first
letter uppercased, is not a good choice for the theorem's title.
-
+
\begin{source}
\begin{preamble}[gobble=4]
\usepackage{amsthm}
@@ -293,13 +296,13 @@
Prove Euclid's Theorem.
\end{exercise}
\end{result}
-
+
To save you from having to look up the name of the key every time, you can
also use |title=| and |heading=| instead of |name=|; they do exactly
the same and hopefully one of these will be easy to remember for you.
Of course, you do not have to follow the abominal practice of numbering
- theorems, lemmas, etc., separately:
+ theorems, lemmas, etc., separately:
\begin{source}
\begin{preamble}[gobble=4]
\usepackage{amsthm}
@@ -309,14 +312,14 @@
\begin{body}[gobble=4]
\begin{lemma}
For every prime $p$, there is a prime $p'>p$.
- In particular, there are infinitely many primes.
+ In particular, there are infinitely many primes.
\end{lemma}
\end{body}
\end{source}
\begin{result}
\begin{lemma}
For every prime $p$, there is a prime $p'>p$.
- In particular, there are infinitely many primes.
+ In particular, there are infinitely many primes.
\end{lemma}
\end{result}
@@ -336,14 +339,14 @@
\begin{body}[gobble=4]
\begin{euclid}
For every prime $p$, there is a prime $p'>p$.
- In particular, there are infinitely many primes.
+ In particular, there are infinitely many primes.
\end{euclid}
\end{body}
\end{source}
\begin{result}
\begin{euclid}
For every prime $p$, there is a prime $p'>p$.
- In particular, there are infinitely many primes.
+ In particular, there are infinitely many primes.
\end{euclid}
\end{result}
@@ -384,19 +387,19 @@
Buck \& Britta
\end{couple}
\end{result}
-
+
\change{New}{2020/08/01} Actually, the mandatory argument of |\declaretheorem| accepts a list of environment names, so you can define similar theorems at once. Moreover, similar to |\setmainfont| from \pkg{fontspec} package, the key-value interface can be used both before and after the mandatory argument.
\begin{source}
\begin{preamble}[gobble=4]
\declaretheorem[numberwithin=section]
{theorem, definition}
\declaretheorem{lemma, proposition, corollary}[
- style=plain,
+ style=plain,
numberwithin=theorem
]
\end{preamble}
\end{source}
-
+
\clearpage
\section{Frilly references}
@@ -421,7 +424,7 @@
cleveref,% \cref
% n.b. cleveref after! hyperref
}
- \declaretheorem[name=Theorem,
+ \declaretheorem[name=Theorem,
refname={theorem,theorems},
Refname={Theorem,Theorems}]{callmeal}
\end{preamble}
@@ -430,11 +433,11 @@
One
\end{callmeal}
\begin{callmeal}\label{garfunkel}
- and another, and together,
+ and another, and together,
\autoref{simon}, ``\nameref{simon}'',
- and \cref{garfunkel} are referred
+ and \cref{garfunkel} are referred
to as \cref{simon,garfunkel}.
- \Cref{simon,garfunkel}, if you are at
+ \Cref{simon,garfunkel}, if you are at
the beginning of a sentence.
\end{callmeal}
\end{body}
@@ -452,7 +455,7 @@
\section{Styling theorems}
\label{sec:styling}
-
+
The major backends provide a command |\theoremstyle| to switch
between looks of theorems. This is handled as follows:
\begin{source}
@@ -464,7 +467,7 @@
\end{preamble}
\begin{body}[gobble=4]
\begin{Theorem}
- Note how it still retains the default style,
+ Note how it still retains the default style,
`plain'.
\end{Theorem}
\begin{remark}
@@ -474,14 +477,14 @@
\end{source}
\begin{result}
\begin{Theorem}
- Note how it still retains the default style,
+ Note how it still retains the default style,
`plain'.
\end{Theorem}
\begin{remark}
This is a remark.
\end{remark}
\end{result}
-
+
\newpage
Thmtools also supports the \pkg{shadethm} and \pkg{thmbox} packages:
\begin{source}
@@ -522,7 +525,7 @@
|\definecolor{colorname}|$\langle$\textsl{what you said}$\rangle$ will be
valid \LaTeX\ code. In our case, we use the |rgb| model to manually specify
white. (|shadethm|'s default background color is {\fboxsep=0pt \fcolorbox{black}[gray]{0.92}{\phantom{XX}}} |[gray]{0.92}|)
-
+
For the \pkg{thmbox} package, use the |thmbox| key:
\begin{source}
\begin{preamble}[gobble=4]
@@ -565,11 +568,12 @@
Note that for both |thmbox| and |shaded| keys, it's quite possible they will not
cooperate with a style key you give at the same time.
+ \newpage
\subsection{Declaring new theoremstyles}
-
+
\Thmtools\ also offers a new command to define new theoremstyles. It is
partly a frontend to the |\newtheoremstyle| command of \pkg{amsthm} or
- \pkg{ntheorem}, but it offers (more or less successfully) the settings of both to
+ \pkg{ntheorem}, but it offers (more or less successfully) the settings of both to
either. So we are talking about the same things, consider the sketch in
\autoref{fig:params}. To get a result like that, you would use something
like
@@ -598,21 +602,21 @@
\end{result}
Again, the defaults are reasonable and you don't
have to give values for everything.
-
+
There is one important thing you cannot see in this example: there are
more keys you can pass to |\declaretheoremstyle|: if \thmtools\ cannot
figure out at all what to do with it, it will pass it on to the
|\declaretheorem| commands that use that style. For example, you may use
the |boxed| and |shaded| keys here.
-
+
To change the order in which title, number and note appear, there is a key
|headformat|. Currently, the values ``margin'' and ``swapnumber'' are
supported. The daring may also try to give a macro here that uses the
- commands |\NUMBER|, |\NAME| and |\NOTE|.
+ commands |\NUMBER|, |\NAME| and |\NOTE|.
You cannot circumvent the fact
that |headpunct| comes at the end, though, nor the fonts and braces you
select with the other keys.
-
+
\begin{figure}
\centering
\fbox{%
@@ -628,26 +632,26 @@
},
tip/.style={|<->|}
]
- \node[black, font=\Large, text width=.618\textwidth, align=justify]
+ \node[black, font=\Large, text width=.618\textwidth, align=justify]
{%
which resulted in the following insight: \\
\subnode{space above}{\rule{0pt}{1.3\baselineskip}} \\
\subnode{head indent}{\strut\hspace*{4em}}
\textbf{%
- \subnode{head}{Theorem} 1.2
+ \subnode{head}{Theorem} 1.2
\subnode{note brace}{(}%
\subnode{note}{\textit{Euclid}})%
\subnode{head punct}{.} %
}
\subnode{post head space}{\strut\hspace*{4.5em}}
- For every prime~$p$, there is a prime~$p'>p$. In particular, the list
+ For every prime~$p$, there is a prime~$p'>p$. In particular, the list
of primes, $2,3,5,7,\dots$, is infinite. \hfill
\subnode{qed}{$\Box$} \\
\subnode{space below}{\rule{0pt}{1.3\baselineskip}} \\
As a consequence, lorem ipsum dolor sit amet frob-%nicate foo
% paret.
};
-
+
\draw[tip] (space above.south west) -- node[right] {spaceabove} (space above.north west);
\draw[tip] (head indent.west) -- node[above] {headindent} (head indent.east);
\draw (head.center) -- +(0, 10pt) node[above] {headfont};
@@ -663,8 +667,9 @@
\label{fig:params}
\end{figure}
+ \newpage
\section{Repeating theorems}
-
+
Sometimes, you want to repeat a theorem you have given in full earlier,
for example you either want to state your strong result in the
introduction and then again in the full text, or you want to re-state a
@@ -698,16 +703,16 @@
\vdots
\firsteuclid*
\end{result}
-
+
Note that in spite of being a theorem-environment, it gets number one all
- over again. Also, we get equation number~\eqref{eq:1} again. The star in
+ over again. Also, we get equation number~\eqref{eq:1} again. The star in
|\firsteuclid*| tells thmtools that it should redirect the label
mechanism, so that this reference: \autoref{thm:euclid} points to
p.\,\pageref{thm:euclid}, where the unstarred environment is used. (You can
also use a starred environment and an unstarred command, in which case the
behaviour is reversed.) Also, if you use \pkg{hyperref} (like you see in this manual), the links will lead you
to the unstarred occurence.
-
+
Just to demonstrate that we also handle more involved cases, I repeat
another theorem here, but this one was numbered within its section: note
we retain the section number which does not fit the current section:
@@ -720,9 +725,9 @@
\euclidii*
\end{result}
-
+ \newpage
\section{Lists of theorems}
-
+
To get a list of theorems with default formatting, just use
|\listoftheorems|:
\begin{source}
@@ -735,12 +740,12 @@
\let\clearpage\relax
\listoftheorems
\end{result}
-
+
Not everything might be of the same importance, so you can filter out
things by environment name:
\begin{source}
\begin{body}[gobble=6]
- \listoftheorems[ignoreall,
+ \listoftheorems[ignoreall,
show={theorem,Theorem,euclid}]
\end{body}
\end{source}
@@ -749,14 +754,14 @@
\let\clearpage\relax
\listoftheorems[ignoreall, show={theorem,Theorem,euclid}]
\end{result}
-
+
And you can also restrict to those environments that have an optional
argument given. Note that two theorems disappear compared to the previous
example. You could also say just |onlynamed|, in which case it will
apply to \emph{all} theorem environments you have defined.
\begin{source}
\begin{body}[gobble=6]
- \listoftheorems[ignoreall,
+ \listoftheorems[ignoreall,
onlynamed={theorem,Theorem,euclid}]
\end{body}
\end{source}
@@ -770,9 +775,9 @@
%And finally, you can configure |\listoftheorems| in advance by |\setlisttheoremstyle{keys}|.
\section{Extended arguments to theorem environments}
-
+
Usually, the optional argument of a theorem serves just to give a note
- that is shown in the theorem's head. \Thmtools\ allows you to have a
+ that is shown in the theorem's head. \Thmtools\ allows you to have a
key-value list here as well. The following keys are known right now:
\begin{description}
\item[name] This is what used to be the old argument. It usually holds
@@ -781,15 +786,15 @@
aware that since we already are within an optional argument, you have to
use an extra level of curly braces:
|\begin{theorem}[name={[Short name]A long name,...]}|
-
+
\item[label] This will issue a |\label| command after the head. Not very
useful, more of a demo.
-
+
\item[continues] Saying |continues=foo| will cause the number that is
given to be changed to |\ref{foo}|, and a text is added to the note.
(The exact text is given by the macro |\thmcontinues|, which takes the
label as its argument.)
-
+
\item[restate] Saying |restate=foo| will hopefully work like
wrapping this theorem in a restatable environment. (It probably still fails
in cases that I didn't think of.) This key also accepts an optional
@@ -801,9 +806,9 @@
\end{description}
\begin{source}
\begin{body}[gobble=6]
- \begin{theorem}[name=Keyed theorem,
+ \begin{theorem}[name=Keyed theorem,
label=thm:key]
- This is a
+ This is a
key-val theorem.
\end{theorem}
\begin{theorem}[continues=thm:key]
@@ -812,7 +817,7 @@
\end{body}
\end{source}
\begin{result}
- \begin{theorem}[name=Keyed theorem,
+ \begin{theorem}[name=Keyed theorem,
label=thm:key]
This is a key-val theorem.
\end{theorem}
@@ -821,7 +826,7 @@
\end{theorem}
\end{result}
-
+
\chapter{\Thmtools for the extravagant}\label{cha:extravagant}
@@ -829,7 +834,7 @@
of this bundle. In particular, it will demonstrate how to use the general
hooks provided to extend theorems in the way you want them to behave.
Again, this is done mostly by some examples.
-
+
\section{Understanding \thmtools' extension mechanism}
\Thmtools\ draws most of its power really only from one feature:
@@ -838,20 +843,20 @@
|\endtheorem|. To add functionality, four places immediately
suggest themselves: ``immediately before'' and ``immediately after'' those
two.
-
+
There are two equivalent ways of adding code there: one is to call
|\addtotheorempreheadhook| and its brothers and sisters
|...postheadhook|, |...prefoothook|
and |...postfoothook|.
All of these take an \emph{optional} argument, the name of the
- environment, and the new code as a mandatory argument. The name of environment is
+ environment, and the new code as a mandatory argument. The name of environment is
optional because there is also a set of ``generic'' hooks added to every
theorem that you define.
-
+
The other way is to use the keys |preheadhook| et al. in your
|\declaretheorem|. (There is no way of accessing the generic
hook in this way.)
-
+
The hooks are arranged in the following way: first the specific prehead,
then the generic one. Then, the original |\theorem| (or
whatever) will be called. Afterwards, first the specific posthead again,
@@ -862,9 +867,9 @@
easily by adding to the prehead and the postfoot hooks. Note that
\thmtools\ does not look inside |\theorem|, so you cannot get
inside the head formatting, spacing, punctuation in this way.
-
+
In many situations, adding static code will not be enough. Your code can
- look at |\thmt@envname|, |\thmt@thmname| and
+ look at |\thmt@envname|, |\thmt@thmname| and
|\thmt@optarg|, which will contain the name of the environment,
its title, and, if present, the optional argument (otherwise, it is
|\@empty|).
@@ -875,17 +880,17 @@
\section{Case in point: the \texttt{shaded} key}
-
+
Let us look at a reasonably simple example: the |shaded| key, which we've
already seen in the first section. You'll observe that we run into a
problem similar to the four-hook mess: your code may either want to modify
- parameters that need to be set beforehand, or it wants to modify the
+ parameters that need to be set beforehand, or it wants to modify the
environment after it has been created. To hide this from the user, the
code you define for the key is actually executed twice, and
|\thmt@trytwice{A}{B}| will execute A on the first pass, and B
on the second. Here, we want to add to the hooks, and the hooks are only
there in the second pass.
-
+
\DocInput{thmdef-shaded.dtx}
\section{Case in point: the \texttt{thmbox} key}
@@ -894,41 +899,41 @@
\section{Case in point: the \texttt{mdframed} key}
\DocInput{thmdef-mdframed.dtx}
-
+
\section{How \thmtools\ finds your extensions}
Up to now, we have discussed how to write the code that adds functionality
- to your theorems, but you don't know how to activate it yet.
+ to your theorems, but you don't know how to activate it yet.
Of course, you can put it in your preamble, likely embraced by
|\makeatletter| and |\makeatother|, because you are
using internal macros with @ in their name (viz.,
|\thmt@envname| and friends). You can also put them into a
- package (then, without the |\makeat...|),
+ package (then, without the |\makeat...|),
which is simply a file ending in |.sty| put somewhere that \LaTeX\ can find
it, which can then be loaded with |\usepackage|.
To find out where exactly that is, and if you'd need to update
- administrative helper files such as a filename database FNDB,
+ administrative helper files such as a filename database FNDB,
please consult the documentation of your \TeX\ distribution.
-
+
Since you most likely want to add keys as well, there is a shortcut that
\thmtools\ offers you: whenever you use a key |key| in a
|\declaretheorem| command, and \thmtools\ doesn't already know
what to do with it, it will try to |\usepackage{thmdef-key}| and
evaluate the key again. (If that doesn't work, \thmtools\ will cry
bitterly.)
-
+
For example, there is no provision in \thmtools\ itself that make the
|shaded| and |thmbox| keys described above special:
in fact, if you want to use a different package to create frames, you just
put a different |thmdef-shaded.sty| into a preferred texmf tree.
Of course, if your new package doesn't offer the old keys, your old
documents might break!
-
+
The behaviour for the keys in the style definition is slightly different:
if a key is not known there, it will be used as a ``default key'' to every
theorem that is defined using this style. For example, you can give the
|shaded| key in a style definition.
-
+
Lastly, the key-val arguments to the theorem environments themselves need
to be loaded manually, not least because inside the document it's too late
to call |\usepackage|.
@@ -957,19 +962,19 @@
theorem is typeset, inside a group. Intended use it to put font switches here.
\key{notefont}
- Value: \TeX\ code. Executed just before the note in the head is typeset, inside a group.
+ Value: \TeX\ code. Executed just before the note in the head is typeset, inside a group.
Intended use it to put font switches here. Formatting also applies to
the braces around the note.
Not supported by \pkg{ntheorem}.
- \key{bodyfont}
+ \key{bodyfont}
Value: \TeX\ code. Executed before the begin part of the theorem ends,
but before all afterheadhooks. Intended use it to put font switches here.
-
+
\key{headpunct}
Value: \TeX\ code, usually a single character. Put at the end of the
theorem's head, prior to linebreaks or indents.
-
+
\key{notebraces}
Value: Two characters, the opening and closing symbol to use around a
theorem's note.
@@ -986,12 +991,12 @@
for |\NOTE| etc.) three parts of a theorem's head. This can be used to
override the usual style ``1.1 Theorem (Foo)'', for example to let the
numbers protude in the margin or put them after the name.
-
+
Additionally, a number of keywords are allowed here instead of \LaTeX\
code:
\begin{description}
\item[margin] Lets the number protrude in the (left) margin.
-
+
\item[swapnumber] Puts the number before the name. Currently
not working so well for unnumbered theorems.
\item[] \emph{This list is likely to grow}
@@ -1016,18 +1021,18 @@
\key{within}
(Same as |parent|.)
-
+
\key{sibling}
Value: a counter name. The theorem will use this counter for numbering.
Usually, this is the name of another theorem environment.
-
+
\key{numberlike}
(Same as |sibling|.)
-
+
\key{sharenumber}
(Same as |sibling|.)
-
+
\key{title}
Value: \TeX\ code. The title of the theorem. Default is the name of the
environment, with |\MakeUppercase| prepended. You'll have to give
@@ -1038,22 +1043,22 @@
\key{heading}
(Same as |title|.)
-
+
\key{numbered}
Value: one of the keywords |yes|, |no| or |unless unique|. The theorem
will be numbered, not numbered, or only numbered if it occurs more than
once in the document. (The latter requires another \LaTeX\ run and works well combined with |sibling|.)
-
+
\key{style}
Value: the name of a style defined with |\declaretheoremstyle| or
|\newtheoremstyle|. The theorem will use the settings of this style.
-
+
\key{preheadhook}
Value: \LaTeX\ code. This code will be executed at the beginning of the
environment, even before vertical spacing is added and the head is
typeset. However, it is already within the group defined by the
environment.
-
+
\key{postheadhook}
Value: \LaTeX\ code. This code will be executed after the call to the
original begin-theorem code. Note that all backends seem to delay
@@ -1064,12 +1069,12 @@
\key{prefoothook}
Value: \LaTeX\ code. This code will be executed at the end of the body
of the environment.
-
+
\key{postfoothook}
Value: \LaTeX\ code. This code will be executed at the end of the
environment, even after eventual vertical spacing, but still within the
group defined by the environment.
-
+
\key{refname}
Value: one string, or two strings separated by a comma (no spaces). This
is the name of the theorem as used by |\autoref|, |\cref| and friends. If it is
@@ -1084,7 +1089,7 @@
used for alternate spellings, for example if your style requests no
abbreviations at the beginning of a sentence. No default.
-
+
\key{shaded}
Value: a key-value list, where the following keys are possible:
\begin{description}
@@ -1101,10 +1106,10 @@
\item[margin]
The length by which the shade box surrounds the text.
\end{description}
-
+
\key{thmbox}
Value: one of the characters |L|, |M| and |S|; see examples in \autoref{sec:styling}.
-
+
\section{Known keys to in-document theorems}
\def\keydefaultcontext{theorem}
@@ -1117,7 +1122,7 @@
non-keyval style, i.e. the note to the head. This is \emph{not} the same
as the |name| key to |\declaretheorem|, you cannot override that from within
the document.
-
+
\key{listhack} Value: doesn't matter. (But put something to trigger
key-val behaviour, maybe |listhack=true|.) Linebreak styles in \pkg{amsthm}
don't linebreak if they start with another list, like an |enumerate|
@@ -1129,19 +1134,19 @@
\section{Known keys to \texttt{\textbackslash listoftheorems}}
\def\keydefaultcontext{listof}
-
+
\key{title} Value: title of |\listoftheorems|. Initially |List of Theorems|.
-
+
\key{ignore} Value: list of theorem environment names. Filter out things by environment names. Default value is list of all defined theorem environments.
-
+
\key{ignoreall} Ignore every theorem environment. This key is usually followed by keys |show| and |onlynamed|.
-
+
\key{show} Value: list of theorem environments. Leave theorems that belong to specified list and filter out others. Default value is list of all defined theorem environments.
-
+
\key{showall} The opposite effect of |ignoreall|.
-
+
\key{onlynamed} Value: list of theorem environments. Leave things that are given an optional argument and belong to specified list, and filter out others. Default value is list of all defined theorem environments.
-
+
\key{swapnumber} Value: |true| or |false|. Initially |false| and default value is |true|. No default.
\begin{source}
\begin{body}[gobble=6]
@@ -1158,7 +1163,7 @@
\vspace{-1ex}
\listoftheorems[ignoreall, onlynamed={lemma}, swapnumber]
\end{result}
-
+
\key{numwidth} Value: a length. If |swapnumber=false|, the theorem number is typeset in a box of of width |numwidth|. Initially |1.5pc| for AMS classes and |2.3em| for others.
\section{Restatable -- hints and caveats}
@@ -1186,14 +1191,14 @@
circumstances, either. Only one I could think of: multiple subequation
blocks that partially overlap the theorem. Dude, that doesn't even nest.
You get what you deserve.
-
+
\item |\label| and \pkg{amsmath}'s |\ltx@label| are disabled inside the
starred execution. Possibly, |\phantomsection| should be disabled as
well?
\end{itemize}
\appendix
-
+
\chapter{\Thmtools for the morbidly curious}\label{cha:sourcecode}
@@ -1203,7 +1208,7 @@
rag with you.
\section{Core functionality}
-
+
\subsection{The main package}
\DocInput{thmtools.dtx}
@@ -1219,11 +1224,11 @@
\subsection{Re-using environments}
\DocInput{thm-restate.dtx}
- \subsection{Fixing \texttt{autoref} and friends}
+ \subsection{Fixing \texttt{autoref} and friends}
\DocInput{thm-autoref.dtx}
\section{Glue code for different backends}
-
+
\subsection{\texttt{amsthm}}
\DocInput{thm-amsthm.dtx}
@@ -1232,19 +1237,19 @@
\subsection{\texttt{ntheorem}}
\DocInput{thm-ntheorem.dtx}
-
+
\section{Generic tools}
-
+
\subsection{A generalized argument parser}
\DocInput{parseargs.dtx}
-
+
\subsection{Different counters sharing the same register}
\DocInput{aliasctr.dtx}
-
+
\subsection{Tracking occurrences: none, one or many}
\DocInput{unique.dtx}
+
-
-
+
\end{document}
diff --git a/macros/latex/contrib/thmtools/source/VERSION.tex b/macros/latex/contrib/thmtools/source/VERSION.tex
index bfdd191c56..b93d3d5934 100644
--- a/macros/latex/contrib/thmtools/source/VERSION.tex
+++ b/macros/latex/contrib/thmtools/source/VERSION.tex
@@ -1 +1 @@
-\def\VERSION{2023/02/04 v0.74}
+\def\VERSION{2023/02/17 v0.75}
diff --git a/macros/latex/contrib/thmtools/source/thm-kv.dtx b/macros/latex/contrib/thmtools/source/thm-kv.dtx
index 7859126274..9fb16c499f 100644
--- a/macros/latex/contrib/thmtools/source/thm-kv.dtx
+++ b/macros/latex/contrib/thmtools/source/thm-kv.dtx
@@ -270,14 +270,19 @@
\else
\protected@edef\thmt@tmp{%
% expand \thmt@envname and \thmt@parent
- \@nx\addtotheorempreheadhook[\thmt@envname @unique]{\@nx\setuniqmark{\thmt@envname.\@nx\@nameuse{the\thmt@parent}}}%
- \@nx\addtotheorempreheadhook[\thmt@envname @numbered]{\@nx\setuniqmark{\thmt@envname.\@nx\@nameuse{the\thmt@parent}}}%
- \@nx\addtotheorempreheadhook[\thmt@envname @unique]{\def\@nx\thmt@dummyctrautorefname{\thmt@thmname\@nx\@gobble}}%
- \@nx\addtotheorempreheadhook[\thmt@envname @numbered]{\def\@nx\thmt@dummyctrautorefname{\thmt@thmname\@nx\@gobble}}%
+ \@nx\addtotheorempreheadhook[\thmt@envname @unique]{%
+ \@nx\setuniqmark{\thmt@envname.\@nx\@nameuse{the\thmt@parent}}}%
+ \@nx\addtotheorempreheadhook[\thmt@envname @numbered]{%
+ \@nx\setuniqmark{\thmt@envname.\@nx\@nameuse{the\thmt@parent}}}%
+ \@nx\addtotheorempreheadhook[\thmt@envname @unique]{%
+ \def\@nx\thmt@dummyctrautorefname{\thmt@thmname\@nx\@gobble}}%
+ \@nx\addtotheorempreheadhook[\thmt@envname @numbered]{%
+ \def\@nx\thmt@dummyctrautorefname{\thmt@thmname\@nx\@gobble}}%
}%
\thmt@tmp
\fi
- % \addtotheorempreheadhook[\thmt@envname]{\def\thmt@dummyctrautorefname{\thmt@thmname\@gobble}}%
+ % \addtotheorempreheadhook[\thmt@envname]{%
+ % \def\thmt@dummyctrautorefname{\thmt@thmname\@gobble}}%
\fi
}%
}
diff --git a/macros/xetex/latex/xduts/README.md b/macros/xetex/latex/xduts/README.md
index 4394ad1811..df273cccab 100644
--- a/macros/xetex/latex/xduts/README.md
+++ b/macros/xetex/latex/xduts/README.md
@@ -70,4 +70,4 @@ Be sure to read the documentation (i.e., `xduts.pdf`) from the beginning in orde
## License
-XDUTS is subject to [the LaTeX Project Public License 1.3c](https://ctan.org/license/lppl1.3).
+XDUTS is subject to [the LaTeX Project Public License version 1.3c or later version](https://www.latex-project.org/lppl.txt).
diff --git a/macros/xetex/latex/xduts/xduts.dtx b/macros/xetex/latex/xduts/xduts.dtx
index 5a4f33c888..ce50064d89 100644
--- a/macros/xetex/latex/xduts/xduts.dtx
+++ b/macros/xetex/latex/xduts/xduts.dtx
@@ -1,7 +1,7 @@
% \iffalse
%<*driver>
\ProvidesFile{xduts.dtx}
-[2023/02/11 v4.4.5.3 Xidian University TeX Suite]
+[2023/02/15 v4.4.5.5 Xidian University TeX Suite]
%</driver>
%<class|sty>\NeedsTeXFormat{LaTeX2e}
%<class|sty>\RequirePackage{expl3}
@@ -9,7 +9,7 @@
%<xduugtp>\ProvidesExplClass{xduugtp}
%<xdupgthesis>\ProvidesExplClass{xdupgthesis}
%<xduugthesis>\ProvidesExplClass{xduugthesis}
-%<class|sty> {2023/02/11}{4.4.5.3}
+%<class|sty> {2023/02/15}{4.4.5.5}
%<xdufont> {Xidian University Font package}
%<xduugtp> {Xidian University Undergraduate Thesis Proposal class}
%<xdupgthesis> {Xidian University Postgraduate Thesis document class}
@@ -59,20 +59,20 @@
\NewDocumentCommand{\secrefx}{m}{第\space\ref{#1}\space{}节}
\NewDocumentCommand{\tabrefx}{O{}mO{\space}}{#1\tablename\space\ref{#2}#3}
\NewDocumentCommand{\figrefx}{O{}mO{\space}}{#1\figurename\space\ref{#2}#3}
-% 文档类选项
+% 选项
\NewDocumentCommand{\optx}{O{\space}mO{\space}}{#1{\ttfamily\seqsplit{#2}}#3}
% \name LaTeX3控制序列
\NewDocumentCommand{\csx}{O{\space}mO{\space}}{#1\cs{#2}#3}
-% \name 传统LaTeX2e命令
+% \name LaTeX2e命令
\NewDocumentCommand{\tnx}{O{\space}mO{\space}}{#1\tn{#2}#3}
-% <name> LaTeX3键值
+% <name> 键值
\NewDocumentCommand{\metax}{O{\space}mO{\space}}{#1\meta{#2}#3}
% LaTeX3键值对
\newcommand{\breakablethinspace}{\hskip 0.16667em\relax}
\NewDocumentCommand{\kvoptx}{O{\space}mmO{\space}}{#1\texttt{#2\breakablethinspace=\breakablethinspace#3}#4}
-% {<name>} LaTeX2e参数
+% {<name>} 必选参数
\NewDocumentCommand{\margx}{O{\space}mO{\space}}{#1\marg{#2}#3}
-% [<name>] LaTeX2e可选参数
+% [<name>] 可选参数
\NewDocumentCommand{\oargx}{O{\space}mO{\space}}{#1\oarg{#2}#3}
% 文件
\usepackage{seqsplit}
@@ -172,14 +172,13 @@ literate = {\$}{{\textcolor{purple3}{\$}}}{1}
% 仅支持\TeXLive{}、Mac\TeX{}、\MiKTeX{},
% 支持Windows、macOS、GNU/Linux、Overleaf和TeXPage。
% \end{abstract}
+% \changes{v4.4.5.4}{2023/02/11}{更新许可证版本号}
% \renewcommand{\abstractname}{免责声明}
% \begin{abstract}
% 在使用\xduts{}时,默认您同意以下内容:
% \begin{enumerate}
% \item \xduts[]{}作者不对使用\xduts{}产生的格式审查问题负责。
-% \item \xduts[]{}的发布遵守
-% \LaTeX{} Project Public License\footurl{https://www.latex-project.org/lppl.txt},
-% 使用前请认真阅读协议内容。
+% \item \xduts[]{}的发布遵守\LaTeX{} Project Public License Version 1.3c或更高版本\footurl{https://www.latex-project.org/lppl.txt}。
% \item 任何个人或组织以\xduts{}为基础进行修改或扩展生成新的\LaTeX{}宏包/文档类,
% 请严格遵守\LaTeX{} Project Public License,
% 由于违犯协议而引起的任何纠纷争端均与\xduts{}作者无关。
@@ -224,8 +223,8 @@ literate = {\$}{{\textcolor{purple3}{\$}}}{1}
% 中提及的内容本文档将不再赘述。
% 此外,在\secrefx{使用建议}中给出了部分使用建议。
% \xduts[]{}中的所有宏包和文档类仅内置了实现功能所需的宏包,
-% 对于常用的宏包如\pkgx{subcaption}[]、\pkgx[]{algpseudocodex}[]、^^A
-% \pkgx[]{amsmath}[]、\pkgx[]{amsthm}和\pkgx{siunitx}等\textbf{均未内置},
+% 对于常用的宏包如\pkgx{subcaption}[]、\pkgx[]{algorithm}[]、\pkgx[]{algpseudocodex}[]、^^A
+% \pkgx[]{amsmath}[]、\pkgx[]{theorem}和\pkgx{siunitx}等\textbf{均未内置},
% 用户可以参考\secrefx{兼容性说明}视需求自行加载。
% 相应格式规范均已实现,用户仅需要撰写文章内容即可,请勿随意添加格式修改命令。
% \changes{v1.1.2.1}{2022/04/15}{增加默认值说明}
@@ -383,6 +382,7 @@ literate = {\$}{{\textcolor{purple3}{\$}}}{1}
% \changes{v4.1.1.0}{2023/01/16}{适配子表样式}
% 以及适配子表caption字体字号和子表引用样式,
% 包括\pkgx{subcaption}宏包和\pkgx{subfig}宏包。
+% \changes{v4.4.5.5}{2023/02/15}{增加定理环境自定义建议}
% \changes{v4.0.0.1}{2022/12/11}{增加使用建议}
% \section{使用建议}
% \label{使用建议}
@@ -395,6 +395,7 @@ literate = {\$}{{\textcolor{purple3}{\$}}}{1}
% 推荐使用\pkgx{subcaption}宏包排版子图和子表;
% 推荐使用\pkgx{tabularray}宏包排版\textbf{所有的表格};
% 推荐使用\pkgx{enumitem}宏包修改列表环境样式;
+% 推荐使用\pkgx{theorem}宏包修改定理环境样式;
% 推荐使用\pkgx{siunitx}宏包排版单位。
% 另外,不要加载任何与参考文献和中英文字体相关的宏包。
% 使用宏包提供的功能时,\textbf{请阅读相应的宏包文档}。
@@ -432,10 +433,10 @@ literate = {\$}{{\textcolor{purple3}{\$}}}{1}
% \end{syntax}
% \xduts[]{}提供了一系列选项,可自行配置。
% 载入宏包/文档类之后,以下所有选项均可通过统一的命令\tnx{xdusetup}来设置。^^A
-% \csx[]{xdusetup}的参数是一组由(英文)逗号隔开的选项列表,
+% \tnx[]{xdusetup}的参数是一组由(英文)逗号隔开的选项列表,
% 下文中尖括号内列出了若干个允许的选项,其中加粗的为默认选项。
% 列表中的选项通常是\kvoptx{\metax[]{key}[]}{\metax[]{value}[]}的形式。^^A
-% \csx[]{xdusetup}采用\LaTeXiii{}风格的键值设置,
+% \tnx[]{xdusetup}采用\LaTeXiii{}风格的键值设置,
% 支持不同类型以及多种层次的选项设定。
% 键值列表中,“|=|”左右的空格不影响设置;
% 但需注意,参数列表中不可以出现空行。
@@ -7673,7 +7674,7 @@ literate = {\$}{{\textcolor{purple3}{\$}}}{1}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\section}
-% 重定义\csx{section}命令。
+% 重定义\tnx{section}命令。
% \begin{macrocode}
\cs_new_eq:NN \@@_org_sec:n \section
\RenewDocumentCommand \section { m }
diff --git a/macros/xetex/latex/xduts/xduts.ins b/macros/xetex/latex/xduts/xduts.ins
index 8900b8d914..fa75ee30da 100644
--- a/macros/xetex/latex/xduts/xduts.ins
+++ b/macros/xetex/latex/xduts/xduts.ins
@@ -5,11 +5,11 @@
Copyright 2022--\the\year by @note286 in GitHub and CTAN
This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
+and version 1.3c or later is part of all distributions of LaTeX
version 2005/12/01 or later.
This work has the LPPL maintenance status `author-maintained'.
@@ -18,7 +18,7 @@ The Current Maintainer of this work is @note286 in GitHub and CTAN.
This work consists of the files README.md, xduts.dtx, and xduts.ins
and the derived files xduts.pdf, xdufont.sty,
-xduugtp.cls, xdupgthesis.cls, and xduugthesis.cls.
+xduugtp.cls, xduugthesis.cls, and xdupgthesis.cls.
The copyright of xdulogo.pdf is Xidian University.
@@ -30,8 +30,8 @@ The copyright of xdulogo.pdf is Xidian University.
{
\file{xdufont.sty}{\from{\jobname.dtx}{sty,xdufont}}
\file{xduugtp.cls}{\from{\jobname.dtx}{class,tp,xduugtp}}
- \file{xdupgthesis.cls}{\from{\jobname.dtx}{class,thesis,xdupgthesis}}
\file{xduugthesis.cls}{\from{\jobname.dtx}{class,thesis,xduugthesis}}
+ \file{xdupgthesis.cls}{\from{\jobname.dtx}{class,thesis,xdupgthesis}}
}
\nopreamble
\nopostamble
diff --git a/macros/xetex/latex/xduts/xduts.pdf b/macros/xetex/latex/xduts/xduts.pdf
index e1a00725c3..9e96f92cc5 100644
--- a/macros/xetex/latex/xduts/xduts.pdf
+++ b/macros/xetex/latex/xduts/xduts.pdf
Binary files differ