diff options
Diffstat (limited to 'macros')
76 files changed, 628 insertions, 243 deletions
diff --git a/macros/latex/contrib/biblatex/CHANGES.md b/macros/latex/contrib/biblatex/CHANGES.md index c4db07a41c..c8d35de4ec 100644 --- a/macros/latex/contrib/biblatex/CHANGES.md +++ b/macros/latex/contrib/biblatex/CHANGES.md @@ -1,3 +1,7 @@ +# RELEASE NOTES FOR VERSION 3.19 +- Added `\AtNextRefsection`. +- Added `\DeclareExtradateContext`. + # RELEASE NOTES FOR VERSION 3.18b - Reenable `\MakeUppercase`/`\MakeLowercase` "patches" for `\bibstring` based on `\CaseSwitch`. @@ -9,8 +13,7 @@ # RELEASE NOTES FOR VERSION 3.18 - New sorting name key generation macro `\visibility` which allows application of sorting name key generation to apply only to sorting - within citati - ons. + within citations. - New sorting macro `\intciteorder` which allows sorting by order internal to a cite command like \cite{a,b,c}. - New option `pluralothers` to force "et al." to be plural (i.e. only diff --git a/macros/latex/contrib/biblatex/bibtex/bst/biblatex.bst b/macros/latex/contrib/biblatex/bibtex/bst/biblatex.bst index 6cd54a3486..55ff9acd66 100644 --- a/macros/latex/contrib/biblatex/bibtex/bst/biblatex.bst +++ b/macros/latex/contrib/biblatex/bibtex/bst/biblatex.bst @@ -184,7 +184,7 @@ STRINGS { ctrl.alphaothers ctrl.sortalphaothers ctrl.sortstr last.name last.hash last.year last.extra } FUNCTION {initialize} { - "$Revision: 3.18 $" + "$Revision: 3.19 $" #12 entry.max$ substring$ #-3 entry.max$ substring$ "Biblatex version: " swap$ * top$ @@ -1928,7 +1928,7 @@ FUNCTION {input:control:options} { % This version corresponds to the .bcf version, *not* the biblatex version! FUNCTION {input:control:version} { input:control:parse - "$Revision: 3.9 $" + "$Revision: 3.10 $" #12 entry.max$ substring$ #-3 entry.max$ substring$ 'tempstrga := diff --git a/macros/latex/contrib/biblatex/doc/biblatex.pdf b/macros/latex/contrib/biblatex/doc/biblatex.pdf Binary files differindex a1f4b3d3c1..fde8bee537 100644 --- a/macros/latex/contrib/biblatex/doc/biblatex.pdf +++ b/macros/latex/contrib/biblatex/doc/biblatex.pdf diff --git a/macros/latex/contrib/biblatex/doc/biblatex.tex b/macros/latex/contrib/biblatex/doc/biblatex.tex index 67d334accd..6c4e147b7b 100644 --- a/macros/latex/contrib/biblatex/doc/biblatex.tex +++ b/macros/latex/contrib/biblatex/doc/biblatex.tex @@ -68,7 +68,7 @@ url={\biblatexhome}, author={Philip Kime, Moritz Wemheuer, Philipp Lehman}, email={}, - revision={3.18b}, + revision={3.19}, date={\today}} \hypersetup{% @@ -413,6 +413,7 @@ compatibility matrix for the recent versions. \sffamily\bfseries\spotcolor Biber version & \sffamily\bfseries\spotcolor \biblatex\ version\\ \midrule +2.19 & 3.19\\ 2.18 & 3.18\\ 2.17 & 3.17\\ 2.16 & 3.16\\ @@ -857,7 +858,7 @@ The author(s) of the \bibfield{title}. \fielditem{authortype}{key} -The type of author. This field will affect the string (if any) used to introduce the author. Not used by the standard bibliography styles. +The type of author. This field will affect the string (if any) used to introduce the author. \listitem{bookauthor}{name} @@ -1082,7 +1083,7 @@ however better to use the \bibfield{date} field as this supports many more featu \fielditem{nameaddon}{literal} -An addon to be printed immediately after the author name in the bibliography. Not used by the standard bibliography styles. This field may be useful to add an alias or pen name (or give the real name if the pseudonym is commonly used to refer to that author). +An addon to be printed immediately after the author name in the bibliography. Not used by the standard bibliography styles. \fielditem{note}{literal} @@ -2663,7 +2664,7 @@ The option is intended mainly for backwards compatibility, because earlier versi \boolitem[true]{dashed} -This option controls whether recurrent the same author\slash editor list in the bibliography are replaced by a dash (\cmd{bibnamdeash}, see \secref{use:fmt:fmt}). If the option is enabled, subsequent mentions of the same name list at the beginning of an entry are replaced by a dash provided the entry is not the first on the current page. If the option is disabled, name lists are never replaced by a dash. +This option controls whether recurrent the same author\slash editor list in the bibliography are replaced by a dash (\cmd{bibnamedash}, see \secref{use:fmt:fmt}). If the option is enabled, subsequent mentions of the same name list at the beginning of an entry are replaced by a dash provided the entry is not the first on the current page. If the option is disabled, name lists are never replaced by a dash. \end{optionlist} @@ -2857,7 +2858,7 @@ This option is also settable on a per-type, per-entry, per-namelist and per-name If \opt{giveninits} is set to \opt{true}, the default name formats will only render the given name initials and not the full given name. The standard styles only use the test \cmd{ifgiveninits} and hence only respond to the option \opt{giveninits}. Setting the option for a name part different from \texttt{given} has no effect on the default name formats. -Note that sorting and name uniqueness are not automatically affected by this option, that have to be requested explicitly via \cmd{DeclareSortingNamekeyTemplate} and the \opt{uniquename} option (or \cmd{DeclareUniquenameTemplate}), respectively. A warning will be issued if \opt{giveninits} is used together with \opt{uniquename} set to one of the \opt{full} values and \opt{uniquename} is automatically set to the corresponding \opt{init} value. +Note that sorting and name uniqueness are not automatically affected by this option, these have to be requested explicitly via \cmd{DeclareSortingNamekeyTemplate} and the \opt{uniquename} option (or \cmd{DeclareUniquenameTemplate}), respectively. A warning will be issued if \opt{giveninits} is used together with \opt{uniquename} set to one of the \opt{full} values and \opt{uniquename} is automatically set to the corresponding \opt{init} value. \boolitem[false]{terseinits} @@ -3047,8 +3048,8 @@ This option is also settable on a per-type, per-entry and per-namelist basis. \multicolumn{1}{@{}H}{Counter tracks} \\ \cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule(r){3-3}\cmidrule{4-4} labelalpha & labelalpha & extraalpha & label\\ -labeldateparts & labelyear & extradate & labelname+\\ - & labelmonth & & labelyear\\ +labeldateparts & labelyear & extradate & extradate context+labelyear\\ + & labelmonth & & \\ & labelday & & \\ & labelendyear & & \\ & labelendmonth & & \\ @@ -4354,7 +4355,7 @@ The \opt{refcontext} environment cannot be nested and \biblatex will generate an \cmditem{newrefcontext}[key=value, \dots]{name} -This command is similar to the \env{refcontext} environment except that it is a stand"=alone command rather than an environment. It automatically ends any previous reference context section begun with \cmd{newrefcontext} (if any) and immediately starts a new one. Note that the context section started by the last \cmd{newrefcontext} command in the document will extend to the very end of the document. Use \cmd{endrefcontext} if you want to terminate it earlier. +This command is similar to the \env{refcontext} environment except that it is a stand"=alone command rather than an environment. It automatically ends any previous reference context section begun with \cmd{newrefcontext} (if any) and immediately starts a new one. Note that the context section started by the last \cmd{newrefcontext} command in the document will extend to the end of the current refsection. Use \cmd{endrefcontext} if you want to terminate it earlier. \cmditem{localrefcontext}[key=value, \dots]{name} @@ -7139,11 +7140,11 @@ The end day of the date field selected by \cmd{DeclareLabeldate} (\secref{aut:ct \fielditem{extradate}{integer} -The author"=year citation scheme usually requires a letter to be appended to the year if the bibliography contains two or more works by the same author which were all published in the same year. In this case, the \bibfield{extradate} field holds an integer which may be converted to a letter with \cmd{mknumalph} or formatted in some other way. This field is undefined if there is only one work by the author in the bibliography or if all works by the author have different publication years. A complete author-year label consists of the fields \bibfield{labelyear} plus \bibfield{extradate}. Note that the \bibfield{labelyear} and \bibfield{extradate} fields need to be requested with the package option \opt{labeldateparts}, see \secref{use:opt:pre:int} for details. See also \bibfield{labelyear}. Table \ref{use:opt:tab1} summarises the various \opt{extra*} disambiguation counters and what they track. +The author"=year citation scheme usually requires a letter to be appended to the year if the bibliography contains two or more works by the same author (actually the \bibfield{labelname}, which is usually the author by default but which need not be) which were all published in the same year. In this case, the \bibfield{extradate} field holds an integer which may be converted to a letter with \cmd{mknumalph} or formatted in some other way. This field is undefined if there is only one work by the author in the bibliography or if all works by the author have different publication years. A complete author-year label consists of the fields \bibfield{labelyear} plus \bibfield{extradate}. Note that the \bibfield{labelyear} and \bibfield{extradate} fields need to be requested with the package option \opt{labeldateparts}, see \secref{use:opt:pre:int} for details. See also \bibfield{labelyear}. Table \ref{use:opt:tab1} summarises the various \opt{extra*} disambiguation counters and what they track. Note that \biblatex allows a generalisation of this behaviour and the default context for \bibfield{extradate} disambiguation can be changed to allow other contexts than the author. The default will fall back to the \bibfield{labeltitle} if there is no \bibfield{labelname} (which is usually the author). See \cmd{DeclareExtradateContext} in \secref{aut:ctm:fld} to customise the \bibfield{extradate} context. \fielditem{extradatescope}{literal} -This field contains the name of the most specific field which determined the value of \bibfield{extradate}. It is not used by the standard styles but may be useful in controlling the placement of the \bibfield{extradate} field value. +This field contains the name of the most specific date part which determined the value of \bibfield{extradate}. It is not used by the standard styles but may be useful in controlling the placement of the \bibfield{extradate} field value. For example, if two works by the same author with dates <2020-05-04> and <2020-06-04> were disambiguated by \bibfield{extradate}, then \bibfield{extradatascope} would contain <labelyear> for both entries as the most specific difference is the (label)year. If the dates were <2020-05-04> and <2020-05-02>, then \bibfield{extradatascope} would contain <labelmonth>. See also \cmd{DeclareExtradate} (\secref{aut:ctm:fld}) which describes how to change the scope used to track dates. \end{fieldlist} @@ -8268,6 +8269,11 @@ limiting source maps to specific refsections only (see \opt{refsection} option to the \cmd{map} command above). \begin{itemize} +\item If \texttt{final} is \texttt{true} for a step then no more steps + after this one are run within the current map for the current entry if + the conditions for the step so far are not satisfied. Examples are given in + the descriptions for specific steps as to what this means for their + particular semantics. \item If \texttt{entrynew} is set, a new entry is created with the entry key \texttt{entrynewkey} and the entry type given in the option \texttt{entrynewtype}. This entry is only in-scope during the processing of the current entry and can be referenced by \texttt{entrytarget}. In \texttt{entrynewkey}, you may use standard Perl regular expression @@ -8315,15 +8321,7 @@ option to the \cmd{map} command above). \texttt{match} regular expression (logic is reversed if you use \texttt{notmatch} and case-insensitive if you use the versions ending in <i>)\footnote{Regular expressions are full Perl 5.16 regular expressions. This means you may need to deal with special characters, see examples.}. You may use capture parenthesis as usual and refer to these (\$1\ldots\$9) in later \texttt{fieldvalue} specifications. This allows you to pull out parts of some fields and put these parts in other fields. \item Perform a regular expression match and replace on the value of the \texttt{fieldsource} \prm{entryfield} if \texttt{match} and \texttt{replace} are defined. \item If \texttt{matches} is defined, it should be a comma-separated list of literal strings which are replaced by corresponding locations in a comma-separated list provided in \texttt{replace}. The lists must have the same number of elements or the step will be skipped. \texttt{matchesi} is the same but case-insensitive. -\item If \texttt{fieldset} is defined, then its value is \prm{entryfield} - which will be set to a value specified by further options. If - \texttt{overwrite} is false for this step and the field to set already - exists then the map step is ignored. If \texttt{final} is also true for - this step, then processing of the parent map stops at this point. If - \texttt{append} is true, then the value to set is appended to the current - value of \prm{entryfield}. \texttt{appendstrict} only appends to - \prm{entryfield} if \prm{entryfield} is not empty. The value to set is - specified by a mandatory one and only one of the following options: +\item If \texttt{fieldset} is defined, then its value is \prm{entryfield} which will be set to a value specified by further options. If \texttt{overwrite} is false for this step and the field to set already exists then the map step is ignored. If \texttt{final} is also true when \texttt{overwrite} is false for this step, then processing of the parent map stops at this point. If \texttt{append} is true, then the value to set is appended to the current value of \prm{entryfield}. \texttt{appendstrict} only appends to \prm{entryfield} if \prm{entryfield} is not empty. The value to set is specified by a mandatory one and only one of the following options: \begin{itemize} \item\ \texttt{fieldvalue} --- The \texttt{fieldset} \prm{entryfield} is set to the \texttt{fieldvalue} \prm{string} \item\ \texttt{null} --- The \texttt{fieldset} \prm{entryfield} is ignored, as if it did not exist in the datasource @@ -9953,7 +9951,7 @@ The \bibfield{label*} fields may be customized globally or on a per-type basis. \cmditem{DeclareExtradate}{specification} -Defines how \biber tracks information used to construct the \bibfield{extradate} field. This field (see \secref{aut:bbx:fld:lab}) is printed to disambiguate works by the same author which occur in the same date scope. By default, the date scope is the year and so two works by the same author within the same year will have different \bibfield{extradate} values which are used to disambiguate the works in the bibliography in the usual manner seen in many authoryear type styles. The \prm{specification} is one or more \cmd{scope} specifications which can contain one or more \cmd{field} specifications. Within a \cmd{scope}, the existence of each \cmd{field} will be checked and if found, the first \cmd{field} is used and the rest are ignored. This allows a fallback in case certain fields are not available in all entries. All \cmd{scope}s are used to track information and \cmd{scope}s should be specified in decreasing order of generality (e.g. year then month then day etc) The default definition is: +Defines which date information used to construct the \bibfield{extradate} field. With the default setting for \cmd{DeclareExtradateContext}, this field (see \secref{aut:bbx:fld:lab}) is printed to disambiguate works by the same \bibfield{labelname} (usually the author) or \bibfield{labeltitle} (usually the main title) which occur in the same date scope. By default, the date scope is the year and so two works by the same author/title within the same year will have different \bibfield{extradate} values which are used to disambiguate the works in the bibliography in the usual manner seen in many authoryear type styles. The \prm{specification} is one or more \cmd{scope} specifications which can contain one or more \cmd{field} specifications. Within a \cmd{scope}, the existence of each \cmd{field} will be checked and if found, the first \cmd{field} is used and the rest are ignored. This allows a fallback in case certain fields are not available in all entries. All \cmd{scope}s are used to track information and \cmd{scope}s should be specified in decreasing order of generality (e.g. year then month then day etc) The default definition is: \begin{ltxexample} \DeclareExtradate{% @@ -10066,6 +10064,19 @@ Doe 2001b % This command may only be used in the preamble. +\cmditem{DeclareExtradateContext}[entrytype, \dots]{specification} + +Defines the context in which identical dates (as determined by \cmd{DeclareExtradate}) are tracked so that \bibfield{extradate} can be appended for disambiguation purposes. Normally this context is the author name so that works of the same date by the same author can be disambiguated in authoryear type styles. Often, when there is no author, the title appears in the author position and the title is used as the context to disambiguate instead. Therefore, the default definition is: + +\begin{ltxexample} +\DeclareExtradateContext{% + \field{labelname} + \field{labeltitle} +} +\end{ltxexample} +% +It is unlikely that this will need to be customised for normal use cases. + \cmditem{DeclareLabeltitle}[entrytype, \dots]{specification} Defines the fields to consider when generating the \bibfield{labeltitle} field (see \secref{aut:bbx:fld:lab}). The \prm{specification} is an ordered list of \cmd{field} commands. The fields are checked in the order listed and the first field which is available will be used as \bibfield{labeltitle}. This is the default definition: @@ -13270,6 +13281,10 @@ The name of the name list currently being processed by \cmd{printnames}. This in Appends the \prm{code} to an internal hook executed at the beginning of every reference section. The \prm{code} is executed just after setting the reference section number. This command may only be used in the preamble. +\cmditem{AtNextRefsection}{code} + +Appends the \prm{code} to an internal hook executed at the beginning of the next reference section. The \prm{code} is executed just after setting the reference section number. + \cmditem{AtBeginBibliography}{code} Appends the \prm{code} to an internal hook executed at the beginning of the bibliography. The \prm{code} is executed at the beginning of the list of references, immediately after the \prm{begin code} of \cmd{defbibenvironment}. This command may only be used in the preamble. @@ -14858,7 +14873,13 @@ use$<$name$>$ &\+&\+&\_&\+&\+&\_&\_\\ This revision history is a list of changes relevant to users of this package. Changes of a more technical nature which do not affect the user interface or the behavior of the package are not included in the list. More technical details are to be found in the \file{CHANGES.md} file. The numbers on the right indicate the relevant section of this manual. \begin{changelog} -\begin{release}{3.18b}{2022-07-12} +\begin{release}{3.19}{2023-03-05} +\item Added \cmd{AtNextRefsection}\see{aut:fmt:hok} +\item Added \cmd{DeclareExtradateContext} option\see{aut:ctm:fld} +\item Modified warning for using bibtex backend +\item Enhanced \bibfield{extradate} tracking to fallback on \bibfield{labeltitle} when there is no author +\end{release} + \begin{release}{3.18b}{2022-07-12} \item Reenable \cmd{MakeUppercase}/\cmd{MakeLowercase} <patches> based on \cmd{CaseSwitch} \end{release} diff --git a/macros/latex/contrib/biblatex/doc/examples/02-annotations-biber.pdf b/macros/latex/contrib/biblatex/doc/examples/02-annotations-biber.pdf Binary files differindex a6a3c22705..c870935219 100644 --- a/macros/latex/contrib/biblatex/doc/examples/02-annotations-biber.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/02-annotations-biber.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/02-annotations-bibtex.pdf b/macros/latex/contrib/biblatex/doc/examples/02-annotations-bibtex.pdf Binary files differindex 188b707462..6341afe161 100644 --- a/macros/latex/contrib/biblatex/doc/examples/02-annotations-bibtex.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/02-annotations-bibtex.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/03-localization-keys-biber.pdf b/macros/latex/contrib/biblatex/doc/examples/03-localization-keys-biber.pdf Binary files differindex d8f867fff7..6e8d59197d 100644 --- a/macros/latex/contrib/biblatex/doc/examples/03-localization-keys-biber.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/03-localization-keys-biber.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/03-localization-keys-bibtex.pdf b/macros/latex/contrib/biblatex/doc/examples/03-localization-keys-bibtex.pdf Binary files differindex c2953f7e4e..bef6ba6cc6 100644 --- a/macros/latex/contrib/biblatex/doc/examples/03-localization-keys-bibtex.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/03-localization-keys-bibtex.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/16-numeric-prefixed-1-biber.pdf b/macros/latex/contrib/biblatex/doc/examples/16-numeric-prefixed-1-biber.pdf Binary files differindex e1fddfe1b8..1a43b99ec6 100644 --- a/macros/latex/contrib/biblatex/doc/examples/16-numeric-prefixed-1-biber.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/16-numeric-prefixed-1-biber.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/16-numeric-prefixed-1-bibtex.pdf b/macros/latex/contrib/biblatex/doc/examples/16-numeric-prefixed-1-bibtex.pdf Binary files differindex 64db9af5a6..17d38864f3 100644 --- a/macros/latex/contrib/biblatex/doc/examples/16-numeric-prefixed-1-bibtex.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/16-numeric-prefixed-1-bibtex.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/17-numeric-prefixed-2-biber.pdf b/macros/latex/contrib/biblatex/doc/examples/17-numeric-prefixed-2-biber.pdf Binary files differindex 906a18b8a0..76a9175ac6 100644 --- a/macros/latex/contrib/biblatex/doc/examples/17-numeric-prefixed-2-biber.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/17-numeric-prefixed-2-biber.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/17-numeric-prefixed-2-bibtex.pdf b/macros/latex/contrib/biblatex/doc/examples/17-numeric-prefixed-2-bibtex.pdf Binary files differindex 1660f1fa12..0f85b8c344 100644 --- a/macros/latex/contrib/biblatex/doc/examples/17-numeric-prefixed-2-bibtex.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/17-numeric-prefixed-2-bibtex.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/19-alphabetic-prefixed-biber.pdf b/macros/latex/contrib/biblatex/doc/examples/19-alphabetic-prefixed-biber.pdf Binary files differindex b0a7303384..22822fa190 100644 --- a/macros/latex/contrib/biblatex/doc/examples/19-alphabetic-prefixed-biber.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/19-alphabetic-prefixed-biber.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/19-alphabetic-prefixed-bibtex.pdf b/macros/latex/contrib/biblatex/doc/examples/19-alphabetic-prefixed-bibtex.pdf Binary files differindex fd02d3ee77..b2dddeeeb4 100644 --- a/macros/latex/contrib/biblatex/doc/examples/19-alphabetic-prefixed-bibtex.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/19-alphabetic-prefixed-bibtex.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/20-indexing-single-biber.pdf b/macros/latex/contrib/biblatex/doc/examples/20-indexing-single-biber.pdf Binary files differindex ac1fb850af..bef1f6f3f1 100644 --- a/macros/latex/contrib/biblatex/doc/examples/20-indexing-single-biber.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/20-indexing-single-biber.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/20-indexing-single-bibtex.pdf b/macros/latex/contrib/biblatex/doc/examples/20-indexing-single-bibtex.pdf Binary files differindex b41bf9968e..52d3cbeba8 100644 --- a/macros/latex/contrib/biblatex/doc/examples/20-indexing-single-bibtex.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/20-indexing-single-bibtex.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/21-indexing-multiple-biber.pdf b/macros/latex/contrib/biblatex/doc/examples/21-indexing-multiple-biber.pdf Binary files differindex 26b3acae8b..eaaabde6a1 100644 --- a/macros/latex/contrib/biblatex/doc/examples/21-indexing-multiple-biber.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/21-indexing-multiple-biber.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/21-indexing-multiple-bibtex.pdf b/macros/latex/contrib/biblatex/doc/examples/21-indexing-multiple-bibtex.pdf Binary files differindex 2d2de8ea76..2fdd6bbc9a 100644 --- a/macros/latex/contrib/biblatex/doc/examples/21-indexing-multiple-bibtex.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/21-indexing-multiple-bibtex.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/40-style-alphabetic-biber.pdf b/macros/latex/contrib/biblatex/doc/examples/40-style-alphabetic-biber.pdf Binary files differindex 17f5db2dce..81d00c245c 100644 --- a/macros/latex/contrib/biblatex/doc/examples/40-style-alphabetic-biber.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/40-style-alphabetic-biber.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/40-style-alphabetic-bibtex.pdf b/macros/latex/contrib/biblatex/doc/examples/40-style-alphabetic-bibtex.pdf Binary files differindex 1095df8ce6..b6d7e8f48c 100644 --- a/macros/latex/contrib/biblatex/doc/examples/40-style-alphabetic-bibtex.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/40-style-alphabetic-bibtex.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/50-style-authoryear-biber.pdf b/macros/latex/contrib/biblatex/doc/examples/50-style-authoryear-biber.pdf Binary files differindex dbf2370b9d..f21e332306 100644 --- a/macros/latex/contrib/biblatex/doc/examples/50-style-authoryear-biber.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/50-style-authoryear-biber.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/50-style-authoryear-bibtex.pdf b/macros/latex/contrib/biblatex/doc/examples/50-style-authoryear-bibtex.pdf Binary files differindex 371dcc0e4c..f553a865b1 100644 --- a/macros/latex/contrib/biblatex/doc/examples/50-style-authoryear-bibtex.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/50-style-authoryear-bibtex.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/60-style-authortitle-biber.pdf b/macros/latex/contrib/biblatex/doc/examples/60-style-authortitle-biber.pdf Binary files differindex d088d528a8..2c4d4c059b 100644 --- a/macros/latex/contrib/biblatex/doc/examples/60-style-authortitle-biber.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/60-style-authortitle-biber.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/60-style-authortitle-bibtex.pdf b/macros/latex/contrib/biblatex/doc/examples/60-style-authortitle-bibtex.pdf Binary files differindex c148d4278c..0c3a82bd9c 100644 --- a/macros/latex/contrib/biblatex/doc/examples/60-style-authortitle-bibtex.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/60-style-authortitle-bibtex.pdf diff --git a/macros/latex/contrib/biblatex/doc/examples/91-sorting-schemes.tex b/macros/latex/contrib/biblatex/doc/examples/91-sorting-schemes.tex index 251e27dcc2..617ceb629c 100644 --- a/macros/latex/contrib/biblatex/doc/examples/91-sorting-schemes.tex +++ b/macros/latex/contrib/biblatex/doc/examples/91-sorting-schemes.tex @@ -6,7 +6,7 @@ \usepackage{hyperref} \addbibresource{biblatex-examples.bib} \begin{document} -% This demonstrates that the sorting of citations can be difference to the +% This demonstrates that the sorting of citations can be different to the % bibliography. However, this is not always advisable in case of multiple % citations in the same year for the same author list. This is because % extradate (the "a", "b" etc. in "Smith 2010a" and "Smith 2010b" etc.) diff --git a/macros/latex/contrib/biblatex/doc/examples/96-dates-biber.pdf b/macros/latex/contrib/biblatex/doc/examples/96-dates-biber.pdf Binary files differindex e1d6a5dcef..52e1a2f310 100644 --- a/macros/latex/contrib/biblatex/doc/examples/96-dates-biber.pdf +++ b/macros/latex/contrib/biblatex/doc/examples/96-dates-biber.pdf diff --git a/macros/latex/contrib/biblatex/latex/biblatex.def b/macros/latex/contrib/biblatex/latex/biblatex.def index 8e52b7fa0d..3b4c4bd68a 100644 --- a/macros/latex/contrib/biblatex/latex/biblatex.def +++ b/macros/latex/contrib/biblatex/latex/biblatex.def @@ -1398,6 +1398,11 @@ } } +\DeclareExtradateContext{% + \field{labelname} + \field{labeltitle} +} + \DeclareLabeltitle{% \field{shorttitle} \field{title} diff --git a/macros/latex/contrib/biblatex/latex/biblatex.sty b/macros/latex/contrib/biblatex/latex/biblatex.sty index 8b33c5d021..a006c5ecd2 100644 --- a/macros/latex/contrib/biblatex/latex/biblatex.sty +++ b/macros/latex/contrib/biblatex/latex/biblatex.sty @@ -12,8 +12,8 @@ % particular purpose. % Set up the version strings here -\def\abx@date{2022/07/12} -\def\abx@version{3.18b} +\def\abx@date{2023/03/05} +\def\abx@version{3.19} \def\abx@bbxid{\abx@date\space v\abx@version\space biblatex bibliography style (PK/MW)} \def\abx@cbxid{\abx@date\space v\abx@version\space biblatex citation style (PK/MW)} \def\abx@lbxid{\abx@date\space v\abx@version\space biblatex localization (PK/MW)} @@ -22,7 +22,7 @@ % This is not updated by build script as the control file version % does not necessarily change with the package version. % This is used when writing the .bcf -\def\blx@bcfversion{3.9} +\def\blx@bcfversion{3.10} % This is not updated by build script as the bbl version % does not necessarily change with the package version. @@ -9476,18 +9476,23 @@ {\blx@printbibchecks \blx@notfilter\blx@tempa{blx@catg@#1}}} +\let\blx@default@thefilter\@empty +\blx@kv@defkey{blx@bibdefaults}{filter}{% + \def\blx@default@thefilter{#1}} \blx@kv@defkey{blx@bib2}{filter}{\blx@key@filter{#1}} \blx@kv@defkey{blx@biblist2}{filter}{\blx@key@filter{#1}} \def\blx@key@filter#1{% - \ifcsdef{blx@filter@#1} - {\blx@printbibchecks - \blx@bibfilter\blx@tempa{blx@filter@#1}} - {\let\blx@tempa\@empty - \blx@error - {Filter '#1' not found} - {The filter '#1' could not be found.\MessageBreak - Use \string\defbibfilter\space to define it}}} + \ifblank{#1} + {} + {\ifcsdef{blx@filter@#1} + {\blx@printbibchecks + \blx@bibfilter\blx@tempa{blx@filter@#1}} + {\let\blx@tempa\@empty + \blx@error + {Filter '#1' not found} + {The filter '#1' could not be found.\MessageBreak + Use \string\defbibfilter\space to define it}}}} \blx@kv@defkey{blx@bib2}{check}{\blx@key@bibcheck{#1}} \blx@kv@defkey{blx@biblist2}{check}{\blx@key@bibcheck{#1}} @@ -9672,6 +9677,7 @@ \let\blx@theprenote\blx@default@theprenote \let\blx@thepostnote\blx@default@thepostnote \let\blx@thetitle\blx@default@thetitle + \let\blx@thefilter\blx@default@thefilter \undef\blx@thelabel % defaults \let\blx@tempa\@empty% before there is a .bbl, this must not be undef @@ -9697,6 +9703,7 @@ % \printbibliography following one with this set will inherit any % previous "true" value \togglefalse{blx@omitnumbers}% + \expandafter\blx@key@filter\expandafter{\blx@thefilter}% Can only be defaulted once \blx@tempa is set since it filters on this \blx@kv@setkeys{blx@bib2}{#1}% ... now we have correct \blx@tempa, set rest of options \blx@rest@actives % Add datalist to list of seen datalists to prevent duplicates @@ -9727,6 +9734,7 @@ \let\blx@theprenote\blx@default@theprenote \let\blx@thepostnote\blx@default@thepostnote \let\blx@thetitle\blx@default@thetitle + \let\blx@thefilter\blx@default@thefilter \undef\blx@thelabel \c@refsection\z@ \blx@safe@actives @@ -9767,6 +9775,7 @@ \let\blx@theprenote\blx@default@theprenote \let\blx@thepostnote\blx@default@thepostnote \let\blx@thetitle\blx@default@thetitle + \let\blx@thefilter\blx@default@thefilter \undef\blx@thelabel \c@refsegment\@ne \blx@safe@actives @@ -9812,8 +9821,8 @@ \let\blx@theprenote\blx@default@theprenote \let\blx@thepostnote\blx@default@thepostnote \let\blx@thetitle\blx@default@thetitle + \let\blx@thefilter\blx@default@thefilter \undef\blx@thelabel - \c@refsection\z@ \blx@safe@actives \blx@kv@setkeys{blx@bbc}{#1}% \blx@rest@actives @@ -10113,6 +10122,7 @@ \let\blx@theprenote\@empty \let\blx@thepostnote\@empty \let\blx@thetitle\@empty + \let\blx@thefilter\@empty \undef\blx@thelabel % defaults \let\blx@tempa\@empty% before there is a .bbl, this must not be undef @@ -10559,6 +10569,12 @@ \newrobustcmd*{\AtBeginRefsection}{\gappto\blx@hook@refsectioninit} \@onlypreamble\AtBeginRefsection +\newrobustcmd*{\AtNextRefsection}{% + \ifundef\blx@hook@refsection@next + {\gdef\blx@hook@refsection@next{\global\undef\blx@hook@refsection@next}} + {}% + \gappto\blx@hook@refsection@next} + \newrobustcmd*{\newrefsection}{% \endrefcontext \ifnum\c@refsection>\z@ @@ -10592,6 +10608,7 @@ \stepcounter{blx@maxsection}% \setcounter{refsection}{\value{blx@maxsection}}% \csuse{blx@hook@refsectioninit}% + \csuse{blx@hook@refsection@next}% \xifinlist{\the\c@refsection}\blx@allrefsections {} {\listxadd\blx@allrefsections{\the\c@refsection}}% @@ -11388,6 +11405,21 @@ \blx@auxwrite\blx@bcfout{}{\blx@xml@citeset{\blx@tempa}{\blx@tempb}}% \endgroup} + +\def\abx@warn@emptycite{% + \abx@warn@emptycite@print + \abx@warn@emptycite@log} + +\def\abx@warn@emptycite@print@text{% + \textless empty citation\textgreater} + +\def\abx@warn@emptycite@print{% + \abx@missing@entry{\abx@warn@emptycite@print@text}} + +\def\abx@warn@emptycite@log{% + \@latex@warning{\blx@msg@cundefon{}}} + + % {<entrykey>,...} % a crude way to check for a do-nothing argument: % loop over it to see what happens @@ -11397,8 +11429,7 @@ \expandafter\docsvlist\expandafter{\detokenize{#1}}% \iftoggle{blx@tempa} {\expandafter\blx@citeloop@i\expandafter{\detokenize{#1}}} - {\abx@missing@entry{empty citation}% - \@latex@warning{\blx@msg@cundefon{}}}} + {\abx@warn@emptycite}} \protected\def\blx@citeloop@i#1{% \begingroup % This must be here and not after \blx@citeadd as this changes the refcontext @@ -13422,6 +13453,7 @@ \blx@xml@comment{GLOBAL}% \blx@xml@options{biblatex}{global}{% \blx@xml@svalue{alphaothers}{\labelalphaothers}% + \blx@xml@mvalue{extradatecontext}{\blx@bcf@extradatecontext}% \blx@xml@toggle{labelalpha}% \blx@xml@mvalue{labelnamespec}{\blx@bcf@labelnamespec}% \blx@xml@toggle{labeltitle}% @@ -13467,6 +13499,10 @@ \def\blx@bcf@options@type#1{% \blx@xml@comment{#1}% \blx@xml@options{biblatex}{#1}{% + \blx@xml@mvalue{extradatecontext}{% + \ifcsdef{blx@bcf@extradatecontext@#1} + {\csuse{blx@bcf@extradatecontext@#1}} + {\blx@bcf@extradatecontext}}% \blx@xml@toggle{labelalpha}% \blx@xml@mvalue{labelnamespec}{% \ifcsdef{blx@bcf@labelnamespec@#1} @@ -14700,6 +14736,21 @@ \noexpand\blx@xml@edordered{\the\blx@tempcnta}{#1}}} % [<type,type,...>]{<field,field,...>} +\newrobustcmd*{\DeclareExtradateContext}[2][]{% + \begingroup + \let\blx@tempa\@empty + \def\blx@tempb{extradatecontext}% + \let\field\blx@ordered@field + \ifblank{#1} + {\global\cslet{blx@bcf@extradatecontext}\@empty} + {\def\blx@tempa{#1}% + \def\do##1{\global\cslet{blx@bcf@extradatecontext@##1}\@empty}% + \expandafter\docsvlist\expandafter{#1}}% + #2% + \endgroup} +\@onlypreamble\DeclareExtradateContext +\blx@DeclareBackendOption{global,type}[xml]{extradatecontext} + \newrobustcmd*{\DeclareLabelname}[2][]{% \begingroup \let\blx@tempa\@empty @@ -16306,6 +16357,7 @@ \blx@bblinput \setcounter{blx@maxsection}{0}% \csuse{blx@hook@refsectioninit}% + \csuse{blx@hook@refsection@next}% \csuse{abx@preamble}% \blx@inf@refsec \blx@inf@refseg} diff --git a/macros/latex/contrib/biblatex/latex/blx-bibtex.def b/macros/latex/contrib/biblatex/latex/blx-bibtex.def index 7e84884ac7..63f1420ef4 100644 --- a/macros/latex/contrib/biblatex/latex/blx-bibtex.def +++ b/macros/latex/contrib/biblatex/latex/blx-bibtex.def @@ -2,7 +2,7 @@ [\abx@cptid] \blx@warning@noline{% - Using fall-back BibTeX(8) backend:\MessageBreak + Using fall-back bibtex backend:\MessageBreak functionality may be reduced/unavailable% } diff --git a/macros/latex/contrib/biblatex/latex/cbx/alphabetic.cbx b/macros/latex/contrib/biblatex/latex/cbx/alphabetic.cbx index e6f4d7d425..b205b68bb9 100644 --- a/macros/latex/contrib/biblatex/latex/cbx/alphabetic.cbx +++ b/macros/latex/contrib/biblatex/latex/cbx/alphabetic.cbx @@ -129,7 +129,10 @@ \newrobustcmd{\cbx@textcite@init}[2]{% \setcounter{textcitetotal}{0}% \setcounter{textcitecount}{0}% - \def\cbx@savedcites{#1}#2\cbx@savedcites\empty} + \def\cbx@savedcites{#1}#2% + \ifnumgreater{\value{textcitetotal}}{0} + {\cbx@savedcites} + {}} \DeclareMultiCiteCommand{\cbx@textcites}{\cbx@textcite}{} \DeclareMultiCiteCommand{\textcites}[\cbx@textcites@init\cbx@textcites]{\textcite}{} diff --git a/macros/latex/contrib/biblatex/latex/cbx/authortitle-comp.cbx b/macros/latex/contrib/biblatex/latex/cbx/authortitle-comp.cbx index f27955b113..cf60c11b10 100644 --- a/macros/latex/contrib/biblatex/latex/cbx/authortitle-comp.cbx +++ b/macros/latex/contrib/biblatex/latex/cbx/authortitle-comp.cbx @@ -174,7 +174,10 @@ \newrobustcmd{\cbx@textcite@init}[2]{% \setcounter{textcitetotal}{0}% \setcounter{textcitecount}{0}% - \def\cbx@savedcites{#1}#2\cbx@savedcites\empty} + \def\cbx@savedcites{#1}#2% + \ifnumgreater{\value{textcitetotal}}{0} + {\cbx@savedcites} + {}} \DeclareMultiCiteCommand{\cbx@textcites}{\cbx@textcite}{} \DeclareMultiCiteCommand{\textcites}[\cbx@textcites@init\cbx@textcites]{\textcite}{} diff --git a/macros/latex/contrib/biblatex/latex/cbx/authortitle-icomp.cbx b/macros/latex/contrib/biblatex/latex/cbx/authortitle-icomp.cbx index 8109110103..fdf5bcc2cc 100644 --- a/macros/latex/contrib/biblatex/latex/cbx/authortitle-icomp.cbx +++ b/macros/latex/contrib/biblatex/latex/cbx/authortitle-icomp.cbx @@ -203,7 +203,10 @@ \newrobustcmd{\cbx@textcite@init}[2]{% \setcounter{textcitetotal}{0}% \setcounter{textcitecount}{0}% - \def\cbx@savedcites{#1}#2\cbx@savedcites\empty} + \def\cbx@savedcites{#1}#2% + \ifnumgreater{\value{textcitetotal}}{0} + {\cbx@savedcites} + {}} \DeclareMultiCiteCommand{\cbx@textcites}{\cbx@textcite}{} \DeclareMultiCiteCommand{\textcites}[\cbx@textcites@init\cbx@textcites]{\textcite}{} diff --git a/macros/latex/contrib/biblatex/latex/cbx/authoryear-comp.cbx b/macros/latex/contrib/biblatex/latex/cbx/authoryear-comp.cbx index 11d91b054e..d764eac8bf 100644 --- a/macros/latex/contrib/biblatex/latex/cbx/authoryear-comp.cbx +++ b/macros/latex/contrib/biblatex/latex/cbx/authoryear-comp.cbx @@ -246,7 +246,10 @@ \newrobustcmd{\cbx@textcite@init}[2]{% \setcounter{textcitetotal}{0}% \setcounter{textcitecount}{0}% - \def\cbx@savedcites{#1}#2\cbx@savedcites\empty} + \def\cbx@savedcites{#1}#2% + \ifnumgreater{\value{textcitetotal}}{0} + {\cbx@savedcites} + {}} \DeclareMultiCiteCommand{\cbx@textcites}{\cbx@textcite}{} \DeclareMultiCiteCommand{\textcites}[\cbx@textcites@init\cbx@textcites]{\textcite}{} diff --git a/macros/latex/contrib/biblatex/latex/cbx/authoryear-icomp.cbx b/macros/latex/contrib/biblatex/latex/cbx/authoryear-icomp.cbx index a194473bea..8897a7ad40 100644 --- a/macros/latex/contrib/biblatex/latex/cbx/authoryear-icomp.cbx +++ b/macros/latex/contrib/biblatex/latex/cbx/authoryear-icomp.cbx @@ -275,7 +275,10 @@ \newrobustcmd{\cbx@textcite@init}[2]{% \setcounter{textcitetotal}{0}% \setcounter{textcitecount}{0}% - \def\cbx@savedcites{#1}#2\cbx@savedcites\empty} + \def\cbx@savedcites{#1}#2% + \ifnumgreater{\value{textcitetotal}}{0} + {\cbx@savedcites} + {}} \DeclareMultiCiteCommand{\cbx@textcites}{\cbx@textcite}{} \DeclareMultiCiteCommand{\textcites}[\cbx@textcites@init\cbx@textcites]{\textcite}{} diff --git a/macros/latex/contrib/biblatex/latex/cbx/numeric-comp.cbx b/macros/latex/contrib/biblatex/latex/cbx/numeric-comp.cbx index 86dfce242d..187ca2bce6 100644 --- a/macros/latex/contrib/biblatex/latex/cbx/numeric-comp.cbx +++ b/macros/latex/contrib/biblatex/latex/cbx/numeric-comp.cbx @@ -305,7 +305,10 @@ \newrobustcmd{\cbx@textcite@init}[2]{% \setcounter{textcitetotal}{0}% \setcounter{textcitecount}{0}% - \def\cbx@savedcites{#1}#2\cbx@savedcites\empty} + \def\cbx@savedcites{#1}#2% + \ifnumgreater{\value{textcitetotal}}{0} + {\cbx@savedcites} + {}} \DeclareMultiCiteCommand{\cbx@textcites}{\cbx@textcite}{} \DeclareMultiCiteCommand{\textcites}[\cbx@textcites@init\cbx@textcites]{\textcite}{} diff --git a/macros/latex/contrib/biblatex/latex/cbx/numeric.cbx b/macros/latex/contrib/biblatex/latex/cbx/numeric.cbx index 8ea47d1338..68b10d891c 100644 --- a/macros/latex/contrib/biblatex/latex/cbx/numeric.cbx +++ b/macros/latex/contrib/biblatex/latex/cbx/numeric.cbx @@ -140,7 +140,10 @@ \newrobustcmd{\cbx@textcite@init}[2]{% \setcounter{textcitetotal}{0}% \setcounter{textcitecount}{0}% - \def\cbx@savedcites{#1}#2\cbx@savedcites\empty} + \def\cbx@savedcites{#1}#2% + \ifnumgreater{\value{textcitetotal}}{0} + {\cbx@savedcites} + {}} \DeclareMultiCiteCommand{\cbx@textcites}{\cbx@textcite}{} \DeclareMultiCiteCommand{\textcites}[\cbx@textcites@init\cbx@textcites]{\textcite}{} diff --git a/macros/latex/contrib/biblatex/latex/lbx/lithuanian.lbx b/macros/latex/contrib/biblatex/latex/lbx/lithuanian.lbx index 0bcbb3a7b5..07482617ff 100644 --- a/macros/latex/contrib/biblatex/latex/lbx/lithuanian.lbx +++ b/macros/latex/contrib/biblatex/latex/lbx/lithuanian.lbx @@ -12,7 +12,7 @@ {The file 'lithuanian.lbx' requires UTF-8 encoding but you seem\MessageBreak to be using a different encoding. This is a fatal error. I will\MessageBreak abort loading - russian.lbx now.}% + lithuanian.lbx now.}% \endinput} \DeclareBibliographyExtras{% diff --git a/macros/latex/contrib/pagelayout/README.md b/macros/latex/contrib/pagelayout/README.md index aa94a0fe9e..16ab16e72c 100644 --- a/macros/latex/contrib/pagelayout/README.md +++ b/macros/latex/contrib/pagelayout/README.md @@ -73,7 +73,7 @@ For a complete reference, read the [manual](doc/pagelayout-manual.pdf). In general, you should use the package manager shipped with your TeX distribution to install the pagelayout package. -To install manually, copy the contents of [pagelayout.tds.zip](https://github.com/friedemannbartels/latex-pagelayout/releases/download/v1.0.3/pagelayout.tds.zip) to your local TeX directory tree and run the command `texhash`. +To install manually, copy the contents of [pagelayout.tds.zip](https://github.com/friedemannbartels/latex-pagelayout/releases/download/v1.0.4/pagelayout.tds.zip) to your local TeX directory tree and run the command `texhash`. To enable image optimization, shadow creation, and preflight, perform these installation steps: diff --git a/macros/latex/contrib/pagelayout/doc/pagelayout-manual.pdf b/macros/latex/contrib/pagelayout/doc/pagelayout-manual.pdf Binary files differindex 6c8c02bfe9..85d1fb4985 100644 --- a/macros/latex/contrib/pagelayout/doc/pagelayout-manual.pdf +++ b/macros/latex/contrib/pagelayout/doc/pagelayout-manual.pdf diff --git a/macros/latex/contrib/pagelayout/doc/pagelayout-manual.tex b/macros/latex/contrib/pagelayout/doc/pagelayout-manual.tex index 4c636941e3..abab7ba9cf 100644 --- a/macros/latex/contrib/pagelayout/doc/pagelayout-manual.tex +++ b/macros/latex/contrib/pagelayout/doc/pagelayout-manual.tex @@ -18,7 +18,7 @@ \usepackage{tikz} \OnlyDescription \hypersetup{pdfborder={0 0 0}} -\def\pagelayoutversion{1.0.3} +\def\pagelayoutversion{1.0.4} \begin{document} diff --git a/macros/latex/contrib/pagelayout/scripts/pagelayoutapi b/macros/latex/contrib/pagelayout/scripts/pagelayoutapi index 295beef2f4..4c6888a249 100755 --- a/macros/latex/contrib/pagelayout/scripts/pagelayoutapi +++ b/macros/latex/contrib/pagelayout/scripts/pagelayoutapi @@ -13,7 +13,7 @@ # LaTeX version 2008/05/04 or later. # -version=1.0.3 +version=1.0.4 _convert() { turbo=$1 @@ -136,7 +136,7 @@ optimize() { } makeshadow() { - if command -v magick >/dev/null 2>&1; then + if command -v inkscape >/dev/null 2>&1; then filename=$1 stdDeviation=$2 opacity=$3 diff --git a/macros/latex/contrib/pagelayout/scripts/textestvis b/macros/latex/contrib/pagelayout/scripts/textestvis index 36b3ff6cfb..dba5e4c1aa 100755 --- a/macros/latex/contrib/pagelayout/scripts/textestvis +++ b/macros/latex/contrib/pagelayout/scripts/textestvis @@ -13,7 +13,7 @@ # LaTeX version 2008/05/04 or later. # -version=1.0.3 +version=1.0.4 OK="$( tput setaf 2 )•$( tput sgr0 )" FAILED="$( tput setaf 1 )$( tput bold )x$( tput sgr0 )" diff --git a/macros/latex/contrib/pagelayout/tex/pagelayout.cls b/macros/latex/contrib/pagelayout/tex/pagelayout.cls index 2f0257de2a..219520dc7b 100644 --- a/macros/latex/contrib/pagelayout/tex/pagelayout.cls +++ b/macros/latex/contrib/pagelayout/tex/pagelayout.cls @@ -13,8 +13,8 @@ %% \NeedsTeXFormat{LaTeX2e}[2020/10/01] -\ProvidesClass{pagelayout}[2023/01/23 Layout graphic rich documents] -\def\pagelayoutversion{1.0.3} +\ProvidesClass{pagelayout}[2023/03/05 Layout graphic rich documents] +\def\pagelayoutversion{1.0.4} % packages \RequirePackage{pgfopts} @@ -391,8 +391,8 @@ \x=\dimexpr\pal@gridstartx{\pal@undefdim}-\pal@leftbleed\relax \y=\dimexpr\pal@gridstarty{\pal@undefdim}-\pal@bottombleed\relax - \pal@gridstartxdim=\dimexpr\pal@gridstartx{\pal@gridoptionx}\relax - \pal@gridstartydim=\dimexpr\pal@gridstarty{\pal@gridoptiony}\relax + \pal@gridstartxdim=\dimexpr\pal@gridstartx{\pal@gridoptionx} - \pal@gutter / 2\relax + \pal@gridstartydim=\dimexpr\pal@gridstarty{\pal@gridoptiony} - \pal@gutter / 2\relax \pal@gridwidth=\dimexpr\pal@calculatefullgridwidth\relax \ifnum\rowsH>0 @@ -728,7 +728,7 @@ \newcommand\pal@gridstartx[1]{ \ifdim\dimexpr#1\relax=\pal@undefdim \ifpal@isdoublepage - (\pal@outermargin + \pal@leftbleed - \pal@gutter / 2 + (\pal@outermargin + \pal@leftbleed \ifpal@frontcover \else \ifpal@fanfold @@ -740,11 +740,11 @@ \fi ) \else - (\pal@leftmargin + \pal@leftbleed - \pal@gutter / 2) + (\pal@leftmargin + \pal@leftbleed) \fi \else% \ifpal@isdoublepage - (#1 + \pal@leftbleed - \pal@gutter / 2 + (#1 + \pal@leftbleed \ifpal@frontcover \else \ifpal@fanfold @@ -756,15 +756,15 @@ \fi ) \else - (#1 + \pal@leftbleed - \pal@gutter / 2) + (#1 + \pal@leftbleed) \fi \fi% } \newcommand\pal@gridstarty[1]{ \ifdim\dimexpr#1\relax=\pal@undefdim - (\pal@bottommargin + \pal@bottombleed - \pal@gutter / 2)% + (\pal@bottommargin + \pal@bottombleed)% \else% - (#1 + \pal@bottombleed - \pal@gutter / 2) + (#1 + \pal@bottombleed) \fi% } \newcommand\pal@setdimensions{ @@ -1532,8 +1532,20 @@ \height=\dimexpr(\pal@yy - \pal@y)\relax \pal@x=\dimexpr(\pal@x + \width)\relax \pal@y=\dimexpr(\pal@y + \height)\relax - \ifdim\pal@x>\dimexpr\pal@pagewidth+\pal@innerbleed+\pal@outerbleed\relax - \pal@x=\dimexpr\pal@pagewidth+\pal@innerbleed+\pal@outerbleed\relax + \ifpal@frontcover + \ifdim\pal@x>\dimexpr2\pal@pagewidth+2\pal@outerbleed+\spinewidth\relax + \pal@x=\dimexpr2\pal@pagewidth+2\pal@outerbleed+\spinewidth\relax + \fi + \else + \ifpal@fanfold + \ifdim\pal@x>\dimexpr2\pal@pagewidth+2\pal@outerbleed\relax + \pal@x=\dimexpr2\pal@pagewidth+2\pal@outerbleed\relax + \fi + \else + \ifdim\pal@x>\dimexpr\pal@pagewidth+\pal@innerbleed+\pal@outerbleed\relax + \pal@x=\dimexpr\pal@pagewidth+\pal@innerbleed+\pal@outerbleed\relax + \fi + \fi \fi \ifdim\pal@y>\dimexpr\pal@pageheight+\pal@topbleed+\pal@bottombleed\relax \pal@y=\dimexpr\pal@pageheight+\pal@topbleed+\pal@bottombleed\relax @@ -3720,11 +3732,7 @@ \ClassError{pagelayout}{Shell access forbidden. #1}{Make sure `pagelayoutapi' is added to the list of shell escape commands\MessageBreak(shell_escape_commands = pagelayoutapi) in your `texmf.cnf'.\MessageBreak\MessageBreak\@ehc} } \def\pal@errmsg@shellaccessfailed#1{ - \ifdefined\XeTeXversion - \ClassError{pagelayout}{Shell access failed. #1}{Make sure the `scripts' folder is added to your path.\MessageBreak\MessageBreak\@ehc} - \else - \ClassError{pagelayout}{Shell access failed. #1}{Make sure the `scripts' folder is added to your path.\MessageBreak Shell access does not work in unrestricted mode (--shell-escape).\MessageBreak Make sure `pagelayoutapi' is added to the list of shell escape commands\MessageBreak(shell_escape_commands = pagelayoutapi) in your `texmf.cnf'.\MessageBreak\MessageBreak\@ehc} - \fi + \ClassError{pagelayout}{Shell access failed. #1}{Make sure the `scripts' folder is added to your path.\MessageBreak\MessageBreak\@ehc} } \def\pal@errmsg@inkscapenotinstalled#1{ \ClassError{pagelayout}{Inkscape not installed. #1}{Make sure Inkscape is installed.\MessageBreak\MessageBreak\@ehc} diff --git a/macros/latex/contrib/spacingtricks/spacingtricks.dtx b/macros/latex/contrib/spacingtricks/spacingtricks.dtx index 68a4afbdd9..cea5d0322e 100644 --- a/macros/latex/contrib/spacingtricks/spacingtricks.dtx +++ b/macros/latex/contrib/spacingtricks/spacingtricks.dtx @@ -20,7 +20,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{spacingtricks} - [2023/02/27 v1.5 .dtx spacingtricks file] + [2023/03/05 v1.6 .dtx spacingtricks file] %</package> %<*driver> \documentclass{ltxdoc} @@ -58,7 +58,7 @@ %</driver> % \fi % -% \CheckSum{242} +% \CheckSum{246} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -108,17 +108,21 @@ % \changes{v1.5}{2023/02/26}{ % - Tests and comments about paracol and reledpar packages} % +% \changes{v1.6}{2023/03/05}{ +% - Any list symbol is followed by a space if there is no punctuation character after it, +% - some changes in documentation} +% % \GetFileInfo{spacingtricks.sty} % % \title{The \textsf{spacingtricks} package\thanks{This document % corresponds to \textsf{spacingtricks}~\fileversion, dated \filedate.}} % \author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}} -% \date{February 27, 2023} +% \date{March 5, 2023} % \maketitle % % \section{Introduction} % -% This package offers some macros to deal with spacing issues. Thus: +% This package offers a few macros to deal with spacing issues. Thus: % \begin{compactlist} % \item \hyperlink{centered}{\texttt{\bslash centered}} yields good horizontal % centering without vertical spacing; @@ -133,7 +137,7 @@ % produces indentation of all its content; % \item the \hyperlink{compactlist}{\texttt{compactlist}} environment % yields a compact list, without vertical spacing between the items, like here; -% several \hyperlink{aliases}{aliases} are provided to type some list symbols shorter: +% several aliases are provided to type some \hyperlink{symbols}{list symbols} shorter: % "\bul", "\dash", "\ddash", "\aster", "\hand", "\checksymb", "\arrowsymb"; % \item common abbreviations \hyperlink{ie-eg}{\ie and \eg} % are typeset by the macros "\ie" and "\eg" with correct spacing; @@ -252,9 +256,9 @@ % a thin space is added before the note calls, and the new \texttt{\bslash footnote} % macro does not alter this behavior.}. % To avoid undesirable spaces, we don't have to put some space before -% or after writing "\footnote{", for instance: +% writing "\footnote{", for instance: % \begin{center} -% "this is a note\footnote{good spacing} which works fine," +% "Here is no space\footnote{The old command} before the macro." % \end{center} % but sometimes, it is convenient to place the "\footnote" command % on a new line. To achieve this, "\footnote" has been redefined to completely eliminate @@ -271,7 +275,8 @@ %The old command.} %with bad spacing. % \end{verbatim} -% \vspace{-4ex} This a note +% \vspace{-4ex} +% This is a note % \footnt{ % The old command.} % with bad spacing. @@ -284,7 +289,8 @@ %The new command.} %with good spacing. % \end{verbatim} -% \vspace{-4ex} This a note +% \vspace{-4ex} +% This is a note % \footnote{ % The new command.} % with good spacing. @@ -294,7 +300,7 @@ % \DescribeMacro{\footnotespace} \DescribeMacro{\footenoteindent} % Like the old one, the new "\footnote" command can take an optional argument % to force the number of the note. -% Likewise, we have always the customization macros +% Likewise, we have always customization macros % "\footnotesize", "\footnotesep", "\footnoterule", % but two new macros have been added to manage spacing: % "\footnotespace" produces the space before the note call symbol @@ -324,20 +330,16 @@ % If the values of \meta{height} and \meta{depth} are inferior to the height and depth % of the current line, the command has no effect. % Here are some examples. -% -% \noindent -% \begin{minipage}[t]{8cm} +% \setlength{\juxtopskip}{0pt}\setlength{\juxbottomskip}{0pt} +% \begin{juxtapose} % \begin{verbatim} %\[\frac{\sqrt{0.5p}}{10} = %\frac{\sqrt{\vstrut{1.7ex} 0.5p}}{10}\] % \end{verbatim} -% \end{minipage} -% \hfill -% \begin{minipage}[t]{6cm} +% \otherside % \[\frac{\sqrt{0.5p}}{10} = \frac{\sqrt{\vstrut{1.7ex} 0.5p}}{10}\] -% \end{minipage} -% \\ -% "\fbox{\vstrut{2ex}$\sigma(X)=1$}" gives +% \end{juxtapose} +% \noindent"\fbox{\vstrut{2ex}$\sigma(X)=1$}" gives % \fbox{\vstrut{2ex}$\sigma(X)=1$} % better than \fbox{$\sigma(X)=1$}. % @@ -382,10 +384,10 @@ % \end{array} %\] % However, for tables, we have the \textsf{arraycols} package~\cite{ARCOL}, -% based on \textsf{cellspace}~\cite{CELLSP}, which allows to adjust +% based on \textsf{cellspace}~\cite{CELLSP}, which allows to adjust % row heights automatically. Nevertheless, "\vstrut" can be useful for fine adjustments. % -% In a text line, "\vstrut" can be used in place of "\vspace". +% In a text line "\vstrut" can be used to increase line space, better than "\vspace". % % \hypertarget{indent}{} % \medskip @@ -443,7 +445,7 @@ % As for lists in \LaTeX, items are generated by the "\item" command. % The environment has an optional argument: "\begin{compactlist}"\oarg{symbol}. % -% \hypertarget{aliases}{} +% \hypertarget{symbols}{} % \medskip % \DescribeMacro{\bul}\DescribeMacro{\dash}\DescribeMacro{\ddash}\DescribeMacro{\aster} % The default item symbol is "\textbullet", but can be changed. @@ -468,10 +470,11 @@ % \item Second item. % \item Third item. % \end{compactlist} -% \hand These aliases can also be used directly in text mode, of course. -% For "\hand", "\checksymb" and "\arrowsymb", the symbol is followed by a space -% if there is no punctuation character just after it (thanks to the +% \hand These aliases can also be used directly in some text. +% The symbol is followed by a space if there is no punctuation character +% just after it (thanks to the % macro \texttt{xspace} from the \textsf{xspace} package~\cite{XSP}). +% Use "\"\meta{symbol}"\unskip" if you want to remove this space. % % \smallskip % \DescribeMacro{\compactlistindent} @@ -605,7 +608,8 @@ % nevertheless vertical positioning can be tricky % and it doesn't belong to common distributions \TeX{}\,Live or MiK\TeX. % A last one we mention is \textsf{picinpar}~\cite{PICINPAR} in which -% text can begin after the first line and can flow to the two side of the figure. +% text can begin after the first line and can flow to the two side of the figure; +% it allows several paragraphs but neither lists, nor verbatim text. % % \hypertarget{juxtapose}{} % \medskip @@ -634,7 +638,8 @@ % without the need of \texttt{multipage} environments. % The two boxes are aligned by their center, but -% unlike "\dualboxes", you cannot adjust vertical positioning. +% unlike "\dualboxes", you cannot adjust vertical positioning, +% except using "\vspace".\smallskip % % \otherside % \myfigure @@ -655,14 +660,15 @@ % (from indent length) and otherwise the user may forgot to % put "\noindent" before the figure. % If you still want to indent the first paragraph use "\indent". -% For horizontal alignment inside one side, you can use "\centering" or "\flushright" +% For horizontal alignment inside a box, you can use "\centering" or "\flushright" % (useful for a figure). % If you want a global indentation of the first (or the second) box, you % can put it in an \texttt{indentblock} environment, it works fine! % % \medskip % One may ask why not using multi column environments instead. -% In the classic \textsf{multicol} environment you cannot choose unbalanced +% In the classic \textsf{multicol} environment you cannot choose +% horizontally unbalanced % columns and you cannot choose where to pass to the other column. % % Some nice packages improve \textsf{multicols}, \eg \textsf{vwcol}~\cite{VWCOL} in which @@ -754,12 +760,12 @@ } }{\end{list}} -\providecommand{\bul}{\textbullet} -\providecommand{\dash}{\textendash} -\providecommand{\ddash}{\textemdash} -\providecommand{\aster}{\textasteriskcentered} +\providecommand{\bul}{\textbullet\xspace} +\providecommand{\dash}{\textendash\xspace} +\providecommand{\ddash}{\textemdash\xspace} +\providecommand{\aster}{\textasteriskcentered\xspace} % \end{macrocode} -% The command "\asterisk" already exists in the \textsf{mathabx} package.\\ +% The command "\asterisk" already exists in the \textsf{mathabx} package (for math mode only).\\ % The following macros need the \textsf{pifont} package. % \smallskip % \begin{macrocode} diff --git a/macros/latex/contrib/spacingtricks/spacingtricks.pdf b/macros/latex/contrib/spacingtricks/spacingtricks.pdf Binary files differindex ba4d8631b8..4b11efd3b1 100644 --- a/macros/latex/contrib/spacingtricks/spacingtricks.pdf +++ b/macros/latex/contrib/spacingtricks/spacingtricks.pdf diff --git a/macros/luatex/generic/minim-math/README b/macros/luatex/generic/minim-math/README index 2463570ef8..e6f44401e2 100644 --- a/macros/luatex/generic/minim-math/README +++ b/macros/luatex/generic/minim-math/README @@ -1,4 +1,4 @@ -Version: 2022/1.1 +Version: 2023/1.2 SUMMARY @@ -18,6 +18,13 @@ In order to obtain the typeset manual of this package, simply say: HISTORY +2023/1.2 (1/1/2023) + + Minor additions: + + * Add \unaryminus and \smartdecimalcomma + * Add convenience functions for numbering displayed equations. + 2022/1.1 (1/1/2022) Minor changes: diff --git a/macros/luatex/generic/minim-math/minim-math.doc b/macros/luatex/generic/minim-math/minim-math.doc index 79ff1dee71..d458876b41 100644 --- a/macros/luatex/generic/minim-math/minim-math.doc +++ b/macros/luatex/generic/minim-math/minim-math.doc @@ -8,8 +8,8 @@ \else \startmetadata author {Esger Renkema} title {minim-math} - date {2022-03-03} - version {2022/1.1} + date {2023-03-03} + version {2023/1.2} keywords {LuaTeX; Plain TeX; Unicode mathematics} stopmetadata \maketitle \fi @@ -117,6 +117,8 @@ sizes, too. Say ⟦*\decimalcomma⟧ and have commas appear as $\decimalcomma1,2$ instead of~$1,2$ (⟦*\nodecimalcomma⟧ restores the default). +Say ⟦*\smartdecimalcomma⟧ for a comma that only acts as punctuation when not +immediately followed by a digit. The explicit ⟦*\comma⟧, like ⟦*\colon⟧, will always be punctuation. The behaviour of limits on integral signs can be set by redefining @@ -209,6 +211,20 @@ brackets: ⟦$$\underbrace[=1]{(x^2+∥penalty0y^2)}$$⟧ gives $$\underbrace[=1]{(x^2 + y^2)}.$$ +Finally, the following (entirely optional) alternative to using dollar signs is +provided, which also offers slight improvements in the spacing of displayed +equations: +\stopformulatagging\Ustartdisplaymath +\halign{# \hfil&#\quad&#\hfil\cr +&⟦\[ ... \]⟧&inline mathematics\cr +⟦\display⟧&⟦\[ ... \]⟧&display mathematics\cr +⟦\displaynr {nr}⟧&⟦\[ ... \]⟧&numbered display mathematics\cr +⟦\displaynr⟧&⟦\[ ... \]⟧&automatically numbered display mathematics\cr +}\Ustopdisplaymath\startformulatagging + +The automatic display numbering uses the count ⟦\equationnumber⟧ and the token +list ⟦\setequationnumber⟧ internally. All displays created this way can be made +left-aligned by saying ⟦\leftdisplaystrue⟧. \section Best practices diff --git a/macros/luatex/generic/minim-math/minim-math.lua b/macros/luatex/generic/minim-math/minim-math.lua index 6373809e43..a4540a92b2 100644 --- a/macros/luatex/generic/minim-math/minim-math.lua +++ b/macros/luatex/generic/minim-math/minim-math.lua @@ -365,8 +365,9 @@ end -- list of noads. --]] -local listmathfields = { 'head', 'nucleus', 'sub', 'sup', 'accent', 'bot_accent', - 'display', 'text', 'script', 'scriptscript', 'num', 'denom', 'degree', 'next' } +local listmathfields = { 'head', 'nucleus', 'sub', 'sup', 'accent', + 'bot_accent', 'display', 'text', 'script', 'scriptscript', 'num', 'denom', + 'degree', 'next' } -- note that ‘next’ should be last! local function noad_iterator (head) local nodelist = { link=nil, content=head } @@ -385,7 +386,7 @@ end local math_char = node.id ('math_char') -local function inspect_noads (h,d,n) +local function inspect_noads (h, _, _) for nd in noad_iterator (h) do if nd.id == math_char then local sa = node.has_attribute(nd, style_attribute) @@ -431,7 +432,6 @@ local is_delimiter = } local function tex_accent(class, num, char) - kind = kind or '' return '\\math:'..accents[class]..'{'..num..'}'..char end diff --git a/macros/luatex/generic/minim-math/minim-math.pdf b/macros/luatex/generic/minim-math/minim-math.pdf Binary files differindex 33e9aec9f6..6a80c7a07e 100644 --- a/macros/luatex/generic/minim-math/minim-math.pdf +++ b/macros/luatex/generic/minim-math/minim-math.pdf diff --git a/macros/luatex/generic/minim-math/minim-math.tex b/macros/luatex/generic/minim-math/minim-math.tex index 06fb632a5c..d24a6693dc 100644 --- a/macros/luatex/generic/minim-math/minim-math.tex +++ b/macros/luatex/generic/minim-math/minim-math.tex @@ -77,7 +77,7 @@ \protected\def\mbb#1{{\mathstyle{bb}#1}} \protected\def\frak#1{{\mathstyle{frak}#1}} \protected\def\bffrak#1{{\mathstyle{bffrak}#1}} -\protected\def\scr#1{{\mathstyle{scr}#1}} \let\mcal = \cal +\protected\def\scr#1{{\mathstyle{scr}#1}} \let\mcal = \scr \protected\def\bfscr#1{{\mathstyle{bfscr}#1}} \let\bfcal = \bfscr % 1 Processing the character table @@ -137,8 +137,26 @@ % decimal comma settings \explicitmathchar \comma +\Umathchardef \ordcomma "0"0"2C +\protected\def\smartcomma{% + \futurelet\smartcomma:next\smartcomma:do} +\def\smartcomma:do{\let\smartcomma:c\comma + \ifx0\smartcomma:next\let\smartcomma:c\ordcomma\fi + \ifx1\smartcomma:next\let\smartcomma:c\ordcomma\fi + \ifx2\smartcomma:next\let\smartcomma:c\ordcomma\fi + \ifx3\smartcomma:next\let\smartcomma:c\ordcomma\fi + \ifx4\smartcomma:next\let\smartcomma:c\ordcomma\fi + \ifx5\smartcomma:next\let\smartcomma:c\ordcomma\fi + \ifx6\smartcomma:next\let\smartcomma:c\ordcomma\fi + \ifx7\smartcomma:next\let\smartcomma:c\ordcomma\fi + \ifx8\smartcomma:next\let\smartcomma:c\ordcomma\fi + \ifx9\smartcomma:next\let\smartcomma:c\ordcomma\fi + \smartcomma:c} + \protected\def\decimalcomma {\Umathcode`\, = 0 \Umathcharfam`\, `\,} \protected\def\nodecimalcomma{\Umathcode`\, = 6 \Umathcharfam`\, `\,} +\protected\def\smartdecimalcomma{\mathlet,\smartcomma} + % set the colon to how it used to be \Umathcode`\:="3"0"2236 % \ratio @@ -439,13 +457,18 @@ \def\norm#1{\left\vert#1\right\vert} \let \abs=\norm \def\Norm#1{\left\Vert#1\right\Vert} -% a smaller inverse-function sign -\protected\def\inv{^{\scriptscriptstyle - \mathbin{\setbox0=\hbox{$\scriptscriptstyle-$} - \kern.75\wd0 \pdfextension save +% a slightly smaller unary minus +\def\unaryminus{\mathord{\mathpalette\unaryminus:make{}}} +\def\unaryminus:make#1#2{% + \setbox0 = \hbox{$#1-$} + \kern .75\wd0 + \pdfextension save \pdfextension setmatrix{.75 0 0 1} - \kern-\wd0\box0 \pdfextension restore} - \mkern-2mu 1}} + \kern -\wd0 \box0 + \pdfextension restore} + +% a smaller inverse-function sign +\protected\def\inv{^{\scriptscriptstyle\unaryminus1}}% % upright multiletter symbols \def\mord#1{\mathord{\mathstyle{up}#1}} @@ -504,6 +527,48 @@ \newmathop {End} \newmathop {Aut} \newmathop {Dom} \newmathop {Codom} +% 1 Displayed equations + +\newif\ifdisplay: +\newif\ifdisplay:nr +\newif\ifleftdisplays +\newtoks\setdisplaynr +\newtoks\display:specialnr +\display:specialnr{\the\setdisplaynr} + +% \display +\protected\def\display{\display:true} +% \displaynr {nr} +\protected\def\displaynr{\display:true\display:nrtrue + \nextifcat\bgroup\display:specialnr\relax} + +% \[ ... \] +\protected\def\[{\ifdisplay:\expandafter\startdisplay\else\Ustartmath\fi} +\protected\def\]{\global\expandafter\display:false + \ifdisplay:\expandafter\stopdisplay\else\Ustopmath\fi} + +\protected\def\startdisplay{% + % if the display starts a paragraph, omit baselineskip + % and ensure that the long \beforedisplayskip is used + \ifvmode \nointerlineskip + \noindent \hbox to .5\hsize{\hss}\fi + \Ustartdisplaymath + % for left-aligned equations, force manual placement + \ifleftdisplays\muskip0mu\fi} +\protected\def\stopdisplay{% + \ifleftdisplays + \hskip\displaywidth minus\displaywidth\fi + \global\expandafter\display:nrfalse + \ifdisplay:nr + \eqno\the\display:specialnr + \global\display:specialnr{\the\setdisplay:nr}\fi + \Ustopdisplaymath + \ignorespaces} + +% default equation numbering +\newcount\equationnumber \equationnumber = 0 +\setdisplaynr{\global\advance\eqnr1(\the\equationnumber)} + % standard mappings diff --git a/macros/luatex/generic/minim-mp/README b/macros/luatex/generic/minim-mp/README index 2e04ee1050..b28f8c4267 100644 --- a/macros/luatex/generic/minim-mp/README +++ b/macros/luatex/generic/minim-mp/README @@ -1,4 +1,4 @@ -Version: 2022/1.1 +Version: 2023/1.2 SUMMARY @@ -19,6 +19,11 @@ In order to obtain the typeset manual of this package, simply say: HISTORY +2023/1.2 (3/3/2023) + + * Add a few more metapost macros. + * Various small bug fixes. + 2022/1.1 (3/3/2022) New features: diff --git a/macros/luatex/generic/minim-mp/minim-mp.doc b/macros/luatex/generic/minim-mp/minim-mp.doc index b7fb47f416..af84cd1581 100644 --- a/macros/luatex/generic/minim-mp/minim-mp.doc +++ b/macros/luatex/generic/minim-mp/minim-mp.doc @@ -8,8 +8,8 @@ \else \startmetadata author {Esger Renkema} title {minim-mp} - date {2022-03-03} - version {2022/1.1} + date {2023-03-03} + version {2023/1.2} keywords {LuaTeX; Plain TeX; MetaPost; mplib} stopmetadata \maketitle \fi @@ -291,6 +291,11 @@ cmyk-colours ⟦*cyan⟧, ⟦*magenta⟧, ⟦*yellow⟧ and ⟦*key⟧. The macr ⟦*clockwise⟧, ⟦*xshifted⟧, ⟦*yshifted⟧, ⟦*hflip⟧ and ⟦*vflip⟧, where the flips are defined in such a way that ⟦p & hflip p⟧ gives the expected result. +Version 1.2 brought the following additions: ⟦*save_pair⟧, ⟦*save_path⟧ etc. +etc. that save and declare in one go; the missing trigonometric functions +⟦*tand⟧, ⟦*arcsind⟧, ⟦*arccosd⟧ and ⟦*arctand⟧, and the unit circle segment +drawing function ⟦*arc(⟧$θ_0$⟦*,⟧$θ_ℓ$⟦*)⟧ (taking a starting angle and arc +length, both in degrees). \section Lua interface %1 diff --git a/macros/luatex/generic/minim-mp/minim-mp.lua b/macros/luatex/generic/minim-mp/minim-mp.lua index 366313e60b..a247c49499 100644 --- a/macros/luatex/generic/minim-mp/minim-mp.lua +++ b/macros/luatex/generic/minim-mp/minim-mp.lua @@ -58,12 +58,12 @@ function A.save(append) stroke = st.stroke, fill = st.fill } - append:node(node.new(8, 30)) -- q + append:node(node.new('whatsit', 'pdf_save')) -- q end function A.restore(append) append.state[#append.state] = nil - append:node(node.new(8, 31)) -- Q + append:node(node.new('whatsit', 'pdf_restore')) -- Q end -- The following callback is executed just before the final step of surrounding @@ -138,7 +138,7 @@ function A.printobj(append, obj) if obj.pen then local x = obj.pen.type or 'not elliptical' append:literal('%% pen: see below, form: %s', x) - local x = mplib.pen_info(obj) + x = mplib.pen_info(obj) append:literal('%% | width: %s', tostring(x.width)) append:literal('%% | sx: %s', tostring(x.sx)) append:literal('%% | sy: %s', tostring(x.sy)) @@ -197,7 +197,7 @@ local function curve_fmt(...) end function A.literal(append, fmt, ...) - local lit = node.new(8,16) -- pdf_literal + local lit = node.new('whatsit', 'pdf_literal') lit.data = fmt:format(...) append:node(lit) end @@ -484,9 +484,9 @@ M.postscripts = postscripts --2 choosing a parser -local function split_specials(specials) - if not specials then return function() return end end - local l = specials:explode('\r') +local function split_specials(thespecials) + if not thespecials then return function() return end end + local l = thespecials:explode('\r') local i, n = 0, #l return function() if i < n then i = i + 1 else return end @@ -627,7 +627,7 @@ end postscripts.pdfcomment = prescripts.pdfcomment prescripts.latelua = function(append, str, object) - local n = node.new(8,7) -- late_lua + local n = node.new('whatsit', 'late_lua') n.data = str append:node(n) end @@ -637,7 +637,7 @@ prescripts.OTYPE = function(append, str, object) append.object_info.otype = append.object_info.otype or str end -specials.BASELINE = function(append, str, object) +specials.BASELINE = function(append, _, object) -- object is a ‘fill’ statement with only a single point in its path (and -- will thus not have to be transformed). append.baseline = object.path[1].y_coord @@ -684,8 +684,8 @@ local function make_pattern_xform(head, bb) return string.format(' /Resources << /XObject << /PTempl %d 0 R >> >>', xform), '/PTempl Do' end -local function definepattern(head, user, bb) - local bb = bbox_fmt(table.unpack(bb)) +local function definepattern(head, user, bbox) + local bb = bbox_fmt(table.unpack(bbox)) local pat, literals, resources = { write = write_pattern_object }, { } -- pattern content for n in node.traverse(head) do @@ -755,9 +755,9 @@ local function make_surrounding_box(nd_id, head) end local function wrap_picture(head, tx, ty) - local horizontal = make_surrounding_box(0, head) - local vertical = make_surrounding_box(1, horizontal) - local outer = make_surrounding_box(0, vertical) + local horizontal = make_surrounding_box('hlist', head) + local vertical = make_surrounding_box('vlist', horizontal) + local outer = make_surrounding_box('hlist', vertical) vertical.shift = tex.sp('-'..ty..'bp') horizontal.shift = tex.sp(''..tx..'bp') return outer @@ -765,7 +765,7 @@ end local function apply_transform(rect, box) local sx, rx, ry, sy, tx, ty = get_transform(rect) - local transform = node.new(8,29) -- pdf_setmatrix + local transform = node.new('whatsit', 'pdf_setmatrix') transform.next, box.prev = box, transform transform.data = string.format('%f %f %f %f', sx, rx, ry, sy) return wrap_picture(transform, tx, ty) @@ -780,14 +780,14 @@ function A.box(append, object, box) append:restore() end -specials.TEXBOX = function(append, box, object) - local box = tex.getbox(tonumber(box)) +specials.TEXBOX = function(append, boxnr, object) + local box = tex.getbox(tonumber(boxnr)) append:box(object, node.copy_list(box)) end specials.CHAR = function(append, data, object) local char, font, xo, yo = table.unpack(data:explode(' ')) - local n = node.new(29) -- glyph + local n = node.new('glyph') n.char, n.font, n.xoffset, n.yoffset = tonumber(char), tonumber(font), tonumber(xo), tonumber(yo) append:box(object, node.hpack(n)) @@ -849,7 +849,7 @@ local function print_log (nr, res, why) -- write out the log log('┌ %smetapost instance %s (%d)', why or '', i.jobname, i.nr) for _,line in ipairs(report) do - log('│ '..line) + log('│ %s', line) end log('└ %s', print_status(res.status)) -- generate error or warning if needed @@ -1198,9 +1198,9 @@ function M.close (nr) local res = i.instance:finish() print_log(nr, res, 'closing ') end - for _, nr in ipairs(i.boxes) do + for _, b in ipairs(i.boxes) do -- remove allocated boxes - tex.box[nr] = nil + tex.box[b] = nil end instances[nr] = false end @@ -1216,6 +1216,7 @@ local function retrieve(nr, name) else image = results.first end + if not image then return end results.count = results.count - 1 if image.prev then if image.next then @@ -1251,7 +1252,7 @@ function M.get_image(nr, name) end function M.shipout(nr) - local ox, oy = pdf.getorigin + local ox, oy = pdf.getorigin() local ho, vo = tex.hoffset, tex.voffset pdf.setorigin() tex.hoffset = 0 @@ -1280,7 +1281,8 @@ alloc.luadef('runmetapost', function() end, 'protected') alloc.luadef('runmetapostimage', function() local i = scan_int() - M.run(i, 'beginfig(0); '..scan_string()..' endfig;') + local code = 'beginfig(0)'..scan_string()..';endfig;' + M.run(i, code) node.write(M.get_image(i)) end, 'protected') diff --git a/macros/luatex/generic/minim-mp/minim-mp.pdf b/macros/luatex/generic/minim-mp/minim-mp.pdf Binary files differindex 1011878d1e..15ada22b36 100644 --- a/macros/luatex/generic/minim-mp/minim-mp.pdf +++ b/macros/luatex/generic/minim-mp/minim-mp.pdf diff --git a/macros/luatex/generic/minim-mp/minim.mp b/macros/luatex/generic/minim-mp/minim.mp index f3f03eb3d0..0bbaa2a27c 100644 --- a/macros/luatex/generic/minim-mp/minim.mp +++ b/macros/luatex/generic/minim-mp/minim.mp @@ -1,14 +1,14 @@ delimiters (); +message "Loading the minim extension macros"; + % redefine some constants to work with the new numerical engines numeric mm, cm, pt, pc, dd, cc; pc = 12 pt; cc = 12 dd; cm = 10 mm; 803 pt = 800; 127 mm = 360; 1157 dd = 1238 pt; eps := 1/2048; infinity := 64*64-epsilon; -message "Loading the minim extension macros"; - % interaction with tex vardef baseline expr o = fill if numeric o : (0,o) else: o fi @@ -114,6 +114,8 @@ def endpattern (expr xstep, ystep) = newinternal tilingtype; tilingtype:=1; _patterns_._last_ := 0; +message "Loading additional definitions"; + % shorthands primarydef p xshifted x = p shifted (x,0) enddef; primarydef p yshifted y = p shifted (0,y) enddef; @@ -141,4 +143,35 @@ key = (0,0,0,1); % constants pi := 355/113; +% shorthands +def save_pair text t = save t; pair t; enddef; +def save_path text t = save t; path t; enddef; +def save_color text t = save t; color t; enddef; +def save_cmykcolor text t = save t; cmykcolor t; enddef; +def save_transform text t = save t; transform t; enddef; +def save_boolean text t = save t; boolean t; enddef; +def save_string text t = save t; string t; enddef; + +% missing trigonometric functions +vardef tand primary x = sind(x)/cosd(x) enddef; +vardef arcsind primary x = angle((1+-+x, x)) enddef; +vardef arccosd primary x = angle((x, 1+-+x)) enddef; +vardef arctand primary x = angle(1, x) enddef; + +% segments of the circle (counterclockwise) +vardef arc (expr thetafrom, thetalen) = + save n, d, l, theta; save_path a; save_pair p, c; + n = ceiling(thetalen / 45); % number of segments (45° is max segment length) + d = thetalen / n; % angle of each segment + l = 4/3 * tand(d/4); % length of control points + theta := thetafrom; + p := (cosd theta, sind theta); + c := l * (-sind theta, cosd theta); + a := p for _ = 1 upto n: + .. controls (p + c) + hide(theta := theta + d; + p := (cosd theta, sind theta); + c := l * (-sind theta, cosd theta);) + and (p - c) .. p + endfor; a enddef; diff --git a/macros/luatex/generic/minim-pdf/README b/macros/luatex/generic/minim-pdf/README index d8f2b19c6e..cff0857823 100644 --- a/macros/luatex/generic/minim-pdf/README +++ b/macros/luatex/generic/minim-pdf/README @@ -1,4 +1,4 @@ -Version: 2022/1.1 +Version: 2023/1.2 SUMMARY @@ -27,6 +27,17 @@ In order to obtain the typeset manual of this package, simply say: HISTORY +2023/1.2 (3/3/2023) + + Breaking changes: + + * \marktablerow no longer implies \marktablecell. + + New features: + + * Support the use of an IDTree in the document structure. + * Add \tagattribute, \settagid and \showstructure. + 2022/1.1 (3/3/2022) New features: diff --git a/macros/luatex/generic/minim-pdf/minim-pdf.doc b/macros/luatex/generic/minim-pdf/minim-pdf.doc index 71e8cea89c..3030378bcb 100644 --- a/macros/luatex/generic/minim-pdf/minim-pdf.doc +++ b/macros/luatex/generic/minim-pdf/minim-pdf.doc @@ -14,8 +14,8 @@ all other features of the package are described here. \else \startmetadata author {Esger Renkema} title {minim-pdf} - date {2022-03-03} - version {2022/1.1} + date {2023-03-03} + version {2023/1.2} keywords {LuaTeX; Plain TeX; PDF/A; Tagged PDF; accessibility; a11y; hypertext; bookmarks; document outline; associated files} stopmetadata @@ -292,6 +292,8 @@ Keep in mind that the reassignment is local: if a paragraph marked with Auto-marking paragraphs can be (locally) disabled or enabled by saying ⟦*\markparagraphsfalse⟧ or ⟦*\markparagraphstrue⟧. +You can query the place in the document structure of any point with +⟦*\showdocumentstructure⟧. \section Structure element aliases %1 @@ -324,21 +326,26 @@ current SE from a named identifier ⟦\name⟧. \section Structure element options %1 -The ⟦\startelement⟧ command allows a few options that are not mentioned -above: its full syntax is ⟦*\startelement <options> {Tag}⟧. +The ⟦\startelement⟧ command allows a few options that are not mentioned above: +its full syntax is ⟦*\startelement <options> {Tag}⟧. The three most useful options are ⟦alt⟧ for setting an alt-text (the ⟦/Alt⟧ entry in the structure element dicionary), ⟦actual⟧ for a text replacement (⟦/ActualText⟧) and ⟦lang⟧ for the language (⟦/Lang⟧; see the next section). The alternative and actual texts can also be given after the fact with -⟦*\setalttext{...}⟧ and ⟦*\setactualtext{...}⟧; these apply to the current +⟦*\setalttext {...}⟧ and ⟦*\setactualtext {...}⟧; these apply to the current structure element. Structure element attributes can be given with -⟦attr <owner> <key> <value>⟧, e.g. ⟦attr Layout Placement /Inline⟧. +⟦attr <owner> <key> <value>⟧, e.g. ⟦attr Layout Placement /Inline⟧ or added +later with ⟦*\tagattribute⟧. Note that for the ⟦owner⟧ and ⟦key⟧ the initial slash must be omitted; the ⟦value⟧ on the other hand will be written to the pdf verbatim. Any number of attributes can be added. +An identifier can be set with the ⟦id⟧ option, or after the fact with +⟦*\settagid {...}⟧. This identifier will be added to the ⟦IDTree⟧ and is +entirely optional; you will probably already know when you need it. + Finally, structure element classes can be given with the ⟦class <classname>⟧ keyword, which can be repeated. Classes can be defined with @@ -394,8 +401,9 @@ the ⟦lbl⟧ is a section number and can also be empty.) For marking up tables, a whole array of helper macros is available. First, ⟦*\marktable⟧ should be given \emph{before} the ⟦\halign⟧. -Then, in the template, the first cell should start with ⟦*\marktablerow⟧ and -each subsequent cell with ⟦*\marktablecell⟧. +Then, in the template, the first cell should start with ⟦*\marktablerow⟧ +⟦*\marktablecell⟧ and +each subsequent cell with ⟦\marktablecell⟧. If your table starts with a header, insert ⟦*\marktableheader⟧ before it and ⟦*\marktablebody⟧ after. Before a table footer, insert ⟦*\marktablefooter⟧. diff --git a/macros/luatex/generic/minim-pdf/minim-pdf.lua b/macros/luatex/generic/minim-pdf/minim-pdf.lua index 96725523d2..72070366d3 100644 --- a/macros/luatex/generic/minim-pdf/minim-pdf.lua +++ b/macros/luatex/generic/minim-pdf/minim-pdf.lua @@ -1,5 +1,5 @@ -local M = { } +local M = { } local alloc = require('minim-alloc') local cb = require('minim-callbacks') alloc.remember('minim-hooks') @@ -56,7 +56,7 @@ local function full_traverse(head) end local function pdf_err(n, msg) - local m = node.new(8,16) -- pdf_literal + local m = node.new('whatsit', 'pdf_literal') m.mode, m.token = 2, '%% Warning: '..msg node.insert_after(n, n, m) end @@ -95,7 +95,7 @@ end local marker_whatsit = alloc.new_whatsit('tagged pdf marker') local function make_whatsit(t, se, order) - local n = node.new(8, 8); -- user_defined + local n = node.new('whatsit', 'user_defined'); n.user_id, n.type = marker_whatsit, 108 n[current_struct] = se or tex.attribute['tagging:current:se'] n[current_order] = order or tex.attribute['tagging:element:order'] @@ -247,7 +247,7 @@ end, 'protected') local function stable_sort_on_order_field(unsorted) -- n.b. ‘unsorted’ is likely to closely resemble two concatenated -- monotonously increasing lists. - local sorted, oldsorted = { unsorted[1] }, nil + local sorted, oldsorted = { unsorted[1] } local i, next, c = 2, unsorted[2], nil while next do oldsorted, sorted = sorted, { } @@ -336,6 +336,7 @@ local function write_structure() if #structure == 1 then return end -- reserve object numbers, prepare for writing local root_obj, parent_tree_obj = pdf.reserveobj(), pdf.reserveobj() + local id_tree, id_tree_obj = { }, pdf.reserveobj() structure[1].parent = { objnum = root_obj } for _, se in ipairs(structure) do if not se.hidden then se.objnum = pdf.reserveobj() end @@ -345,13 +346,14 @@ local function write_structure() add_to_catalog('/StructTreeRoot %s 0 R', root_obj) -- write the structure tree root pdf.immediateobj(root_obj, string.format( - '<< /Type/StructTreeRoot /K %d 0 R /ParentTree %d 0 R%s%s >>', - structure[1].objnum, parent_tree_obj, make_rolemap(), make_classmap())) + '<< /Type/StructTreeRoot /K %d 0 R /ParentTree %d 0 R /IDTree %d 0 R%s%s >>', + structure[1].objnum, parent_tree_obj, id_tree_obj, make_rolemap(), make_classmap())) -- write structure elements for _, se in ipairs(structure) do if not se.hidden then local res = { '<<' } insert_formatted(res, '/Type/StructElem /S%s /P %d 0 R', pdf_name(se.struct), se.parent.objnum) + if se.id then id_tree[se.id] = se.objnum; insert_formatted(res, '/ID %s', pdf_string(se.id)) end if se.lang and se.lang ~= se.parent.lang then insert_formatted(res, '/Lang (%s)', se.lang) end if se.alt then insert_formatted(res, '/Alt %s', pdf_string(se.alt)) end if se.actual then insert_formatted(res, '/ActualText %s', pdf_string(se.actual)) end @@ -380,7 +382,7 @@ local function write_structure() pdf.immediateobj(se.objnum, table.concat(res, ' ')) end end - -- write the parent tree + -- write the parent tree (a number tree) local res = { '<< /Nums [' } for i, parents in ipairs(parent_tree) do -- i, parents = StructParents index + 1, list of structure elems @@ -398,6 +400,19 @@ local function write_structure() end table.insert(res, '] >>') pdf.immediateobj(parent_tree_obj, table.concat(res, '\n')) + -- write the id tree (a name tree) + local ids = { } + for k, _ in pairs(id_tree) do + -- luatex uses the C locale, + table.insert(ids, k) + end + table.sort(ids) + res = { '<< /Names ['} + for _, id in ipairs(ids) do + insert_formatted(res, '%s %d 0 R', pdf_string(id), id_tree[id]) + end + table.insert(res, '] >>') + pdf.immediateobj(id_tree_obj, table.concat(res, '\n')) end -- 1 languages @@ -466,7 +481,7 @@ end function M.close_structure_node(stype, raiseerror) local strict = tex.count['strictstructuretagging'] > 0 - local current, open = current_structure_element(), false + local current, open = current_structure_element() if strict then open = current.struct == stype and current.parent else @@ -490,42 +505,45 @@ alloc.luadef('tagging:ensurestopelement', function() end, 'protected') function M.open_structure_node(n) + -- retrieve defaults for the structure type local info = structure_types[n.struct] if not info then alloc.err('Unknown structure type %s replaced with NonStruct', n.struct) n.struct, info = 'NonStruct', structure_types.NonStruct end info.inuse = true + -- attributes: set default from se info + n.attributes = n.attr or { }; n.attr = nil if info.attributes then - n.attributes = n.attr or { } - for k1,v1 in pairs(info.attributes) do - n.attributes[k1] = n.attributes[k1] or { } - for k2, v2 in pairs(v1) do - n.attributes[k1][k2] = n.attributes[k1][k2] or v2 + for o,kv in pairs(info.attributes) do + n.attributes[o] = n.attributes[o] or { } + for k, v in pairs(kv) do + n.attributes[o][k] = n.attributes[o][k] or v end end - else - n.attributes = n.attr end + -- bookkeeping: order and parent can be forced (needed for asynchronous elements) n.index = #structure + 1 n.children = { } - -- order and parent can be forced (needed for asynchronous elements) n.order = n.order or tex.getattribute(current_order) n.parent = (n.parent and structure[n.parent]) or determine_parent_node(current_structure_element(), n) table.insert(structure, n) + -- determine the proper language code if n.lang then - n.lang = get_language_code(n.lang) + n.lang = M.get_language_code(n.lang) else local lang = tex.getattribute(current_lang) n.lang = language_codes[lang] end + -- hacks for out-of-sync elements if not n.hidden then table.insert(n.parent.children, n) end if not n.async then tex.setattribute(current_struct, #structure) end end alloc.luadef('tagging:startelement', function() local s = options_scanner() + :string('id') :string('type') -- 'section', 'group', 'block' etc. :argument('alt') :argument('actual') @@ -545,11 +563,35 @@ alloc.luadef('tagging:actual', function() current_structure_element().actual = token.scan_string() end) +local function add_attribute(se, o, k, v) + se.attributes = se.attributes or { } + se.attributes[o] = se.attributes[o] or { } + se.attributes[o][k] = v +end + +alloc.luadef('tagging:attribute', function() + add_attribute(current_structure_element(), + token.scan_string(), token.scan_string(), token.scan_string()) +end) + alloc.luadef('newattributeclass', function() local s = options_scanner():subtable('attr') attribute_classes[token.scan_string()] = s:scan().attr end, 'protected') +alloc.luadef('tagging:tagid', function() + current_structure_element().id = token.scan_string() +end) + +alloc.luadef('tagging:getshowstructure', function() + local e, lst = current_structure_element(), { string.format ('%d', + tex.attribute[current_struct]) } + while e do + table.insert(lst, string.format('%s (%d)', e.struct, e.index)) + e = e.parent + end + tex.toks['tagging:showtoks'] = table.concat(lst, ' < ') +end, 'protected') -- 1 marking content items @@ -583,13 +625,13 @@ end clear_page_tagging_parameters() local function new_open_mci_node(se, order) - local n = node.new(8,7) -- late_lua + local n = node.new('whatsit', 'late_lua') n.token = string.format('_open_mci_node_(%d, %d)', se, order) return n end local function pdf_literal(token) - local n = node.new(8,16) -- pdf_literal + local n = node.new('whatsit', 'pdf_literal') n.mode, n.token = 1, token return n end @@ -613,7 +655,7 @@ end) function M.mark_content_items(box) local se, order, art, open local start_node, end_node, parent_node - local pageobj = pdf.getpageref(status.total_pages + 1) + local lastpageobj = pdf.getpageref(status.total_pages + 1) -- helper functions for inserting mci markers local insert_tags = function(end_parent) if not open then return end @@ -639,7 +681,7 @@ function M.mark_content_items(box) elseif marker and marker.what == 'art_stop' then end_node = n insert_tags(b); - open_artifacts[art], art = nil, nil + if art then open_artifacts[art], art = nil, nil end elseif stat and stat >10 and stat ~=art then -- broken artifact insert_tags(b); start_content(n, b) @@ -657,7 +699,7 @@ function M.mark_content_items(box) local _se, _order = n[current_struct], n[current_order] local link = structure[_se] if link.struct == 'Link' then - table.insert(link.children, { objnum = n.objnum, order = _order, pageobj = pageobj }) + table.insert(link.children, { objnum = n.objnum, order = _order, lastpageobj = lastpageobj }) n.link_attr = string.format('%s /StructParent %d', n.link_attr, #parent_tree) table.insert(parent_tree, _se) else @@ -859,7 +901,7 @@ alloc.luadef('embedfile', function() :keyword('uncompressed') :scan() if not t.name then - t.name = t.file or aloc.err('No name specified for embedded file stream') + t.name = t.file or alloc.err('No name specified for embedded file stream') end t.name = pdf_string(t.name or '(unnamed)') local fs, ef = M.embed_file(t, t.global) @@ -891,7 +933,7 @@ function M.mark_discretionaries(head, gc) table.insert(actual, c.char) end -- special case: a single hyphen - if #actual == 0 and pre.char and pre.char == 0x2D then + if #actual == 0 and pre and pre.char and pre.char == 0x2D then actual = '' -- soft hyphen U+00AD elseif #actual > 0 then actual = string.utfcharacter(table.unpack(actual)) @@ -903,7 +945,7 @@ function M.mark_discretionaries(head, gc) struct = 'Span', parent = se, order = order, actual = actual } -- apply the new se to pre and post for n, _ in full_traverse(pre) do n[current_struct] = #structure end - for n, _ in full_traverse(past) do n[current_struct] = #structure end + for n, _ in full_traverse(post) do n[current_struct] = #structure end end ::continue:: end @@ -930,7 +972,7 @@ function M.mark_spaces(head, gc) end local function create_space(n) - local s = node.new(29) -- glyph + local s = node.new('glyph') s.char, s.font, s.attr = 0x20, n[space_attr], n.attr local b = node.hpack(s) b.width, b.height, b.depth = 0, 0, 0 diff --git a/macros/luatex/generic/minim-pdf/minim-pdf.pdf b/macros/luatex/generic/minim-pdf/minim-pdf.pdf Binary files differindex 414e577186..39500a7985 100644 --- a/macros/luatex/generic/minim-pdf/minim-pdf.pdf +++ b/macros/luatex/generic/minim-pdf/minim-pdf.pdf diff --git a/macros/luatex/generic/minim-pdf/minim-pdf.tex b/macros/luatex/generic/minim-pdf/minim-pdf.tex index 630c374d41..a8fe5aeea6 100644 --- a/macros/luatex/generic/minim-pdf/minim-pdf.tex +++ b/macros/luatex/generic/minim-pdf/minim-pdf.tex @@ -118,6 +118,19 @@ \protected\def\setactualtext{\iftagging:enabled \expandafter\tagging:actual\fi} +% \tagattribute Owner Key /verbatim_value +\protected\def\tagattribute{\iftagging:enabled + \expandafter\tagging:attribute\fi} + +% \settagid {name} +\protected\def\settagid{\iftagging:enabled + \expandafter\tagging:tagid\fi} + +% \showstructure +\newtoks\tagging:showtoks +\protected\def\showstructure{% + \tagging:getshowstructure + \showthe\tagging:showtoks} % 1 auto-marking paragraphs @@ -131,21 +144,9 @@ \startelement{\the\nextpartag}\fi \nextpartag{P}\fi \fi} -% 1 tagging helper macros - -% \marktocentry {destination}{label}{title}{filler}{page} -\def\marktocentry#1#2#3#4#5{% - \ifx\marktocentry#1\marktocentry - \def\marktocentry:link##1{##1}\else - \def\marktocentry:link##1{\hyperlink dest{#1}##1\endlink}\fi - \markelement{TOCI}{\nextpartag{}\quitvmode - \ifx\marktocentry#2\marktocentry\else - \markelement{Lbl}{\marktocentry:link{#2}}\fi - \markelement{Reference}{\marktocentry:link{#3% - \ifx\marktocentry#4\marktocentry\else - \markartifact{Layout}{#4}\fi#5}}}} +% 1 tagging tables -% \marktable \halign {\marktablerow#&\marktablecell#\cr +% \marktable \halign {\marktablerow\marktablecell#&\marktablecell#\cr % \marktableheader % Header & cells \cr % \marktablebody @@ -153,30 +154,57 @@ % \marktablefooter % ... & ... \cr ... } % +% lots of variables and constants +\newcount\tagging:tablec +\newcount\tagging:tablerow +\newcount\tagging:tablecol +\newcount\tagging:tablecolspan \tagging:tablecolspan 1 +\newcount\tagging:tablerowspan \tagging:tablerowspan 1 +\newcount\tagging:i +\def\tagging:TH{TH} +\def\tagging:TD{TD} +% initialising variables \def\marktable{\startelement{Table}% - \def\tagging:cell{TD}} + \global\advance\tagging:tablec1 + \global\tagging:tablerow0 + \global\tagging:tablecol0 + \global\def\tagging:tablecolheaders{}% + \global\def\tagging:tablerowheaders{}% + \global\let\tagging:cell\tagging:TD} +% the header \def\marktableheader{% - \noalign{\gdef\tagging:cell{TH}% + \noalign{\global\let\tagging:cell\tagging:TH \startelement{THead}% \savecurrentelementto\tagging:tpart}} +% the body \def\marktablebody{% - \noalign{\gdef\tagging:cell{TD}% + \noalign{\global\let\tagging:cell\tagging:TD \startelement{TBody}% \savecurrentelementto\tagging:tpart}} +% the footer \def\marktablefooter{% \noalign{\startelement{TFoot}% \savecurrentelementto\tagging:tpart}} -\def\marktablerow{ +% rows +\def\marktablerow{% + \global\advance\tagging:tablerow1 + \global\tagging:tablecol0 \unless\ifdefined\tagging:tpart \startelement{TBody}% \savecurrentelementto\tagging:tpart\fi \continueelementfrom\tagging:tpart \startelement{TR}% - \savecurrentelementto\tagging:row - \startelement{\tagging:cell}} + \savecurrentelementto\tagging:row} +% cells \def\marktablecell{% + \global\advance\tagging:tablecol1 \continueelementfrom\tagging:row - \startelement{\tagging:cell}} + \startelement{\tagging:cell}% + \tagging:assignheaders} +% table headers +\def\tagging:assignheaders{% + % TODO + } % \automarktable \halign ... { ... } \def\automarktable#1#{\marktable @@ -184,7 +212,7 @@ \afterassignment\tagging:table \let\tagging:tmp= } \def\tagging:mktrow#1#2\cr{\iftrue - \tagging:mktcell{#1\bgroup\marktablerow#2}\fi + \tagging:mktcell{#1\bgroup\marktablerow\marktablecell#2}\fi #3&\tagging:mktrow&\cr} \def\tagging:mktcell#1#2\fi#3&{\fi \ifx\tagging:mktrow#3\tagging:mkthdr{#1}\fi @@ -193,7 +221,8 @@ \tagging:mktcell{#1&\marktablecell#3}\fi} \def\tagging:mkthdr#1#2\cr#3\cr{\fi#1\cr \marktableheader#3\cr\marktablebody} -\def\tagging:fi{\fi} + +% 1 tagging helper macros % \marktableaslist \halign ... { ... } \def\marktableaslist#1#{\startelement{L}% @@ -201,9 +230,23 @@ \afterassignment\tagging:table \let\tagging:tmp= } \def\tagging:mktlist#1#2&{#1\bgroup - \startelement{LI}\savecurrentelement - \startelement{Lbl}#2&\continueelement - \startelement{LBody}} + \startelement{LI}\savecurrentelementto\tagging:li + \startelement{Lbl}#2&\continueelementfrom\tagging:li + \startelement{LBody}\savecurrentelementto\tagging:lbody} + +% \marktocentry {destination}{label}{title}{filler}{page} +\def\marktocentry#1#2#3#4#5{% + \ifx\marktocentry#1\marktocentry + \def\marktocentry:link##1{##1}\else + \def\marktocentry:link##1{\hyperlink dest{#1}##1\endlink}\fi + \markelement{TOCI}{\nextpartag{}\quitvmode + \ifx\marktocentry#2\marktocentry\else + \markelement{Lbl}{\marktocentry:link{#2}}\fi + \markelement{Reference}{\marktocentry:link{#3% + \ifx\marktocentry#4\marktocentry\else + \markartifact{Layout}{#4}\fi#5}}}} + +% 1 tagging formulas % \autotagformulas % \stopformulatagging ... \startformulatagging @@ -339,6 +382,7 @@ \minim:default:rgb:profile \if#2A\writedocumentstructure1\fi \input minim-xmp + \pdfvariable omitcidset 1 \setmetadata pdfaid:conformance{#2}% \setmetadata pdfaid:part{#3}} diff --git a/macros/luatex/generic/minim-xmp/README b/macros/luatex/generic/minim-xmp/README index 46d9d3cc6e..4b983bddeb 100644 --- a/macros/luatex/generic/minim-xmp/README +++ b/macros/luatex/generic/minim-xmp/README @@ -1,4 +1,4 @@ -Version: 2022/1.1 +Version: 2023/1.2 SUMMARY @@ -21,6 +21,10 @@ In order to obtain the typeset manual of this package, simply say: HISTORY +2023/1.2 (3/3/2022) + + No new features. + 2022/1.1 (3/3/2022) New features: diff --git a/macros/luatex/generic/minim-xmp/minim-xmp.doc b/macros/luatex/generic/minim-xmp/minim-xmp.doc index 57fe527d2c..651373e2b6 100644 --- a/macros/luatex/generic/minim-xmp/minim-xmp.doc +++ b/macros/luatex/generic/minim-xmp/minim-xmp.doc @@ -8,8 +8,8 @@ \else \startmetadata author {Esger Renkema} title {minim-xmp} - date {2022-03-03} - version {2022/1.1} + date {2023-03-03} + version {2023/1.2} keywords {LuaTeX; Plain TeX; XMP; metadata; PDF/A;} stopmetadata \maketitle \fi diff --git a/macros/luatex/generic/minim-xmp/minim-xmp.lua b/macros/luatex/generic/minim-xmp/minim-xmp.lua index 95275aef35..d6867a4c9b 100644 --- a/macros/luatex/generic/minim-xmp/minim-xmp.lua +++ b/macros/luatex/generic/minim-xmp/minim-xmp.lua @@ -1,5 +1,5 @@ -local M = { } +local M = { } local alloc = require('minim-alloc') alloc.remember('minim-xmp') local cb = require('minim-callbacks') @@ -82,14 +82,14 @@ function M.add_valuetype(prefix, name, t) for n, f in pairs(t.fields) do fields[n] = { type = f.type or f[1], description = f.description or f[2] } end - M.getters[name] = function(t, k) + M.getters[name] = function(tt, k) if k then return (fields[k] or alloc.err('Unknown field ‘%s’', k)) - and t and t[k] or 'not found' + and tt and tt[k] or 'not found' else local res = { } - for k, v in sorted_pairs(t) do - table.insert(res, string.format('/{%s} {%s}', k, v)) + for kk, v in sorted_pairs(tt) do + table.insert(res, string.format('/{%s} {%s}', kk, v)) end return table.concat(res, ' ') end @@ -302,9 +302,9 @@ local function get_metadata_extensions() add(' <pdfaType:description>%s</pdfaType:description>', vtype.description) if vtype.fields then add(' <pdfaType:field>\n <rdf:Seq>') - for name, field in sorted_pairs(vtype.fields) do + for fname, field in sorted_pairs(vtype.fields) do add(' <rdf:li rdf:parseType="Resource">') - add(' <pdfaField:name>%s</pdfaField:name>', name) + add(' <pdfaField:name>%s</pdfaField:name>', fname) add(' <pdfaField:valueType>%s</pdfaField:valueType>', field.type) add(' <pdfaField:description>%s</pdfaField:description>', field.description) add(' </rdf:li>') diff --git a/macros/luatex/generic/minim-xmp/minim-xmp.pdf b/macros/luatex/generic/minim-xmp/minim-xmp.pdf Binary files differindex 11c86a9d67..b5011cd8e0 100644 --- a/macros/luatex/generic/minim-xmp/minim-xmp.pdf +++ b/macros/luatex/generic/minim-xmp/minim-xmp.pdf diff --git a/macros/luatex/generic/minim/README b/macros/luatex/generic/minim/README index 31c34b28bf..2114fa4fb4 100644 --- a/macros/luatex/generic/minim/README +++ b/macros/luatex/generic/minim/README @@ -1,4 +1,4 @@ -Version: 2022/1.1 +Version: 2023/1.2 SUMMARY @@ -31,6 +31,12 @@ the packages mentioned above. HISTORY +2023/1.2 (3/3/2023) + + * Added \Ucharcat, as in XeTeX. + * Gave sensible definitions to unicode space characters. + * Updated the manual to reflect the latest versions of the other minims. + 2022/1.1 (3/3/2022) Major changes: diff --git a/macros/luatex/generic/minim/minim-alloc.doc b/macros/luatex/generic/minim/minim-alloc.doc index edf268c81d..4aec2d39fc 100644 --- a/macros/luatex/generic/minim/minim-alloc.doc +++ b/macros/luatex/generic/minim/minim-alloc.doc @@ -233,7 +233,7 @@ in into an eternal loop, however. On the tex side, ⟦*\voidbox⟧, ⟦*\ignore⟧, ⟦*\spacechar⟧, ⟦*\unbrace⟧, ⟦*\firstoftwo⟧ and ⟦*\secondoftwo⟧ should be self-explanatory and -uncontroversial additions. For looking ahead, you can use +uncontroversial additions. ⟦*\Ucharcat⟧ works as in xetex. For looking ahead, you can use ⟦*\nextif \token {executed if present} {executed if not}⟧ or its siblings ⟦*\nextifx⟧ and ⟦*\nextifcat⟧. For defining macros with optional arguments, ⟦*\withoptions[default]{code}⟧ diff --git a/macros/luatex/generic/minim/minim-alloc.lua b/macros/luatex/generic/minim/minim-alloc.lua index 8f6a69ed0d..3775aafa43 100644 --- a/macros/luatex/generic/minim/minim-alloc.lua +++ b/macros/luatex/generic/minim/minim-alloc.lua @@ -50,8 +50,8 @@ local function pdf_hex_string(text) insert_formatted(str, '%04x', i) else i = i - 0x10000 - m = math.floor(i/0x400) + 0xd800 - n = ( i % 0x400 ) + 0xdc00 + local m = math.floor(i/0x400) + 0xd800 + local n = ( i % 0x400 ) + 0xdc00 insert_formatted(str, '%04x%04x', m, n) end end @@ -177,7 +177,7 @@ end function M.table_to_text (tbl) local r = { } for i,t in pairs(tbl) do - local l = '' + local l if type(i) == 'string' then l = string.format('[%q] = ', i) else @@ -282,7 +282,7 @@ M.luadef('minim:currentfile', function() end) -- make pdf_string() available as \pdfstring{...} -M.luadef('pdfstring', function() M.pdf_string(token.scan_string()) end) +M.luadef('pdfstring', function() tex.sprint(M.pdf_string(token.scan_string())) end) -- uselanguage hook callback cb.new_callback('uselanguage', 'simple') @@ -291,6 +291,12 @@ M.luadef('minim:uselanguagecallback', function() cb.call_callback('uselanguage', langname) end) +-- copy of \Ucharcat from xetex +M.luadef('Ucharcat', function() + local chr, cat = token.scan_int(), token.scan_int() + token.put_next(token.new(chr, cat)) +end) + --1 dumping information to the format file -- reserve a bytecode register @@ -302,7 +308,7 @@ token.set_macro('minim:restoremodules', '\\luabytecodecall'..saved_tables_byteco local function dump_saved_tables() M.msg('pre_dump: save modules and tables to format file') -- save modules - for i,name in ipairs (modules) do + for _, name in ipairs (modules) do if not modules[name] then M.msg('saving module '..name) -- reserve (if necessary) a bytecode register @@ -313,7 +319,7 @@ local function dump_saved_tables() end -- save tables (and restore modules) local saved_tables = [[ - + -- include all saved tables in this bytecode register local t = ]]..M.table_to_text(tables)..[[ diff --git a/macros/luatex/generic/minim/minim-alloc.tex b/macros/luatex/generic/minim/minim-alloc.tex index 8752c2e336..4110301413 100644 --- a/macros/luatex/generic/minim/minim-alloc.tex +++ b/macros/luatex/generic/minim/minim-alloc.tex @@ -10,6 +10,21 @@ \suppressoutererror = 1 \frenchspacing +% unicode space characters +\def\hairspace{\kern .1em } +\def\threeperemspace{\kern .33333em } +\def\fourperemspace {\kern .25em } +\catcode"00A0 = \active \letcharcode"00A0 = ~ % no-break +\catcode"2002 = \active \letcharcode"2002 = \enskip +\catcode"2003 = \active \letcharcode"2003 = \quad +\catcode"2004 = \active \letcharcode"2004 = \threeperemspace +\catcode"2005 = \active \letcharcode"2005 = \fourperemspace +\catcode"2006 = \active \letcharcode"2006 = \thinspace % six-per-em +\catcode"2008 = \active \letcharcode"2008 = \thinspace % punctuation +\catcode"2009 = \active \letcharcode"2009 = \thinspace % thin +\catcode"200A = \active \letcharcode"200A = \hairspace % hair +\catcode"202F = \active \letcharcode"202F = \thinspace % narrow no-break + % 1 programming macros \newbox\voidbox \setbox0=\box\voidbox diff --git a/macros/luatex/generic/minim/minim-callbacks.lua b/macros/luatex/generic/minim/minim-callbacks.lua index af3db59e24..b0ecc1a711 100644 --- a/macros/luatex/generic/minim/minim-callbacks.lua +++ b/macros/luatex/generic/minim/minim-callbacks.lua @@ -217,7 +217,7 @@ end -- TODO: preserve return values local primitively_registered = { } function M.primitiveregister(cb, f) - local rv = false + local rv, _ if f == nil then f = primitively_registered[cb] if f == nil then @@ -307,7 +307,6 @@ for n,f in pairs(primitively_registered) do do_log('restore callback: %s', n) M.primitiveregister (n,f) end -saved = nil -- @@ -317,7 +316,7 @@ callback.list = M.list callback.register = M.primitiveregister log = do_log -local function alog(msg, ...) +alog = function(msg, ...) texio.write('log', string.format(msg, ...)) end diff --git a/macros/luatex/generic/minim/minim-doc.sty b/macros/luatex/generic/minim/minim-doc.sty index 93e770153b..5da6494c5e 100644 --- a/macros/luatex/generic/minim/minim-doc.sty +++ b/macros/luatex/generic/minim/minim-doc.sty @@ -178,6 +178,7 @@ endfig;} \autotagformulas +\def\mailname{minim} \def\maketitle{% \setembeddedfilesmoddate {\getmetadata date} \begingroup @@ -189,7 +190,7 @@ endfig;} \qquad##\quad&##\hfil\cr author&\getmetadata author\cr contact&{\def\tmp{@}\def\TMP{.}% - minim\tmp elrenkema\TMP nl}\cr} + \mailname\tmp elrenkema\TMP nl}\cr} \smallskip} % 1 Chapters and full manuals diff --git a/macros/luatex/generic/minim/minim-pdfresources.lua b/macros/luatex/generic/minim/minim-pdfresources.lua index bc09aeaf40..e6a06e783e 100644 --- a/macros/luatex/generic/minim/minim-pdfresources.lua +++ b/macros/luatex/generic/minim/minim-pdfresources.lua @@ -73,7 +73,7 @@ if not M.self_destruct then pdf.add_page_resource = M.add_global_resource end --- for nonglobal resources, every use must be markes with a late_lua node. from +-- for nonglobal resources, every use must be marked with a late_lua node. from -- those, the M.use_resouce() function will be called automatically. -- local page_resources = init_resources() -- name ↦ '/Key <value>' diff --git a/macros/luatex/generic/minim/minim.doc b/macros/luatex/generic/minim/minim.doc index a0ad8f2d4a..7061917398 100644 --- a/macros/luatex/generic/minim/minim.doc +++ b/macros/luatex/generic/minim/minim.doc @@ -4,8 +4,8 @@ \startmetadata author {Esger Renkema} title {minim} - date {2022-03-03} - version {2022/1.1} + date {2023-03-03} + version {2023/1.2} keywords {LuaTeX; Plain TeX; MetaPost; PDF/A; Tagged PDF; accessibility; a11y; Unicode mathematics; XMP; metadata; hypertext; bookmarks} stopmetadata diff --git a/macros/luatex/generic/minim/minim.pdf b/macros/luatex/generic/minim/minim.pdf Binary files differindex 1596eb65d4..3685ecf7fd 100644 --- a/macros/luatex/generic/minim/minim.pdf +++ b/macros/luatex/generic/minim/minim.pdf diff --git a/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.pdf b/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.pdf Binary files differindex 98e89d1aaf..efebebee72 100644 --- a/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.pdf +++ b/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.pdf diff --git a/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.tex b/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.tex index d89096a6e1..d8b207df79 100644 --- a/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.tex +++ b/macros/xetex/plain/unimath-plain-xetex/doc/unimath-plain-xetex-doc.tex @@ -8,7 +8,7 @@ %% ****************************************************** \def\mainfontname{erewhon} \def\sansfontname{Fira Sans Book} -\def\monofontname{Source Code Pro} +\def\monofontname{Noto Sans Mono} \def\mathfontname{Erewhon Math} \def\textfontopt{mapping=tex-text,} \input unimath-plain-xetex @@ -61,8 +61,8 @@ \dp1#2\dp0 \hbox to#1\wd0{\box1\kern#1\wd0\hss}% } -\long\def\colorspec#1#2#3#4{\special{pdf:code q #1 #2 #3 rg}#4% - \special{pdf:code Q}} +\long\def\colorspec#1#2#3#4{\special{color push rgb #1 #2 #3}#4 + \special{color pop}} \def\green{\colorspec{0.08}{0.52}{0.08}} \newdimen\paperwd @@ -103,16 +103,16 @@ \parskip=3pt plus 2pt minus 1pt\relax % title -\centerline{\twentyrm The +\centerline{\twentyrm\green{The \scalehbox{0.5}{0.5}{\special{pdf:code q 1 Tr}% {\hugesans\umpx}% - \special{pdf:code Q}} package} + \special{pdf:code Q}} package}} \biggskip \centerline{Zhang Tingxuan} \medskip -\centerline{2023/01/11\quad Version 0.2a} +\centerline{2023/03/06\quad Version 0.2b} \biggskip \begingroup\parskip0pt @@ -323,8 +323,8 @@ Then your math font will be set as XITS Math and the font of variable family letters ("A"--"Z", "a"--"z") and Greek letters ("\alpha" and so on). "\mathdelimiterfontname" will influence the font of math delimiters, -including some open symbols, close symbols and some ordinary symbols -which can be used as delimiters like "\{", "\}", "\vert" and so on. +for example, extensible open symbols, close symbols and ordinary symbols +like "\{", "\}", "\vert" and so on. Horizontal delimiters (or very long accents) are also influenced by "\mathdelimiterfontname". diff --git a/macros/xetex/plain/unimath-plain-xetex/tex/unimath-plain-xetex.tex b/macros/xetex/plain/unimath-plain-xetex/tex/unimath-plain-xetex.tex index c5732c0e58..891f8dc366 100644 --- a/macros/xetex/plain/unimath-plain-xetex/tex/unimath-plain-xetex.tex +++ b/macros/xetex/plain/unimath-plain-xetex/tex/unimath-plain-xetex.tex @@ -689,8 +689,8 @@ \chardef\l="0142 \chardef\L="0141 \chardef\AA="00C5 -\protected\def\dag{\ifmmode\mathord{\dagger}\else\char"2020\fi} -\protected\def\ddag{\ifmmode\mathord{\ddagger}\else\char"2021\fi} +\protected\def\dag{\ifmmode{\dagger}\else\char"2020\fi} +\protected\def\ddag{\ifmmode{\ddagger}\else\char"2021\fi} \chardef\S="00A7 \chardef\P"00B6 \chardef\copyright="00A9 |