From 80e0ab3c814b0dfd8ff304620dccbdea877f93ba Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 31 Dec 2020 03:03:26 +0000 Subject: CTAN sync 202012310303 --- .../biblatex-nature/biblatex-nature.bib | 2 +- .../biblatex-nature/biblatex-nature.pdf | Bin 379506 -> 379357 bytes .../biblatex-nature/biblatex-nature.tex | 7 +- .../biblatex-contrib/biblatex-nature/nature.bbx | 8 +- .../biblatex-contrib/biblatex-nature/nature.cbx | 4 +- macros/latex/contrib/skeldoc/LICENSE | 21 + macros/latex/contrib/skeldoc/README.md | 11 + macros/latex/contrib/skeldoc/skeldoc.pdf | Bin 0 -> 216738 bytes macros/latex/contrib/skeldoc/skeldoc.sty | 778 +++++++++++++++++++++ macros/latex/contrib/skeldoc/skeldoc.tex | 220 ++++++ macros/latex/contrib/xurl/Changes | 1 + macros/latex/contrib/xurl/doc/xurl.pdf | Bin 56276 -> 56330 bytes macros/latex/contrib/xurl/doc/xurl.tex | 4 +- macros/latex/contrib/xurl/latex/xurl.sty | 4 +- macros/luatex/generic/luamplib/NEWS | 6 + macros/luatex/generic/luamplib/luamplib.dtx | 57 +- macros/luatex/generic/luamplib/luamplib.pdf | Bin 149263 -> 149233 bytes .../generic/luamplib/test-luamplib-latex.tex | 2 + 18 files changed, 1082 insertions(+), 43 deletions(-) create mode 100644 macros/latex/contrib/skeldoc/LICENSE create mode 100644 macros/latex/contrib/skeldoc/README.md create mode 100644 macros/latex/contrib/skeldoc/skeldoc.pdf create mode 100644 macros/latex/contrib/skeldoc/skeldoc.sty create mode 100644 macros/latex/contrib/skeldoc/skeldoc.tex (limited to 'macros') diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.bib b/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.bib index 1ccddbf7b8..db19cb38e0 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.bib +++ b/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.bib @@ -387,7 +387,7 @@ } %% -%% Copyright (C) 2010-2013,2016-2018 by +%% Copyright (C) 2010-2013,2016-2018,2020 by %% Joseph Wright %% %% It may be distributed and/or modified under the conditions of diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.pdf index 4e68c441fd..645ed5f874 100644 Binary files a/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.pdf and b/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.pdf differ diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.tex b/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.tex index 843199df94..1205b65058 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.tex +++ b/macros/latex/contrib/biblatex-contrib/biblatex-nature/biblatex-nature.tex @@ -23,8 +23,8 @@ \href{mailto:joseph.wright@morningstar2.co.uk} {\texttt{joseph.wright@morningstar2.co.uk}}}} \title{The \pkg{nature} bibliography style for \pkg{biblatex}% - \footnote{This file describes v1.3c, last revised 2018/10/18.}} -\date{Released 2018/10/18} + \footnote{This file describes v1.3d, last revised 2020/12/30.}} +\date{Released 2020/12/30} \providecommand*{\opt}[1]{\texttt{#1}} \providecommand*{\pkg}[1]{\textsf{#1}} @@ -94,13 +94,14 @@ be sent by e-mail to \changes{v1.3b}{2017/03/01}{Update \texttt{url} formatting} \changes{v1.3c}{2018/10/18}{Better \texttt{doi} support} \changes{v1.3c}{2018/10/18}{Better \texttt{related} support} +\changes{v1.3d}{2020/12/30}{Adjust appearance of commentor string} \PrintChanges \end{document} %% -%% Copyright (C) 2010-2013,2016-2018 by +%% Copyright (C) 2010-2013,2016-2018,2020 by %% Joseph Wright %% %% It may be distributed and/or modified under the conditions of diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-nature/nature.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-nature/nature.bbx index bd9efec403..6d094c7771 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-nature/nature.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-nature/nature.bbx @@ -8,7 +8,7 @@ %% --------------------------------------------------------------- %% -\ProvidesFile{nature.bbx}[2018/10/18 v1.3c biblatex bibliography style] +\ProvidesFile{nature.bbx}[2020/12/30 v1.3d biblatex bibliography style] % Load the standard style to avoid copy-pasting unnecessary material \RequireBibliographyStyle{numeric-comp} @@ -66,7 +66,7 @@ \DeclareFieldFormat{doi}{% doi\addcolon \ifhyperref - {\href{http://dx.doi.org/#1}{\nolinkurl{#1}}} + {\href{https://doi.org/#1}{\nolinkurl{#1}}} {\nolinkurl{#1}}% } \DeclareFieldFormat*{pages}{#1} @@ -103,7 +103,7 @@ \nopunct \printtext[parens]{\usebibmacro{editor}}% \clearname{editor}% - \nopunct + \addspace\nopunct }% \usebibmacro{byeditorx}% \usebibmacro{bytranslator+others}% @@ -690,7 +690,7 @@ } %% -%% Copyright (C) 2010-2013,2016-2018 by +%% Copyright (C) 2010-2013,2016-2018,2020 by %% Joseph Wright %% %% It may be distributed and/or modified under the conditions of diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-nature/nature.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-nature/nature.cbx index 5652d22f14..b5f1fc6347 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-nature/nature.cbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-nature/nature.cbx @@ -8,7 +8,7 @@ %% --------------------------------------------------------------- %% -\ProvidesFile{nature.cbx}[2018/10/18 v1.3c biblatex citation style] +\ProvidesFile{nature.cbx}[2020/12/30 v1.3d biblatex citation style] \RequireCitationStyle{numeric-comp} @@ -19,7 +19,7 @@ } %% -%% Copyright (C) 2010-2013,2016-2018 by +%% Copyright (C) 2010-2013,2016-2018,2020 by %% Joseph Wright %% %% It may be distributed and/or modified under the conditions of diff --git a/macros/latex/contrib/skeldoc/LICENSE b/macros/latex/contrib/skeldoc/LICENSE new file mode 100644 index 0000000000..eb75fde0e7 --- /dev/null +++ b/macros/latex/contrib/skeldoc/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Magnus Lie Hetland + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/macros/latex/contrib/skeldoc/README.md b/macros/latex/contrib/skeldoc/README.md new file mode 100644 index 0000000000..c1f6deaa92 --- /dev/null +++ b/macros/latex/contrib/skeldoc/README.md @@ -0,0 +1,11 @@ +# skeldoc.sty + +The **skeldoc** package lets you produce placeholder elements for documents +under development, similar to the skeleton screens used while loading contents +in many applications and websites. It also has a mechanism for attaching +explanatory endnotes to these placeholder, or to anything else in your +document. For an example of use, along with some explanations, see the file +[skeldoc.pdf](skeldoc.pdf), or [its source](skeldoc.tex). + +The package is written by [Magnus Lie Hetland](mailto:mlh@ntnu.no) and is +released under the [MIT license](LICENSE). diff --git a/macros/latex/contrib/skeldoc/skeldoc.pdf b/macros/latex/contrib/skeldoc/skeldoc.pdf new file mode 100644 index 0000000000..541a42cad5 Binary files /dev/null and b/macros/latex/contrib/skeldoc/skeldoc.pdf differ diff --git a/macros/latex/contrib/skeldoc/skeldoc.sty b/macros/latex/contrib/skeldoc/skeldoc.sty new file mode 100644 index 0000000000..5afb1c9c5f --- /dev/null +++ b/macros/latex/contrib/skeldoc/skeldoc.sty @@ -0,0 +1,778 @@ +% Copyright (c) 2020 Magnus Lie Hetland +% +% Permission is hereby granted, free of charge, to any person obtaining a copy +% of this software and associated documentation files (the "Software"), to deal +% in the Software without restriction, including without limitation the rights +% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +% copies of the Software, and to permit persons to whom the Software is +% furnished to do so, subject to the following conditions: +% +% The above copyright notice and this permission notice shall be included in all +% copies or substantial portions of the Software. +% +% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +% SOFTWARE. + +\def \skelversion {0.1} +\def \skeldate {2020-12-30} + +\RequirePackage{expl3} + +\ProvidesExplPackage + {skeldoc} + {\skeldate} + {\skelversion} + {Placeholders for unfinished documents} + +\RequirePackage{xcolor} +\RequirePackage{xparse} + +\RequirePackage{tabularx} +\RequirePackage{booktabs} + +\RequirePackage{hyperref} + +\RequirePackage{enotez} +\setenotez{backref, mark-cs={}} + +\RequirePackage{marginnote} + +\RequirePackage{enumitem} + +\cs_new:Npn \skel_tl_from_key:N #1 { + \tl_set_rescan:Nno #1 { } { \l_keys_key_str } +} + +% #1: command name +% #2: variable associated with unknown keys +% #3: key-val list for local \keys_define:nn +% +% Note: Local keyword arguments referring to global defaults should be token +% lists (..._tl, rather than, say, ..._int) to avoid expansion of the default +% when it is set initially. +\cs_new:Npn \skel_defaults:nnn #1 #2 #3 { + + \keys_define:nn { skeldoc / #1 } { + + #3 + + unknown .code:n = { + \tl_set_rescan:Nno #2 { } { \l_keys_key_str } + }, + unknown .value_forbidden:n = true + + } + +} + +% #1: command name +% #2: key-val list for local \keys_set:nn +\cs_new:Npn \skel_args:nn #1 #2 { + + \keys_set:nn { skeldoc / #1 } { #2 } + +} + +%% Configuration %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Blue from Solarized (https://ethanschoonover.com/solarized/) +% (See also https://ctan.org/pkg/xcolor-solarized.) +\definecolor{skel-blue}{HTML}{268BD2} + +\keys_define:nn { skeldoc } { + + %% General config + + main-color .code:n = \colorlet{skel-main-color}{#1} , + main-color .initial:n = black!7 , + + full-width .tl_set:N = \l_skel_full_width_tl , + full-width .initial:n = \linewidth , + + short-width .tl_set:N = \l_skel_short_width_tl , + short-width .initial:n = .72\l_skel_full_width_tl , + + fill-width .tl_set:N = \l_skel_fill_width_tl , + fill-width .initial:n = 0pt~plus~1fill , + + hypersetup .tl_set:N = \l_skel_hypersetup_tl , + hypersetup .initial:n = hidelinks , + + % With basic LaTeX classes, twocolumn seems to shrink \marginparwidth to + % 4.0pt. marginnote.sty uses this width, so we must make sure there's room + % for our endnote marks. (To avoid having \marginpardiwth interfered with, + % just set min-mpwidth=0pt in the preamble.) + min-mpwidth .dim_set:N = \l_skel_min_mpwidth_dim , + min-mpwidth .initial:n = 3em , + + line-raise .tl_set:N = \l_skel_line_raise_tl , + line-raise .initial:n = -.3ex , + + line-height .tl_set:N = \l_skel_line_height_tl , + line-height .initial:n = 2.1ex , + + %% \skelnote is only configured through \skelset -- no local config + + note-font .tl_set:N = \l_skel_note_font_tl , + note-font .initial:n = \normalsize\normalfont , + + note-color .code:n = \colorlet{skel-note-color}{#1} , + note-color .initial:n = skel-blue!70 , + + %% Defaults for \skelline + + line-width .tl_set:N = \l_skel_line_width_default_tl , + line-width .initial:n = \l_skel_short_width_tl , + + %% Defaults for \skelpar + + par-lines .int_set:N = \l_skel_par_lines_default_int , + par-lines .initial:n = 10 , + + par-first-width .tl_set:N = \l_skel_par_first_width_default_tl , + par-first-width .initial:n = \l_skel_fill_width_tl , + + par-width .tl_set:N = \l_skel_par_width_default_tl , + par-width .initial:n = \l_skel_full_width_tl , + + par-last-width .tl_set:N = \l_skel_par_last_width_default_tl , + par-last-width .initial:n = \l_skel_short_width_tl , + + %% Defaults for \skelfig + + fig-width .tl_set:N = \l_skel_fig_width_default_tl , + fig-width .initial:n = \l_skel_full_width_tl , + + fig-height .tl_set:N = \l_skel_fig_height_default_tl , + fig-height .initial:n = 5cm , + + %% Defaults for \skelcaption + + caption-lines .int_set:N = \l_skel_caption_lines_default_int , + caption-lines .initial:n = 3 , + + %% Defaults for \skelpars + + pars-pars .int_set:N = \l_skel_pars_default_int , + pars-pars .initial:n = 5 , + + %% Defaults for lists (\skelitems and \skelenum) + + list-items .int_set:N = \l_skel_list_items_default_int , + list-items .initial:n = 4 , + + list-item-lines .int_set:N = \l_skel_list_item_lines_default_int , + list-item-lines .initial:n = 2 , + + %% Defaults for \skeltabular + + tabular-rows .int_set:N = \l_skel_tabular_rows_default_int , + tabular-rows .initial:n = 10 , + + tabular-colsep .tl_set:N = \l_skel_tabular_colsep_default_tl , + tabular-colsep .initial:n = 2pt , + + tabular-stretch .tl_set:N = \l_skel_tabular_stretch_default_tl , + tabular-stretch .initial:n = 1.2 , + + %% Defaults for \skelbib + + bib-items .int_set:N = \l_skel_bib_items_default_int , + bib-items .initial:n = 12 , + + bib-item-lines .int_set:N = \l_skel_bib_item_lines_default_int , + bib-item-lines .initial:n = 2 , + + %% Defaults for \skelpseudo + + pseudo-lines .int_set:N = \l_skel_pseudo_lines_default_int , + pseudo-lines .initial:n = 8 , + + pseudo-head .tl_set:N = \l_skel_pseudo_head_default_tl , + pseudo-head .initial:n = , + + pseudo-newlines .tl_set:N = \l_skel_pseudo_newlines_default_tl , + pseudo-newlines .initial:n = { + \\+, \\-, \\+, \\+, \\--, \\+, \\, \\- + }, + +} + +\NewDocumentCommand \skelset { +m } { + \keys_set:nn { skeldoc } { #1 } +} + +%% Rules %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% #1: raise +% #2: width +% #3: thickness +\cs_new_protected:Npn \skel_rule:nnn #1 #2 #3 { + \textcolor {skel-main-color} { + \rule [#1] {#2} {#3} + } +} + +% #1: width +\cs_new_protected:Npn \skel_line:n #1 { + \skel_rule:nnn + { \l_skel_line_raise_tl } { #1 } { \l_skel_line_height_tl } +} +\cs_new:Npn \skel_line: { + \skel_line:n { \l_skel_line_width_tl } +} + +% #1: raise +% #2: width/fill +% #3: thickness +\cs_new_protected:Npn \skel_fill:nnn #1 #2 #3 { + \leavevmode + \textcolor{skel-main-color}{ + \leaders\hrule + height \dim_eval:n { #3 + #1 } + depth \dim_eval:n { -#1 } + \skip_horizontal:n { #2 } + } + \kern0pt +} + +% #1: fill +\cs_new:Npn \skel_fill:n #1 { + \skel_fill:nnn + { \l_skel_line_raise_tl } + { #1 } + { \l_skel_line_height_tl } +} + +\cs_new:Npn \skel_fill: { + \skel_fill:n { \l_skel_fill_width_tl } +} + +%% skelline %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\skel_defaults:nnn { skelline } { \l_skel_line_width_tl } { + + width .tl_set:N = \l_skel_line_width_tl , + width .initial:n = \l_skel_line_width_default_tl , + +} +\NewDocumentCommand \skelline { +O{} +g } { + + \group_begin: + + \skel_args:nn { skelline } { #1 } + + \IfValueT { #2 } { \skelnote { #2 } } + + \skel_line: + + \group_end: + +} + +%% skelpar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\int_new:N \l_skel_par_lines_int + +\skel_defaults:nnn { skelpar } { \l_skel_par_lines_tl } { + + lines .tl_set:N = \l_skel_par_lines_tl , + lines .initial:n = \l_skel_par_lines_default_int , + + first-width .tl_set:N = \l_skel_par_first_width_tl , + first-width .initial:n = \l_skel_par_first_width_default_tl , + + width .tl_set:N = \l_skel_par_width_tl , + width .initial:n = \l_skel_par_width_default_tl , + + last-width .tl_set:N = \l_skel_par_last_width_tl , + last-width .initial:n = \l_skel_par_last_width_default_tl , + +} +\NewDocumentCommand \skelpar { +O{} +g } { + + \group_begin: + + \skel_args:nn { skelpar } { #1 } + \int_set:Nn \l_skel_par_lines_int \l_skel_par_lines_tl + + \IfValueT { #2 } { \skelnote { #2 } } + + \skel_par: + + \group_end: + +} + +% \skelpar implementation -- also used in \skelcaption + +\cs_new_protected:Npn \skel_par: { + + \group_begin: + + \int_compare:nNnTF { \l_skel_par_lines_int } = { 1 } { + \skel_line:n { \l_skel_par_last_width_tl } + } { + \skel_fill:n { \l_skel_par_first_width_tl } \\ + } + + \int_decr:N \l_skel_par_lines_int + + \int_step_inline:nn { \l_skel_par_lines_int } { + + \int_compare:nNnTF { ##1 } = { \l_skel_par_lines_int } { + \skel_line:n { \l_skel_par_last_width_tl } + } { + \skel_line:n { \l_skel_par_width_tl } + } + + \allowbreak + + } + + \group_end: + +} + +%% \skelfig %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\skel_defaults:nnn { skelfig } { \l_skel_fig_height_tl } { + + width .tl_set:N = \l_skel_fig_width_tl , + width .initial:n = \l_skel_fig_width_default_tl , + + height .tl_set:N = \l_skel_fig_height_tl , + height .initial:n = \l_skel_fig_height_default_tl , + +} +\NewDocumentCommand \skelfig { +O{} +g } { + + \group_begin: + + \skel_args:nn { skelfig } { #1 } + + \IfValueT { #2 } { \skelnote { #2 } } + + \skel_rule:nnn + { 0pt } + { \l_skel_fig_width_tl } + { \l_skel_fig_height_tl } + + \group_end: + +} + +%% \skelcaption %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\skel_defaults:nnn { skelcaption } { \l_skel_caption_lines_tl } { + + lines .tl_set:N = \l_skel_caption_lines_tl , + lines .initial:n = \l_skel_caption_lines_default_int , + + first-width .tl_set:N = \l_skel_par_first_width_tl , + first-width .initial:n = \l_skel_par_first_width_default_tl , + + width .tl_set:N = \l_skel_par_width_tl , + width .initial:n = \l_skel_par_width_default_tl , + + last-width .tl_set:N = \l_skel_par_last_width_tl , + last-width .initial:n = \l_skel_par_last_width_default_tl , + +} +\NewDocumentCommand \skelcaption { +O{} +g } { + + \group_begin: + + \skel_args:nn { skelcaption } { #1 } + \int_set:Nn \l_skel_par_lines_int \l_skel_caption_lines_tl + + \skel_maybe_skip_note:n \l_skel_par_lines_int + + % In case we have paragraphs in the note -- we don't want those on the + % loose inside \caption (and we might as well avoid putting the + % conditional in there, while we're at it): + \tl_clear:N \l_tmpa_tl + \IfValueT { #2 } { + \tl_set:Nn \l_tmpa_tl { \skelnote { #2 } } + } + + \caption{ + \l_tmpa_tl + \skel_par: + } + + \group_end: + +} + +%% \skelpars %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\int_new:N \l_skel_pars_int + +\skel_defaults:nnn { skelpars } { \l_skel_pars_tl } { + + pars .int_set:N = \l_skel_pars_tl , + pars .initial:n = \l_skel_pars_default_int , + +} +\NewDocumentCommand \skelpars { +O{} +g } { + + \group_begin: + + \skel_args:nn { skelpars } { #1 } + \int_set:Nn \l_skel_pars_int \l_skel_pars_tl + \int_set:Nn \l_skel_par_lines_int \l_skel_par_lines_tl + + \IfValueT { #2 } { \skelnote { #2 } } + + \int_step_inline:nn { \l_skel_pars_int } { + \skel_par: + \int_compare:nNnF { ##1 } = { \l_skel_pars_int } { + \par + } + } + + \group_end: + +} + +%% Lists: \skelitems and \skelenum %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\skel_defaults:nnn { lists } { \l_skel_items_tl } { + + items .tl_set:N = \l_skel_list_items_tl , + items .initial:n = \l_skel_list_items_default_int , + + item-lines .tl_set:N = \l_skel_list_item_lines_tl , + item-lines .initial:n = \l_skel_list_item_lines_default_int , + +} + +\NewDocumentCommand \skelitems { +O{} +g } { + + \skel_list:nnn { #1 } { #2 } { itemize } + +} + +\NewDocumentCommand \skelenum { +O{} +g } { + + \skel_list:nnn { #1 } { #2 } { enumerate } + +} + +\cs_new:Npn \skel_list:nnn #1 #2 #3 { + + \group_begin: + + \skel_args:nn { lists } { #1 } + \int_set:Nn \l_skel_par_lines_int \l_skel_list_item_lines_tl + + \begin{#3} + \int_step_inline:nn { \l_skel_list_items_tl } { + \item \mbox{} + \int_compare:nNnT { ##1 } = { 1 } { + \IfValueT { #2 } { \skelnote { #2 } } + } + \skel_par: + } + \end{#3} + + \group_end: +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Initial definitions here may be overridden for some additional +% customization, beyond the configuration keys. + +% Could also use l columns here, and \skel_rule:n with a given width in the +% header row, but if colortbl is imported (e.g., indirectly via pseudo), using +% \skel_fill: in later rows won't work. +\cs_new:Npn \skel_tabular_env:n #1 { + \begin{tabularx}{\l_skel_full_width_tl}[t]{@{}p{.22\linewidth}p{1.5cm}X@{}} + #1 + \end{tabularx} +} + +\tl_const:Nn \c_skel_tabular_row_tl { + \skel_fill: & \skel_fill: & \skel_fill: \\ +} + +\tl_const:Nn \c_skel_tabular_note_raise_tl { -1.8ex } + +\skel_defaults:nnn { skeltabular } { \l_skel_tabular_rows_tl } { + + rows .tl_set:N = \l_skel_tabular_rows_tl , + rows .initial:n = \l_skel_tabular_rows_default_int , + + colsep .tl_set:N = \l_skel_tabular_colsep_tl , + colsep .initial:n = \l_skel_tabular_colsep_default_tl , + + stretch .tl_set:N = \arraystretch , + stretch .initial:n = \l_skel_tabular_stretch_default_tl , + +} +\NewDocumentCommand \skeltabular { +O{} +g } { + + \group_begin: + + \skel_args:nn { skeltabular } { #1 } + + \dim_set:Nn \tabcolsep \l_skel_tabular_colsep_tl + + \IfValueT { #2 } { + % Adjusted for top-alignment to match that of \skelline/\skelpar + \raisebox{ \c_skel_tabular_note_raise_tl }{ + \skelnote { #2 } + } + } + + \tl_clear:N \l_tmpa_tl + \int_step_inline:nn { \l_skel_tabular_rows_tl } { + \tl_put_right:Nn \l_tmpa_tl { + \c_skel_tabular_row_tl + } + } + + \skel_tabular_env:n { + \toprule + \c_skel_tabular_row_tl + \midrule + \l_tmpa_tl + \bottomrule + } + + \group_end: + +} + +%% \skelbib %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\skel_defaults:nnn { skelbib } { \l_skel_bib_items_tl } { + + items .tl_set:N = \l_skel_bib_items_tl , + items .initial:n = \l_skel_bib_items_default_int , + + item-lines .tl_set:N = \l_skel_bib_item_lines_tl , + item-lines .initial:n = \l_skel_bib_item_lines_default_int , + +} +\NewDocumentCommand \skelbib { +O{} +g } { + + \group_begin: + + \skel_args:nn { skelbib } { #1 } + + \IfValueT { #2 } { + % Hack: Inject note into the section name, for positioning. + \tl_set_eq:NN \l_tmpa_tl \refname + \tl_set:Nn \refname { \skelnote{#2} \l_tmpa_tl } + } + \int_set:Nn \l_tmpa_int \l_skel_bib_items_tl + \begin{thebibliography} { \int_use:N \l_tmpa_int } + \int_step_inline:nn { \l_skel_bib_items_tl } { + \bibitem{bibitem##1} + \skelpar[lines=\l_skel_bib_item_lines_tl] + } + \end{thebibliography} + + \group_end: + +} + +%% \skelpseudo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\int_new:N \l_skel_pseudo_lines_int + +\skel_defaults:nnn { skelpseudo } { \l_skel_pseudo_lines_tl } { + + lines .tl_set:N = \l_skel_pseudo_lines_tl , + lines .initial:n = \l_skel_pseudo_lines_default_int , + + % If no head is given, the headline will be suppressed + head .tl_set:N = \l_skel_pseudo_head_tl , + head .initial:n = \l_skel_pseudo_head_default_tl , + + newlines .tl_set:N = \l_skel_pseudo_newlines_tl , + % Can't use this, because we wouldn't know the number of levels to expand: + % newlines .initial:n = \l_skel_pseudo_newlines_default_tl , + newlines .initial:n = , + +} +\NewDocumentCommand \skelpseudo { +O{} +g } { + + \group_begin: + + \skel_args:nn { skelpseudo } { #1 } + \int_set:Nn \l_skel_pseudo_lines_int \l_skel_pseudo_lines_tl + + % Body, constructed incrementally + \tl_clear:N \l_tmpa_tl + + % Line number, so we know when we're done + \int_zero:N \l_tmpa_int + + % Because we can't use .initial:n for newlines: + \tl_if_empty:NT \l_skel_pseudo_newlines_tl { + \tl_set_eq:NN + \l_skel_pseudo_newlines_tl + \l_skel_pseudo_newlines_default_tl + } + + \seq_set_from_clist:NN \l_tmpa_seq \l_skel_pseudo_newlines_tl + + \int_while_do:nNnn { \l_tmpa_int } < { \l_skel_pseudo_lines_int + 1 } { + + \seq_map_inline:Nn \l_tmpa_seq { + + \int_incr:N \l_tmpa_int + + \int_compare:nNnT { \l_tmpa_int } > { \l_skel_pseudo_lines_int } { + \seq_map_break: + } + + \tl_put_right:Nn \l_tmpa_tl { \skelline ##1 } + + } + + } + + % Expanding the head, to see if it's actually empty + \tl_set:Nx \l_tmpb_tl \l_skel_pseudo_head_tl + \tl_if_empty:NTF \l_tmpb_tl { + \begin{pseudo} + \IfValueT { #2 } { \skelnote { #2 } } + \l_tmpa_tl + \end{pseudo} + } { + \begin{pseudo}* + \multicolumn{2} + {>{\pseudohpad} l <{\pseudohpad}} + { \IfValueT { #2 } { \skelnote { #2 } } + \l_tmpb_tl } + \\ + \l_tmpa_tl + \end{pseudo} + } + + \group_end: + + % The indentation behavior gets messed up by the group around the pseudo + % environment. This restores the behavior: No indent unless you have a + % new paragraph. + \noindent\ignorespaces + +} + +%% Notes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\cs_new:Npn \skel_note:n #1 { + \leavevmode + % Smash to avoid messing with vertical alignment of of surrounding text + \smash{\marginnote{ + \l_skel_note_font_tl + \textcolor{skel-note-color}{ + \endnotemark + } + }} + \endnotetext{\ignorespaces #1 \unskip} + \ignorespaces +} + +\NewDocumentCommand \skelnote { +m } { + \skel_note:n { #1 } +} + +\cs_set_eq:NN \skel_note_orig:n \skel_note:n + +\cs_new:Npn \skel_skip_note: { + \cs_gset_eq:NN \skel_note:n \skel_note_skipped:n +} + +\cs_new:Npn \skel_note_skipped:n #1 { + \cs_gset_eq:NN \skel_note:n \skel_note_orig:n +} + +\AtBeginDocument { + + % Make sure this is run after caption is loaded, even if it's loaded + % before skeldoc: + \@ifpackageloaded { caption } { + % The caption package typesets the caption twice even if it's only a + % single line -- but only if the singlelinecheck is on, so we'll turn + % that on locally, for predictability. + \cs_new:Npn \skel_maybe_skip_note:n #1 { + \captionsetup{singlelinecheck=true} + \skel_skip_note: + } + } { + % Without caption.sty, assuming default LaTeX behavior, which is that the + % caption is typeset twice only if there are two or more lines (as + % indicated by #1). + \cs_new:Npn \skel_maybe_skip_note:n #1 { + \int_compare:nNnT { #1 } > { 1 } { + \skel_skip_note: + } + } + } + + % If the \marginparwidth is too low when the document begins, we change + % it to make room: + \dim_compare:nNnT { \marginparwidth } < { \l_skel_min_mpwidth_dim } { + \dim_set:Nn \marginparwidth { \l_skel_min_mpwidth_dim } + } + + % Supply hyperref.sty with the hidelinks option, unless that's been turned + % off (or changed) with \skelset: + \hypersetup { \l_skel_hypersetup_tl } + +} + +% Rewritten (from enotez.sty), to avoid having the \box_move_up:nn shift my +% margin notes. Adding a \smash to the hypertarget, but not the link (which +% would then be essentially unclickable). +\cs_set_protected:Npn \enotez_write_mark:nn #1#2 { + \bool_if:NTF \l__enotez_hyperfootnotes_bool { + \enotezwritemark { \hyperlink {enz.#1} { \enmarkstyle #2 } } + \bool_if:NT \l__enotez_hyperbackref_bool { + \smash { % Added + \box_move_up:nn {1em} + { \hbox:n { \hypertarget {enz.#1.backref} { } } } + } + } + } + { \enotezwritemark { \enmarkstyle #2 } } +} + +% The default enumitem paragraph-style list has the label protrude into the +% margin, which can be problematic in twocolumn layout, with a narrow column +% gap. To automatically compute the width of the widest label, we keep the +% widest label from enotez in \g_skel_widest_note_label_tl. +\newlist { skel-note-list-type } { enumerate } { 10 } +\tl_new:N \g_skel_widest_note_label_tl +\setlist [ skel-note-list-type ] { + widest = \g_skel_widest_note_label_tl, + label = \arabic*., + leftmargin = *, + listparindent=\parindent, + parsep = 0pt, + itemsep = 4.0pt plus 2.0pt minus 1.0pt, + +} + +\DeclareInstance { enotez-list } { skel-note-list } { list } { + number = \textcolor{skel-note-color}{#1.}, + list-type = skel-note-list-type, +} + +\NewDocumentCommand \printskelnotes { } { + \tl_set:Ne \g_skel_widest_note_label_tl \theendnote + \printendnotes[skel-note-list] +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/macros/latex/contrib/skeldoc/skeldoc.tex b/macros/latex/contrib/skeldoc/skeldoc.tex new file mode 100644 index 0000000000..ec9ad5c435 --- /dev/null +++ b/macros/latex/contrib/skeldoc/skeldoc.tex @@ -0,0 +1,220 @@ +% Copyright (c) 2020 Magnus Lie Hetland +% +% Permission is hereby granted, free of charge, to any person obtaining a copy +% of this software and associated documentation files (the "Software"), to deal +% in the Software without restriction, including without limitation the rights +% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +% copies of the Software, and to permit persons to whom the Software is +% furnished to do so, subject to the following conditions: +% +% The above copyright notice and this permission notice shall be included in all +% copies or substantial portions of the Software. +% +% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +% SOFTWARE. + +\documentclass[twocolumn, a4paper]{article} + +\usepackage{lmodern} +\def\sfdefault{cmbr} +\def\ttdefault{cmtl} + +\usepackage{skeldoc} + +\usepackage{amsthm} +\newtheorem{thm}{Theorem} + +% For discussing commmands: + +\makeatletter +\ExplSyntaxOn + +% Copied from http://ctan.uib.no/macros/latex/base/doc.dtx +% Protect when used in moving arguments. +{\catcode`\|=\z@ \catcode`\\=12 |gdef|bslash{\}} + +\NewDocumentCommand \cs { m } {% + \texttt{\bslash #1}% +} + +\NewDocumentCommand \braces { +m } {% + \string{#1\string}% +} + +\NewDocumentCommand \pkg { o m } { + \IfNoValueTF { #1 } { + \textsf { #2 } + } { + \href{ #1 }{ \textsf { #2 } } + } +} + +\NewDocumentCommand \var { m } { + $\langle$ + \textnormal{\textit{#1}} + $\rangle$ +} + +\ExplSyntaxOff +\makeatother + +% To illustrate the \skelpseudo command: + +\usepackage{pseudo} + +\title{\skelline{The \pkg{skeldoc} package is intended for incremental +document development, with commands that insert simplified placeholder +elements for missing parts, similar to \emph{skeleton screens}, optionally +with associated notes explaining the placeholders.}} + +\author{\skelline[5cm]{The \pkg{skeldoc} package is written by Magnus Lie +Hetland.}} + +\begin{document} +\maketitle + +\begin{abstract} + \skelpar[4] +\end{abstract} + +\section{Introduction} + +\skelpar[7]{All the skeleton commands are followed by an optional argument in +brackets, and one (also optional) in braces, like +\cs{skelfoo}\texttt{[\var{conf}]\braces{\var{note}}}. The first argument is +for limited local +configuration, setting keys relevant to the specific command. Each command +also lets you supply one such config value \emph{without} a key, leaving the +key implicit. For example, for \cs{skelline} (a single skeleton line), this is +\texttt{width} and for \cs{skelpar} (a single skeleton paragraph), it's +\texttt{lines}. So \cs{skelline[5cm]} is the same as +\cs{skelline[width\,=\,5cm]}. The \cs{skelpar} command also has the keys +\texttt{first-width}, \texttt{width} and \texttt{last-width}, to adjust the +various line widths. + +The argument in braces is a \emph{note} associated with the skeleton element, +typeset using the \cs{skelnote} command, which places a number in the margin +and an note at the end of the document (or wherever the \cs{printskelnotes} +command is placed), with hyperlinks in both directions. + +Beyond the keys available locally, there are several \emph{global} config +keys, which may be set using the \cs{skelset} command (which respects \TeX{} +groups, so such config may also be local, e.g., by wrapping the relevant part +of the document in braces). For example, one might use +\cs{skelset\braces{main-color\allowbreak\,=\,black}} to produce a look along +the lines of the \pkg[https://ctan.org/pkg/censor]{censor} package. Shared +defaults for the local keys may also be set in this way, generally using the +local key name with the type of element as a prefix; for example, +\texttt{par-lines} is used to set the default for the \texttt{lines} key of +the \cs{skelpar} command. There are also some other general keys, like +\texttt{main-color} and \texttt{full-width}. For an overview of the +configuration keys, please consult the source file, \texttt{skeldoc.sty}.} +\skelenum[3] +\noindent +\skelpar[3] + +\section{\skelline} + +\skelpar + +\skelnote{It is possible to add notes in arbitrary parts of a document with +the \cs{skelnote} command. This could also be used as a simple to-do or +annotation mechanism.} +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam +voluptua. +\skelpar[2] +At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd +gubergren, no sea takimata sanctus est. + +\skelpar +\skelitems{The \cs{skelenum} and \cs{skelitems} commands produce skeleton +\emph{lists} (using \texttt{enumeration} and \texttt{itemize}). Their implicit +key is \texttt{items}, which controls the number of items, while +\texttt{item-lines} controls the number of lines per item.} +\noindent +\skelpar[4] + +\begin{figure} +\skelfig[5cm]{Skeleton figures (\cs{skelfig}) have \texttt{height} as their +implicit key. The width may be modified using the \texttt{width} key.} +\skelcaption{Skeleton captions are best typeset using the special-purpose +\cs{skelcaption} command, rather than simply placing a \cs{skelpar} in a +normal \cs{caption}, at least if you intend to attach a note. This is because +captions are generally typeset more than once, in order to determine whether +to center them; \cs{skelcaption} prevents any attached note from being added +to the note list twice. + +The implicit argument of \cs{skelcaption} is \texttt{lines}, and the other +keys are as for \cs{skelpar}, relying on the same defaults and global +configuration.} +\end{figure}% + +\skelpar +\begin{equation} + \skelline +\end{equation} +\skelpars[3]{Multiple skeleton paragraphs may be produced using the +\cs{skelpars} command, whose implicit key is \texttt{pars}, controlling +the number of paragraphs.} + +\begin{table} +\skelcaption[1]{The \cs{skelcaption} command may be used for figures and +tables alike.} +\skeltabular[7]{The \cs{skeltabular} command produces a skeleton table +(specifically, a \texttt{tabularx}). The implicit key is \texttt{rows}, +controlling the number of rows in the table. The \cs{tabcolsep} and +\cs{arraystretch} used can be set with the \texttt{colsep} and +\texttt{stretch} keys.} +\end{table} + +\skelpar + +\begin{thm} + \skelpar[3] +\end{thm} +\begin{proof} +\skelpar +\end{proof} + +\skelpar + +\section{\skelline} + +\skelpar +\skelpseudo[ + head={\pr{Lorem-Ipsum}(\id{dolor}, \id{sit}, \id{amet})}, +]{The \cs{skelpseudo} command only works if the +\pkg[https://ctan.org/pkg/pseudo]{pseudo} package has been imported. (It is +not imported by the \pkg{skeldoc} package.) The implicit key is +\texttt{lines}, the number of lines to produce (in addition to the headline, +if any). By default, no headline is included, but one may be set using the +\texttt{head} key (e.g., using the \cs{pr} command from the +\pkg[https://ctan.org/pkg/pseudo]{pseudo} package, rather than \cs{hd}, +because the \texttt{head} key handles the \cs{multicolumn} stuff itself; for +example, use +\texttt{head\,=\,\braces{\cs{pr}\braces{\var{name}}(\var{args})}}). The indent +pattern is set using the \texttt{newlines} key, which should be a +comma-separated list of newline commands as used by the +\pkg[https://ctan.org/pkg/pseudo]{pseudo} package (such as \cs{\bslash+} or +\cs{\bslash--}). This list is used round-robin as the lines progress. E.g., if +you want pseudocode without any indentation, simply use +\texttt{newlines\,=\,\cs{\bslash}}.} +\skelpar + +\section{Discussion} + +\skelpars[2] + +\skelbib{The \cs{skelbib} command produces a skeleton bibliography, with the +number of items controlled by the implicit key \texttt{items}. The number of +lines per item is controlled by \texttt{item-lines}.} + +\printskelnotes + +\end{document} diff --git a/macros/latex/contrib/xurl/Changes b/macros/latex/contrib/xurl/Changes index 0cc148f4ee..c322f4c311 100644 --- a/macros/latex/contrib/xurl/Changes +++ b/macros/latex/contrib/xurl/Changes @@ -1,3 +1,4 @@ +0.09a 2020-12-30 - fix a typo in the documentation 0.09 2020-01-24 - add missing \do\\ 0.08 2020-01-14 - define macro \useOriginalUrlSetting 0.07 2018-12-23 - move numbers into \UrlBreaks diff --git a/macros/latex/contrib/xurl/doc/xurl.pdf b/macros/latex/contrib/xurl/doc/xurl.pdf index 993da5b021..8ed6f730e2 100644 Binary files a/macros/latex/contrib/xurl/doc/xurl.pdf and b/macros/latex/contrib/xurl/doc/xurl.pdf differ diff --git a/macros/latex/contrib/xurl/doc/xurl.tex b/macros/latex/contrib/xurl/doc/xurl.tex index 79d48dc2e7..1c7c42ab34 100644 --- a/macros/latex/contrib/xurl/doc/xurl.tex +++ b/macros/latex/contrib/xurl/doc/xurl.tex @@ -1,4 +1,4 @@ -%% $Id: xurl.tex 1133 2020-01-14 12:10:03Z herbert $ +%% $Id: xurl.tex 45 2020-12-30 17:45:20Z herbert $ % \listfiles\setcounter{errorcontextlines}{100} \RequirePackage{filecontents} @@ -65,7 +65,7 @@ the documentation of package url. \section{With the original setting from package url} -The original behaviour of package \texttt{url} can be optained +The original behaviour of package \texttt{url} can be obtained by using the macro \texttt{\textbackslash useOriginalUrlSetting} which should be used inside a group: diff --git a/macros/latex/contrib/xurl/latex/xurl.sty b/macros/latex/contrib/xurl/latex/xurl.sty index 9f1f41bfff..6a1ca35326 100644 --- a/macros/latex/contrib/xurl/latex/xurl.sty +++ b/macros/latex/contrib/xurl/latex/xurl.sty @@ -1,4 +1,4 @@ -%% $Id: xurl.sty 1137 2020-01-24 13:32:38Z herbert $ +%% $Id: xurl.sty 45 2020-12-30 17:45:20Z herbert $ %% %% This is file `xurl.sty', %% @@ -16,7 +16,7 @@ %% `xurl' is a package for extended URL breaks %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{xurl}[2020/01/24 v 0.09 modify URL breaks] +\ProvidesPackage{xurl}[2020/12/30 v 0.09a modify URL breaks] \newif\if@no@biblatex \@no@biblatexfalse \DeclareOption{nobiblatex}{\@no@biblatextrue} diff --git a/macros/luatex/generic/luamplib/NEWS b/macros/luatex/generic/luamplib/NEWS index 7155c5a4b8..4eed375513 100644 --- a/macros/luatex/generic/luamplib/NEWS +++ b/macros/luatex/generic/luamplib/NEWS @@ -1,5 +1,11 @@ History of the luamplib package +2020/12/30 2.20.6 + * fix a bug regarding no figure output when luamplib.showlog is + true. (#91) + * now metapost `show' command triggers a warning message, so that + it could be shown on the console. (#91) + 2020/02/24 2.20.5 * Extra check for \pdfliteral (PR #89) * allow expansion of \mpdim and \mpcolor when they are used in diff --git a/macros/luatex/generic/luamplib/luamplib.dtx b/macros/luatex/generic/luamplib/luamplib.dtx index af3229da7a..12a9519dc8 100644 --- a/macros/luatex/generic/luamplib/luamplib.dtx +++ b/macros/luatex/generic/luamplib/luamplib.dtx @@ -85,7 +85,7 @@ See source file '\inFileName' for licencing and contact information. %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luamplib.drv}% - [2020/02/24 v2.20.5 Interface for using the mplib library]% + [2020/12/30 v2.20.6 Interface for using the mplib library]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xspace} \usepackage[x11names]{xcolor} @@ -153,7 +153,7 @@ See source file '\inFileName' for licencing and contact information. % \author{Hans Hagen, Taco Hoekwater, Elie Roux, Philipp Gesang and Kim Dohyun\\ % Maintainer: LuaLaTeX Maintainers --- % Support: \email{lualatex-dev@tug.org}} -% \date{2020/02/24 v2.20.5} +% \date{2020/12/30 v2.20.6} % % \maketitle % @@ -407,8 +407,8 @@ See source file '\inFileName' for licencing and contact information. luatexbase.provides_module { name = "luamplib", - version = "2.20.5", - date = "2020/02/24", + version = "2.20.6", + date = "2020/12/30", description = "Lua package to typeset Metapost with LuaTeX's MPLib.", } @@ -427,7 +427,6 @@ luamplib = luamplib or { } local luamplib = luamplib luamplib.showlog = luamplib.showlog or false -luamplib.lastlog = "" % \end{macrocode} % @@ -702,22 +701,34 @@ local preamble = [[ input %s ; ]] -local function luamplibresetlastlog() - luamplib.lastlog = "" -end - -local function reporterror (result) +local function reporterror (result, indeed) if not result then err("no result object returned") else local t, e, l = result.term, result.error, result.log local log = t or l or "no-term" - log = log:gsub("^%s+","\n") - luamplib.lastlog = luamplib.lastlog .. "\n" .. (l or t or "no-log") + log = log:gsub("%(Please type a command or say `end'%)",""):gsub("\n+","\n") if result.status > 0 then - warn("%s",log) + warn(log) if result.status > 1 then - err("%s",e or "see above messages") + err(e or "see above messages") + end + else +% \end{macrocode} +% +% v2.6.1: now luamplib does not disregard |show| command, +% even when |luamplib.showlog| is false. Incidentally, +% it does not raise error but just prints a warning, +% even if output has no figure. +% \begin{macrocode} + if log:find"\n>>" then + warn(log) + elseif log:find"%g" then + if luamplib.showlog then + info(log) + elseif indeed and not result.fig then + info(log) + end end end return log @@ -784,23 +795,11 @@ local function process_indeed (mpx, data) local converted, result = false, {} if mpx and data then result = mpx:execute(data) - local log = reporterror(result) + local log = reporterror(result, true) if log then - if luamplib.showlog then - info("%s",luamplib.lastlog) - luamplibresetlastlog() - elseif result.fig then -% \end{macrocode} -% -% v2.6.1: now luamplib does not disregard |show| command, -% even when |luamplib.showlog| is false. Incidentally, -% it does not raise error but just prints a warning, -% even if output has no figure. -% \begin{macrocode} - if log:find("\n>>") then info("%s",log) end + if result.fig then converted = luamplib.convert(result) else - info("%s",log) warn("No figure output. Maybe no beginfig/endfig") end end @@ -1960,7 +1959,7 @@ luamplib.colorconverter = colorconverter \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luamplib} - [2020/02/24 v2.20.5 mplib package for LuaTeX] + [2020/12/30 v2.20.6 mplib package for LuaTeX] \ifx\newluafunction\@undefined \input ltluatex \fi diff --git a/macros/luatex/generic/luamplib/luamplib.pdf b/macros/luatex/generic/luamplib/luamplib.pdf index 881e643e25..6b74341aa8 100644 Binary files a/macros/luatex/generic/luamplib/luamplib.pdf and b/macros/luatex/generic/luamplib/luamplib.pdf differ diff --git a/macros/luatex/generic/luamplib/test-luamplib-latex.tex b/macros/luatex/generic/luamplib/test-luamplib-latex.tex index 3e53eb2662..dc06a9bd8f 100644 --- a/macros/luatex/generic/luamplib/test-luamplib-latex.tex +++ b/macros/luatex/generic/luamplib/test-luamplib-latex.tex @@ -164,4 +164,6 @@ diameter:\Dia bp.% rotatedlabel.top(textext("Rotated!"), origin, 45); endfig; \end{mplibcode}% + +\tracingcommands0 \end{document} -- cgit v1.2.3