diff options
author | Norbert Preining <norbert@preining.info> | 2021-12-10 03:01:42 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-12-10 03:01:42 +0000 |
commit | e8ddf481fa0d453faba1a05623b2d4cba9b6404e (patch) | |
tree | db96e35cfa187f7ab90ec266a63b577db8a5095d /macros/latex/contrib | |
parent | 48aad54f9d8faf7776248c653b2a7da9bb2ffa95 (diff) |
CTAN sync 202112100301
Diffstat (limited to 'macros/latex/contrib')
18 files changed, 257 insertions, 122 deletions
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/README.md b/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/README.md index 3586a78da9..a98aeb29d7 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/README.md +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/README.md @@ -1,4 +1,4 @@ -# Focus v3.0.0 +# Focus v3.1.0 A presentation theme for LaTeX Beamer that aims at a clean and minimalist design, so to minimize distractions and put the focus directly on the content. @@ -63,13 +63,19 @@ Alternatively, a full footline bar with the frame numbering can be shown with: ```latex \usetheme[numbering=fullbar]{focus} ``` -In such case, an optional text to be printed on the left side of the footline + +The `minimal` style just prints the frame numbering without any footline background: +```latex +\usetheme[numbering=minimal]{focus} +``` + +In the `fullbar` and `minimal` cases, an optional text to be printed on the left side of the footline can be customized with: ```latex \footlineinfo{Custom footline text} ``` -For both footline styles the total frame number (shown by default) can be suppressed with: +For all footline styles the total frame number (shown by default) can be suppressed with: ```latex \usetheme[totalframenumbering=no]{focus} ``` diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/beamerouterthemefocus.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/beamerouterthemefocus.sty index 0f09243977..e65db21774 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/beamerouterthemefocus.sty +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/beamerouterthemefocus.sty @@ -164,6 +164,44 @@ \fi% } +\defbeamertemplate{footline}{minimal}{% + % If not appendix. + \ifnum\mainend<0% From package appendixnumberbeamer. + % + \settowidth{\focus@pbar@leftoffset}{1}% + \addtolength{\focus@pbar@leftoffset}{1.5em}% + % + \ifx\beamer@focus@totalframenumbering\no% + \settowidth{\focus@pbar@rightoffset}{}% + \addtolength{\focus@pbar@rightoffset}{0.5em}% + \else% + \settowidth{\focus@pbar@rightoffset}{\inserttotalframenumber}% + \addtolength{\focus@pbar@rightoffset}{1.5em}% + \fi% + % + % If not title page. + \ifnum\value{realframenumber}>0% + \begin{tikzpicture}[inner xsep=0.5em, inner ysep=0.5ex] + \clip (0,0) rectangle ++(\paperwidth,\the\focus@pbar@height); + \fill[footline.fg] (0,0) rectangle ++(\paperwidth,\the\focus@pbar@height); + + \ifx\focus@footlineinfo\empty% + \else% + \node[anchor=west, footline.bg] at ({\the\focus@pbar@leftoffset},{0.5*\focus@pbar@height}) {\focus@footlineinfo}; + \fi% + + \node[anchor=east, footline.bg] at ({\paperwidth-\the\focus@pbar@rightoffset},{0.5*\focus@pbar@height}) {\strut\insertframenumber}; + + \ifx\beamer@focus@totalframenumbering\no% + \else% + \node[footline.bg] at ({\paperwidth-\the\focus@pbar@rightoffset},{0.5*\focus@pbar@height}) {\strut/}; + \node[anchor=west, footline.bg] at ({\paperwidth-\the\focus@pbar@rightoffset},{0.5*\focus@pbar@height}) {\strut\inserttotalframenumber}; + \fi% + \end{tikzpicture}% + \fi% + \fi% +} + % Empty footline. \defbeamertemplate{footline}{none}{} @@ -177,6 +215,7 @@ \def\beamer@focus@numberingprogressbar{progressbar} \def\beamer@focus@numberingfullbar{fullbar} +\def\beamer@focus@numberingminimal{minimal} \def\beamer@focus@numberingnone{none} \def\beamer@focus@totalframenumberingyes{yes} @@ -220,7 +259,11 @@ \ifx\beamer@focus@numbering\beamer@focus@numberingfullbar% \setbeamertemplate{footline}[fullbar]% \else% - \setbeamertemplate{footline}[none]% + \ifx\beamer@focus@numbering\beamer@focus@numberingminimal% + \setbeamertemplate{footline}[minimal]% + \else% + \setbeamertemplate{footline}[none]% + \fi \fi% \fi% % diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/beamerthemefocus.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/beamerthemefocus.sty index 70effd6386..60fe0d644a 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/beamerthemefocus.sty +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-focus/beamerthemefocus.sty @@ -19,7 +19,7 @@ % along with beamerthemefocus. If not, see <http://www.gnu.org/licenses/>. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerthemefocus}[2021/12/07 v3.0.0 Focus Beamer theme] +\ProvidesPackage{beamerthemefocus}[2021/12/08 v3.1.0 Focus Beamer theme] \mode<presentation> diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index f8f3e85ddb..ce53b48600 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -15,14 +15,14 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/12/08}{1.41L} +\ProvidesExplClass{easybook}{2021/12/08}{1.41N} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool \bool_set_false:N \l__eb_title_newline_bool \bool_set_true:N \l__eb_class_mode_book_bool \tl_new:N \g__eb_config_tl -\tl_new:N \l__eb_font_choice_tl +\tl_new:N \l__eb_font_value_tl \clist_new:N \g__eb_options_clist \cs_new_protected:Npn \eb_put_ctexbook:n #1 { \PassOptionsToClass{#1}{ctexbook} } @@ -35,18 +35,12 @@ enmode .meta:n = { newline,scheme = plain }, font .choices:nn = { noto,garamond,times,times*,libertine,palatino,auto } - { \tl_set:Nn \l__eb_font_choice_tl {#1} }, + { \tl_set:Nn \l__eb_font_value_tl {#1} }, font .value_required:n = true, font .initial:n = auto, cjkfont .code:n = \eb_put_ctexbook:n { fontset = #1 }, paper .code:n = \PassOptionsToPackage{#1}{geometry}, - mathfont .choices:nn = - { - noto,notosans,times,libertine, - charter,garamond,none,nc,stix - } - { \tl_set:Nn \l__eb_mathfont_choice_tl {#1} }, - mathfont .value_required:n = true, + mathfont .tl_set:N = \l__eb_mathfont_value_tl, mathfont .initial:n = times, class .choice:, class .value_required:n = true, @@ -72,7 +66,7 @@ \RequirePackage{easybase} \ctex_at_end:n { - \use:c { eb@font@load@\l__eb_font_choice_tl } + \use:c { eb@font@load@\l__eb_font_value_tl } \tl_if_empty:NF \g__eb_config_tl { \file_input:n { \g__eb_config_tl } } } @@ -231,18 +225,16 @@ } \cs_new_protected:Npn \eb_put_newtxmath:n #1 { \PassOptionsToPackage{#1}{newtxmath} } -\str_case:VnT \l__eb_mathfont_choice_tl - { - { times } { } - { nc } { \eb_put_newtxmath:n { nc } } - { noto } { \eb_put_newtxmath:n { noto } } - { stix } { \eb_put_newtxmath:n { stix2 } } - { charter } { \eb_put_newtxmath:n { charter } } - { notosans } { \eb_put_newtxmath:n { notosans } } - { garamond } { \eb_put_newtxmath:n { ebgaramond } } - { libertine } { \eb_put_newtxmath:n { libertine } } - } - { \LoadPackage{newtxmath+bm} } +\cs_generate_variant:Nn \eb_put_newtxmath:n { V } +\str_case:VnF \l__eb_mathfont_value_tl + { + { times } { \LoadPackage{newtxmath+bm} } + { none } { } + } + { + \eb_put_newtxmath:V \l__eb_mathfont_value_tl + \LoadPackage{newtxmath+bm} + } \ctex_set:n { @@ -319,7 +311,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/12/08}{1.41L} +\ProvidesExplPackage{easybase}{2021/12/08}{1.41N} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -463,7 +455,7 @@ \bool_new:N \l__eb_mark_uppercase_bool \bool_new:N \l__eb_chap_counter_withpart_bool -\tl_new:N \l__eb_foot_counter_parent_choice_tl +\tl_new:N \l__eb_foot_counter_parent_value_tl \eb_seq_map_inline:nn { @@ -473,11 +465,8 @@ } { \ctex_define:n { #1 .meta:nn = { ctex/#1 } {##1} } - \cs_new_protected:cpn {#1} ##1 { \ctex_set:nn {#1} {##1} } + \cs_new_protected:cpn { eb#1 } ##1 { \ctex_set:nn {#1} {##1} } } -\keys_define:nn { } { ctex/link .inherit:n = ctex/refset } -\ctex_define:n { link .meta:nn = { ctex/link } {#1} } -\cs_set_eq:NN \link \refset \eb_seq_map_inline:nn { style,subfont,spread,bibset,thmset,hdrset,tocset } { @@ -581,7 +570,7 @@ withpart .default:n = true, withpart .initial:n = false, rulewidth .dim_set:N = \l__eb_rule_width_dim, - rulewidth .initial:n = 0.6pt, + rulewidth .initial:n = 0.5pt, uppercase .bool_set:N = \l__eb_mark_uppercase_bool, uppercase .default:n = true, uppercase .initial:n = true, @@ -747,7 +736,7 @@ { footwith .choices:nn = { part,page,chapter } - { \tl_set:Nn \l__eb_foot_counter_parent_choice_tl {#1} }, + { \tl_set:Nn \l__eb_foot_counter_parent_value_tl {#1} }, footwith .value_required:n = true, footwith .initial:n = chapter } @@ -830,7 +819,7 @@ } \cs_set_eq:cN {#2} \l__eb_fnmate_short_tokens_tl } -\cs_new_protected:Npn \eb_footnote_choice_handle:n #1 +\cs_new_protected:Npn \eb_footnote_value_handle:n #1 { \str_case:nnF {#1} { @@ -838,7 +827,7 @@ { \bool_set_true:N \l__eb_fnpara_bottom_bool } { flush } { - \tl_set:Nn \l__eb_footnote_choice_tl { default } + \tl_set:Nn \l__eb_footnote_value_tl { default } \clist_push:Nn \l__eb_footnote_mulchoice_clist {#1} } } @@ -846,7 +835,7 @@ \bool_lazy_or:nnT { \str_if_eq_p:nn {#1} { hang } } { \str_if_eq_p:nn {#1} { default } } - { \tl_set:Nn \l__eb_footnote_choice_tl {#1} } + { \tl_set:Nn \l__eb_footnote_value_tl {#1} } } } \cs_new_protected:Npn \eb_fnmate_shift_set:nnn #1#2#3 @@ -892,7 +881,7 @@ footnotetype .multichoices:nn = { default,hang,bottom,para,flush } - { \eb_footnote_choice_handle:n {#1} }, + { \eb_footnote_value_handle:n {#1} }, footnotetype .value_required:n = true, footnotetype .initial:n = hang, @@ -927,7 +916,7 @@ \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox } \bool_if:NT \l__eb_chap_counter_withpart_bool { \counterwithin*{chapter}{part} } - \str_case:VnT \l__eb_foot_counter_parent_choice_tl + \str_case:VnT \l__eb_foot_counter_parent_value_tl { { part } { \counterwithin*{footnote}{part} } { page } { \counterwithin*{footnote}{page} } @@ -1016,7 +1005,7 @@ \cs_set:Npn \@makefntext #1 { \group_begin: - \str_case:Vn \l__eb_footnote_choice_tl + \str_case:Vn \l__eb_footnote_value_tl { { hang } { \use_i:nn } { default } { \use_ii:nn } @@ -1026,7 +1015,7 @@ \skip_set:NV \parskip \footparskip \dim_set:NV \parindent \footparindent \l__eb_fnpara_format_tl{#1} - \tl_if_eq:NnT \l__eb_footnote_choice_tl { hang } { \par } + \tl_if_eq:NnT \l__eb_footnote_value_tl { hang } { \par } \group_end: } \cs_set_eq:NN \eb@makefntext \@makefntext @@ -1737,7 +1726,7 @@ marginpar .initial:n = \rmfamily\footnotesize, unknown .code:n = \eb_msg_abandon_option:n { subfont } } -\cs_new_protected:Npn \addsubfont #1#2 +\cs_new_protected:Npn \addtosubfont #1#2 { \str_case:nnF {#1} { @@ -2441,17 +2430,17 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/08}{1.41L} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/08}{1.41N} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \setexercise #1 { \keys_set:nn { eb/exercise } {#1} } -\cs_set_protected:Npn \addtcbstyle #1#2 +\cs_set_protected:Npn \addtotcbstyle #1#2 { \tcbset{#1/.append~style = {#2}} } \cs_set_protected:Npn \deftcbstyle #1#2 { \tcbset{#1/.style = {#2}} } \cs_new_protected:Npn \tcbappstyle - { \@ifstar{\deftcbstyle}{\addtcbstyle} } + { \@ifstar{\deftcbstyle}{\addtotcbstyle} } \cs_set_eq:NN \newtcbstyle \deftcbstyle \keys_define:nn { eb/exercise } { @@ -2467,7 +2456,7 @@ tocnumsep .initial:n = 1em, label .tl_set:N = \eb@tc@exercise@label, enumitem .code:n = \setexerlist{#1}, - tcolorbox .code:n = \addtcbstyle{exercise}{#1} + tcolorbox .code:n = \addtotcbstyle{exercise}{#1} } \tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip } diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf Binary files differindex 9d29831242..6807d6f6fe 100644 --- a/macros/latex/contrib/easybook/easybook.pdf +++ b/macros/latex/contrib/easybook/easybook.pdf diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex index ffb579a3b0..2a18f9a519 100644 --- a/macros/latex/contrib/easybook/easybook.tex +++ b/macros/latex/contrib/easybook/easybook.tex @@ -20,7 +20,7 @@ name = easybook, color-scheme = blue, title = EASYBOOK 使用手册, - version = v1.41L, + version = v1.41N, date = 2021/12/08, authors = 瞿毅, info = 排版简体中文学位论文和书籍, @@ -35,8 +35,8 @@ module-sep = \,$\Rightarrow$\,, title-format = \huge\sffamily } -\KOMAoptions{headsepline = 0.6pt,numbers = noenddot} -\setfootnoterule[0.6pt]{0.4\columnwidth} +\KOMAoptions{headsepline = 0.5pt,numbers = noenddot} +\setfootnoterule[0.5pt]{0.4\columnwidth} \addtokomafont{headsepline}{\color{Blue}} \addtokomafont{footnoterule}{\color{Blue}} \addtokomafont{section}{\normalfont\sffamily} @@ -47,7 +47,7 @@ \setlist{nosep,labelindent = \parindent,leftmargin = *,labelsep = 0.5em} \setlist[itemize,1]{label = \small\color{Blue}\textbullet} \setcounter{tocdepth}{2} -\SetTblrInner{hline{1,Z} = {1pt,Blue}} +\SetTblrInner{hline{1,Z} = {0.8pt,Blue}} \ExplSyntaxOn\makeatletter \newcommand{\splitmeta}[2][\code{,}] @@ -108,7 +108,7 @@ \DefineVerbatimEnvironment{frameverb}{Verbatim} { baselinestretch = 1.2,gobble = 2,fontsize = \small, - rulecolor = \color{Blue},framerule = 0.6pt, + rulecolor = \color{Blue},framerule = 0.5pt, frame = single,framesep = 10pt, listparameters = { @@ -119,7 +119,7 @@ \DefineVerbatimEnvironment{ctexexam}{Verbatim} { baselinestretch = 1.2,gobble = 2,fontsize = \small, - rulecolor = \color{Blue},framerule = 0.6pt, + rulecolor = \color{Blue},framerule = 0.5pt, frame = single,framesep = 10pt, label = \rule{0pt}{12pt}\textnormal{\bfseries 例 \arabic{ctexexam}}, listparameters = @@ -134,7 +134,7 @@ \begin{document} \section{准备开始} -您在使用 \cls*{easybook} 文档类编写文档前可能需要满足以下的条件: +您在使用 \cls*{easybook} 文档类编写文档前可能需要具备以下的条件: \begin{itemize} \item 使用 \hologo{XeLaTeX}(推荐)或 \hologo{LuaLaTeX} 两种编译方式。 \item 由于用到了一些 \LaTeX 和宏包较新的功能,建议安装最新的 \TeX 发行版,例如 \TeX Live 2021 或 \hologo{MiKTeX} 21.2 之后的版本。 @@ -247,7 +247,7 @@ \insertblr { colspec = @{}*{4}{c}@{}, - hline{2} = {0.6pt,Blue}, + hline{2} = {0.5pt,Blue}, row{1} = {font = \sffamily}, column{1} = {cmd = \code} }{ @@ -263,7 +263,7 @@ \subsection{数学字体} \begin{options} - \keychoice{mathfont}{times,noto,notosans,nc,stix,charter,garamond,libertine,none}\Default{times} + \keychoice{mathfont}{times,noto,notosans,nc,stix2,charter,ebgaramond,libertine,none}\Default{times} 选择合适的数学字体,将会加载 \pkg*{newtxmath} 和 \pkg*{bm} 宏包。使用选项 \code{none} 时可以使用 \pkg*{unicode-math} 等其它数学字体宏包定义字体。 \end{options} @@ -366,11 +366,11 @@ \label{sec:interface options} \begin{commands} \command*{ctexset}[\marg{键值列表}] - \cls*{easybook} 扩展了 C\TeX 宏集 \hologo{LaTeX3} 风格键值的通用控制命令 \cs*{ctexset},接口选项同样可用它设置, 原有的 \meta{键值列表} 仍然可用。本文档类目前有 9 个模块用于实现常规的排版功能,如下表所示,它们既是统一接口 \cs*{ctexset} 的路径,也是相关模块的接口命令名: + \cls*{easybook} 扩展了 C\TeX 宏集 \hologo{LaTeX3} 风格键值的通用控制命令 \cs*{ctexset},接口选项同样可用它设置, 原有的 \meta{键值列表} 仍然可用。本文档类目前有 9 个模块用于实现常规的排版功能,如下表所示。模块名也是统一接口 \cs*{ctexset} 的路径,不同模块单独接口的命令名加上前缀 \code{eb}: \insertblr { colspec = @{}*{5}{c}@{}, - hline{3} = {0.6pt,Blue}, + hline{3} = {0.5pt,Blue}, row{1,3} = {font = \sffamily,belowsep = 0pt}, row{2,4} = {cmd = \module*} }{ @@ -391,7 +391,7 @@ uppercase = false } } - \style{figure-connect = {-}} + \ebstyle{connect-figure = {-}} \end{ctexexam} 文档类有三种选项:布尔型 \boolkey*{key},选项的值为 \code{true} 或 \code{false},如果不指定默认为真。键值型 \key*-{key}{value} 需要为选项指定值,后面 \code{=} 号不能省略。选择型 \choicekey*{key}{one,\default{two},three} 根据提供的可选值进行设定。 @@ -414,19 +414,19 @@ 使章标题跟随每一部分编号,开启新的一部分时章编号从 1 开始,默认不跟随。 \keychoice{footwith}{part,chapter,page}\Default{chapter} 使脚注跟随编号的计数器,默认跟随章,当开启新的一章时脚注编号从 1 开始。 - \keyval-{rulewidth}{刚性长度}\Default{0.6pt} + \keyval-{rulewidth}{刚性长度}\Default{0.5pt} 统一调整页眉、定理盒子以及代码等边框线条的粗细。需要单独设置代码和定理盒子边框线条的粗细时可用它们的宏包自带命令: \begin{ctexexam} \lstset{framerule = 0.5pt} \tcbset{boxrule = 0.5pt} \end{ctexexam} \keybool{uppercase}\Default{true} - 使用 \cs*{rightmark} 及 \cs*{leftmark} 标题标记命令获取标题内容时英文是否大写。 + 使用 \cs*{rightmark} 及 \cs*{leftmark} 等标题标记命令获取标题内容时英文是否大写。 \kvsplit{brackets}{左括号,右括号}\Default{\Carg{(\black{,})}} 设置行间公式编号标签的括号及格式,以英文逗号分隔,分别代表左右括号。\meta{左括号} 可以是带有一个参数的命令,用于接受编号和 \meta{右括号}。将标签括号设置为方括号,并使用无衬线字体: \begin{ctexexam} \newcommand{\bracketsf}[1]{\textsf{[#1}} - \style{brackets = {\bracketsf,]}} + \ebstyle{brackets = {\bracketsf,]}} \end{ctexexam} \kvsplit*{figurepath}{\meta{路径名1}\code{\}\{}\meta{路径名2}}\Default 设置插入图片的文件夹路径名,可以有多个路径名,每个路径包含在括号分隔,只有一个路径时需要包含在两层括号内。 @@ -450,27 +450,27 @@ \label{subsubsec:super-sub-script} \begin{options} \keyval-{super-vshift}{刚性长度}\Default{0pt} - 上标垂直偏移量,对应 \cs{super} 命令的参数 \meta{垂直偏移}。 + 上标垂直偏移量,对应上标命令 \cs{super} 的参数 \meta{垂直偏移}。 \keyval-{super-hshift}{刚性长度}\Default{0pt} - 上标水平偏移量,对应 \cs{super} 命令的参数 \meta{水平偏移}。 + 上标水平偏移量,对应上标命令 \cs{super} 的参数 \meta{水平偏移}。 \keyval-{sub-vshift}{刚性长度}\Default{0pt} - 下标垂直偏移量,对应 \cs{sub} 命令的参数 \meta{垂直偏移}。 + 下标垂直偏移量,对应下标命令 \cs{sub} 的参数 \meta{垂直偏移}。 \keyval-{sub-hshift}{刚性长度}\Default{0pt} - 下标水平偏移量,对应 \cs{sub} 命令的参数 \meta{水平偏移}。 + 下标水平偏移量,对应下标命令 \cs{sub} 的参数 \meta{水平偏移}。 \opt{nohshift}\Default! 同时取消上标和下标的 \meta{水平偏移},与 \keyis-{super-hshift}{0pt} 和 \keyis-{sub-hshift}{0pt} 等效。 \opt{novshift}\Default! 同时取消上标和下标的 \meta{垂直偏移},与 \keyis-{super-vshift}{0pt} 和 \keyis-{sub-vshift}{0pt} 等效。 \keyval-{super-format}{上标格式}\Default - 上标的格式,对应 \cs{super} 命令的参数 \meta{格式代码}。 + 上标的格式,对应上标命令 \cs{super} 的参数 \meta{格式代码}。 \keyval-{sub-format}{下标格式}\Default - 下标的格式,对应 \cs{sub} 命令的参数 \meta{格式代码}。 + 下标的格式,对应下标命令 \cs{sub} 的参数 \meta{格式代码}。 \keyval-{supersub-hshift}{刚性长度}\Default{0pt} - 上下标水平偏移量,对应 \cs{supersub} 命令的参数 \meta{水平偏移}。 + 上下标水平偏移量,对应上下标命令 \cs{supersub} 的参数 \meta{水平偏移}。 \kvsplit{supersub-format}{上标格式,下标格式}\Default - 上下标格式,对应 \cs{supersub} 命令的参数 \splitmeta{上标格式,下标格式}。以英文逗号分隔为前后部分,也可以只有前部分,表示上标的格式。 + 上下标格式,对应上下标命令 \cs{supersub} 的参数 \splitmeta{上标格式,下标格式}。以英文逗号分隔为前后部分,也可以只有前部分,表示上标的格式。 \keyval-{supersubsep}{刚性长度}\Default{0.3ex} - 上下标垂直间距,对应 \cs{supersub} 命令的参数 \meta{间距}。 + 上下标垂直间距,对应上下标命令 \cs{supersub} 的参数 \meta{间距}。 \keychoice{supersubalign}{l,c,r}\Default{l} 上下标的水平对齐方式,有左对齐、居中对齐和右对齐三种 \meta{对齐方式}。 \end{options} @@ -514,8 +514,8 @@ \keyval-{footnote}{数值}\Default{1.2} 脚注内容整体的行距因子,可以使用 \option{fnpara-form} 的代码覆盖每个脚注单独的行距,从而与不同脚注的段落间距不同\footnote{若在正文区中更改脚注行距,脚注横线下方的间距不会随当前行距改变。}。 \begin{ctexexam} - \spread{footnote = 1.3} - \hdrset{fnpara-form = \linespread{1.2}\selectfont} + \ebspread{footnote = 1.3} + \ebhdrset{fnpara-form = \linespread{1.2}\selectfont} \end{ctexexam} \keyval-{every}{数值}\Default 统一设置上述所有的行距因子。 @@ -539,11 +539,11 @@ \end{options} \begin{commands} - \command{addsubfont}[\marg{字体类型}\marg{字体命令}] + \command{addtosubfont}[\marg{字体类型}\marg{字体命令}] 用于在上述各种字体原有的格式上附加代码。其中 \meta{字体命令} 也可以包括行距命令且相对于 \module*{spread} 模块具有优先性,不同题注的 \meta{字体类型} 则为相应选项的后缀名。 \begin{ctexexam} - \addsubfont{every}{\linespread{1.5}\selectfont} - \addsubfont{footnote}{\sffamily} + \addtosubfont{every}{\linespread{1.5}\selectfont} + \addtosubfont{footnote}{\sffamily} \end{ctexexam} \end{commands} @@ -647,10 +647,10 @@ \item 新建定理环境默认使用的 \meta{定理样式} 为 \code{easy-theorem},而不是 \pkg*{thmtools} 的默认样式。 \end{itemize} - 下面新建一个与例 \ref{exam:new theorem env} 相同的定理环境猜想,并使用 \cs{addtcbstyle} 命令调整 \keyis-{thmframe}{true} 时默认的盒子风格。它的第一个参数为 \code{tc-theorem},关于命令的介绍在小节 \ref{subsec:box}。 + 下面新建一个与例 \ref{exam:new theorem env} 相同的定理环境猜想,并使用 \cs{addtotcbstyle} 命令调整 \keyis-{thmframe}{true} 时默认的盒子风格。它的第一个参数为 \code{tc-theorem},关于命令的介绍在小节 \ref{subsec:box}。 \begin{ctexexam} \deftheorem{caixiang}{猜想}[style = mythm] - \addtcbstyle{tc-theorem}{colback = GreenYellow} + \addtotcbstyle{tc-theorem}{colback = GreenYellow} \end{ctexexam} \command{declaretheoremstyle}[\oarg{键值列表1}\marg{定理样式}\oarg{键值列表2}] 声明新的定理样式命令,键值列表支持 \pkg*{thmtools} 宏包中原命令以及 \cs{declaretheorem} 的所有选项。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,用法与原来的同名命令一致。下面定义一个名为 \code{mythm} 的定理样式用于 \cs{declaretheorem} 的 \option*{style} 选项: @@ -671,7 +671,7 @@ \keyval*-{textwidth}{页面文本区宽度}\default{} \keybool*{includehead}\Default*{false} \begin{ctexexam} - \geoset + \ebgeoset { headruleskip = 3pt, top = 2.5cm, @@ -696,7 +696,7 @@ \kvsplit-{chap-label}{\oarg{数字输出命令}\marg{距离命令}}\Default{\cs*{hspace}\Carg{1em}} 标题标记命令 \cs*{chaptermark} 内容的标签(标题有编号时),比标题标记选项更常用,可选参数是对应于章节编号计数器的输出命令,必选参数是编号与标题之间的距离命令: \begin{ctexexam} - \hdrset + \ebhdrset { chap-label = [\thechapter]{\hspace{1em}}, sec-mark = \CTEXifname{\CTEXthesection——}{}#1 @@ -731,7 +731,7 @@ \command{markrule}[\oarg{长度}\darg{颜色名}\marg{线宽}\spemcoarg{上间距,下间距}] 命令 \cs{markrule} 既可在 \meta{横线命令} 中用于绘制页眉页脚横线,也可以在正文中使用。\meta{长度} 默认为页面文本区的宽度,上下间距为横线与上下方部件的间距,带有长度单位,上下间距之间用 \code{|} 符号分开,若只有一部分则表示 \meta{上间距}。下面举一个设置页眉内容的例子: \begin{ctexexam} - \hdrset{headrule = \markrule(DarkOrchid){0.5pt}[2pt|2pt]} + \ebhdrset{headrule = \markrule(DarkOrchid){0.5pt}[2pt|2pt]} \fancyhead[ER]{\leftmark} \fancyhead[OL]{\rightmark} \fancyhead[EL,OR]{\textbf{\thepage}} @@ -744,8 +744,8 @@ \keychoice{footnotetype}{hang,default,flush,bottom}\Module{hdrset}\Default{hang} 脚注的类型,悬挂缩进 \code{hang} 是默认值,\code{default} 是原始的类型,在一些浮动体排版的情况下,脚注可能位于页面中间,\code{bottom} 使脚注始终位于页面底端,\code{flush} 使脚注内容标记位于脚注首行边缘外侧并右对齐。其中 \code{bottom} 是复合选项,可以与前三种类型重复或复合使用: \begin{ctexexam} - \hdrset{footnotetype = default,footnotetype = bottom} - \hdrset{footnotetype = {hang,bottom}} + \ebhdrset{footnotetype = default,footnotetype = bottom} + \ebhdrset{footnotetype = {hang,bottom}} \end{ctexexam} \keyval-{fnindent}{刚性长度}\Default{0.75em} 每个脚注首段的首行缩进(选项 \option*{hang} 为整体缩进),等于长度 \cs{footindent} 的值。 @@ -760,8 +760,8 @@ 短编号的形式与列表环境类似,不过增加了中文数字 \code{c} 和符号 \code{s} 格式参数。原生样式 \code{plain} 等同于单独使用数字 \code{1} 参数。这个选项可以用在正文中改变其后脚注编号类型。 \begin{ctexexam} - \hdrset{fnmark-num = 1} % 等于编号类型plain - \hdrset{fnmark-num = (a)} + \ebhdrset{fnmark-num = 1} % 等于编号类型plain + \ebhdrset{fnmark-num = (a)} \end{ctexexam} \begin{commands}\noitemsep \command{DefineFntSymbols}[\marg{符号表名}\marg{符号数量}\marg{符号列表}]\default{} @@ -770,7 +770,7 @@ \begin{ctexexam} \DefineFntSymbols{myfnsymb}{2}{{1}{*}{2}{@}} \setfntsymbol{myfnsymb} - \hdrset{fnmark-num = s} + \ebhdrset{fnmark-num = s} \end{ctexexam} \end{commands} \keychoice{fntext-num}{plain,pifont,pifont*,pisans,pisans*,short num}\Default{plain} @@ -787,7 +787,7 @@ 默认脚注标记的格式,\code{match} 可以匹配 \option*{super-format} 全局的值。一般配合选项 \keyis-{fnmate-num}{plain} 使用,例如配合 \pkg*{circledsteps} 宏包的带圈符号命令 \cs*{Circled} 给脚注标记添加圆圈: \begin{ctexexam} \usepackage{circledsteps} - \hdrset + \ebhdrset { fntext-pos = normal, fnmate-form = \tiny\Circled @@ -802,7 +802,7 @@ \kvsplit{fntext-code}{前代码,后代码}\newline 可以用 \meta{前代码} 与 \meta{后代码} 额外增加脚注内容标记前后的代码,也可以只有前部分,\meta{前代码} 中最后一个格式命令可以带有一个参数接受脚注内容标记。由于脚注标记处于水平模式,一般用于在脚注内容标记与脚注首行间插入一点距离,或与脚注正文标记的格式稍有不同。 \begin{ctexexam} - \hdrset + \ebhdrset { footnotetype = flush, fntext-code = {,\enskip} @@ -956,7 +956,7 @@ \insertblr { colspec = @{}*{11}{c}@{}, - hline{2} = {0.6pt,Blue}, + hline{2} = {0.5pt,Blue}, row{1} = {font = \sffamily}, row{2} = {cmd = \env} }{ @@ -1013,10 +1013,10 @@ \environment{exercise}[\sarg\parg\oarg{键值列表1}\darg{键值列表2}\oarg{键值列表3}] 习题环境的标题使用 \cs*{tcbox} 行内盒子包装样式,内容则使用 \env*{enumerate} 列表环境。它有 5 个可选参数,应当注意用法。当使用星号参数时标题不进行编号,使用 \parg{} 号参数时不显示标题,此时 \meta{键值列表1} 除了 \option{label} 选项失效。 - \meta{键值列表2} 包括 \pkg*{tcolorbox} 的盒子样式选项,例如 \option*{boxsep} 和 \option*{fontupper} 等,也可以使用下述 \option{tcolorbox} 选项。在这里可以使用 \cs{addtcbstyle} 命令设置标题选项 \meta{键值列表2} 的值,第一个参数为 \code{tc-exercise}。 + \meta{键值列表2} 包括 \pkg*{tcolorbox} 的盒子样式选项,例如 \option*{boxsep} 和 \option*{fontupper} 等,也可以使用下述 \option{tcolorbox} 选项。在这里可以使用 \cs{addtotcbstyle} 命令设置标题选项 \meta{键值列表2} 的值,第一个参数为 \code{tc-exercise}。 \begin{ctexexam} \tcphantomifname{\markright{\counteruse{tcbcounter}\quad 习题}}{} - \addtcbstyle{tc-exercise}{boxsep = 5pt} + \addtotcbstyle{tc-exercise}{boxsep = 5pt} \exerprologue{习题前的一段文本} \begin{exercise}+[color = LightSkyBlue](after skip = 2pc)[itemsep = 1ex] \item 第一题 @@ -1059,8 +1059,8 @@ 使用盒子以及小节 \ref{subsec:exercise} 中的 \env{exercise} 环境需要在导言区\textbf{手动载入} \pkg*{tcolorbox} 宏包,它们 \meta{配置选项} 的键值列表同样由 \pkg*{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖预设。 \begin{commands} \command{deftcbstyle}[\marg{盒子风格}\marg{键值列表}] - 新建或重置一个名称为 \meta{盒子风格} 的 \pkg*{tcolorbox} 宏包盒子风格,可以与 \cs{addtcbstyle} 命令联用。 - \command{addtcbstyle}[\marg{盒子风格}\marg{键值列表}] + 新建或重置一个名称为 \meta{盒子风格} 的 \pkg*{tcolorbox} 宏包盒子风格,可以与 \cs{addtotcbstyle} 命令联用。 + \command{addtotcbstyle}[\marg{盒子风格}\marg{键值列表}] 修改已存在的 \pkg*{tcolorbox} 宏包盒子风格。这个命令可以调整以下即将介绍的预置盒子风格,对于预置盒子来说参数 \meta{盒子风格} 即为它们对应的环境或命令名。 \begin{ctexexam} \deftcbstyle{mytcb} % 新建一个盒子风格mytcb @@ -1083,14 +1083,14 @@ \subsubsection{摘要盒子} \begin{environments} \environment{outline}[\oarg{键值列表1}\darg{标题名称}\oarg{键值列表2}] - 摘要盒子 \env{outline} 可用于章前摘要,它的标题是可选参数,默认标题是摘要。\meta{键值列表2} 是摘要盒子样式选项,可以使用 \cs{addtcbstyle} 命令对它进行全局设置,第一个参数为 \code{tc-outline}。 + 摘要盒子 \env{outline} 可用于章前摘要,它的标题是可选参数,默认标题是摘要。\meta{键值列表2} 是摘要盒子样式选项,可以使用 \cs{addtotcbstyle} 命令对它进行全局设置,第一个参数为 \code{tc-outline}。 \end{environments} \begin{commands} \command{setoutlinelist}[\marg{键值列表1}] \meta{键值列表1} 与 \pkg*{enumitem} 宏包中列表配置选项相同,可以设置摘要条目的各种距离,要对它进行全局设置可以使用 \cs{setoutlinelist} 命令。 \begin{ctexexam} - \addtcbstyle{tc-outline}{arc = 6pt} + \addtotcbstyle{tc-outline}{arc = 6pt} \begin{outline}[leftmargin = *](摘要标题) \item 摘要内容1 \item 摘要内容2 @@ -1101,7 +1101,7 @@ \subsubsection{段落盒子} \begin{environments} \environment{easybox}[\sarg\oarg{颜色名}\darg{段落标题}\oarg{配置选项}] - 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认无标题。如果 \meta{配置选项} 较长且希望在原有基础上改为全局固定的样式,可以使用 \cs{addtcbstyle} 命令设置,第一个参数为 \code{tc-easybox}。 + 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认无标题。如果 \meta{配置选项} 较长且希望在原有基础上改为全局固定的样式,可以使用 \cs{addtotcbstyle} 命令设置,第一个参数为 \code{tc-easybox}。 \begin{ctexexam} \begin{easybox}*[DarkCyan](段落标题) 上半盒子内容 diff --git a/macros/latex/contrib/l3build/CHANGELOG.md b/macros/latex/contrib/l3build/CHANGELOG.md index b12a3671e1..07631b0dd9 100644 --- a/macros/latex/contrib/l3build/CHANGELOG.md +++ b/macros/latex/contrib/l3build/CHANGELOG.md @@ -7,6 +7,16 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2021-12-09] + +### Added +- Support for pre-constructed TDS-style sources (variable `tdsdirs`) +- Support for injection of tokens using `specialformats` + +### Changed +- If multiple configurations are present, let `l3build clean` run + on all of them by default. (issue #214) + ## [2021-12-06] ### Fixed @@ -18,7 +28,7 @@ this project uses date-based 'snapshot' version identifiers. - Documentation improvements - Use `checkengines[1]` as the default for `stdengine` - Add sanity check for `TEXMFHOME` value -- Double \ when writing the curl options, so that \ +- Double \ when writing the curl options, so that \ does not need to be doubled in note and announcement texts. ### Fixed @@ -543,7 +553,8 @@ this project uses date-based 'snapshot' version identifiers. - Rationalise short option names: removed `-d`, `-E`, `-r` - Target `cmdcheck`: specific to LaTeX kernel work -[Unreleased]: https://github.com/latex3/l3build/compare/2021-12-06...HEAD +[Unreleased]: https://github.com/latex3/l3build/compare/2021-12-09...HEAD +[2021-12-09]: https://github.com/latex3/l3build/compare/2021-12-06...2021-12-09 [2021-12-06]: https://github.com/latex3/l3build/compare/2021-11-29...2021-12-06 [2021-11-29]: https://github.com/latex3/l3build/compare/2021-11-24...2021-11-29 [2021-11-24]: https://github.com/latex3/l3build/compare/2021-11-12...2021-11-24 diff --git a/macros/latex/contrib/l3build/README.md b/macros/latex/contrib/l3build/README.md index 4dc3b68984..2c5e33a032 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 LaTeX ================================================= -Release 2021-12-06 +Release 2021-12-09 Overview -------- diff --git a/macros/latex/contrib/l3build/l3build-aux.lua b/macros/latex/contrib/l3build/l3build-aux.lua index 42e7f6a53a..2f6902a7b0 100644 --- a/macros/latex/contrib/l3build/l3build-aux.lua +++ b/macros/latex/contrib/l3build/l3build-aux.lua @@ -166,3 +166,16 @@ function dep_install(deps) end return 0 end + +-- Construct a localtexmf including any tdsdirs +-- Needed for checking and typesetting, hence global +function localtexmf() + local paths = "" + for src,_ in pairs(tdsdirs) do + paths = paths .. os_pathsep .. abspath(src) .. "//" + end + if texmfdir and texmfdir ~= "" and direxists(texmfdir) then + paths = paths .. os_pathsep .. abspath(texmfdir) .. "//" + end + return paths +end diff --git a/macros/latex/contrib/l3build/l3build-check.lua b/macros/latex/contrib/l3build/l3build-check.lua index 249b22164a..65ac222271 100644 --- a/macros/latex/contrib/l3build/l3build-check.lua +++ b/macros/latex/contrib/l3build/l3build-check.lua @@ -719,6 +719,7 @@ function runtest(name, engine, hide, ext, test_type, breakout) cp(lvtfile, fileexists(testfiledir .. "/" .. lvtfile) and testfiledir or unpackdir, testdir) local checkopts = checkopts + local tokens = "" engine = engine or stdengine local binary = engine local format = gsub(engine,"tex$",checkformat) @@ -730,6 +731,8 @@ function runtest(name, engine, hide, ext, test_type, breakout) binary = engine_info.binary or binary format = engine_info.format or format checkopts = engine_info.options or checkopts + tokens = engine_info.tokens and (' "' .. engine_info.tokens .. '" ') + or tokens end end -- Finalise format string @@ -742,10 +745,10 @@ function runtest(name, engine, hide, ext, test_type, breakout) end -- Special casing for ConTeXt local function setup(file) - return " -jobname=" .. name .. " " .. ' "\\input ' .. file .. '" ' + return " -jobname=" .. name .. tokens .. ' "\\input ' .. file .. '" ' end if match(checkformat,"^context$") then - function setup(file) return ' "' .. file .. '" ' end + function setup(file) return tokens .. ' "' .. file .. '" ' end end local basename = testdir .. "/" .. name local gen_file = basename .. test_type.generated @@ -764,19 +767,15 @@ function runtest(name, engine, hide, ext, test_type, breakout) -- Ensure there is no stray .log file rmfile(testdir,name .. logext) local errlevels = {} - local localtexmf = "" - if texmfdir and texmfdir ~= "" and direxists(texmfdir) then - localtexmf = os_pathsep .. abspath(texmfdir) .. "//" - end for i = 1, checkruns do errlevels[i] = run( testdir, -- No use of localdir here as the files get copied to testdir: -- avoids any paths in the logs - os_setenv .. " TEXINPUTS=." .. localtexmf + os_setenv .. " TEXINPUTS=." .. localtexmf() .. (checksearch and os_pathsep or "") .. os_concat .. - os_setenv .. " LUAINPUTS=." .. localtexmf + os_setenv .. " LUAINPUTS=." .. localtexmf() .. (checksearch and os_pathsep or "") .. os_concat .. -- Avoid spurious output from (u)pTeX diff --git a/macros/latex/contrib/l3build/l3build-ctan.lua b/macros/latex/contrib/l3build/l3build-ctan.lua index 1f5aa2bc90..2efdd14067 100644 --- a/macros/latex/contrib/l3build/l3build-ctan.lua +++ b/macros/latex/contrib/l3build/l3build-ctan.lua @@ -33,17 +33,28 @@ local newzip = require"l3build-zip" -- Copy files to the main CTAN release directory function copyctan() - mkdir(ctandir .. "/" .. ctanpkg) + local pkgdir = ctandir .. "/" .. ctanpkg + mkdir(pkgdir) + + -- Handle pre-formed sources: do two passes to avoid any cleandir() issues + for _,dest in pairs(tdsdirs) do + mkdir(pkgdir .. "/" .. dest) + end + for src,dest in pairs(tdsdirs) do + cp("*",src,pkgdir .. "/" .. dest) + end + + -- Now deal with the one-at-a-time files local function copyfiles(files,source) if source == currentdir or flatten then for _,filetype in pairs(files) do - cp(filetype,source,ctandir .. "/" .. ctanpkg) + cp(filetype,source,pkgdir) end else for _,filetype in pairs(files) do for _,p in ipairs(tree(source,filetype)) do local path = dirname(p.src) - local ctantarget = ctandir .. "/" .. ctanpkg .. "/" + local ctantarget = pkgdir .. "/" .. source .. "/" .. path mkdir(ctantarget) cp(p.src,source,ctantarget) @@ -57,8 +68,9 @@ function copyctan() end copyfiles(sourcefiles,sourcefiledir) for _,file in pairs(textfiles) do - cp(file, textfiledir, ctandir .. "/" .. ctanpkg) + cp(file, textfiledir, pkgdir) end + end function bundlectan() diff --git a/macros/latex/contrib/l3build/l3build-install.lua b/macros/latex/contrib/l3build/l3build-install.lua index 78fe2d4b2f..6a28463e65 100644 --- a/macros/latex/contrib/l3build/l3build-install.lua +++ b/macros/latex/contrib/l3build/l3build-install.lua @@ -32,6 +32,7 @@ local var_value = kpse.var_value local gsub = string.gsub local lower = string.lower local match = string.match +local format = string.format local insert = table.insert @@ -107,6 +108,23 @@ function uninstall() errorlevel = zapdir(path) if errorlevel ~= 0 then return errorlevel end end + -- We remove all directories which contain at least one ordinary file in the source tree + for src, dest in pairs(tdsdirs) do + dest = dest .. '/' + local skipdir + for _, p in ipairs(tree(src, '**')) do + local src = p.src:sub(2) -- Skip the first '.' + if skipdir and src:sub(1, #skipdir) ~= skipdir then + skipdir = nil + end + if (not skipdir) and (not direxists(p.cwd)) then + skipdir = dirname(src) + errorlevel = zapdir(dest .. skipdir) + if errorlevel ~= 0 then return errorlevel end + skipdir = skipdir .. '/' + end + end + end return 0 end @@ -287,6 +305,26 @@ function install_files(target,full,dry_run) + create_install_map(unpackdir,"makeindex",{makeindexfiles},module) + create_install_map(unpackdir,"scripts",{scriptfiles},module) + for src, dest in pairs(tdsdirs) do + dest = target .. '/' .. dest + insert(installmap, + {file = '*', source = src, dest = dest}) + dest = dest .. '/' + local skipdir + for _, p in ipairs(tree(src, '**')) do + local src = p.src:sub(2) -- Skip the first '.' + if skipdir and src:sub(1, #skipdir) ~= skipdir then + skipdir = nil + end + if (not skipdir) and (not direxists(p.cwd)) then + skipdir = dirname(src) + errorlevel = cleandir(dest .. skipdir) + if errorlevel ~= 0 then return errorlevel end + skipdir = skipdir .. '/' + end + end + end + if errorlevel ~= 0 then return errorlevel end -- Files are all copied in one shot: this ensures that cleandir() diff --git a/macros/latex/contrib/l3build/l3build-typesetting.lua b/macros/latex/contrib/l3build/l3build-typesetting.lua index cc04ac1e38..c173b2593b 100644 --- a/macros/latex/contrib/l3build/l3build-typesetting.lua +++ b/macros/latex/contrib/l3build/l3build-typesetting.lua @@ -54,11 +54,7 @@ function runcmd(cmd,dir,vars) vars = vars or {} -- Allow for local texmf files local env = os_setenv .. " TEXMFCNF=." .. os_pathsep - local localtexmf = "" - if texmfdir and texmfdir ~= "" and direxists(texmfdir) then - localtexmf = os_pathsep .. abspath(texmfdir) .. "//" - end - local envpaths = "." .. localtexmf .. os_pathsep + local envpaths = "." .. localtexmf() .. os_pathsep .. abspath(localdir) .. os_pathsep .. dir .. (typesetsearch and os_pathsep or "") -- Deal with spaces in paths diff --git a/macros/latex/contrib/l3build/l3build-variables.lua b/macros/latex/contrib/l3build/l3build-variables.lua index d78c39c92f..ffabf3490a 100644 --- a/macros/latex/contrib/l3build/l3build-variables.lua +++ b/macros/latex/contrib/l3build/l3build-variables.lua @@ -229,6 +229,7 @@ manifestfile = manifestfile or "MANIFEST.md" -- Non-standard installation locations tdslocations = tdslocations or { } +tdsdirs = tdsdirs or {} -- Upload settings curlexe = curlexe or "curl" diff --git a/macros/latex/contrib/l3build/l3build.1 b/macros/latex/contrib/l3build/l3build.1 index 4b40afa213..0a0fbf2344 100644 --- a/macros/latex/contrib/l3build/l3build.1 +++ b/macros/latex/contrib/l3build/l3build.1 @@ -1,4 +1,4 @@ -.TH l3build 1 "2021-12-06" +.TH l3build 1 "2021-12-09" .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 41ff08dc72..b11dc1adcb 100644 --- a/macros/latex/contrib/l3build/l3build.dtx +++ b/macros/latex/contrib/l3build/l3build.dtx @@ -161,6 +161,7 @@ \luavarset{manifestfile} {"MANIFEST.md"} {Filename to use for the manifest file} \luavarseparator \luavarset{tdslocations}{\{ \}}{Map for non-standard file installations} +\luavarset{tdsdirs}{\{ \}}{List of ready-to-use source locations} \luavarseparator \luavarset{uploadconfig} {\meta{table}} {Metadata to describe the package for CTAN (see Table~\ref{tab:upload-setup})} \luavarset{uploadconfig.pkg}{ctanpkg}{Name of the CTAN package} @@ -236,7 +237,7 @@ % }^^A % } % -% \date{Released 2021-12-06} +% \date{Released 2021-12-09} % % \maketitle % \tableofcontents @@ -774,6 +775,22 @@ % A series of example layouts and matching |build.lua| files are available from % \url{https://github.com/latex3/l3build/tree/master/examples}. % +% For more complex layouts in which sources are laid out in TDS format and +% should be used directly, the table \var{tdsdirs} is available. Each entry +% is a source directory and the matching installation target, for example +% \begin{Verbatim} +% tdsdirs = {sources = "tex"} +% \end{Verbatim} +% This would enable a directory \texttt{sources} in the development area to +% be used for testing and typesetting, and for it to be installed into the +% \texttt{tex} tree when building a release. When this method is used, the +% sources are \emph{not} copied into the local tree: like \var{texmfdir}, +% they are added directly to the areas accessible during a testing or +% typesetting run. When using this approach, the files listed in +% \var{typesetfiles} \emph{must} still be included in \var{docfiles}: +% they have to be directly visible to \pkg{l3build}, not found by +% \texttt{kpsewhich} searching. +% % \subsection{Non-standard formats/binaries} % % The standard approach used by \pkg{l3build} is to use a combination @@ -799,6 +816,9 @@ % xetex = {binary = "texexec", format = "", options = "--xetex"} % } % \end{verbatim} +% Additional tokens can also be injected before the loading of a test file using +% the |tokens| entry: this might for example be used to select a graphics driver +% with a DVI-based route. % % \subsection{Output normalisation} % \label{sec:norm} diff --git a/macros/latex/contrib/l3build/l3build.lua b/macros/latex/contrib/l3build/l3build.lua index 2c555373f6..1d8d58c694 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 = "2021-12-06" +release_date = "2021-12-09" -- File operations are aided by the LuaFileSystem module local lfs = require("lfs") @@ -133,8 +133,8 @@ else checkconfigs = options["config"] or checkconfigs end -if options["target"] == "check" then - if #checkconfigs > 1 then +if #checkconfigs > 1 then + if options["target"] == "check" then local errorlevel = 0 local opts = options local failed = { } @@ -196,6 +196,13 @@ if options["target"] == "check" then -- Avoid running the 'main' set of tests twice exit(0) end + elseif options["target"] == "clean" then + local failure + for i = 1, #checkconfigs do + opts["config"] = {checkconfigs[i]} + failure = 0 ~= call({"."}, "clean", opts) or failure + end + exit(failure and 1 or 0) end end if #checkconfigs == 1 and diff --git a/macros/latex/contrib/l3build/l3build.pdf b/macros/latex/contrib/l3build/l3build.pdf Binary files differindex cf3bc28d55..43000ca133 100644 --- a/macros/latex/contrib/l3build/l3build.pdf +++ b/macros/latex/contrib/l3build/l3build.pdf |