diff options
author | Norbert Preining <norbert@preining.info> | 2020-02-18 03:02:28 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-02-18 03:02:28 +0000 |
commit | bb5325dae4202b519b7210a338651301e048998d (patch) | |
tree | 4caa8d8c62275cb193df85d10f8f0e10bab587b3 /macros | |
parent | 67394fd2cfa6167f7e2316237629bec93851c1fb (diff) |
CTAN sync 202002180302
Diffstat (limited to 'macros')
34 files changed, 557 insertions, 169 deletions
diff --git a/macros/latex/contrib/ghsystem/README b/macros/latex/contrib/ghsystem/README index 6117fa22c4..d1dcf7617b 100644 --- a/macros/latex/contrib/ghsystem/README +++ b/macros/latex/contrib/ghsystem/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -the GHSYSTEM package v4.8b 2020/01/16 +the GHSYSTEM package v4.8c 2020/02/17 globally harmonized system @@ -34,7 +34,7 @@ language-definition files: - ghsystem_italian.def - ghsystem_langtemplate.def documentation and README: - - ghsystem_en.tex, ghsystem_en.pdf, + - ghsystem-manual.tex, ghsystem-manual.cls, ghsystem-manual.pdf, - README -------------------------------------------------------------------------- If you have any ideas, questions, suggestions or bugs to report, please diff --git a/macros/latex/contrib/ghsystem/ghsystem-manual.cls b/macros/latex/contrib/ghsystem/ghsystem-manual.cls new file mode 100644 index 0000000000..1a47c50a13 --- /dev/null +++ b/macros/latex/contrib/ghsystem/ghsystem-manual.cls @@ -0,0 +1,272 @@ +% -------------------------------------------------------------------------- +% the GHSYSTEM package +% +% globally harmonised system +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% -------------------------------------------------------------------------- +% https://github.org/cgnieder/ghsystem/ +% contact@mychemistry.eu +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- +% Copyright 2011--2020 Clemens Niederberger +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Clemens Niederberger. +% -------------------------------------------------------------------------- +\ProvidesClass{ghsystem-manual}[2020/02/17] + +\LoadClass[load-preamble,add-index]{cnltx-doc} +\RequirePackage{imakeidx} +\RequirePackage[utf8]{inputenc} + +\RequirePackage{ghsystem,chemmacros} + +\setcnltx{ + package = {ghsystem}, + info = \acl*{ghs} , + url = https://github.com/cgnieder/ghsystem/ , + authors = Clemens Niederberger , + email = contact@mychemistry.eu , + abstract = {% + \centering + \includegraphics{chemmacros-logo.pdf} + \par + } , + add-cmds = { + chemsetup, + ghs, ghslistall, ghspic, ghssetup + } , + index-setup = { noclearpage , level = \addsec } +} + +\RequirePackage{booktabs} + +\def\libertine@figurestyle{LF} +\RequirePackage{amsmath} +\undef\lvert \undef\lVert +\undef\rvert \undef\rVert +\RequirePackage[libertine]{newtxmath} +\def\libertine@figurestyle{OsF} + +\RequirePackage[biblatex]{embrac} +\ChangeEmph{[}[,.02em]{]}[.055em,-.08em] +\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em] + +\RequirePackage[accsupp]{acro} +\acsetup{ + long-format = \scshape , + short-format = \scshape +} + +\chemsetup{ + greek = newtx , + formula = chemformula , + chemformula/format = \libertineLF +} + +\ghssetup{ + language = {german,english} +} + +\sisetup{ + detect-mode=false, + mode=text, + text-rm=\libertineLF +} + +\RequirePackage{fontawesome} +\RequirePackage{datetime2} +\DTMsetup{useregional=numeric,datesep=/} +\newrobustcmd*\ghsystem@add@version[2]{% + \csdef{ghsystem@ver@#2}{% + \DTMdate{#1}% + \csgdef{ghsystem@ver@#2used}{}% + \csdef{ghsystem@ver@#2}{\DTMdate{#1}}% + }% +} + +\newrobustcmd*\ghsystem@date[1]{% + \ifcsdef{ghsystem@ver@#1used}{}{ (\csuse{ghsystem@ver@#1})}} +\newrobustcmd*\ghsystem@ifnew[1]{\ifcsstring{c_ghsystem_version_tl}{#1}} +\newrobustcmd*\ghsystem@NEW{\faStarO\ New} + +\renewrobustcmd*\sinceversion[1]{% + \ghsystem@ifnew{#1}% + {\cnltx@version@note{\textcolor{red}{\ghsystem@NEW}}}% + {\cnltx@version@note{\GetTranslation{cnltx-introduced}~#1\ghsystem@date{#1}}}% +} +\renewrobustcmd*\changedversion[1]{% + \cnltx@version@note{\GetTranslation{cnltx-changed}~#1\ghsystem@date{#1}}% +} + +\newnote*\sincechanged[2]{% + \GetTranslation{cnltx-introduced}~#1\ghsystem@date{#1}, + changed with version~#2\ghsystem@date{#2}\ghsystem@ifnew{#2}{ \ghsystem@NEW}{}% +} + +\RenewDocumentEnvironment{commands}{} + {% + \cnltx@set@catcode_{12}% + \let\command\cnltx@command + \cnltxlist + } + {\endcnltxlist} + +\RequirePackage{tcolorbox,xsimverb} +\tcbuselibrary{skins,breakable} +\tcbset{enhanced,enhanced jigsaw} + +\newtcolorbox{bewareofthedog}{ + colback = white , + colframe = red , + underlay={% + \path[draw=none] + (interior.south west) + rectangle node[red]{\Huge\bfseries !} + ([xshift=-4mm]interior.north west); + }% +} + +\newtcolorbox{cnltxcode}[1][]{ + boxrule = 1pt , + colback = cnltxbg , + colframe = cnltx , + arc = 5pt , + beforeafter skip = .5\baselineskip ,% + #1% +} + +\newcommand*\ghsystem@readoptions[1]{% + \catcode`\^^M=13 + \ghsystem@read@options{#1}% +} + +\begingroup +\catcode`\^^M=13 +\gdef\ghsystem@read@options#1#2^^M{% + \endgroup + \ifblank{#2}{}{\ghsystem@read@options@#2}% + #1% + \XSIMfilewritestart*{\jobname.tmp}% +}% +\endgroup +\def\ghsystem@read@options@[#1]{\pgfqkeys{/cnltx}{#1}} + +\RenewDocumentEnvironment{sourcecode}{} + {% + \begingroup + \ghsystem@readoptions{% + \setlength\cnltx@sidebysidewidth + {\dimexpr .45\columnwidth -\lst@xleftmargin -\lst@xrightmargin\relax}% + \expanded{% + \noexpand\lstset{ + style=cnltx, + \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} } + {linewidth=\cnltx@sidebysidewidth,}{}% + \expandonce\cnltx@local@listings@options + }% + }% + \XSIMgobblechars{2}% + }% + } + {% + \XSIMfilewritestop + \cnltxcode[breakable]% + \lstinputlisting[style=cnltx]{\jobname.tmp}% + \endcnltxcode + } + +\RenewDocumentEnvironment{example}{} + {% + \begingroup + \ghsystem@readoptions{% + \setlength\cnltx@sidebysidewidth + {\dimexpr .45\columnwidth -\lst@xleftmargin -\lst@xrightmargin\relax}% + \expanded{% + \noexpand\lstset{ + style=cnltx, + \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} } + {linewidth=\cnltx@sidebysidewidth,}{}% + \expandonce\cnltx@local@listings@options + }% + }% + \XSIMgobblechars{2}% + }% + } + {% + \XSIMfilewritestop + \ifbool{cnltx@sidebyside} + {% + \cnltxcode + \noindent + \minipage[c]{\cnltx@sidebysidewidth}% + \cnltx@pre@source@hook + \lstinputlisting[style=cnltx] {\jobname.tmp}% + \cnltx@after@source@hook + \endminipage\hfill + \minipage[c]{\cnltx@sidebysidewidth}% + \cnltx@pre@example@hook + \input {\jobname.tmp}% + \cnltx@after@example@hook + \endminipage + } + {% + \cnltxcode[breakable]% + \cnltx@pre@source@hook + \lstinputlisting{\jobname.tmp}% + \cnltx@after@source@hook + \tcblower + \cnltx@pre@example@hook + \input {\jobname.tmp}% + \cnltx@after@example@hook + }% + \endcnltxcode + } + +\RequirePackage[ + backend=biber, + style=cnltx, + sortlocale=en_US, + indexing=cite]{biblatex} +\RequirePackage{csquotes,varioref} +\defbibheading{bibliography}{\section{References}} + +\RequirePackage[biblatex]{embrac}[2012/06/29] +\ChangeEmph{[}[,.02em]{]}[.055em,-.08em] +\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em] + +\ghsystem@add@version{2012-01-28}{3.0} +\ghsystem@add@version{2012/01/30}{3.0a} +\ghsystem@add@version{2012/02/05}{3.0c} +\ghsystem@add@version{2012/05/13}{3.3a} +\ghsystem@add@version{2012/05/18}{3.3b} +\ghsystem@add@version{2012/05/18}{3.3c} +\ghsystem@add@version{2012/07/24}{3.3d} +\ghsystem@add@version{2013/02/19}{3.5a} +\ghsystem@add@version{2013/07/06}{4.0} +\ghsystem@add@version{2013/12/13}{4.0a} +\ghsystem@add@version{2014/01/09}{4.2e} +\ghsystem@add@version{2014/04/08}{4.5} +\ghsystem@add@version{2014/04/13}{4.5a} +\ghsystem@add@version{2014/06/30}{4.5b} +\ghsystem@add@version{2014/08/08}{4.6} +\ghsystem@add@version{2016/01/15}{4.7} +\ghsystem@add@version{2016/07/16}{4.8} +\ghsystem@add@version{2019/09/30}{4.8a} +\ghsystem@add@version{2020/01/16}{4.8b} +\ghsystem@add@version{2020/02/17}{4.8c} + +\endinput diff --git a/macros/latex/contrib/ghsystem/ghsystem_en.pdf b/macros/latex/contrib/ghsystem/ghsystem-manual.pdf Binary files differindex dccf33b05d..c6d566d6c9 100644 --- a/macros/latex/contrib/ghsystem/ghsystem_en.pdf +++ b/macros/latex/contrib/ghsystem/ghsystem-manual.pdf diff --git a/macros/latex/contrib/ghsystem/ghsystem_en.tex b/macros/latex/contrib/ghsystem/ghsystem-manual.tex index 1267fb29e3..230deda95b 100644 --- a/macros/latex/contrib/ghsystem/ghsystem_en.tex +++ b/macros/latex/contrib/ghsystem/ghsystem-manual.tex @@ -30,43 +30,8 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\documentclass[load-preamble+]{cnltx-doc} -\usepackage[utf8]{inputenc} -% \usepackage[greek=newtx]{chemmacros} -\usepackage{ghsystem} -\setcnltx{ - package = {ghsystem}, - info = \acl*{ghs} , - url = https://github.com/cgnieder/ghsystem/ , - authors = Clemens Niederberger , - email = contact@mychemistry.eu , - abstract = {% - \centering - \includegraphics{chemmacros-logo.pdf} - \par - } , - add-cmds = { - chemsetup, - ghs, ghslistall, ghspic, ghssetup - } , - index-setup = noclearpage -} - -\usepackage{booktabs} - -\expandafter\def\csname libertine@figurestyle\endcsname{LF} -\usepackage[libertine]{newtxmath} -\expandafter\def\csname libertine@figurestyle\endcsname{OsF} +\documentclass{ghsystem-manual} -\usepackage[biblatex]{embrac} -\ChangeEmph{[}[,.02em]{]}[.055em,-.08em] -\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em] - -\usepackage[accsupp]{acro} -\acsetup{ - long-format = \scshape , - short-format = \scshape -} \DeclareAcronym{ghs}{ short = ghs , long = Globally Harmonized System of Classification and Labelling of @@ -99,27 +64,11 @@ accsupp = PDF } -\chemsetup{ - greek = newtx , - formula = chemformula , - chemformula/format = \libertineLF -} - -\ghssetup{ - language = {german,english} -} - -\sisetup{ - detect-mode=false, - mode=text, - text-rm=\libertineLF -} - -\usepackage{filecontents} \defbibheading{bibliography}{\addsec{References}} +\addbibresource{cnltx.bib} \addbibresource{\jobname.bib} -\begin{filecontents*}{\jobname.bib} +\begin{filecontents*}[overwrite]{\jobname.bib} @misc{eu:ghsystem_regulation, author = {{The European Parliament and The Council of the European Union}}, title = {Regulation (EC) No 1272/2008 of the European Parliament and of @@ -491,4 +440,6 @@ The code below shows how table~\ref{tab:ghs-hp-statements} was created: \ghslistall[fill-in,table-rules=booktabs] +\printbibliography + \end{document} diff --git a/macros/latex/contrib/ghsystem/ghsystem.sty b/macros/latex/contrib/ghsystem/ghsystem.sty index dfc4d1eacd..62f97b8282 100644 --- a/macros/latex/contrib/ghsystem/ghsystem.sty +++ b/macros/latex/contrib/ghsystem/ghsystem.sty @@ -29,8 +29,8 @@ \RequirePackage{ expl3, xparse, chemmacros } \ExplSyntaxOn -\tl_const:Nn \c_ghsystem_version_tl {4.8b} -\tl_const:Nn \c_ghsystem_date_tl {2020/01/16} +\tl_const:Nn \c_ghsystem_version_tl {4.8c} +\tl_const:Nn \c_ghsystem_date_tl {2020/02/17} \tl_const:Nn \c_ghsystem_info_tl {globally~ harmonised~ system} \ProvidesExplPackage @@ -525,7 +525,7 @@ \caption [ \l_ghsystem_table_caption_short_tl ] { \l_ghsystem_table_caption_tl - \exp_args:No \label { \l__ghsystem_table_label_tl } + \exp_args:NV \label \l__ghsystem_table_label_tl } \\ \l__ghsystem_table_top_head_rule_tl \textbf { \l_ghsystem_identifier_tl } & @@ -714,3 +714,4 @@ VERSION HISTORY 2019/09/30 - version 4.8a - add \l_ghsystem_table_next_page_tl to the template and the French translations 2020/01/16 - version 4.8b - adapt to renaming of case changing functions +2020/02/17 - version 4.8c - resolve bug with French and Lua- or XeLaTeX diff --git a/macros/latex/contrib/ghsystem/language/ghsystem_english.def b/macros/latex/contrib/ghsystem/language/ghsystem_english.def index 67b579371c..1d6e18d7d0 100644 --- a/macros/latex/contrib/ghsystem/language/ghsystem_english.def +++ b/macros/latex/contrib/ghsystem/language/ghsystem_english.def @@ -26,7 +26,7 @@ % - The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- % ENGLISH DEFINITIONS -\ghsystemlanguagefile{english}{2016/01/16} +\ghsystemlanguagefile {english} {2020/02/17} % table head and foot: \tl_set:Nn \l_ghsystem_identifier_tl { Identifier } @@ -61,7 +61,9 @@ % <or state all organs affected, if known> \cs_set:Npn \ghsystem_organs: { - \bool_if:nT { \l_ghsystem_fill_in_bool && !\l_ghsystem_organs_bool } + \bool_lazy_and:nnT + { \l_ghsystem_fill_in_bool } + { !\l_ghsystem_organs_bool } { \c_space_tl \ghsystem_filler:n { or~ state~ all~ organs~ affected,~ if~ known } diff --git a/macros/latex/contrib/ghsystem/language/ghsystem_french.def b/macros/latex/contrib/ghsystem/language/ghsystem_french.def index 417df28349..0901369fd3 100644 --- a/macros/latex/contrib/ghsystem/language/ghsystem_french.def +++ b/macros/latex/contrib/ghsystem/language/ghsystem_french.def @@ -29,7 +29,7 @@ % - Aurélien. Many thanks! % FRENCH DEFINITIONS -\ghsystemlanguagefile{french}{2019/09/30} +\ghsystemlanguagefile {french} {2020/02/17} % table head: \tl_set:Nn \l_ghsystem_identifier_tl { num\'ero } @@ -37,13 +37,20 @@ \tl_set:Nn \l_ghsystem_table_caption_tl { Toutes~ les~ phrases~ H,~ EUH~ et~ P } \tl_set:Nn \l_ghsystem_table_next_page_tl { suite~ sur~ la~ prochaine~ page } -\group_begin: -\char_set_catcode_active:N \^^@ -\char_set_lccode:nn { `^^@ } { `: } -\tex_lowercase:D - { - \group_end: - \tl_const:Nn \c_ghsystem_french_colon_tl { ^^@ } +% with pdflatex babel sets the colon active: +\bool_lazy_or:nnTF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } + { \tl_const:Nn \c_ghsystem_french_colon_tl { \c_colon_str } } + { + \group_begin: + \char_set_catcode_active:N \^^~ + \char_set_lccode:nn { `^^~ } { `: } + \tex_lowercase:D + { + \group_end: + \tl_const:Nn \c_ghsystem_french_colon_tl { ^^~ } + } } % fill-in functions: @@ -76,7 +83,9 @@ % <or state all organs affected, if known> \cs_set:Npn \ghsystem_organs: { - \bool_if:nT { \l_ghsystem_fill_in_bool && !\l_ghsystem_organs_bool } + \bool_lazy_and:nnT + { \l_ghsystem_fill_in_bool } + { !\l_ghsystem_organs_bool } { \c_space_tl \ghsystem_filler:n diff --git a/macros/latex/contrib/ghsystem/language/ghsystem_german.def b/macros/latex/contrib/ghsystem/language/ghsystem_german.def index f7f706996d..481830eab4 100644 --- a/macros/latex/contrib/ghsystem/language/ghsystem_german.def +++ b/macros/latex/contrib/ghsystem/language/ghsystem_german.def @@ -26,7 +26,7 @@ % - The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- % GERMAN DEFINITIONS -\ghsystemlanguagefile{german}{2016/01/16} +\ghsystemlanguagefile {german} {2016/01/16} % table head and foot: \tl_set:Nn \l_ghsystem_identifier_tl { Nummer } @@ -62,7 +62,9 @@ % <or state all organs affected, if known> \cs_set:Npn \ghsystem_organs: { - \bool_if:nT { \l_ghsystem_fill_in_bool && !\l_ghsystem_organs_bool } + \bool_lazy_and:nnT + { \l_ghsystem_fill_in_bool } + { !\l_ghsystem_organs_bool } { \c_space_tl \ghsystem_filler:n diff --git a/macros/latex/contrib/ghsystem/language/ghsystem_italian.def b/macros/latex/contrib/ghsystem/language/ghsystem_italian.def index 9d97ca043c..6e89094ff3 100644 --- a/macros/latex/contrib/ghsystem/language/ghsystem_italian.def +++ b/macros/latex/contrib/ghsystem/language/ghsystem_italian.def @@ -28,7 +28,7 @@ % - the Italian translation was kindly provided by Jonas Rivetti. Many thanks! % ITALIAN DEFINITIONS -\ghsystemlanguagefile{italian}{2016/01/16} +\ghsystemlanguagefile {italian} {2020/02/17} % table head and foot: \tl_set:Nn \l_ghsystem_identifier_tl { Numero } @@ -66,7 +66,9 @@ % <or state all organs affected, if known> \cs_set:Npn \ghsystem_organs: { - \bool_if:nT { \l_ghsystem_fill_in_bool && !\l_ghsystem_organs_bool } + \bool_lazy_and:nnT + { \l_ghsystem_fill_in_bool } + { !\l_ghsystem_organs_bool } { \c_space_tl \ghsystem_filler:n diff --git a/macros/latex/contrib/ghsystem/language/ghsystem_langtemplate.def b/macros/latex/contrib/ghsystem/language/ghsystem_langtemplate.def index 52a6a21011..75f19cae5c 100644 --- a/macros/latex/contrib/ghsystem/language/ghsystem_langtemplate.def +++ b/macros/latex/contrib/ghsystem/language/ghsystem_langtemplate.def @@ -70,7 +70,7 @@ % ----------------------------------------------------------------------------- % % <LANGUAGE> DEFINITIONS -\ghsystemlanguagefile{language}{date} +\ghsystemlanguagefile {language} {date} % table head: \tl_set:Nn \l_ghsystem_identifier_tl { ... } @@ -100,7 +100,9 @@ % <or state all organs affected, if known> \cs_set:Npn \ghsystem_organs: { - \bool_if:nT { \l_ghsystem_fill_in_bool && !\l_ghsystem_organs_bool } + \bool_lazy_and:nnT + { \l_ghsystem_fill_in_bool } + { !\l_ghsystem_organs_bool } { \c_space_tl \ghsystem_filler:n { ... } } diff --git a/macros/latex/contrib/ghsystem/language/ghsystem_spanish.def b/macros/latex/contrib/ghsystem/language/ghsystem_spanish.def index ecbf46fa17..5b6a203884 100644 --- a/macros/latex/contrib/ghsystem/language/ghsystem_spanish.def +++ b/macros/latex/contrib/ghsystem/language/ghsystem_spanish.def @@ -29,7 +29,7 @@ % - Galván. Many thanks! % SPANISH DEFINITIONS -\ghsystemlanguagefile{spanish}{2016/01/16} +\ghsystemlanguagefile {spanish} {2020/02/17} % table head: \tl_set:Nn \l_ghsystem_identifier_tl { Identificador } @@ -67,7 +67,9 @@ % <or state all organs affected, if known> \cs_set:Npn \ghsystem_organs: { - \bool_if:nT { \l_ghsystem_fill_in_bool && !\l_ghsystem_organs_bool } + \bool_lazy_and:nnT + { \l_ghsystem_fill_in_bool } + { !\l_ghsystem_organs_bool } { \c_space_tl \ghsystem_filler:n diff --git a/macros/latex/contrib/l3build/CHANGELOG.md b/macros/latex/contrib/l3build/CHANGELOG.md index 1c54b0044e..8b1ddb26ee 100644 --- a/macros/latex/contrib/l3build/CHANGELOG.md +++ b/macros/latex/contrib/l3build/CHANGELOG.md @@ -7,6 +7,19 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2020-02-17] + +### Added +- Variable `textfiledir` +- Table `specialtypesetting` and support data + +### Changed +- Documentation improvements + +### Fixed +- When `checkruns` > 1 and `recordstatus=true`, testing code would crash + (issue #90) + ## [2020-02-03] ### Changed @@ -413,7 +426,8 @@ this project uses date-based 'snapshot' version identifiers. - Rationalise short option names: removed `-d`, `-E`, `-r` - Target `cmdcheck`: specific to LaTeX3 kernel work -[Unreleased]: https://github.com/latex3/l3build/compare/2020-02-03...HEAD +[Unreleased]: https://github.com/latex3/l3build/compare/2020-02-17...HEAD +[2020-02-17]: https://github.com/latex3/l3build/compare/2020-02-03...2020-02-17 [2020-02-03]: https://github.com/latex3/l3build/compare/2020-01-14...2020-02-03 [2020-01-14]: https://github.com/latex3/l3build/compare/2019-11-27...2020-01-14 [2019-11-27]: https://github.com/latex3/l3build/compare/2019-11-01...2019-11-27 diff --git a/macros/latex/contrib/l3build/README.md b/macros/latex/contrib/l3build/README.md index 4ff2f712d0..80c039a813 100644 --- a/macros/latex/contrib/l3build/README.md +++ b/macros/latex/contrib/l3build/README.md @@ -1,7 +1,7 @@ l3build: a testing and building system for LaTeX3 ================================================= -Release 2020-02-03 +Release 2020-02-17 Overview -------- diff --git a/macros/latex/contrib/l3build/l3build-arguments.lua b/macros/latex/contrib/l3build/l3build-arguments.lua index cbf68c6254..aa2f086d61 100644 --- a/macros/latex/contrib/l3build/l3build-arguments.lua +++ b/macros/latex/contrib/l3build/l3build-arguments.lua @@ -1,6 +1,6 @@ --[[ -File l3build-arguments.lua Copyright (C) 2018 The LaTeX3 Project +File l3build-arguments.lua Copyright (C) 2018-2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -108,6 +108,7 @@ option_list = }, help = { + desc = "Print this message and exit", short = "h", type = "boolean" }, @@ -147,6 +148,11 @@ option_list = { desc = "Location of user texmf tree", type = "string" + }, + version = + { + desc = "Print version information and exit", + type = "boolean" } } diff --git a/macros/latex/contrib/l3build/l3build-aux.lua b/macros/latex/contrib/l3build/l3build-aux.lua index 2146d9a142..8fa4b0cd82 100644 --- a/macros/latex/contrib/l3build/l3build-aux.lua +++ b/macros/latex/contrib/l3build/l3build-aux.lua @@ -1,6 +1,6 @@ --[[ -File l3build-aux.lua Copyright (C) 2018 The LaTeX3 Project +File l3build-aux.lua Copyright (C) 2018-2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-check.lua b/macros/latex/contrib/l3build/l3build-check.lua index 8bafe0591c..17e6321787 100644 --- a/macros/latex/contrib/l3build/l3build-check.lua +++ b/macros/latex/contrib/l3build/l3build-check.lua @@ -1,6 +1,6 @@ --[[ -File l3build-check.lua Copyright (C) 2018,2019 The LaTeX3 Project +File l3build-check.lua Copyright (C) 2018-2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -292,9 +292,14 @@ local function normalize_log(content,engine,errlevels) if recordstatus then new_content = new_content .. '***************' .. os_newline for i = 1, checkruns do - new_content = new_content .. - 'Compilation ' .. i .. ' of test file completed with exit status ' .. - errlevels[i] .. os_newline + if (errlevels[i]==nil) then + new_content = new_content .. + 'Compilation ' .. i .. ' of test file skipped ' .. os_newline + else + new_content = new_content .. + 'Compilation ' .. i .. ' of test file completed with exit status ' .. + errlevels[i] .. os_newline + end end end return new_content diff --git a/macros/latex/contrib/l3build/l3build-ctan.lua b/macros/latex/contrib/l3build/l3build-ctan.lua index 09b10e0eca..df1daf9728 100644 --- a/macros/latex/contrib/l3build/l3build-ctan.lua +++ b/macros/latex/contrib/l3build/l3build-ctan.lua @@ -1,6 +1,6 @@ --[[ -File l3build-ctan.lua Copyright (C) 2018 The LaTeX3 Project +File l3build-ctan.lua Copyright (C) 2018-2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -54,7 +54,7 @@ function copyctan() end copyfiles(sourcefiles,sourcefiledir) for _,file in pairs(textfiles) do - cp(file, currentdir, ctandir .. "/" .. ctanpkg) + cp(file, textfiledir, ctandir .. "/" .. ctanpkg) end end @@ -127,7 +127,7 @@ function ctan() end if errorlevel == 0 then for _,i in ipairs(textfiles) do - for _,j in pairs({unpackdir, currentdir}) do + for _,j in pairs({unpackdir, textfiledir}) do cp(i, j, ctandir .. "/" .. ctanpkg) cp(i, j, tdsdir .. "/doc/" .. tdsroot .. "/" .. bundle) end diff --git a/macros/latex/contrib/l3build/l3build-help.lua b/macros/latex/contrib/l3build/l3build-help.lua index 8c3877595f..055fc1a918 100644 --- a/macros/latex/contrib/l3build/l3build-help.lua +++ b/macros/latex/contrib/l3build/l3build-help.lua @@ -1,6 +1,6 @@ --[[ -File l3build-help.lua Copyright (C) 2018 The LaTeX3 Project +File l3build-help.lua Copyright (C) 2018,2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -31,7 +31,8 @@ function version() print( "\n" .. "l3build: A testing and building system for LaTeX\n\n" .. - "Release " .. release_date + "Release " .. release_date .. "\n" .. + "Copyright (C) 2014-2020 The LaTeX3 Project" ) end @@ -53,12 +54,12 @@ function help() end local scriptname = "l3build" - if not match(arg[0], "l3build(%.lua)$") then + if not (match(arg[0], "l3build%.lua$") or match(arg[0],"l3build$")) then scriptname = arg[0] end - print("usage: " .. scriptname .. " <command> [<options>] [<names>]") + print("usage: " .. scriptname .. " <target> [<options>] [<names>]") print("") - print("Valid commands are:") + print("Valid targets are:") local longest,t = setup_list(target_list) for _,k in ipairs(t) do local target = target_list[k] @@ -82,5 +83,9 @@ function help() end end print("") - print("See l3build.pdf for further details.") + print("Full manual available via 'texdoc l3build'.") + print("") + print("Repository : https://github.com/latex3/l3build") + print("Bug tracker : https://github.com/latex3/l3build/issues") + print("Copyright (C) 2014-2020 The LaTeX3 Project") end diff --git a/macros/latex/contrib/l3build/l3build-manifest-setup.lua b/macros/latex/contrib/l3build/l3build-manifest-setup.lua index fb46eb1d36..26bf1ca008 100644 --- a/macros/latex/contrib/l3build/l3build-manifest-setup.lua +++ b/macros/latex/contrib/l3build/l3build-manifest-setup.lua @@ -1,6 +1,6 @@ --[[ -File l3build-manifest-setup.lua Copyright (C) 2017-2018 The LaTeX3 Project +File l3build-manifest-setup.lua Copyright (C) 2018,2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-manifest.lua b/macros/latex/contrib/l3build/l3build-manifest.lua index 3b899d55fd..dc5138952c 100644 --- a/macros/latex/contrib/l3build/l3build-manifest.lua +++ b/macros/latex/contrib/l3build/l3build-manifest.lua @@ -1,6 +1,6 @@ --[[ -File l3build-manifest.lua Copyright (C) 2017-2018 The LaTeX3 Project +File l3build-manifest.lua Copyright (C) 2018,2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-stdmain.lua b/macros/latex/contrib/l3build/l3build-stdmain.lua index 9123349ee0..10303b71f7 100644 --- a/macros/latex/contrib/l3build/l3build-stdmain.lua +++ b/macros/latex/contrib/l3build/l3build-stdmain.lua @@ -1,6 +1,6 @@ --[[ -File l3build-stdmain.lua Copyright (C) 2018 The LaTeX3 Project +File l3build-stdmain.lua Copyright (C) 2018-2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-tagging.lua b/macros/latex/contrib/l3build/l3build-tagging.lua index 2c0c1641a4..a00180b34c 100644 --- a/macros/latex/contrib/l3build/l3build-tagging.lua +++ b/macros/latex/contrib/l3build/l3build-tagging.lua @@ -1,6 +1,6 @@ --[[ -File l3build-tagging.lua Copyright (C) 2018 The LaTeX3 Project +File l3build-tagging.lua Copyright (C) 2018-2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-typesetting.lua b/macros/latex/contrib/l3build/l3build-typesetting.lua index fe6a6a58dc..b76edd913b 100644 --- a/macros/latex/contrib/l3build/l3build-typesetting.lua +++ b/macros/latex/contrib/l3build/l3build-typesetting.lua @@ -127,9 +127,10 @@ function makeindex(name,dir,inext,outext,logext,style) return 0 end -function tex(file,dir) +function tex(file,dir,cmd) local dir = dir or "." - return runcmd(typesetexe .. " " .. typesetopts .. " \"" .. typesetcmds + local cmd = cmd or typesetexe .. typesetopts + return runcmd(cmd .. " \"" .. typesetcmds .. "\\input " .. file .. "\"", dir,{"TEXINPUTS","LUAINPUTS"}) end @@ -138,7 +139,13 @@ local function typesetpdf(file,dir) local dir = dir or "." local name = jobname(file) print("Typesetting " .. name) - local errorlevel = typeset(file,dir) + local fn = typeset + local cmd = typesetexe .. " " .. typesetopts + if specialtypesetting and specialtypesetting[file] then + fn = specialtypesetting[file].func or fn + cmd = specialtypesetting[file].cmd or cmd + end + local errorlevel = fn(file,dir,cmd) if errorlevel ~= 0 then print(" ! Compilation failed") return errorlevel @@ -148,9 +155,9 @@ local function typesetpdf(file,dir) return cp(pdfname,dir,docfiledir) end -typeset = typeset or function(file,dir) +typeset = typeset or function(file,dir,exe) dir = dir or "." - local errorlevel = tex(file,dir) + local errorlevel = tex(file,dir,exe) if errorlevel ~= 0 then return errorlevel end @@ -163,7 +170,7 @@ typeset = typeset or function(file,dir) errorlevel = makeindex(name,dir,".glo",".gls",".glg",glossarystyle) + makeindex(name,dir,".idx",".ind",".ilg",indexstyle) + - tex(file,dir) + tex(file,dir,exe) if errorlevel ~= 0 then break end end return errorlevel diff --git a/macros/latex/contrib/l3build/l3build-unpack.lua b/macros/latex/contrib/l3build/l3build-unpack.lua index 89bbfaa17f..47aaca7ca7 100644 --- a/macros/latex/contrib/l3build/l3build-unpack.lua +++ b/macros/latex/contrib/l3build/l3build-unpack.lua @@ -1,6 +1,6 @@ --[[ -File l3build-unpack.lua Copyright (C) 2018 The LaTeX3 Project +File l3build-unpack.lua Copyright (C) 2018-2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-upload.lua b/macros/latex/contrib/l3build/l3build-upload.lua index 257cce61a3..fc25d5d6ac 100644 --- a/macros/latex/contrib/l3build/l3build-upload.lua +++ b/macros/latex/contrib/l3build/l3build-upload.lua @@ -1,6 +1,6 @@ --[[ -File l3build-upload.lua Copyright (C) 2018 The LaTeX3 Project +File l3build-upload.lua Copyright (C) 2018-2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-variables.lua b/macros/latex/contrib/l3build/l3build-variables.lua index 06cfdd34af..e69eb5aff1 100644 --- a/macros/latex/contrib/l3build/l3build-variables.lua +++ b/macros/latex/contrib/l3build/l3build-variables.lua @@ -1,6 +1,6 @@ --[[ -File l3build-variables.lua Copyright (C) 2018,2019 The LaTeX3 Project +File l3build-variables.lua Copyright (C) 2018-2020 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,6 +43,7 @@ maindir = maindir or currentdir -- Substructure for file locations docfiledir = docfiledir or currentdir sourcefiledir = sourcefiledir or currentdir +textfiledir = textfiledir or currentdir supportdir = supportdir or maindir .. "/support" testfiledir = testfiledir or currentdir .. "/testfiles" testsuppdir = testsuppdir or testfiledir .. "/support" @@ -151,6 +152,7 @@ end -- Additional settings to fine-tune typesetting glossarystyle = glossarystyle or "gglo.ist" indexstyle = indexstyle or "gind.ist" +specialtypesetting = specialtypesetting or { } -- Supporting binaries and options biberexe = biberexe or "biber" diff --git a/macros/latex/contrib/l3build/l3build.1 b/macros/latex/contrib/l3build/l3build.1 index e40861b50d..f771558386 100644 --- a/macros/latex/contrib/l3build/l3build.1 +++ b/macros/latex/contrib/l3build/l3build.1 @@ -1,4 +1,4 @@ -.TH l3build 1 "2020-02-03" +.TH l3build 1 "2020-02-17" .SH NAME l3build \- Checking and building packages .SH SYNOPSIS diff --git a/macros/latex/contrib/l3build/l3build.dtx b/macros/latex/contrib/l3build/l3build.dtx index b2a981434f..f00774cada 100644 --- a/macros/latex/contrib/l3build/l3build.dtx +++ b/macros/latex/contrib/l3build/l3build.dtx @@ -64,6 +64,7 @@ \luavarset{testfiledir}{"./testfiles"} {Directory containing test files} \luavarset{testsuppdir}{testfiledir .. "/support"}{Directory containing test-specific support files} \luavarset{texmfdir}{maindir .. "/texmf"}{Directory containing support files in tree form} +\luavarset{textfiledir}{"."} {Directory containing plain text files} \luavarseparator \luavarset{builddir} {maindir .. "/build"} {Directory for building and testing} \luavarset{distribdir}{builddir .. "/distrib"}{Directory for generating distribution structure} @@ -137,6 +138,7 @@ \luavarseparator \luavarset{glossarystyle}{"gglo.ist"}{MakeIndex style file for glossary/changes creation} \luavarset{indexstyle} {"gind.ist"}{MakeIndex style for index creation} +\luavarset{specialtypesetting}{\meta{table}} {Non-standard typesetting combinations} \luavarseparator \luavarset{forcecheckepoch}{"true"} {Force epoch when running tests} \luavarset{forcedocepoch} {"false"} {Force epoch when typesetting} @@ -231,7 +233,7 @@ % }^^A % } % -% \date{Released 2020-02-03} +% \date{Released 2020-02-17} % % \maketitle % \tableofcontents @@ -310,13 +312,22 @@ % For a module, this build folder can be in the main directory of the package itself, but for a bundle it should be common for the bundle itself and for all modules within that bundle. % A |build/| folder can be safety deleted; all material within is re-generated for each command of the \pkg{l3build} system. % -% \subsection{Main build commands} +% \subsection{The \texttt{build.lua} file} +% +% The \texttt{build.lua} file used to control \pkg{l3build} is a simple Lua file +% which is read during execution. In the current release of \pkg{l3build}, +% \texttt{build.lua} is read automatically and can access all of the global +% functions provided by the script. Thus it may contain a simple list of +% variable settings \emph{or} additionally custom code to change the build +% process. A number of example scripts are given in Section~\ref{sec:examples}. +% +% \subsection{Main build targets} % % In the working directory of a bundle or module, \pkg{l3build} is run by executing % \begin{center} -% \texttt{l3build \meta{command} [\meta{option(s)}]} +% \texttt{l3build \meta{targets} [\meta{option(s)}]} % \end{center} -% where \texttt{\meta{command}} can be one of the following: +% where \texttt{\meta{targets}} can be one of the following: % \begin{itemize}[noitemsep]\ttfamily % \item check % \item check \meta{name(s)} @@ -333,9 +344,9 @@ % \item upload % \item upload \meta{tag} % \end{itemize} -% These commands are described below. +% These targets are described below. % -% As well as these commands, the system recognises the options +% As well as these targets, the system recognises the options % \begin{itemize} % \item |--config| (|-c|) Configuration(s) to use for testing % \item |--date| Date to use when tagging data @@ -510,7 +521,7 @@ % % \begin{buildcmd}{install} % Copies all package files (defined by \var{installfiles}) into the user's home \texttt{texmf} tree in the form of the \TeX\ Directory Structure. -% The location of the user tree can be adjusted using the |--texmfhome| swtich: +% The location of the user tree can be adjusted using the |--texmfhome| switch: % the standard setting is the location set as |TEXMFHOME|. % \end{buildcmd} % @@ -584,15 +595,6 @@ % See Section~\ref{sec:upload} for full details on this feature. % \end{buildcmd} % -% \subsection{The \texttt{build.lua} file} -% -% The \texttt{build.lua} file used to control \pkg{l3build} is a simple Lua file -% which is read during execution. In the current release of \pkg{l3build}, -% \texttt{build.lua} is read automatically and can access all of the global -% functions provided by the script. Thus it may contain a simple list of -% variable settings \emph{or} additionally custom code to change the build -% process. A number of example scripts are given in Section~\ref{sec:examples}. -% % \subsection{Example build scripts} % \label{sec:examples} % @@ -649,10 +651,13 @@ % \label{fig:module} % \end{figure} % +% A collection of full examples (source files in various layouts) are available +% at \url{https://github.com/latex3/l3build/tree/master/examples}. +% % \subsection{Backwards compatibility} % % Earlier releases of \pkg{l3build} required that the last line of -% \texttt{build.lua} ran the main script, \emph{i.e.}~ that \texttt{build.lua} +% \texttt{build.lua} ran the main script, \emph{i.e.}~that \texttt{build.lua} % was what the user called rather than \texttt{l3build.lua}. To allow scripts % to support both forms \emph{for the transition}, a simple test may be % included as showing in Figure~\ref{fig:build-compat}. @@ -770,7 +775,8 @@ % A variety of source layouts are supported. In general, a \enquote{flat} % layout with all source files \enquote{here} is most convenient. However, % \pkg{l3build} supports placement of both code and documentation source -% files in other locations using the \var{sourcefiledir} and \var{docfiledir} +% files in other locations using the \var{sourcefiledir}, \var{docfiledir} +% and \var{textfiledir} % variables. For pre-built trees, the glob syntax \texttt{**/*.\meta{ext}} may % be useful in these cases: this enables recursive searching in the appropriate % tree locations. With the standard settings, this structure will be removed @@ -778,6 +784,11 @@ % used to control this behavior. The \var{flattentds} setting controls % the same concept for TDS creation. % +% Notice that text files are treated separately from documentation files when +% splitting trees: this is to allow for the common case where files such +% as |README| and |LICENSE| are at the top level even when other documentation +% files are in a sub-directory. +% % A series of example layouts and matching |build.lua| files are available from % \url{https://github.com/latex3/l3build/tree/master/examples}. % @@ -924,8 +935,6 @@ % \item % \cs{TESTEXP} surrounds its contents with \cs{TYPE} and formatting to match \cs{TEST}; this can be used as a shorthand to test expandable commands. % \item -% TODO: would a \cs{TESTFEXP} command (based on \cs{romannumeral} expansion) be useful as well? -% \item % \cs{BEGINTEST}\marg{title} \dots \cs{ENDTEST} is an environment form of % \cs{TEST}, allowing verbatim material, \emph{etc.} to appear. % \item @@ -1263,7 +1272,7 @@ % tree, one might use the set up shown in Figure~\ref{fig:tds}. % \begin{figure} % \begin{lstlisting}[frame=single,language={[5.2]Lua},gobble = 6] -% tdslocations = +% tdslocations = % { % "tex/generic/mypkg/*.generic.tex" , % "tex/plain/mypkg/*.plain.tex" , @@ -1355,7 +1364,8 @@ % copying files to the typesetting location but before the main typesetting % run. This may be used for example to script a very large number of % demonstrations using a single source (see the \pkg{beamer} package -% for an example of this). +% for an example of this). Note that this hook is intended for use files +% \emph{not} listed in \var{typesetfiles} or \var{typesetdemofiles}. % % \begin{figure}[!b] % \begin{lstlisting}[frame=single,language={[5.2]Lua},gobble = 6] @@ -1391,6 +1401,22 @@ % to be executed once all standard set up is complete but before any typesetting % is run. % +% \subsection{Non-standard typesetting} +% +% To allow non-standard typesetting combinations, for example per-file +% choice of engines, the table \var{specialtypesetting} may be used. +% This is a table with one entry per file. Each entry is itself a table, +% and these contain a list of engines and settings for |cmd| and |func|. +% For example, to choose to use \LuaTeX{} for one file when \var{typesetexe} +% is |pdftex| +% \begin{verbatim} +% specialtypesetting.foo = {cmd = "luatex -interaction=nonstopmode"} +% \end{verbatim} +% or to select an entirely different typesetting function +% \begin{verbatim} +% specialtypesetting.foo = {func = typeset_foo} +% \end{verbatim} +% % \subsection{Automated upload to CTAN} % \label{sec:upload} % @@ -1790,7 +1816,7 @@ % \end{syntax} % Runs Biber on the \meta{name} (\emph{i.e.}~a jobname lacking any % extension) inside the \meta{dir}. If there is no |.bcf| file then -% no action is taken with a return value of $0$. +% no action is taken with a return value of $0$. % \end{function} % % \begin{function}{bibtex()} @@ -1799,7 +1825,7 @@ % \end{syntax} % Runs Bib\TeX{} on the \meta{name} (\emph{i.e.}~a jobname lacking any % extension) inside the \meta{dir}. If there are no |\citation| lines in -% the |.aux| file then no action is taken with a return value of $0$. +% the |.aux| file then no action is taken with a return value of $0$. % \end{function} % % \begin{function}{makeindex()} @@ -1813,9 +1839,10 @@ % % \begin{function}{tex()} % \begin{syntax} -% |tex(|\meta{file},\meta{dir}|)| +% |tex(|\meta{file},\meta{dir},\meta{cmd}|)| % \end{syntax} -% Runs \luavar{typesetexe} on the \meta{name} inside the \meta{dir}. +% Runs \meta{cmd} (by default \luavar{typesetexe} \luavar{typesetopts}) on the +% \meta{name} inside the \meta{dir}. % \end{function} % % \begin{function}{runcmd()} diff --git a/macros/latex/contrib/l3build/l3build.lua b/macros/latex/contrib/l3build/l3build.lua index 2c244c1ea5..03521ce612 100755 --- a/macros/latex/contrib/l3build/l3build.lua +++ b/macros/latex/contrib/l3build/l3build.lua @@ -25,7 +25,7 @@ for those people who are interested. --]] -- Version information -release_date = "2020-02-03" +release_date = "2020-02-17" -- File operations are aided by the LuaFileSystem module local lfs = require("lfs") diff --git a/macros/latex/contrib/l3build/l3build.pdf b/macros/latex/contrib/l3build/l3build.pdf Binary files differindex 271bfb6beb..2eaeda6f10 100644 --- a/macros/latex/contrib/l3build/l3build.pdf +++ b/macros/latex/contrib/l3build/l3build.pdf diff --git a/macros/luatex/latex/luatodonotes/luatodonotes.dtx b/macros/luatex/latex/luatodonotes/luatodonotes.dtx index 2351cfbf6c..1d634a6fc8 100644 --- a/macros/luatex/latex/luatodonotes/luatodonotes.dtx +++ b/macros/luatex/latex/luatodonotes/luatodonotes.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2014-2017 by Fabian Lipp <fabian.lipp@gmx.de> +% Copyright (C) 2014-2020 by Fabian Lipp <fabian.lipp@gmx.de> % based on the todonotes package % by Henrik Skov Midtiby <henrikmidtiby@gmail.com> % ------------------------------------------------------------ @@ -24,7 +24,7 @@ %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{luatodonotes} %<*package> - [2017/09/30 v0.4 luatodonotes source and documentation.] + [2020/02/16 v0.5 luatodonotes source and documentation.] %</package> % %<*driver> @@ -32,7 +32,7 @@ \usepackage{wrapfig} \PassOptionsToPackage{colorlinks, urlcolor=blue}{hyperref} \usepackage{hypdoc} % this package loads hyperref among others -\usepackage[colorinlistoftodos, shadow]{luatodonotes}[2017/09/30] +\usepackage[colorinlistoftodos, shadow]{luatodonotes}[2020/02/16] \usepackage{fontspec} \usepackage{amsmath} \usepackage{setspace} @@ -51,7 +51,7 @@ %</driver> % \fi % -% \CheckSum{906} +% \CheckSum{951} % % \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 @@ -742,7 +742,7 @@ % l.250 \directlua{require("luatodonotes")} % \end{verbatim} % This means that the file |luatodonotes.lua| cannot be found by Lua\TeX. -% It depends on the version of your \TeX{} installation. in which directories +% It depends on the version of your \TeX{} installation in which directories % Lua\TeX{} is looking for Lua source files. % You can query these paths with the following command: % \begin{verbatim} @@ -933,6 +933,12 @@ % placed in \texttt{\textbackslash caption}, e.g.)} % \changes{0.3}{2015/11/30}{Remove two variables from Lua global namespace} % \changes{0.3}{2015/12/02}{Less console output unless debug option is set} +% \changes{0.5}{2020/01/19}{Fixed bugs when using \texttt{poLeadersAvoidLines} +% as positioning algorithm in newer LuaTeX versions because some APIs have +% changed} +% \changes{0.5}{2020/01/20}{Bugfix: The line position calculation didn't use +% the current page height, which caused an offset on these positions in +% documents not using a4paper} % \end{environment} % % \subsection{Dependencies and definitions} @@ -1316,6 +1322,11 @@ % \changes{0.3}{2015/12/01}{Introduce package option \texttt{additionalMargin}} % \changes{0.4}{2016/04/01}{Fixed problems of the \texttt{additionalMargin} % option with certain documentclasses} +% \changes{0.5}{2017/11/21}{Make \texttt{additionalMargin} compatible with +% \texttt{\textbackslash newgeometry}} +% \changes{0.5}{2020/01/19}{Adapt to new LuaTeX versions, which provide command +% \texttt{\textbackslash pagewidth} instead of +% \texttt{\textbackslash pdfpagewidth} (but stay backwards compatible)} % \begin{macrocode} \newif{\if@todonotes@additionalMarginEnabled} \@todonotes@additionalMarginEnabledfalse @@ -1363,20 +1374,34 @@ \fi % \end{macrocode} % If the option |additionalMargin| is given, we enlarge the margins for the notes. -% We simply increase the page size by the doubled value of |additionalMargin| -% and move the contents to the right using |\hoffset|. % \begin{macrocode} \if@todonotes@additionalMarginEnabled \newlength{\@todonotes@modpaperwidth} \AfterEndPreamble{% - \setlength{\@todonotes@modpaperwidth}{\paperwidth}% - \addtolength{\@todonotes@modpaperwidth}{\@todonotes@additionalMargin}% - \addtolength{\@todonotes@modpaperwidth}{\@todonotes@additionalMargin}% - \pdfpagewidth=\@todonotes@modpaperwidth% - \addtolength{\hoffset}{\@todonotes@additionalMargin}% + \@todonotes@setAdditionalMargin% +% \end{macrocode} +% Additionally, if the |geometry| package is loaded we hook into +% |\Gm@changelayout| to repeat this computation whenever |\newgeometry| is +% called. +% \begin{macrocode} + \ifdefined\Gm@changelayout + \g@addto@macro{\Gm@changelayout}{\@todonotes@setAdditionalMargin} + \fi }% \fi% % \end{macrocode} +% We simply increase the page size by the doubled value of |additionalMargin| +% and move the contents to the right using |\hoffset|. +% \begin{macrocode} +\newcommand{\@todonotes@setAdditionalMargin}{ + \setlength{\@todonotes@modpaperwidth}{\paperwidth}% + \addtolength{\@todonotes@modpaperwidth}{\@todonotes@additionalMargin}% + \addtolength{\@todonotes@modpaperwidth}{\@todonotes@additionalMargin}% + \ifdefined\pdfpagewidth\else\let\pdfpagewidth\pagewidth\fi + \pdfpagewidth=\@todonotes@modpaperwidth% + \addtolength{\hoffset}{\@todonotes@additionalMargin}% +} +% \end{macrocode} % \subsection{Initialisation of our Lua code} % In this part we define some of the variables used by Lua depending on the % package options and do some other initialisation tasks. @@ -1456,6 +1481,7 @@ % We need this workaround because we cannot insert |\pdflastypos| directly into % the tokenlist in the Lua callback \texttt{callbackOutputLinePositions()}. % \begin{macrocode} +\ifdefined\pdflastypos\else\let\pdflastypos\lastypos\fi \def\@todonotes@pdflastypos{\the\pdflastypos} % \end{macrocode} % The following commands are written to the temporary \texttt{lpo}-file. @@ -1493,6 +1519,18 @@ {\AtBeginShipoutUpperLeft} \fi % \end{macrocode} +% Define commands that are used for every tikzpicture to disable +% externalization. +% We only call the |\tikzexternaldisable| command if it is defined (i.e., the +% externalization library for TikZ is loaded). +% Externalization is reenabled after the end of the group (if it was enabled +% before). +% \changes{0.5}{2018/04/08}{Disable TikZ externalization for our tikzpictures} +% \begin{macrocode} +\newcommand{\@todonotes@before@tikzpict}{\begingroup% + \ifdefined\tikzexternaldisable\tikzexternaldisable\fi} +\newcommand{\@todonotes@after@tikzpict}{\endgroup} +% \end{macrocode} % Initialise the script when all Lua variables are set according to the package % options. % \begin{macrocode} @@ -1532,6 +1570,7 @@ {@todonotes@\arabic{@todonotes@numberoftodonotes}% @\arabic{@todonotes@numberofLinesInArea} }% \hspace*{\todonotes@textmark@shift}{\smash{% + \@todonotes@before@tikzpict% \begin{tikzpicture}[overlay,remember picture, deco/.style={}]% \setlength\todonotes@textmark@linebelow% @@ -1560,7 +1599,8 @@ -- (\@todonotes@nodeNamePrefix areaSE) } -- cycle; - \end{tikzpicture}% + \end{tikzpicture}% + \@todonotes@after@tikzpict% }}% }% % \end{macrocode} @@ -1828,10 +1868,12 @@ % Mark the end of the highlighted area with a Tikz coordinate. % The begin is marked by |\@todocommon|. % \begin{macrocode} + \@todonotes@before@tikzpict% \begin{tikzpicture}[remember picture, overlay]% \node [coordinate] (@todonotes@\arabic{@todonotes@numberoftodonotes} % inTextEnd) {};% \end{tikzpicture}% + \@todonotes@after@tikzpict% \zref@label{@todonotes@\arabic{@todonotes@numberoftodonotes}@end}% }% % \end{macrocode} @@ -1846,10 +1888,12 @@ % First is the current location in the document stored, this enables % us later to connect this point with the inserted todonote. % \begin{macrocode} + \@todonotes@before@tikzpict% \begin{tikzpicture}[remember picture, overlay]% \node [coordinate] (@todonotes@\arabic{@todonotes@numberoftodonotes} % inText) {};% \end{tikzpicture}% + \@todonotes@after@tikzpict% % \end{macrocode} % Update the dimensions to be accessed by Lua. % \begin{macrocode} @@ -1937,7 +1981,9 @@ % Define helper function |drawInlineNote|. % \begin{macrocode} \newcommand{\@todonotes@drawInlineNote}{% - {\par\noindent\begin{tikzpicture}[remember picture]% + {\par\noindent% + \@todonotes@before@tikzpict% + \begin{tikzpicture}[remember picture]% \draw node[@todonotes@inlinenote,font=\@todonotes@sizecommand]{% \if@todonotes@authorgiven% {\noindent \@todonotes@sizecommand % @@ -1945,7 +1991,9 @@ \else% {\noindent \@todonotes@sizecommand \@todonotes@text}% \fi};% - \end{tikzpicture}\par}% + \end{tikzpicture}% + \@todonotes@after@tikzpict% + \par}% }% % \end{macrocode} % \end{macro} @@ -1957,6 +2005,7 @@ \addcontentsline{tdo}{todo}{\@todonotes@MissingFigureText: #2}% \par \noindent +\@todonotes@before@tikzpict% \begin{tikzpicture} \draw[fill=\@todonotes@currentfigcolor, draw = black!40, line width=2pt] (-2, -2.5) rectangle +(\@todonotes@currentfigwidth, \@todonotes@currentfigheight); @@ -1967,6 +2016,7 @@ \draw (0, 0.3) node {\@todonotes@MissingFigureUp}; \draw (0, -0.3) node {\@todonotes@MissingFigureDown}; \end{tikzpicture}\hfill +\@todonotes@after@tikzpict% }% Ending \missingfigure command \fi% Ending \@todonotes@ifdisabled % \end{macrocode} @@ -2054,6 +2104,7 @@ % \begin{macrocode} \raisebox{\voffset}{% \hspace{-\hoffset}% + \@todonotes@before@tikzpict% \begin{tikzpicture}[remember picture,overlay] % \end{macrocode} % Reads the absolute coordinates of every note on the page and writes them to @@ -2065,6 +2116,7 @@ % \begin{macrocode} \directlua{luatodonotes.printNotes()} \end{tikzpicture}% + \@todonotes@after@tikzpict% }% % \end{macrocode} % Delete the drawn notes from the Lua lists and prepare for the next page. diff --git a/macros/luatex/latex/luatodonotes/luatodonotes.ins b/macros/luatex/latex/luatodonotes/luatodonotes.ins index 1fc75094df..bfaeb98a7e 100644 --- a/macros/luatex/latex/luatodonotes/luatodonotes.ins +++ b/macros/luatex/latex/luatodonotes/luatodonotes.ins @@ -1,5 +1,5 @@ %% -%% Copyright (C) 2014-2015 by Fabian Lipp <fabian.lipp@gmx.de> +%% Copyright (C) 2014-2020 by Fabian Lipp <fabian.lipp@gmx.de> %% based on the todonotes package by %% Henrik Skov Midtiby <henrikmidtiby@gmail.com> %% @@ -23,7 +23,7 @@ This is a generated file. -Copyright (C) 2014-2015 by Fabian Lipp <fabian.lipp@gmx.de> +Copyright (C) 2014-2020 by Fabian Lipp <fabian.lipp@gmx.de> based on the todonotes package by Henrik Skov Midtiby <henrikmidtiby@gmail.com> diff --git a/macros/luatex/latex/luatodonotes/luatodonotes.lua b/macros/luatex/latex/luatodonotes/luatodonotes.lua index 5ef9b8f03b..1926597ab9 100644 --- a/macros/luatex/latex/luatodonotes/luatodonotes.lua +++ b/macros/luatex/latex/luatodonotes/luatodonotes.lua @@ -1,5 +1,5 @@ -- --- Copyright (C) 2014-2015 by Fabian Lipp <fabian.lipp@gmx.de> +-- Copyright (C) 2014-2020 by Fabian Lipp <fabian.lipp@gmx.de> -- ------------------------------------------------------------ -- -- This file may be distributed and/or modified under the @@ -374,8 +374,7 @@ function luatodonotes.linePositionsNextPage() end function luatodonotes.linePositionsAddLine(ycoord, lineheight, linedepth) - local baseline = ycoord - tex.pageheight - linePositionsCurPage[#linePositionsCurPage + 1] = {baseline, baseline + lineheight, baseline - linedepth} + linePositionsCurPage[#linePositionsCurPage + 1] = {ycoord, lineheight, linedepth} end @@ -741,7 +740,7 @@ function luatodonotes.callbackOutputLinePositions(head) end if foundGlyph then - local w = node.new("whatsit", "write") -- 8/1 + local w = node.new("whatsit", "write") w.stream = lpoFileStream local tokenlist = { {12, 92, 0}, -- \ @@ -770,19 +769,31 @@ function luatodonotes.callbackOutputLinePositions(head) {12, 110, 0}, -- n {12, 123, 0} -- { } - t = token.create("@todonotes@pdflastypos") - tokenlist[#tokenlist + 1] = t - tokenlist[#tokenlist + 1] = {12, 125, 0} - tokenlist[#tokenlist + 1] = {12, 123, 0} + local t = token.create("@todonotes@pdflastypos") + -- the token handling changed with newer LuaTeX versions + if tex.luatexversion > 81 then + tokenlist[#tokenlist + 1] = {0, t.tok} + else + tokenlist[#tokenlist + 1] = t + end + tokenlist[#tokenlist + 1] = {12, 125, 0} -- } + tokenlist[#tokenlist + 1] = {12, 123, 0} -- { appendStrToTokenlist(tokenlist, tostring(head.height)) - tokenlist[#tokenlist + 1] = {12, 125, 0} - tokenlist[#tokenlist + 1] = {12, 123, 0} + tokenlist[#tokenlist + 1] = {12, 125, 0} -- } + tokenlist[#tokenlist + 1] = {12, 123, 0} -- { appendStrToTokenlist(tokenlist, tostring(head.depth)) - tokenlist[#tokenlist + 1] = {12, 125, 0} + tokenlist[#tokenlist + 1] = {12, 125, 0} -- } w.data = tokenlist head.head = node.insert_before(head.head,head.head,w) - local w = node.new("whatsit", "pdf_save_pos") -- 8/23 + -- the name of the whatsit node changed with newer LuaTeX versions + local whatsitName + if tex.luatexversion > 80 then + whatsitName = "save_pos" + else + whatsitName = "pdf_save_pos" + end + local w = node.new("whatsit", whatsitName) head.head = node.insert_before(head.head,head.head,w) end end @@ -1742,7 +1753,18 @@ end local function posPoLeaders(notes, rightSide, avoidLines) local linePositionsCurPage if avoidLines then - linePositionsCurPage = linePositions[currentPage] or {} + linePositionsCurPage = {} + -- use the current pageheight to convert coordinates: + -- savepos yields coordinates relativ to lower left corner of page, + -- while our tikzpicture is anchored at the upper left corner + for k, v in pairs(linePositions[currentPage] or {}) do + local baseline = v[1] - tex.pageheight + linePositionsCurPage[k] = {baseline, baseline + v[2], baseline - v[3]} + if todonotesDebug then + print("linePositionsAddLine, add: " .. v[1] .. ", pageheight: " .. tex.pageheight .. + ", result: " .. baseline) + end + end end -- number of slots on the whole page @@ -1759,11 +1781,16 @@ local function posPoLeaders(notes, rightSide, avoidLines) -- sort notes by inputY table.sort(notes, compareNoteIndInputYDesc) - -- draw slots + -- draw slots and line positions if todonotesDebug then for i = 1,totalNumSlots+1 do local pos = area.top - (i-1) * rasterHeight - tex.print("\\draw[blue,dashed] (0," .. pos .. "sp) -- +(21cm,0);") + tex.print("\\draw[blue,dashed] (0," .. pos .. "sp) -- +(21cm,0);") + end + for ind, v in pairs(linePositionsCurPage) do + local pos = v[1] + tex.print("\\draw[red,dashed] (0," .. pos .. "sp) -- +(21cm,0);") + tex.print("\\node[red] at (1cm," .. pos .. "sp) {" .. ind .. "};") end end @@ -1870,7 +1897,7 @@ local function posPoLeaders(notes, rightSide, avoidLines) if avoidLines then leaderArmR = labelTopR - noteInnerSep - r:getHeight() / 2 -- east anchor - -- find first line (from the top) which lower bound is below leaderArmR + -- find first line (from the top) whose lower bound is below leaderArmR local lineBelowInd for ind, v in pairs(linePositionsCurPage) do if v[3] <= leaderArmR then diff --git a/macros/luatex/latex/luatodonotes/luatodonotes.pdf b/macros/luatex/latex/luatodonotes/luatodonotes.pdf Binary files differindex 3235a373c2..81bc887aa6 100644 --- a/macros/luatex/latex/luatodonotes/luatodonotes.pdf +++ b/macros/luatex/latex/luatodonotes/luatodonotes.pdf |