diff options
author | Karl Berry <karl@freefriends.org> | 2021-02-24 18:00:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-02-24 18:00:42 +0000 |
commit | 12819de5a193a81ba460e12c80e9e5af3d88e8a7 (patch) | |
tree | fa3f87dafcc4c8614fa373e364f77826a485ce02 /Master/texmf-dist/tex | |
parent | 1f8a99f91f89d808a685fb90434693017786a8a6 (diff) | |
parent | 3ce790a95a47285842ce11676520c9ebaa3d6d83 (diff) |
sync with trunk 57871; starting pretest
git-svn-id: svn://tug.org/texlive/branches/branch2020@57872 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
109 files changed, 11500 insertions, 3249 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index e02952cb58b..5242215ff52 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.def +++ b/Master/texmf-dist/tex/generic/babel/babel.def @@ -39,7 +39,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{babel.def}[2021/01/26 3.53 Babel common definitions] +\ProvidesFile{babel.def}[2021/02/22 3.54 Babel common definitions] \ifx\AtBeginDocument\@undefined % TODO. change test. % == Code for plain == \def\@empty{} @@ -397,8 +397,8 @@ \fi \countdef\last@language=19 % TODO. why? remove? \def\addlanguage{\csname newlanguage\endcsname} -\def\bbl@version{3.53} -\def\bbl@date{2021/01/26} +\def\bbl@version{3.54} +\def\bbl@date{2021/02/22} \def\adddialect#1#2{% \global\chardef#1#2\relax \bbl@usehooks{adddialect}{{#1}{#2}}% @@ -735,6 +735,7 @@ \def\bbl@foreign@s#1#2{% TODO - \shapemode, \@setpar, ?\@@par \begingroup {\par}% + \let\bbl@select@opts\@empty \let\BabelText\@firstofone \foreign@language{#1}% \bbl@usehooks{foreign*}{}% @@ -871,12 +872,13 @@ \def\bbl@nocaption@i#1#2{% 1: text to be printed 2: caption macro \langXname \global\@namedef{#2}{\textbf{?#1?}}% \@nameuse{#2}% - \bbl@warning{% - \@backslashchar#2 not set. Please, define it\\% - after the language has been loaded (typically\\% - in the preamble) with the help of\\% - \string\setlocalecaption. An example is\\% - \string\setlocalecaption{mylang}{chapter}{..}\\ + \edef\bbl@tempa{#1}% + \bbl@sreplace\bbl@tempa{name}{}% + \bbl@warning{% TODO. + \@backslashchar#1 not set for '\languagename'. Please,\\% + define it after the language has been loaded\\% + (typically in the preamble) with:\\% + \string\setlocalecaption{\languagename}{\bbl@tempa}{..}\\% Reported}} \def\bbl@tentative{\protect\bbl@tentative@i} \def\bbl@tentative@i#1{% @@ -1687,8 +1689,7 @@ \bbl@afterelse#3% \else \bbl@afterfi#4% - \fi - } + \fi} \def\bbl@ifknown@ttrib#1#2{% \let\bbl@tempa\@secondoftwo \bbl@loopx\bbl@tempb{#2}{% @@ -1697,8 +1698,7 @@ \let\bbl@tempa\@firstoftwo \else \fi}% - \bbl@tempa -} + \bbl@tempa} \def\bbl@clear@ttribs{% \ifx\bbl@attributes\@undefined\else \bbl@loopx\bbl@tempa{\bbl@attributes}{% @@ -1772,7 +1772,7 @@ \bbl@iflanguage\bbl@tempa{% \bbl@csarg\protected@edef{hyphenation@\bbl@tempa}{% \bbl@ifunset{bbl@hyphenation@\bbl@tempa}% - \@empty + {}% {\csname bbl@hyphenation@\bbl@tempa\endcsname\space}% #2}}}% \fi}} @@ -2339,6 +2339,7 @@ \let\bbl@KVP@Alph\@nil \let\bbl@KVP@labels\@nil \bbl@csarg\let{KVP@labels*}\@nil + \global\let\bbl@inidata\@empty \bbl@forkv{#1}{% TODO - error handling \in@{/}{##1}% \ifin@ @@ -2404,7 +2405,8 @@ % == % At this point all parameters are defined if 'import'. Now we % execute some code depending on them. But what about if nothing was - % imported? We just set the very basic parameters. + % imported? We just set the basic parameters, but still loading the + % whole ini file. \bbl@load@basic{#2}% % == script, language == % Override the values from ini or defines them @@ -2641,12 +2643,10 @@ \expandafter\bbl@tempb\bbl@captionslist\@empty \else \ifx\bbl@initoload\relax - \bbl@read@ini{\bbl@KVP@captions}0% Here letters cat = 11 + \bbl@read@ini{\bbl@KVP@captions}2% % Here letters cat = 11 \else - \bbl@read@ini{\bbl@initoload}0% Here all letters cat = 11 + \bbl@read@ini{\bbl@initoload}2% % Same \fi - \bbl@after@ini - \bbl@savestrings \fi \StartBabelCommands*{#1}{date}% \ifx\bbl@KVP@import\@nil @@ -2696,9 +2696,7 @@ \def\bbl@provide@renew#1{% \ifx\bbl@KVP@captions\@nil\else \StartBabelCommands*{#1}{captions}% - \bbl@read@ini{\bbl@KVP@captions}0% Here all letters cat = 11 - \bbl@after@ini - \bbl@savestrings + \bbl@read@ini{\bbl@KVP@captions}2% % Here all letters cat = 11 \EndBabelCommands \fi \ifx\bbl@KVP@import\@nil\else @@ -2711,20 +2709,10 @@ \ifx\bbl@lbkflag\@empty \bbl@provide@hyphens{#1}% \fi} -\def\bbl@linebreak@export{% - \bbl@exportkey{lnbrk}{typography.linebreaking}{h}% - \bbl@exportkey{hyphr}{typography.hyphenrules}{}% - \bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}% - \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}% - \bbl@exportkey{prehc}{typography.prehyphenchar}{}% - \bbl@exportkey{hyotl}{typography.hyphenate.other.locale}{}% - \bbl@exportkey{hyots}{typography.hyphenate.other.script}{}% - \bbl@exportkey{intsp}{typography.intraspace}{}% - \bbl@exportkey{chrng}{characters.ranges}{}} \def\bbl@load@basic#1{% \bbl@ifunset{bbl@inidata@\languagename}{}% {\getlocaleproperty\bbl@tempa{\languagename}{identification/load.level}% - \ifcase\bbl@tempa\else + \ifcase\bbl@tempa \bbl@csarg\let{lname@\languagename}\relax \fi}% \bbl@ifunset{bbl@lname@#1}% @@ -2732,10 +2720,7 @@ \begingroup \let\bbl@ini@captions@aux\@gobbletwo \def\bbl@inidate ####1.####2.####3.####4\relax ####5####6{}% - \bbl@read@ini{##1}0% - \bbl@linebreak@export - \bbl@exportkey{dgnat}{numbers.digits.native}{}% - \bbl@exportkey{frspc}{typography.frenchspacing}{u}% unset + \bbl@read@ini{##1}1% \ifx\bbl@initoload\relax\endinput\fi \endgroup}% \begingroup % boxed, to avoid extra spaces: @@ -2780,9 +2765,6 @@ {\bbl@exp{\\\adddialect\<l@#1>\language}}% {}}% so, l@<lang> is ok - nothing to do {\bbl@exp{\\\adddialect\<l@#1>\bbl@tempa}}}% found in opt list or ini -\ifx\bbl@readstream\@undefined - \csname newread\endcsname\bbl@readstream -\fi \def\bbl@input@texini#1{% \bbl@bsphack \bbl@exp{% @@ -2794,20 +2776,30 @@ \catcode`\\\{=\the\catcode`\{\relax \catcode`\\\}=\the\catcode`\}\relax}% \bbl@esphack} -\def\bbl@inipreread#1=#2\@@{% - \bbl@trim@def\bbl@tempa{#1}% Redundant below !! +\def\bbl@iniline#1\bbl@iniline{% + \@ifnextchar[\bbl@inisect{\@ifnextchar;\bbl@iniskip\bbl@inistore}#1\@@}% ] +\def\bbl@inisect[#1]#2\@@{\def\bbl@section{#1}}% +\def\bbl@iniskip#1\@@{}% if starts with ; +\def\bbl@inistore#1=#2\@@{% full (default) + \bbl@trim@def\bbl@tempa{#1}% \bbl@trim\toks@{#2}% - % Move trims here ?? \bbl@ifunset{bbl@KVP@\bbl@section/\bbl@tempa}% {\bbl@exp{% - \\\g@addto@macro\\\bbl@inidata{% - \\\bbl@elt{\bbl@section}{\bbl@tempa}{\the\toks@}}}% - \expandafter\bbl@inireader\bbl@tempa=#2\@@}% + \\\g@addto@macro\\\bbl@inidata{% + \\\bbl@elt{\bbl@section}{\bbl@tempa}{\the\toks@}}}}% {}}% -\def\bbl@fetch@ini#1#2{% - \bbl@exp{\def\\\bbl@inidata{% - \\\bbl@elt{identification}{tag.ini}{#1}% - \\\bbl@elt{identification}{load.level}{#2}}}% +\def\bbl@inistore@min#1=#2\@@{% minimal (maybe set in \bbl@read@ini) + \bbl@trim@def\bbl@tempa{#1}% + \bbl@trim\toks@{#2}% + \bbl@xin@{.identification.}{.\bbl@section.}% + \ifin@ + \bbl@exp{\\\g@addto@macro\\\bbl@inidata{% + \\\bbl@elt{identification}{\bbl@tempa}{\the\toks@}}}% + \fi}% +\ifx\bbl@readstream\@undefined + \csname newread\endcsname\bbl@readstream +\fi +\def\bbl@read@ini#1#2{% \openin\bbl@readstream=babel-#1.ini \ifeof\bbl@readstream \bbl@error @@ -2816,12 +2808,20 @@ is not complete.}% {Fix the name or reinstall babel.}% \else + % Store ini data in \bbl@inidata \catcode`\[=12 \catcode`\]=12 \catcode`\==12 \catcode`\&=12 \catcode`\;=12 \catcode`\|=12 \catcode`\%=14 \catcode`\-=12 \bbl@info{Importing - \ifcase#2 \or font and identification \or basic \fi - data for \languagename\\% + \ifcase#2font and identification \or basic \fi + data for \languagename\\% from babel-#1.ini. Reported}% + \ifnum#2=\z@ + \global\let\bbl@inidata\@empty + \let\bbl@inistore\bbl@inistore@min % Remember it's local + \fi + \def\bbl@section{identification}% + \bbl@exp{\\\bbl@inistore tag.ini=#1\\\@@}% + \bbl@inistore load.level=#2\@@ \loop \if T\ifeof\bbl@readstream F\fi T\relax % Trick, because inside \loop \endlinechar\m@ne @@ -2831,80 +2831,54 @@ \expandafter\bbl@iniline\bbl@line\bbl@iniline \fi \repeat - \fi} -\def\bbl@read@ini#1#2{% - \bbl@csarg\xdef{lini@\languagename}{#1}% - \let\bbl@section\@empty - \let\bbl@savestrings\@empty - \let\bbl@savetoday\@empty - \let\bbl@savedate\@empty - \let\bbl@inireader\bbl@iniskip - \bbl@fetch@ini{#1}{#2}% - \bbl@foreach\bbl@renewlist{% - \bbl@ifunset{bbl@renew@##1}{}{\bbl@inisec[##1]\@@}}% - \global\let\bbl@renewlist\@empty - % Ends last section. See \bbl@inisec - \def\bbl@elt##1##2{\bbl@inireader##1=##2\@@}% - \bbl@cs{renew@\bbl@section}% - \global\bbl@csarg\let{renew@\bbl@section}\relax - \bbl@cs{secpost@\bbl@section}% - \bbl@csarg{\global\expandafter\let}{inidata@\languagename}\bbl@inidata - \bbl@exp{\\\bbl@add@list\\\bbl@ini@loaded{\languagename}}% - \bbl@toglobal\bbl@ini@loaded} -\def\bbl@iniline#1\bbl@iniline{% - \@ifnextchar[\bbl@inisec{\@ifnextchar;\bbl@iniskip\bbl@inipreread}#1\@@}% ] -\def\bbl@iniskip#1\@@{}% if starts with ; -\def\bbl@inisec[#1]#2\@@{% if starts with opening bracket - \def\bbl@elt##1##2{% - \expandafter\toks@\expandafter{% - \expandafter{\bbl@section}{##1}{##2}}% - \bbl@exp{% - \\\g@addto@macro\\\bbl@inidata{\\\bbl@elt\the\toks@}}% - \bbl@inireader##1=##2\@@}% - \bbl@cs{renew@\bbl@section}% - \global\bbl@csarg\let{renew@\bbl@section}\relax - \bbl@cs{secpost@\bbl@section}% - % The previous code belongs to the previous section. - % -------------------------- - % Now start the current one. - \in@{=date.}{=#1}% - \ifin@ - \lowercase{\def\bbl@tempa{=#1=}}% - \bbl@replace\bbl@tempa{=date.gregorian}{}% - \bbl@replace\bbl@tempa{=date.}{}% - \in@{.licr=}{#1=}% - \ifin@ - \ifcase\bbl@engine - \bbl@replace\bbl@tempa{.licr=}{}% - \else - \let\bbl@tempa\relax + % Process stored data + \bbl@csarg\xdef{lini@\languagename}{#1}% + \let\bbl@savestrings\@empty + \let\bbl@savetoday\@empty + \let\bbl@savedate\@empty + \def\bbl@elt##1##2##3{% + \def\bbl@section{##1}% + \in@{=date.}{=##1}% Find a better place + \ifin@ + \bbl@ini@calendar{##1}% \fi - \fi - \ifx\bbl@tempa\relax\else - \bbl@replace\bbl@tempa{=}{}% - \bbl@exp{% - \def\<bbl@inikv@#1>####1=####2\\\@@{% - \\\bbl@inidate####1...\relax{####2}{\bbl@tempa}}}% - \fi - \fi - \def\bbl@section{#1}% - \def\bbl@elt##1##2{% - \@namedef{bbl@KVP@#1/##1}{}}% - \bbl@cs{renew@#1}% - \bbl@cs{secpre@#1}% pre-section `hook' - \bbl@ifunset{bbl@inikv@#1}% - {\let\bbl@inireader\bbl@iniskip}% - {\bbl@exp{\let\\\bbl@inireader\<bbl@inikv@#1>}}} -\let\bbl@renewlist\@empty + \global\bbl@csarg\let{bbl@KVP@##1/##2}\relax + \bbl@ifunset{bbl@inikv@##1}{}% + {\csname bbl@inikv@##1\endcsname{##2}{##3}}}% + \bbl@inidata + % 'Export' data + \bbl@ini@exports{#2}% + \global\bbl@csarg\let{inidata@\languagename}\bbl@inidata + \global\let\bbl@inidata\@empty + \bbl@exp{\\\bbl@add@list\\\bbl@ini@loaded{\languagename}}% + \bbl@toglobal\bbl@ini@loaded + \fi} +\def\bbl@ini@calendar#1{% + \lowercase{\def\bbl@tempa{=#1=}}% + \bbl@replace\bbl@tempa{=date.gregorian}{}% + \bbl@replace\bbl@tempa{=date.}{}% + \in@{.licr=}{#1=}% + \ifin@ + \ifcase\bbl@engine + \bbl@replace\bbl@tempa{.licr=}{}% + \else + \let\bbl@tempa\relax + \fi + \fi + \ifx\bbl@tempa\relax\else + \bbl@replace\bbl@tempa{=}{}% + \bbl@exp{% + \def\<bbl@inikv@#1>####1####2{% + \\\bbl@inidate####1...\relax{####2}{\bbl@tempa}}}% + \fi} \def\bbl@renewinikey#1/#2\@@#3{% - \bbl@ifunset{bbl@renew@#1}% - {\bbl@add@list\bbl@renewlist{#1}}% - {}% - \bbl@csarg\bbl@add{renew@#1}{\bbl@elt{#2}{#3}}} -\def\bbl@inikv#1=#2\@@{% key=value - \bbl@trim@def\bbl@tempa{#1}% - \bbl@trim\toks@{#2}% - \bbl@csarg\edef{@kv@\bbl@section.\bbl@tempa}{\the\toks@}} + \edef\bbl@tempa{\zap@space #1 \@empty}% section + \edef\bbl@tempb{\zap@space #2 \@empty}% key + \bbl@trim\toks@{#3}% value + \bbl@exp{% + \global\let\<bbl@KVP@\bbl@tempa/\bbl@tempb>\\\@empty % just a flag + \\\g@addto@macro\\\bbl@inidata{% + \\\bbl@elt{\bbl@tempa}{\bbl@tempb}{\the\toks@}}}}% \def\bbl@exportkey#1#2#3{% \bbl@ifunset{bbl@@kv@#2}% {\bbl@csarg\gdef{#1@\languagename}{#3}}% @@ -2919,8 +2893,8 @@ From babel-\bbl@cs{lini@\languagename}.ini:\\% \bbl@cs{@kv@identification.warning#1}\\% Reported }}} -\let\bbl@inikv@identification\bbl@inikv -\def\bbl@secpost@identification{% +\def\bbl@ini@exports#1{% + % Identification always exported \bbl@iniwarning{}% \ifcase\bbl@engine \bbl@iniwarning{.pdflatex}% @@ -2940,13 +2914,38 @@ {\csname bbl@esname@\languagename\endcsname}}% \bbl@exportkey{sbcp}{identification.script.tag.bcp47}{}% \bbl@exportkey{sotf}{identification.script.tag.opentype}{DFLT}% + % Also maps bcp47 -> languagename \ifbbl@bcptoname \bbl@csarg\xdef{bcp@map@\bbl@cl{tbcp}}{\languagename}% + \fi + % Conditional + \ifnum#1>\z@ % 0 = only info, 1, 2 = basic, (re)new + \bbl@exportkey{lnbrk}{typography.linebreaking}{h}% + \bbl@exportkey{hyphr}{typography.hyphenrules}{}% + \bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}% + \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}% + \bbl@exportkey{prehc}{typography.prehyphenchar}{}% + \bbl@exportkey{hyotl}{typography.hyphenate.other.locale}{}% + \bbl@exportkey{hyots}{typography.hyphenate.other.script}{}% + \bbl@exportkey{intsp}{typography.intraspace}{}% + \bbl@exportkey{chrng}{characters.ranges}{}% + \bbl@exportkey{dgnat}{numbers.digits.native}{}% + \bbl@exportkey{frspc}{typography.frenchspacing}{u}% + \ifnum#1=\tw@ % only (re)new + \bbl@exportkey{rqtex}{identification.require.babel}{}% + \bbl@toglobal\bbl@savetoday + \bbl@toglobal\bbl@savedate + \bbl@savestrings + \fi \fi} +\def\bbl@inikv#1#2{% key=value + \toks@{#2}% This hides #'s from ini values + \bbl@csarg\edef{@kv@\bbl@section.#1}{\the\toks@}} +\let\bbl@inikv@identification\bbl@inikv \let\bbl@inikv@typography\bbl@inikv \let\bbl@inikv@characters\bbl@inikv \let\bbl@inikv@numbers\bbl@inikv -\def\bbl@inikv@counters#1=#2\@@{% +\def\bbl@inikv@counters#1#2{% \bbl@ifsamestring{#1}{digits}% {\bbl@error{The counter name 'digits' is reserved for mapping\\% decimal digits}% @@ -2969,18 +2968,11 @@ \expandafter\bbl@buildifcase\bbl@tempb* \\ % Space after \\ \bbl@csarg{\global\expandafter\let}{cntr@#1@\languagename}\bbl@tempa \fi} -\def\bbl@after@ini{% - \bbl@linebreak@export - \bbl@exportkey{dgnat}{numbers.digits.native}{}% - \bbl@exportkey{rqtex}{identification.require.babel}{}% - \bbl@exportkey{frspc}{typography.frenchspacing}{u}% unset - \bbl@toglobal\bbl@savetoday - \bbl@toglobal\bbl@savedate} \ifcase\bbl@engine - \bbl@csarg\def{inikv@captions.licr}#1=#2\@@{% + \bbl@csarg\def{inikv@captions.licr}#1#2{% \bbl@ini@captions@aux{#1}{#2}} \else - \def\bbl@inikv@captions#1=#2\@@{% + \def\bbl@inikv@captions#1#2{% \bbl@ini@captions@aux{#1}{#2}} \fi \def\bbl@ini@captions@template#1#2{% string language tempa=capt-name @@ -3030,7 +3022,7 @@ \bbl@ifunset{bbl@map@#1@\languagename}% {\@nameuse{#1}}% {\@nameuse{bbl@map@#1@\languagename}}} -\def\bbl@inikv@labels#1=#2\@@{% +\def\bbl@inikv@labels#1#2{% \in@{.map}{#1}% \ifin@ \ifx\bbl@KVP@labels\@nil\else @@ -3218,7 +3210,7 @@ \def\bbl@xdatecntr[#1|#2]{\localenumeral{#2}{#1}} \def\bbl@provide@lsys#1{% \bbl@ifunset{bbl@lname@#1}% - {\bbl@ini@basic{#1}}% + {\bbl@load@info{#1}}% {}% \bbl@csarg\let{lsys@#1}\@empty \bbl@ifunset{bbl@sname@#1}{\bbl@csarg\gdef{sname@#1}{Default}}{}% @@ -3262,11 +3254,10 @@ \fi}% {\hyphenchar\font\defaulthyphenchar}} % \fi} -\def\bbl@ini@basic#1{% +\def\bbl@load@info#1{% \def\BabelBeforeIni##1##2{% \begingroup - \bbl@add\bbl@secpost@identification{\closein\bbl@readstream }% - \bbl@read@ini{##1}1% + \bbl@read@ini{##1}0% \endinput % babel- .tex may contain onlypreamble's \endgroup}% boxed, to avoid extra spaces: {\bbl@input@texini{#1}}} @@ -3360,7 +3351,7 @@ \newcommand\BabelEnsureInfo{% \ifx\InputIfFileExists\@undefined\else \def\bbl@ensureinfo##1{% - \bbl@ifunset{bbl@lname@##1}{\bbl@ini@basic{##1}}{}}% + \bbl@ifunset{bbl@lname@##1}{\bbl@load@info{##1}}{}}% \fi \bbl@foreach\bbl@loaded{{% \def\languagename{##1}% diff --git a/Master/texmf-dist/tex/generic/babel/babel.sty b/Master/texmf-dist/tex/generic/babel/babel.sty index b524f7ede80..b7dc33eea74 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.sty +++ b/Master/texmf-dist/tex/generic/babel/babel.sty @@ -33,7 +33,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{babel}[2021/01/26 3.53 The Babel package] +\ProvidesPackage{babel}[2021/02/22 3.54 The Babel package] \@ifpackagewith{babel}{debug} {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}% \let\bbl@debug\@firstofone @@ -216,7 +216,7 @@ \else \expandafter\@firstofone \fi} - % Temporarily repeat here the code for errors + % Temporarily repeat here the code for errors. TODO. \def\bbl@error#1#2{% \begingroup \def\\{\MessageBreak}% @@ -239,16 +239,17 @@ \def\\{\MessageBreak}% \PackageInfo{babel}{#1}% \endgroup} - \def\bbl@nocaption{\protect\bbl@nocaption@i} +\def\bbl@nocaption{\protect\bbl@nocaption@i} \def\bbl@nocaption@i#1#2{% 1: text to be printed 2: caption macro \langXname \global\@namedef{#2}{\textbf{?#1?}}% \@nameuse{#2}% - \bbl@warning{% TODO. - \@backslashchar#2 not set. Please, define it\\% - after the language has been loaded (typically\\% - in the preamble) with the help of\\% - \string\setlocalecaption. An example is:\\% - \string\setlocalecaption{mylang}{chapter}{..}\\ + \edef\bbl@tempa{#1}% + \bbl@sreplace\bbl@tempa{name}{}% + \bbl@warning{% + \@backslashchar#1 not set for '\languagename'. Please,\\% + define it after the language has been loaded\\% + (typically in the preamble) with\\% + \string\setlocalecaption{\languagename}{\bbl@tempa}{..}\\% Reported}} \def\bbl@tentative{\protect\bbl@tentative@i} \def\bbl@tentative@i#1{% diff --git a/Master/texmf-dist/tex/generic/babel/hyphen.cfg b/Master/texmf-dist/tex/generic/babel/hyphen.cfg index ffcd74741e2..9ad1aa862e9 100644 --- a/Master/texmf-dist/tex/generic/babel/hyphen.cfg +++ b/Master/texmf-dist/tex/generic/babel/hyphen.cfg @@ -37,10 +37,10 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{hyphen.cfg}[2021/01/26 3.53 Babel hyphens] +\ProvidesFile{hyphen.cfg}[2021/02/22 3.54 Babel hyphens] \xdef\bbl@format{\jobname} -\def\bbl@version{3.53} -\def\bbl@date{2021/01/26} +\def\bbl@version{3.54} +\def\bbl@date{2021/02/22} \ifx\AtBeginDocument\@undefined \def\@empty{} \let\orig@dump\dump diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def index 5f489e8062d..fb2459868e8 100644 --- a/Master/texmf-dist/tex/generic/babel/luababel.def +++ b/Master/texmf-dist/tex/generic/babel/luababel.def @@ -417,7 +417,7 @@ \let\bbl@cjkintraspace\relax \directlua{ Babel = Babel or {} - require'babel-data-cjk.lua' + require('babel-data-cjk.lua') Babel.cjk_enabled = true function Babel.cjk_linebreak(head) local GLYPH = node.id'glyph' @@ -1413,21 +1413,86 @@ end \ifcase\bbl@thetextdir \let\bbl@pictresetdir\relax \else - \bodydir TLT + \ifcase#1\bodydir TLT % Remember this sets the inner boxes + \or\textdir TLT + \else\bodydir TLT \textdir TLT + \fi % \(text|par)dir required in pgf: \def\bbl@pictresetdir{\bodydir TRT\pardir TRT\textdir TRT\relax}% \fi}% \ifx\AddToHook\@undefined\else - \AddToHook{env/picture/begin}{\bbl@pictsetdir\z@}% + \AddToHook{env/picture/begin}{\bbl@pictsetdir\tw@}% + \directlua{ + Babel.get_picture_dir = true + Babel.picture_has_bidi = 0 + function Babel.picture_dir (head) + if not Babel.get_picture_dir then return head end + for item in node.traverse(head) do + if item.id == node.id'glyph' then + local itemchar = item.char + % TODO. Copypaste pattern from Babel.bidi (-r) + local chardata = Babel.characters[itemchar] + local dir = chardata and chardata.d or nil + if not dir then + for nn, et in ipairs(Babel.ranges) do + if itemchar < et[1] then + break + elseif itemchar <= et[2] then + dir = et[3] + break + end + end + end + if dir and (dir == 'al' or dir == 'r') then + Babel.picture_has_bidi = 1 + end + end + end + return head + end + luatexbase.add_to_callback("hpack_filter", Babel.picture_dir, + "Babel.picture_dir") + }% + \AtBeginDocument{% + \long\def\put(#1,#2)#3{% + \@killglue + % Try: + \ifx\bbl@pictresetdir\relax + \def\bbl@tempc{0}% + \else + \directlua{ + Babel.get_picture_dir = true + Babel.picture_has_bidi = 0 + }% + \setbox\z@\hb@xt@\z@{% + \@defaultunitsset\@tempdimc{#1}\unitlength + \kern\@tempdimc + #3\hss}% + \edef\bbl@tempc{\directlua{tex.print(Babel.picture_has_bidi)}}% + \fi + % Do: + \@defaultunitsset\@tempdimc{#2}\unitlength + \raise\@tempdimc\hb@xt@\z@{% + \@defaultunitsset\@tempdimc{#1}\unitlength + \kern\@tempdimc + {\ifnum\bbl@tempc>\z@\bbl@pictresetdir\fi#3}\hss}% + \ignorespaces}% + \MakeRobust\put}% \fi \AtBeginDocument {\ifx\tikz@atbegin@node\@undefined\else \let\bbl@OL@pgfpicture\pgfpicture \bbl@sreplace\pgfpicture{\pgfpicturetrue}% - {\bbl@pictsetdir\@ne\pgfpicturetrue}% - \bbl@add\pgfsys@beginpicture{\bbl@pictsetdir\@ne}% + {\bbl@pictsetdir\z@\pgfpicturetrue}% + \bbl@add\pgfsys@beginpicture{\bbl@pictsetdir\z@}% \bbl@add\tikz@atbegin@node{\bbl@pictresetdir}% - \fi}} + \bbl@sreplace\tikz{\begingroup}% + {\begingroup\bbl@pictsetdir\tw@}% + \fi + \ifx\AddToHook\@undefined\else + \AddToHook{env/tcolorbox/begin}{\bbl@pictsetdir\@ne}% + \fi + }} {} \IfBabelLayout{counters}% {\let\bbl@OL@@textsuperscript\@textsuperscript diff --git a/Master/texmf-dist/tex/generic/babel/nil.ldf b/Master/texmf-dist/tex/generic/babel/nil.ldf index f909f2f9e48..68e9eaad3c4 100644 --- a/Master/texmf-dist/tex/generic/babel/nil.ldf +++ b/Master/texmf-dist/tex/generic/babel/nil.ldf @@ -32,7 +32,7 @@ %% extension |.ins|) which are part of the distribution. %% -\ProvidesLanguage{nil}[2021/01/26 3.53 Nil language] +\ProvidesLanguage{nil}[2021/02/22 3.54 Nil language] \LdfInit{nil}{datenil} \ifx\l@nil\@undefined \newlanguage\l@nil diff --git a/Master/texmf-dist/tex/latex/csquotes/csq-compat.def b/Master/texmf-dist/tex/latex/csquotes/csq-compat.def index b8ad344c1d9..aafc40fdd44 100644 --- a/Master/texmf-dist/tex/latex/csquotes/csq-compat.def +++ b/Master/texmf-dist/tex/latex/csquotes/csq-compat.def @@ -1,5 +1,5 @@ \ProvidesFile{csq-compat.def} - [2021-01-04 v5.2k csquotes backwards compatibility (JAW)] + [2021-02-22 v5.2l csquotes backwards compatibility (JAW)] \def\csq@getversion#1{% \expandafter\csq@getversion@i diff --git a/Master/texmf-dist/tex/latex/csquotes/csquotes.def b/Master/texmf-dist/tex/latex/csquotes/csquotes.def index 12197c3ee8e..0b7104a2b7e 100644 --- a/Master/texmf-dist/tex/latex/csquotes/csquotes.def +++ b/Master/texmf-dist/tex/latex/csquotes/csquotes.def @@ -1,5 +1,5 @@ \ProvidesFile{csquotes.def} - [2021-01-04 v5.2k csquotes generic definitions (JAW)] + [2021-02-22 v5.2l csquotes generic definitions (JAW)] % Set defaults diff --git a/Master/texmf-dist/tex/latex/csquotes/csquotes.sty b/Master/texmf-dist/tex/latex/csquotes/csquotes.sty index 72bc9ba0310..fbd4a2dda5a 100644 --- a/Master/texmf-dist/tex/latex/csquotes/csquotes.sty +++ b/Master/texmf-dist/tex/latex/csquotes/csquotes.sty @@ -12,7 +12,7 @@ \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{csquotes} - [2021-01-04 v5.2k context-sensitive quotations (JAW)] + [2021-02-22 v5.2l context-sensitive quotations (JAW)] %% Compatibility and requirements @@ -2237,9 +2237,9 @@ \newrobustcmd*{\textdel}{% \mktextdel} -\newcommand{\mktextelp}{[\textellipsis\unkern]} -\newcommand{\mktextelpins}[1]{[\textellipsis\unkern] [#1]} -\newcommand{\mktextinselp}[1]{[#1] [\textellipsis\unkern]} +\newcommand{\mktextelp}{[\textellipsis\unkern]\@} +\newcommand{\mktextelpins}[1]{[\textellipsis\unkern]\@ [#1]} +\newcommand{\mktextinselp}[1]{[#1] [\textellipsis\unkern]\@} \newcommand{\mktextins}[1]{[#1]} \newcommand{\mktextmod}[1]{[#1]} \newcommand{\mktextdel}[1]{[]} diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 16ae60d7a78..470d7ae4951 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -9,7 +9,7 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e} \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/02/21}{1.23f}{} +\ProvidesExplClass{easybook}{2021/02/23}{1.23g}{} \cs_generate_variant:Nn \keys_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -1046,7 +1046,7 @@ bibstyle .choice:, bibstyle .value_required:n = true, - bibstyle/number .code:n = + bibstyle/numerical .code:n = { \tl_set:Nn \l__bib_style_tl{#1} \tl_clear:N \l__bib_mysty_tl @@ -1058,7 +1058,7 @@ }, bibstyle/unknown .code:n = {\tl_set_eq:NN \l__bib_mysty_tl\l_keys_value_tl}, - bibstyle .initial:n = number, + bibstyle .initial:n = numerical, citestyle .code:n = {\tl_set:Nn \l__bib_citesty_tl{#1}}, @@ -1070,10 +1070,10 @@ { \tl_if_empty:NTF \l__bib_mysty_tl { - \tl_if_eq:VnT \l__bib_style_tl{number} + \tl_if_eq:VnT \l__bib_style_tl{numerical} { \bibliographystyle{gbt7714-numerical} - \setcitestyle{square,comma,super} + \setcitestyle{comma,square,super} } \tl_if_eq:VnT \l__bib_style_tl{authoryear} {\bibliographystyle{gbt7714-author-year}} @@ -1081,6 +1081,8 @@ }{ \exp_args:NV \bibliographystyle\l__bib_mysty_tl } + \tl_if_empty:NF \l__bib_citesty_tl + {\exp_args:NV \setcitestyle\l__bib_citesty_tl} \cs_set:Npn \bibsection{\__title_mark_intoc:n \bibname} \skip_set:Nn \bibsep{0ex} \NewDocumentCommand\printbibliography{o} @@ -1100,7 +1102,7 @@ \__put_biblatex:n {style = \l__bib_mysty_tl} } \tl_if_empty:NF \l__bib_citesty_tl - {\__put_biblatex:n {citestyle = \l__bib_mysty_tl}} + {\__put_biblatex:n {citestyle = \l__bib_citesty_tl}} \__put_biblatex:n {backend = biber} } \cs_new_protected:Npn \__biblatex_after_set: @@ -1178,7 +1180,7 @@ rulecolor = \color{ctex@frame}, commentstyle = \color{gray}, emphstyle = \color{ctex@emph}, - emph = {caption,subcaption,tabularx}, + emph = {caption,makecell,subcaption,tabularx}, keywordstyle = \lst@ifdisplaystyle\bfseries\color{ctex@emph}\else\color{ctex@verb}\fi, morekeywords = diff --git a/Master/texmf-dist/tex/latex/microtype/README.TEXLIVE b/Master/texmf-dist/tex/latex/microtype/README.TEXLIVE deleted file mode 100644 index 740e2836b0c..00000000000 --- a/Master/texmf-dist/tex/latex/microtype/README.TEXLIVE +++ /dev/null @@ -1,11 +0,0 @@ -The files below have been removed in the TeX Live installation of -the current package, possibly because of missing source (e.g., a -PDF with no source), possibly because their only purpose is to support -nonfree fonts or other software, possibly for other reasons. -More info: https://tug.org/texlive/pkgcontrib.html#requirements - -If this is a concern, please contact the package maintainer. - - mt-euroitc.cfg - mt-PalatinoLinotype.cfg - mt-pad.cfg diff --git a/Master/texmf-dist/tex/latex/microtype/letterspace.sty b/Master/texmf-dist/tex/latex/microtype/letterspace.sty index 1e2477b9aff..3f881de01af 100644 --- a/Master/texmf-dist/tex/latex/microtype/letterspace.sty +++ b/Master/texmf-dist/tex/latex/microtype/letterspace.sty @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at @@ -33,7 +33,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage {letterspace} - [2020/12/07 v2.8 + [2021/02/22 v2.8a Robust letterspacing (RS)] \def\MT@MT diff --git a/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def b/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def index ea55d562c3c..ff8e63523e8 100644 --- a/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def +++ b/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at @@ -30,21 +30,24 @@ %% \ProvidesFile {microtype-luatex.def} - [2020/12/07 v2.8 + [2021/02/22 v2.8a Definitions specific to luatex (RS)] \let\MT@lua\directlua -\def\MT@luatex@no{5} -\ifnum\luatexversion<90 - \def\MT@luatex@no{4} - \ifnum\luatexversion<85 - \def\MT@luatex@no{3} - \ifnum\luatexversion<62 - \def\MT@luatex@no{2} - \ifnum\luatexversion<36 - \def\MT@lua{\directlua0} - \def\MT@luatex@no{1} +\def\MT@luatex@no{6} +\ifnum\luatexversion<110 + \def\MT@luatex@no{5} + \ifnum\luatexversion<90 + \def\MT@luatex@no{4} + \ifnum\luatexversion<85 + \def\MT@luatex@no{3} + \ifnum\luatexversion<62 + \def\MT@luatex@no{2} + \ifnum\luatexversion<36 + \def\MT@lua{\directlua0} + \def\MT@luatex@no{1} + \fi \fi \fi \fi @@ -57,6 +60,7 @@ \@ifl@t@r\fmtversion{2016/01/01}\relax{\RequirePackage{luatexbase}} \@ifl@t@r\fmtversion{2017/01/01}\relax{\RequirePackage{luaotfload}} \MT@lua{require("microtype")} +\MT@requires@luatex6{\let\MT@glet\glet}\relax \def\MT@ifint#1{\csname\MT@lua{microtype.if_int([[#1]])}\endcsname} \def\MT@ifdimen#1{\csname\MT@lua{microtype.if_dimen([[#1]])}\endcsname} \def\MT@ifstreq#1#2{\csname\MT@lua{microtype.if_str_eq([[#1]],[[#2]])}\endcsname} diff --git a/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def b/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def index 5cc828c24f6..925d57f7f34 100644 --- a/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def +++ b/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at @@ -30,7 +30,7 @@ %% \ProvidesFile {microtype-pdftex.def} - [2020/12/07 v2.8 + [2021/02/22 v2.8a Definitions specific to pdftex (RS)] diff --git a/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def b/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def index e7991789055..050841ae7c5 100644 --- a/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def +++ b/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at @@ -30,7 +30,7 @@ %% \ProvidesFile {microtype-xetex.def} - [2020/12/07 v2.8 + [2021/02/22 v2.8a Definitions specific to xetex (RS)] diff --git a/Master/texmf-dist/tex/latex/microtype/microtype.cfg b/Master/texmf-dist/tex/latex/microtype/microtype.cfg index 5c62ae2b8da..efc41c239d6 100644 --- a/Master/texmf-dist/tex/latex/microtype/microtype.cfg +++ b/Master/texmf-dist/tex/latex/microtype/microtype.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at @@ -40,7 +40,7 @@ %% \ProvidesFile {microtype.cfg} - [2020/12/07 v2.8 + [2021/02/22 v2.8a microtype main configuration file (RS)] @@ -110,7 +110,7 @@ %%% ----------------------------------------------------------------------- %%% FONT VARIANTS AND ALIASES -\DeclareMicrotypeVariants{x,j,w,a,d,0,1} +\DeclareMicrotypeVariants{x,j,w,a,d,0,1,-LF,-TLF,-OsF,-TOsF} \MT@if@false \ifx\UnicodeEncodingName\@undefined\else @@ -129,7 +129,12 @@ \DeclareMicrotypeAlias{zer} {cmr} % zefonts \DeclareMicrotypeAlias{cmor}{cmr} % eco \DeclareMicrotypeAlias{hfor}{cmr} % hfoldsty +\DeclareMicrotypeAlias{mlmr}{cmr} % mlmodern +\DeclareMicrotypeAlias{mlmsy}{cmsy} % " +\DeclareMicrotypeAlias{mlmm} {cmm} % " \DeclareMicrotypeAlias{New Computer Modern}{Latin Modern Roman} +\DeclareMicrotypeAlias{NewCM10-Book.otf} {Latin Modern Roman} +\DeclareMicrotypeAlias{NewCM10-Regular.otf}{Latin Modern Roman} %% -- Palatino \DeclareMicrotypeAlias{pxr} {ppl} % pxfonts \DeclareMicrotypeAlias{qpl} {ppl} % TeX Gyre Pagella (formerly: qfonts/QuasiPalatino) @@ -141,21 +146,21 @@ \DeclareMicrotypeAlias{zpltosf}{pplj} % " \DeclareMicrotypeAlias{Domitian-TLF} {pplx}% domitian \DeclareMicrotypeAlias{Domitian-TOsF}{pplj}% " -\DeclareMicrotypeAlias{Domitian} {Palatino Linotype} -\DeclareMicrotypeAlias{TeX Gyre Pagella}{Palatino Linotype} -\DeclareMicrotypeAlias{Palatino LT Std} {Palatino Linotype} -\DeclareMicrotypeAlias{Palatino} {Palatino Linotype} -\DeclareMicrotypeAlias{Asana Math} {Palatino Linotype} +\DeclareMicrotypeAlias{Palatino Linotype}{Palatino} +\DeclareMicrotypeAlias{Palatino LT Std} {Palatino} +\DeclareMicrotypeAlias{TeX Gyre Pagella} {Palatino} +\DeclareMicrotypeAlias{Domitian} {Palatino} +\DeclareMicrotypeAlias{Asana Math} {Palatino} %% -- Times New Roman \DeclareMicrotypeAlias{txr}{ptm} % txfonts \DeclareMicrotypeAlias{ntxlf}{ptmx} % newtxtext \DeclareMicrotypeAlias{ntxosf}{ptmj} % " \DeclareMicrotypeAlias{ntxtlf}{ptmx} % " \DeclareMicrotypeAlias{ntxtosf}{ptmj} % " -\DeclareMicrotypeAlias{Tempora-TLF}{ptmx} % tempora +\DeclareMicrotypeAlias{Tempora-TLF} {ptmx} % tempora \DeclareMicrotypeAlias{Tempora-TOsF}{ptmj} % " \DeclareMicrotypeAlias{qtm}{ptm} % TeX Gyre Termes (formerly: qfonts/QuasiTimes) -\DeclareMicrotypeAlias{STEP-TLF}{ptmx} % step +\DeclareMicrotypeAlias{STEP-TLF} {ptmx} % step \DeclareMicrotypeAlias{STEP-TOsF}{ptmj} % " \DeclareMicrotypeAlias{stix} {ptm} % stix \DeclareMicrotypeAlias{stix2}{ptm} % stix2 @@ -170,13 +175,15 @@ \DeclareMicrotypeAlias{zgmj}{ugm} % " \DeclareMicrotypeAlias{zgmI}{ugm} % " \DeclareMicrotypeAlias{zgmq}{ugm} % " +\DeclareMicrotypeAlias{pad} {EBGaramond-LF}% Adobe Garamond +\DeclareMicrotypeAlias{padx}{EBGaramond-TLF}% " +\DeclareMicrotypeAlias{padj}{EBGaramond-TOsF}% " %% -- \DeclareMicrotypeAlias{ulg}{blg} % URW LetterGothic -> Bitstream LetterGothic12Pitch \DeclareMicrotypeAlias{zeur}{eur} % Euler VM \DeclareMicrotypeAlias{zeus}{eus} % " \DeclareMicrotypeAlias{zpeus} {zpeu} % Adobe Euro sans -> serif \DeclareMicrotypeAlias{eurosans}{zpeu} % Adobe Euro sans -> serif -\DeclareMicrotypeAlias{euroitcs}{euroitc} % ITC Euro sans -> serif %%% ----------------------------------------------------------------------- %%% INTERACTION WITH THE `babel' PACKAGE @@ -356,7 +363,7 @@ } \DeclareCharacterInheritance - { encoding = {EU1,EU2,TU} } + { encoding = {TU,EU1,EU2} } { A = {\`A,\'A,\^A,\~A,\"A,\r A,\k A,\u A}, a = {\`a,\'a,\^a,\~a,\"a,\r a,\k a,\u a}, C = {\'C,\c C,\v C}, @@ -822,6 +829,11 @@ {,}= { , 250,-200} } +\SetExtraSpacing + [ name = empty ] + { encoding = {TS1} } + { } + %%% ----------------------------------------------------------------------- %%% ADDITIONAL KERNING diff --git a/Master/texmf-dist/tex/latex/microtype/microtype.lua b/Master/texmf-dist/tex/latex/microtype/microtype.lua index 796b4f8bf9f..e5f43fa8963 100644 --- a/Master/texmf-dist/tex/latex/microtype/microtype.lua +++ b/Master/texmf-dist/tex/latex/microtype/microtype.lua @@ -10,7 +10,7 @@ -- -- The `microtype' package -- Subliminal refinements towards typographical perfection --- Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +-- Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> -- -- This work may be distributed and/or modified under the conditions of the -- LaTeX Project Public License, either version 1.3c of this license or (at @@ -34,8 +34,8 @@ microtype = microtype or {} local microtype = microtype microtype.module = { name = "microtype", - version = "2.8", - date = "2020/12/07", + version = "2.8a", + date = "2021/02/22", description = "microtype module.", author = "E. Roux, R. Schlicht and P. Gesang", copyright = "E. Roux, R. Schlicht and P. Gesang", diff --git a/Master/texmf-dist/tex/latex/microtype/microtype.sty b/Master/texmf-dist/tex/latex/microtype/microtype.sty index 07375123b7d..41798862307 100644 --- a/Master/texmf-dist/tex/latex/microtype/microtype.sty +++ b/Master/texmf-dist/tex/latex/microtype/microtype.sty @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at @@ -29,7 +29,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage {microtype} - [2020/12/07 v2.8 + [2021/02/22 v2.8a Micro-typographical refinements (RS)] \def\MT@MT @@ -1536,10 +1536,8 @@ time will almost certainly lead to undesired results. Have your choice!}% \else \MT@let@cn\@tempa{\MT@val}% \fi - \ifx\@tempa\relax \else - \begingroup - \def\set@fontsize##1##2##3##4\@nil{\endgroup\def\MT@val{##2}}% - \@tempa\@nil + \ifx\@tempa\relax\else + \MT@get@size@ \fi \MT@ifdimen\MT@val{% \@defaultunits\@tempdima\MT@val pt\relax\@nnil @@ -1550,6 +1548,23 @@ time will almost certainly lead to undesired results. Have your choice!}% \let\MT@val\relax }% } +\def\MT@get@size@@{% + \begingroup + \def\set@fontsize##1##2##3##4\@nil{\endgroup\def\MT@val{##2}}% + \@tempa\@nil +} +^^X\@ifclassloaded{svjour3}{% +^^X \def\MT@get@size@{% +^^X \@tempcnta=\currentiflevel +^^X \MT@get@size@@ +^^X \loop +^^X \ifnum\numexpr\currentiflevel-1>\@tempcnta +^^X \csname fi\endcsname +^^X \repeat +^^X }% +^^X}{% + \let\MT@get@size@\MT@get@size@@ +^^X} \def\MT@define@set@key@font#1{% \define@key{MT@#1@set}{font}[]{% \MT@glet@nc{MT@#1list@font@\MT@curr@set@name}\@empty @@ -1840,14 +1855,16 @@ time will almost certainly lead to undesired results. Have your choice!}% } \def\MT@set@inh@list#1#2{% \MT@ifempty\MT@inh@feat{% - \MT@map@clist@c\MT@features{{\MT@declare@char@inh{##1}{#1}{#2}}}% + \MT@map@clist@c\MT@features{{% + \MT@ifstreq{##1}{tr}\relax{\MT@declare@char@inh{##1}{#1}{#2}}% + }}% }{% \MT@map@clist@c\MT@inh@feat{{% \KV@@sp@def\@tempa{##1}% \MT@ifempty\@tempa\relax{% - \MT@exp@one@n\MT@declare@char@inh - {\csname MT@rbba@\@tempa\endcsname}{#1}{#2}% - }% + \edef\@tempa{\csname MT@rbba@\@tempa\endcsname}% + \MT@ifstreq\@tempa{tr}\relax{% + \MT@exp@one@n\MT@declare@char@inh{\@tempa}{#1}{#2}}}% }}% }% \MT@end@catcodes @@ -1878,6 +1895,12 @@ time will almost certainly lead to undesired results. Have your choice!}% \expandafter\MT@inh@do \fi } +\MT@gdef@n{MT@pr@c@U/euroitc///}{euroitc} +\MT@gdef@n{MT@pr@c@U/euroitcs///}{euroitc} +\MT@gdef@n{MT@pr@c@U/euroitc//it/}{euroitci} +\MT@gdef@n{MT@pr@c@U/euroitcs//it/}{euroitci} +\MT@gdef@n{MT@pr@c@euroitc}{E={100,50}} +\MT@gdef@n{MT@pr@c@euroitci}{E={100,}} \def\MT@permute{% \let\MT@cnt@encoding\@ne \MT@permute@ diff --git a/Master/texmf-dist/tex/latex/microtype/mt-CharisSIL.cfg b/Master/texmf-dist/tex/latex/microtype/mt-CharisSIL.cfg index ce3c4606eda..9133b6b8ab6 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-CharisSIL.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-CharisSIL.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-EBGaramond.cfg b/Master/texmf-dist/tex/latex/microtype/mt-EBGaramond.cfg new file mode 100644 index 00000000000..9ed6839e72a --- /dev/null +++ b/Master/texmf-dist/tex/latex/microtype/mt-EBGaramond.cfg @@ -0,0 +1,323 @@ +%% +%% This is file `mt-EBGaramond.cfg', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% microtype.dtx (with options: `config,cfg-t,ebg') +%% +%% ------------------------------------------------------------------------ +%% +%% The `microtype' package +%% Subliminal refinements towards typographical perfection +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> +%% +%% This work may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License, either version 1.3c of this license or (at +%% your option) any later version. The latest version of this license is in: +%% http://www.latex-project.org/lppl.txt, and version 1.3c or later is part +%% of all distributions of LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of the files microtype.dtx and microtype.ins and the +%% derived files microtype.sty, microtype-pdftex.def, microtype-luatex.def, +%% microtype-xetex.def, microtype.lua and letterspace.sty. +%% +%% ------------------------------------------------------------------------ +%% This is a font-specific configuration file for the `microtype' package. +%% It may contain settings for font expansion and character protrusion, +%% tracking, interword spacing and additional kerning, as well as +%% character inheritance declarations. +%% Please consult the documentation for details. +%% +%% If you think you have found improvements to these settings, please +%% let me know. +%% +%% When modifying this file, also change the identification line below. +%% ------------------------------------------------------------------------ +%% +\ProvidesFile + {mt-EBGaramond.cfg}[2021/02/22 v1.6 microtype config. file: EB Garamond / Adobe Garamond (RS)] + +%%% ----------------------------------------------------------------------- +%%% PROTRUSION + +\SetProtrusion + [ name = EBGaramond-default ] + { encoding = OT1, + family = {EBGaramond-LF,EBGaramond-OsF,EBGaramond-TLF,EBGaramond-TOsF} } + { + A = {50,50}, + \AE = {50, }, + C = {50, }, + D = { ,50}, + F = { ,50}, + G = {50, }, + J = {50, }, + K = { ,50}, + L = { ,50}, + O = {50,50}, + \OE = {50, }, + Q = {50,70}, + T = {50,50}, + V = {50,50}, + W = {50,50}, + X = {50,50}, + Y = {50,50}, + k = { ,50}, + p = {50,50}, + q = {50, }, + r = { ,50}, + t = { ,70}, + v = {50,50}, + w = {50,50}, + x = {50,50}, + y = { ,50}, + 1 = {150,150}, + 2 = {50,50}, + 3 = {50,50}, + 4 = {50,50}, + 5 = {50,50}, + 6 = {50,50}, + 7 = {50,80}, + 9 = {50,50}, + . = { ,700}, + {,}= { ,500}, + : = { ,500}, + ; = { ,300}, + ! = { ,100}, + ? = { ,100}, + @ = {50,50}, + ~ = {200,250}, + & = {50,100}, + \% = {50,50}, + * = {300,300}, + + = {300,300}, + ( = {100, }, ) = { ,200}, + / = {100,200}, + - = {300,500}, + \textendash = {300,300}, \textemdash = {200,200}, + \textquoteleft = {500,700}, \textquoteright = {500,700}, + \textquotedblleft = {300,400}, \textquotedblright = {300,400} + } + +\SetProtrusion + [ name = EBGaramond-T1, + load = EBGaramond-default ] + { encoding = {T1,LY1}, + family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF} } + { + _ = {100,100}, + \textbackslash = {100,200}, + \quotesinglbase = {400,400}, \quotedblbase = {400,400}, + \guilsinglleft = {400,400}, \guilsinglright = {300,500}, + \guillemotleft = {300,300}, \guillemotright = {200,400}, + \textexclamdown = {100, }, \textquestiondown = {100, }, + \textbraceleft = {400,200}, \textbraceright = {200,400}, + \textless = {200,100}, \textgreater = {100,200} + } + +\SetProtrusion + [ name = EBGaramond-it ] + { encoding = OT1, + family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF}, + shape = {it,sl} } + { + A = {50, }, + \AE = {50, }, + B = {50, }, + C = {100, }, + D = {50,50}, + E = {50, }, + F = {100, }, + G = {100, }, + H = {50, }, + I = {50, }, + J = {50, }, + K = {50, }, + L = {50, }, + O = {100, }, + \OE = {100, }, + P = {50, }, + Q = {100, }, + R = {50, }, + S = {50, }, + $ = {50, }, + T = {100, }, + U = {50, }, + V = {100, }, + W = {100, }, + f = { ,-100}, + 1 = {150, }, + 2 = {50, }, + 4 = {150, }, + 7 = {100, }, + . = { ,500}, + {,}= { ,500}, + : = { ,300}, + ; = { ,300}, + & = {50,50}, + \% = {100, }, + * = {500,100}, + + = {250,200}, + @ = {50,50}, + ~ = {200,150}, + ( = {200, }, ) = { ,200}, + / = {100,200}, + - = {300,400}, + \textendash = {300,300}, \textemdash = {200,200}, + \textquoteleft = {800,200}, \textquoteright = {800,200}, + \textquotedblleft = {700,200}, \textquotedblright = {700,200} + } + +\SetProtrusion + [ name = EBGaramond-it-T1, + load = EBGaramond-it ] + { encoding = {T1,LY1}, + family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF}, + shape = {it,sl} } + { + _ = {100,100}, + 156 = {50, }, % IJ + \textbackslash = {100,200}, + \quotesinglbase = {500,500}, \quotedblbase = {400,400}, + \guilsinglleft = {500,400}, \guilsinglright = {300,500}, + \guillemotleft = {300,300}, \guillemotright = {200,400}, + \textexclamdown = {100, }, \textquestiondown = {200, }, + \textbraceleft = {400,100}, \textbraceright = {200,200}, + \textless = {300,100}, \textgreater = {200,100} + } + +\SetProtrusion + [ name = EBGaramond-sc, + load = EBGaramond-default ] + { encoding = OT1, + family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF}, + shape = sc } + { + a = {50,50}, + \ae = {50, }, + d = { ,50}, + f = { ,50}, + g = {50, }, + j = {50, }, + l = { ,50}, + 013 = { ,50}, % fl + o = {50,50}, + \oe = {50, }, + q = {50,70}, + r = { , 0}, + t = {50,50}, + y = {50,50} + } + +\SetProtrusion + [ name = EBGaramond-sc-T1, + load = EBGaramond-T1 ] + { encoding = {T1,LY1}, + family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF}, + shape = sc } + { + a = {50,50}, + \ae = {50, }, + d = { ,50}, + f = { ,50}, + g = {50, }, + j = {50, }, + l = { ,50}, + 029 = { ,50}, % fl + o = {50,50}, + \oe = {50, }, + q = {50,70}, + r = { , 0}, + t = {50,50}, + y = {50,50} + } + +\SetProtrusion + [ name = EBGaramond-textcomp ] + { encoding = TS1, + family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF} } + { + \textquotestraightbase = {400,400}, + \textquotestraightdblbase = {400,400}, + \texttwelveudash = {200,200}, + \textthreequartersemdash = {150,150}, + \textquotesingle = {400,500}, + \textasteriskcentered = {300,300}, + \textthreeoldstyle = { 50, }, + \textfouroldstyle = { 50, }, + \textsevenoldstyle = { 50, 80}, + \textminus = {300,300}, + \textlbrackdbl = {100, }, + \textrbrackdbl = { ,100}, + \texttildelow = {200,250}, + \textdagger = {100,100}, + \textdaggerdbl = { 80, 80}, + \textbullet = { ,100}, + \textcelsius = { 80, }, + \textflorin = { ,100}, + \textcolonmonetary = { 50, }, + \texttrademark = {100,100}, + \textcopyright = {100,100}, + \textordfeminine = {200,200}, + \textlnot = {200, }, + \textregistered = {100,100}, + \textdegree = {400,400}, + \textpm = {150,200}, + \texttwosuperior = {200,200}, + \textthreesuperior = {200,200}, + \textparagraph = { ,100}, + \textperiodcentered = {300,400}, + \textonesuperior = {200,200}, + \textordmasculine = {200,200}, + \texteuro = { 50,100}, + \texttimes = {100,150}, + \textdiv = {150,200} + } + +\SetProtrusion + [ name = EBGaramond-textcomp-it ] + { encoding = TS1, + family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF}, + shape = {it,sl} } + { + \textquotestraightbase = {400,400}, + \textquotestraightdblbase = {300,400}, + \texttwelveudash = {200,200}, + \textthreequartersemdash = {150,150}, + \textquotesingle = {800,100}, + \textasteriskcentered = {500,100}, + \textoneoldstyle = {100, }, + \texttwooldstyle = { 50, }, + \textfouroldstyle = { 50,100}, + \textsevenoldstyle = { 50, }, + \textminus = {300,300}, + \textlbrackdbl = {100, }, + \textrbrackdbl = { ,100}, + \texttildelow = {200,250}, + \textdagger = {200,100}, + \textdaggerdbl = { 80, 80}, + \textbullet = {300, }, + \textcelsius = {200, }, + \textflorin = {100, }, + \textcolonmonetary = {100, }, + \texttrademark = {200, }, + \textcopyright = {200,100}, + \textlnot = {300, }, + \textregistered = {200,100}, + \textdegree = {500,100}, + \textpm = {200,150}, + \textonesuperior = {300,100}, + \texttwosuperior = {300, }, + \textthreesuperior = {300, }, + \textperiodcentered = {300,400}, + \texteuro = {100, }, + \texttimes = {200,100}, + \textdiv = {200,200} + } + +\endinput +%% +%% End of file `mt-EBGaramond.cfg'. diff --git a/Master/texmf-dist/tex/latex/microtype/mt-LatinModernRoman.cfg b/Master/texmf-dist/tex/latex/microtype/mt-LatinModernRoman.cfg index f7585c60e98..13b96cbad08 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-LatinModernRoman.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-LatinModernRoman.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at @@ -38,7 +38,7 @@ %% ------------------------------------------------------------------------ %% \ProvidesFile - {mt-LatinModernRoman.cfg}[2013/03/13 v1.0 microtype config. file: Latin Modern Roman (RS)] + {mt-LatinModernRoman.cfg}[2021/02/21 v1.1 microtype config. file: Latin Modern Roman (RS)] %%% ----------------------------------------------------------------------- %%% INHERITANCE @@ -86,7 +86,7 @@ c = {ç,ć,ĉ,ċ,č}, d = {đ,ḍ,ḏ}, e = {è,é,ê,ë,ē,ĕ,ė,ę,ě,ȅ,ẹ,ẻ,ẽ,ế,ề,ể,ễ,ệ}, - f = {/f_f}, + f = {ff}, % Unicode 64256, glyph name in Latin Modern: /f_f ; in New Computer Modern: /ff g = {ĝ,ğ,ġ,ģ,ǧ,ǵ}, h = {ĥ,ħ,ḥ,ḧ,ḫ}, i = {ì,í,î,ï,ĩ,ī,ĭ,į,ı,ȉ,ỉ,ị}, diff --git a/Master/texmf-dist/tex/latex/microtype/mt-Palatino.cfg b/Master/texmf-dist/tex/latex/microtype/mt-Palatino.cfg new file mode 100644 index 00000000000..61dfd46366b --- /dev/null +++ b/Master/texmf-dist/tex/latex/microtype/mt-Palatino.cfg @@ -0,0 +1,330 @@ +%% +%% This is file `mt-Palatino.cfg', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% microtype-utf.dtx (with options: `Palatino') +%% +%% ------------------------------------------------------------------------ +%% +%% The `microtype' package +%% Subliminal refinements towards typographical perfection +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> +%% +%% This work may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License, either version 1.3c of this license or (at +%% your option) any later version. The latest version of this license is in: +%% http://www.latex-project.org/lppl.txt, and version 1.3c or later is part +%% of all distributions of LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of the files microtype.dtx and microtype.ins and the +%% derived files microtype.sty, microtype-pdftex.def, microtype-luatex.def, +%% microtype-xetex.def, microtype.lua and letterspace.sty. +%% +%% ------------------------------------------------------------------------ +%% This is a font-specific configuration file for the `microtype' package. +%% It may contain settings for font expansion and character protrusion, +%% tracking, interword spacing and additional kerning, as well as +%% character inheritance declarations. +%% Please consult the documentation for details. +%% +%% If you think you have found improvements to these settings, please +%% let me know. +%% +%% When modifying this file, also change the identification line below. +%% ------------------------------------------------------------------------ +%% +%% These settings have been prepared by, and are copied with the +%% generous permission of: +%% Loren B. Davis. (c) 2012 +%% +%% ------------------------------------------------------------------------ +%% Palatino is a registered trademark of Linotype GmbH. +%% Used without permission. +%% ------------------------------------------------------------------------ +%% +\ProvidesFile + {mt-Palatino.cfg}[2012/03/10 v1.0 microtype config. file: Palatino and similar fonts (LBD)] + +%%% ----------------------------------------------------------------------- +%%% INHERITANCE + +%% for xetex (EU1) and luatex (EU2), resp. both (TU) +\DeclareCharacterInheritance + { encoding = {EU1,EU2,TU}, + family = {Palatino} } + { A = {À,Á,Â,Ã,Ä,Ā,Ă,Ą,Ǎ,Ǟ,Ǡ,Ȧ,Ǻ,Ȁ,Ȃ,Ḁ,Ạ,Ả,Ấ,Ầ,Ẩ,Ẫ,Ậ,Ắ,Ằ,Ẳ,Ẵ,Ặ,Ꜳ}, + B = {Ḃ,Ḅ,Ḇ}, + C = {Ç,Ć,Ĉ,Ḉ,Ċ,Č}, + D = {Ď,Ḋ,Ḍ,Ḏ,Ḑ,Ḓ}, + E = {È,É,Ê,Ë,Ē,Ĕ,Ė,Ę,Ě,Ȅ,Ȩ,Ȇ,Ḕ,Ḗ,Ḙ,Ḛ,Ḝ,Ẹ,Ẻ,Ẽ,Ế,Ề,Ể,Ễ,Ệ}, + F = {Ḟ}, + G = {Ĝ,Ğ,Ġ,Ģ,Ǧ,Ǵ,Ḡ}, + H = {Ĥ,Ȟ,Ḣ,Ḥ,Ḧ,Ḩ,Ḫ}, + I = {Ì,Í,Î,Ȉ,Ï,Į,Ĩ,Ị,Ī,İ,Ǐ,Ỉ,Ȋ,Ĭ,Ḭ,Ï}, + J = {Ĵ}, + K = {Ķ,Ǩ,Ḱ,Ḳ,Ḵ}, + L = {Ĺ,Ļ,Ľ,Ḷ,Ḹ,Ḻ,Ḽ,Ỻ,Ŀ,Ł}, % L· + M = {Ḿ,Ṁ,Ṃ}, + N = {Ñ,Ń,Ņ,Ň,Ǹ,Ṅ,Ṇ,Ṉ,Ṋ}, + O = {Ò,Ó,Ô,Õ,Ö,Ō,Ŏ,Ő,Ǒ,Ǫ,Ǭ,Ȍ,Ȏ,Ȫ,Ȭ,Ȯ,Ȱ,Ṍ,Ṏ,Ṑ,Ṓ,Ọ,Ỏ,Ố,Ồ,Ổ,Ỗ,Ộ,Ớ,Ờ,Ở,Ỡ,Ơ}, + P = {Ṕ,Ṗ}, + R = {Ŕ,Ŗ,Ř,Ȑ,Ȓ,Ṙ,Ṛ,Ṝ,Ṟ}, + S = {Ś,Ŝ,Ş,Š,Ș,Ṡ,Ṣ,Ṥ,Ṧ,Ṩ}, + T = {Ţ,Ť,Ț,Ṫ,Ṭ,Ṯ,Ṱ}, + U = {Ù,Ú,Û,Ü,Ũ,Ū,Ŭ,Ů,Ű,Ų,Ǔ,Ǖ,Ǘ,Ǚ,Ǜ,Ȕ,Ȗ,Ṳ,Ṵ,Ṷ,Ṹ,Ṻ,Ụ,Ủ,Ứ,Ừ,Ử,Ữ,Ự}, + V = {Ṽ,Ṿ}, + W = {Ŵ,Ẁ,Ẃ,Ẅ,Ẇ,Ẉ}, + X = {Ẋ,Ẍ}, + Y = {Ý,Ŷ,Ÿ,Ȳ,Ẏ,Ỳ,Ỵ,Ỷ,Ỹ}, + Z = {Ź,Ż,Ž,Ẑ,Ẓ,Ẕ}, + a = {à,á,â,ã,ä,å,ā,ă,ą,ǎ,ǟ,ǡ,ȧ,ǻ,ȁ,ȃ,ḁ,ạ,ả,ầ,ấ,ẩ,ẫ,ậ,ắ,ằ,ẳ,ẵ,ặ}, % aʾ + b = {ḃ,ḅ,ḇ}, + c = {ç,ć,ĉ,ċ,č,ḉ}, + d = {ď,ḋ,ḍ,ḏ,ḑ,ḓ}, + e = {è,é,ê,ë,ē,ĕ,ė,ę,ě,ȅ,ȩ,ȇ,ḕ,ḗ,ḙ,ḛ,ḝ,ẹ,ẻ,ẽ,ề,ế,ể,ễ,ệ}, + f = {ḟ,ff}, + g = {ĝ,ğ,ġ,ģ,ǧ,ǵ,ḡ}, + h = {ĥ,ȟ,ḣ,ḥ,ḧ,ḩ,ḫ,ẖ}, + i = {ı,ì,í,î,ȉ,ǐ,ï,į,ī,ị,ĩ,ḭ,ḯ,ỉ,ȋ,ĭ}, + j = {ĵ,ǰ}, + k = {ķ,ǩ,ḱ,ḳ,ḵ}, + l = {ĺ,ļ,ḻ,ḷ,ḹ,ḽ}, % ľ,l· + m = {ḿ,ṁ,ṃ}, + n = {ñ,ń,ņ,ň,ǹ,ṅ,ṇ,ṉ,ṋ}, % ʼn + o = {ò,ó,ô,õ,ö,ō,ŏ,ő,ǒ,ǫ,ǭ,ȍ,ȏ,ȫ,ȭ,ȯ,ȱ,ṍ,ṏ,ṑ,ṓ,ọ,ỏ,ồ,ố,ổ,ỗ,ộ,ớ,ờ,ở,ỡ,ợ}, + p = {ṕ,ṗ}, + r = {ŕ,ŗ,ř,ȑ,ȓ,ṙ,ṛ,ṝ,ṟ}, + s = {ś,ŝ,ş,š,ș,ṡ,ṣ,ṥ,ṧ,ṩ}, + t = {ţ,ț,ṫ,ṭ,ṯ,ṱ,ẗ}, % ť + u = {ù,ú,û,ü,ũ,ū,ŭ,ů,ű,ų,ǔ,ǖ,ǘ,ǚ,ǜ,ȕ,ȗ,ṳ,ṵ,ṷ,ṹ,ṻ,ụ,ủ,ứ,ừ,ử,ữ,ự}, + v = {ṽ,ṿ}, + w = {ŵ,ẁ,ẃ,ẅ,ẇ,ẉ,ẘ}, + x = {ẋ,ẍ}, + y = {ý,ÿ,ŷ,ȳ,ẏ,ẙ,ỳ,ỵ,ỷ,ỹ}, + z = {ź,ż,ž,ẑ,ẓ,ẕ}, + } + +%%% ----------------------------------------------------------------------- +%%% PROTRUSION + +\SetProtrusion + [ name = palatino-default ] + { encoding = {EU1,EU2,TU}, + family = {Palatino} } + { + A = {50,50}, + D = { ,50}, + J = {50, }, + K = { ,50}, + L = { ,50}, + O = {25, }, + T = {50,50}, + V = {50,50}, + W = {50,50}, + X = {50,50}, + Y = {50,50}, + b = { ,25}, + d = {25,30}, + f = { ,50}, + g = { ,100}, + k = { ,50}, + p = { ,50}, + q = {50, }, + r = { ,50}, + t = { ,50}, st = { ,50}, ſt = { ,50}, + v = {75,50}, + w = {50,50}, + x = {50,50}, + y = {50,70}, + 1 = {100,50}, + 2 = {25,50}, + 4 = {50, }, + 6 = {50, }, + 9 = {25, }, + Æ = {100, }, + Œ = {25, }, + . = { ,700}, ‥ = { ,350}, … = {,150}, + {,}= { ,500}, + : = { ,500}, + ; = { ,500}, + ! = { ,100}, ‼ = { ,100}, + ? = { ,200}, ‽ = { ,200}, + @ = {50,50}, + ~ = {200,250}, + & = {50,100}, + \% = {100,100}, + * = {200,200}, + + = {250,250}, + ( = {100, }, ) = { ,300}, + / = {200,300}, + - = {400,500}, + \textendash = {300,300}, \textemdash = {200,200}, + \textquoteleft = {500,700}, \textquoteright = {500,700}, + \textquotedblleft = {300,400}, \textquotedblright = {300,400}, + \textbackslash = {200,300}, + \quotesinglbase = {400,400}, \quotedblbase = {400,400}, + \guilsinglleft = {400,400}, \guilsinglright = {300,500}, + \guillemotleft = {300,300}, \guillemotright = {200,400}, + \textexclamdown = {100, }, \textquestiondown = {100, }, + \textbraceleft = {400,200}, \textbraceright = {200,400}, + \textless = {200,100}, \textgreater = {100,200}, + ≤ = {200,100}, ≥ = {100,200}, + \textminus = {300,300}, + \texttrademark = {200,200}, + \textcopyright = {200,200}, + \textregistered = {200,200}, + \textdegree = {300,300}, + ¦ = {450,500}, ¬ = {250,150}, + ⌐ = {150,250}, + · = {850, 700}, + ¶ = {100,0}, + × = {150, 300}, + ª = {300,300}, º = {300,300}, + ⁰ = {200,400}, + ¹ = {400,350}, ² = {200,300}, ³ = {250,400}, + ⁴ = {250,350}, ⁵ = {200,300}, ⁶ = {250,400}, + ⁷ = {200,450}, ⁸ = {250,400}, ⁹ = {200,350}, + ₀ = {200,400}, + ₁ = {400,250}, ₂ = {200,300}, ₃ = {250,400}, + ₄ = {250,350}, ₅ = {200,300}, ₆ = {250,400}, + ₇ = {200,450}, ₈ = {250,400}, ₉ = {200,350}, + ± = {150,100}, ÷ = {300,300}, + þ = { ,25}, + ₊ = {300,450}, ₋ = {300,450}, + ⁺ = {300,450}, ⁻ = {300,450}, + † = {200,250}, ‡ = {200,250}, + π = {50, }, + ſ = { ,50}, + № = {100,150}, + \textservicemark = {100,200}, + ‐ = {400,500}, ‑ = {400,500}, ‒ = {200,300}, + – = {205,305}, — = {200,300}, ― = {50,150}, + • = {125,200}, + } + +\SetProtrusion + [ name = palatino-it ] + { encoding = {EU1,EU2,TU}, + family = {Palatino}, + shape = {it,sl} } + { + A = {50,50}, + Æ = {50, }, + B = {50, }, + C = {50, }, + D = {50,50}, + E = {50, }, + F = {50, }, + G = {50, }, + H = {50, }, + K = {50, }, + L = {50, }, + O = {50, }, + Œ = {50, }, + P = {50, }, + Q = {50, }, + R = {50, }, + S = {50, }, + $ = {50, }, + T = {100, }, + U = {50, }, + V = {100,50}, + W = {50, }, + X = {50, }, + Y = {100,50}, + b = { ,50}, + c = {25, }, + g = {75, }, + i = {25, }, + m = { ,50}, + n = { ,50}, + p = { ,25}, + q = {25, }, + x = { ,50}, + 1 = {100, }, + 2 = {50, }, + 4 = {50, }, + 7 = {50, }, + . = { ,500}, ‥ = { ,350}, … = { ,200}, + {,}= { ,500}, + : = { ,300}, + ; = { ,300}, + ? = { ,300}, ‽ = { ,300}, + & = {50,50}, + \% = {100,100}, + * = {200,200}, + + = {150,200}, + @ = {50,50}, + ~ = {200,150}, + ( = {200, }, ) = { ,200}, + / = {100,200}, + - = {300,500}, + \textendash = {300,300}, \textemdash = {200,200}, + \textquoteleft = {700,400}, \textquoteright = {700,400}, + \textquotedblleft = {500,300}, \textquotedblright = {500,300}, + _ = {100,100}, + \textbackslash = {100,200}, + \quotesinglbase = {500,500}, \quotedblbase = {400,400}, + \guilsinglleft = {400,400}, \guilsinglright = {300,500}, + \guillemotleft = {300,300}, \guillemotright = {300,300}, + \textexclamdown = {100, }, \textquestiondown = {200, }, + \textbraceleft = {200,100}, \textbraceright = {200,200}, + \textless = {300,100}, \textgreater = {200,100}, + ≤ = {200,100}, ≥ = {100,200}, + ¦ = {450,500}, ¬ = {250,150}, + · = {850, 700}, + ¶ = {100,0}, + × = {150, 300}, + ª = {300,250}, ° = {300,300}, º = {300,250}, + ⁰ = {300,200}, + ¹ = {300,150}, ² = {350,200}, ³ = {250,150}, + ⁴ = {350,100}, ⁵ = {300, 50}, ⁶ = {400,100}, + ⁷ = {400, 50}, ⁸ = {250, 50}, ⁹ = {300, 50}, + ₀ = {300,300}, + ₁ = {300,350}, ₂ = {300,150}, ₃ = {250,250}, + ₄ = {400,200}, ₅ = {300,100}, ₆ = {450,200}, + ₇ = {450,150}, ₈ = {400,250}, ₉ = {400,200}, + ± = {150,100}, ÷ = {300,300}, + þ = { 50, }, + † = {250,200}, ‡ = {250,200}, + ₊ = {300,450}, ₋ = {300,450}, + ⁺ = {300,450}, ⁻ = {300,450}, + ‐ = {300,500}, ‑ = {300,500}, ‒ = {100,300}, + – = {125,305}, — = {200,300}, ― = {125,150}, + • = {125,200} + } + +\SetProtrusion + [ name = palatino-sc, + load = palatino-default ] + { encoding = {EU1,EU2,TU}, + family = {Palatino}, + shape = sc } + { + a = {50,50}, + æ = {50, }, + b = { 0, 0}, + d = { 0, 0}, + f = { 0, 0}, + g = { 0, 0}, + j = {50, }, + l = { ,50}, + o = { 0, 0}, + p = { 0, 0}, + q = { 0, }, + r = { , 0}, + t = {50,50}, + y = {50,50}, + fl = { 0,50}, + ffl = { 0,50}, + ſt = { 0,50}, + st = { 0,50} + } + +\endinput +%% +%% End of file `mt-Palatino.cfg'. diff --git a/Master/texmf-dist/tex/latex/microtype/mt-bch.cfg b/Master/texmf-dist/tex/latex/microtype/mt-bch.cfg index 0e9e92ff3e7..362c79fc4c3 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-bch.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-bch.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-blg.cfg b/Master/texmf-dist/tex/latex/microtype/mt-blg.cfg index 53674f18aef..130bfb4490f 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-blg.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-blg.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-cmr.cfg b/Master/texmf-dist/tex/latex/microtype/mt-cmr.cfg index e3c6a4cfa62..ca83096e37e 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-cmr.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-cmr.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-euf.cfg b/Master/texmf-dist/tex/latex/microtype/mt-euf.cfg index 9fc0aa3f84d..fcd09591e5b 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-euf.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-euf.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-eur.cfg b/Master/texmf-dist/tex/latex/microtype/mt-eur.cfg index 6f1060f27d0..215d3110e8d 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-eur.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-eur.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-eus.cfg b/Master/texmf-dist/tex/latex/microtype/mt-eus.cfg index b73991daadb..501105f0b19 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-eus.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-eus.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-msa.cfg b/Master/texmf-dist/tex/latex/microtype/mt-msa.cfg index b7c7c37f2b7..06f49ce8c1c 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-msa.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-msa.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-msb.cfg b/Master/texmf-dist/tex/latex/microtype/mt-msb.cfg index 94e45bbdb7a..f54a6d474b0 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-msb.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-msb.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-mvs.cfg b/Master/texmf-dist/tex/latex/microtype/mt-mvs.cfg index 3337978da52..2585d715a0b 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-mvs.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-mvs.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-pmn.cfg b/Master/texmf-dist/tex/latex/microtype/mt-pmn.cfg index eb9bf265add..a0a853e8fa1 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-pmn.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-pmn.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-ppl.cfg b/Master/texmf-dist/tex/latex/microtype/mt-ppl.cfg index 09f9beded6e..1c55ce86933 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-ppl.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-ppl.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-ptm.cfg b/Master/texmf-dist/tex/latex/microtype/mt-ptm.cfg index dc17fb071f8..e00d1106e8c 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-ptm.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-ptm.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-ugm.cfg b/Master/texmf-dist/tex/latex/microtype/mt-ugm.cfg index 7f8657a2f36..6f9740c4acb 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-ugm.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-ugm.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/microtype/mt-zpeu.cfg b/Master/texmf-dist/tex/latex/microtype/mt-zpeu.cfg index e1dd43776b2..7c963c7054c 100644 --- a/Master/texmf-dist/tex/latex/microtype/mt-zpeu.cfg +++ b/Master/texmf-dist/tex/latex/microtype/mt-zpeu.cfg @@ -10,7 +10,7 @@ %% %% The `microtype' package %% Subliminal refinements towards typographical perfection -%% Copyright (c) 2004--2020 R Schlicht <w.m.l@gmx.net> +%% Copyright (c) 2004--2021 R Schlicht <w.m.l@gmx.net> %% %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty index 6a423f2b113..3a1076b1831 100644 --- a/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty +++ b/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty @@ -18,8 +18,8 @@ %% and version 1.3 or later is part of all distributions of %% LaTeX version 2005/12/01 or later. %% -\def\myfileversion{5.10} -\def\myfiledate{2021/02/05} +\def\myfileversion{5.11} +\def\myfiledate{2021/02/22} \RequirePackage{pgfcore} \usepgfmodule{shapes} \RequirePackage{l3keys2e} @@ -28,6 +28,7 @@ {\myfiledate} {\myfileversion} {Enhanced arrays with the help of PGF/TikZ} +\RequirePackage { xparse } \RequirePackage { array } \RequirePackage { amsmath } \cs_new_protected:Npn \__nicematrix_error:n { \msg_error:nn { nicematrix } } @@ -272,6 +273,8 @@ \__nicematrix_fatal:n { Outside~math~mode } \fi: } +\tl_new:N \l__nicematrix_letter_vlism_tl +\seq_new:N \g__nicematrix_cols_vlism_seq \colorlet { nicematrix-last-col } { . } \colorlet { nicematrix-last-row } { . } \str_new:N \g__nicematrix_name_env_str @@ -299,7 +302,6 @@ \dim_zero_new:N \l_tmpc_dim \dim_zero_new:N \l_tmpd_dim \bool_new:N \g__nicematrix_empty_cell_bool -\dim_new:N \__nicematrix_old_arraycolsep_dim \dim_new:N \g__nicematrix_width_last_col_dim \dim_new:N \g__nicematrix_width_first_col_dim \seq_new:N \g__nicematrix_blocks_seq @@ -316,6 +318,11 @@ \tl_set:Nn \l__nicematrix_pos_of_block_tl { c } \bool_new:N \l__nicematrix_draw_first_bool \int_new:N \g__nicematrix_block_box_int +\dim_new:N \l__nicematrix_submatrix_extra_height_dim +\dim_new:N \l__nicematrix_submatrix_left_xshift_dim +\dim_new:N \l__nicematrix_submatrix_right_xshift_dim +\clist_new:N \l__nicematrix_submatrix_hlines_clist +\clist_new:N \l__nicematrix_submatrix_vlines_clist \int_new:N \l__nicematrix_first_row_int \int_set:Nn \l__nicematrix_first_row_int 1 \int_new:N \l__nicematrix_first_col_int @@ -500,7 +507,7 @@ down .tl_set:N = \l__nicematrix_xdots_down_tl , up .tl_set:N = \l__nicematrix_xdots_up_tl , draw-first .code:n = \prg_do_nothing: , - unknown .code:n = \__nicematrix_error:n { Unknown~option~for~xdots } + unknown .code:n = \__nicematrix_error:n { Unknown~key~for~xdots } } \keys_define:nn { NiceMatrix / rules } { @@ -511,6 +518,8 @@ } \keys_define:nn { NiceMatrix / Global } { + rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } , + rules .value_required:n = true , standard-cline .bool_set:N = \l__nicematrix_standard_cline_bool , standard-cline .default:n = true , cell-space-top-limit .dim_set:N = \l__nicematrix_cell_space_top_limit_dim , @@ -543,6 +552,13 @@ code-for-last-row .value_required:n = true , hlines .bool_set:N = \l__nicematrix_hlines_bool , vlines .bool_set:N = \l__nicematrix_vlines_bool , + vlines-in-sub-matrix .code:n = + { + \tl_if_single_token:nTF { #1 } + { \tl_set:Nn \l__nicematrix_letter_vlism_tl { #1 } } + { \__nicematrix_error:n { One~letter~allowed } } + } , + vlines-in-sub-matrix .value_required:n = true , hvlines .code:n = { \bool_set_true:N \l__nicematrix_vlines_bool @@ -674,6 +690,7 @@ NiceMatrixOptions / rules .inherit:n = NiceMatrix / rules , NiceMatrixOptions / notes .inherit:n = NiceMatrix / notes , NiceMatrixOptions / sub-matrix .inherit:n = NiceMatrix / sub-matrix , + SubMatrix / rules .inherit:n = NiceMatrix / rules , CodeAfter / xdots .inherit:n = NiceMatrix / xdots , NiceMatrix .inherit:n = { @@ -706,6 +723,8 @@ } \keys_define:nn { NiceMatrix / NiceMatrixOptions } { + delimiters / color .tl_set:N = \l__nicematrix_delimiters_color_tl , + delimiters / color .value_required:n = true , delimiters-color .tl_set:N = \l__nicematrix_delimiters_color_tl , delimiters-color .value_required:n = true , last-col .code:n = \tl_if_empty:nF { #1 } @@ -734,7 +753,7 @@ { \tl_if_single_token:nTF { #1 } { \str_set:Nx \l__nicematrix_letter_for_dotted_lines_str { #1 } } - { \__nicematrix_error:n { Bad~value~for~letter~for~dotted~lines } } + { \__nicematrix_error:n { One~letter~allowed } } } , letter-for-dotted-lines .value_required:n = true , notes .code:n = \keys_set:nn { NiceMatrix / notes } { #1 } , @@ -760,6 +779,8 @@ r .code:n = \tl_set:Nn \l__nicematrix_type_of_col_tl r , small .bool_set:N = \l__nicematrix_small_bool , small .value_forbidden:n = true , + delimiters / color .tl_set:N = \l__nicematrix_delimiters_color_tl , + delimiters / color .value_required:n = true , delimiters-color .tl_set:N = \l__nicematrix_delimiters_color_tl , delimiters-color .value_required:n = true , unknown .code:n = \__nicematrix_error:n { Unknown~option~for~NiceMatrix } @@ -779,6 +800,8 @@ tabularnote .value_required:n = true , delimiters-color .tl_set:N = \l__nicematrix_delimiters_color_tl , delimiters-color .value_required:n = true , + delimiters / color .tl_set:N = \l__nicematrix_delimiters_color_tl , + delimiters / color .value_required:n = true , unknown .code:n = \__nicematrix_error:n { Unknown~option~for~NiceArray } } \keys_define:nn { NiceMatrix / pNiceArray } @@ -1223,6 +1246,7 @@ { \pgfpointdiff \__nicematrix_picture_position: \__nicematrix_node_position: } } \endpgfpicture + \__nicematrix_create_diag_nodes: \group_begin: \bool_if:NT \c__nicematrix_tikz_loaded_bool { @@ -1436,6 +1460,7 @@ { ! { \skip_horizontal:N \arrayrulewidth } } } { \tl_gclear:N \g__nicematrix_preamble_tl } + \seq_clear:N \g__nicematrix_cols_vlism_seq \int_zero:N \l_tmpa_int \exp_after:wN \__nicematrix_patch_preamble:n \the \@temptokena \q_stop \int_gset_eq:NN \g__nicematrix_static_num_of_col_int \c@jCol @@ -1473,8 +1498,7 @@ } \dim_compare:nNnT \l__nicematrix_tabular_width_dim = \c_zero_dim { - \tl_gput_right:Nn - \g__nicematrix_preamble_tl + \tl_gput_right:Nn \g__nicematrix_preamble_tl { > { \__nicematrix_error_too_much_cols: } l } } \group_end: @@ -1511,14 +1535,24 @@ \str_if_eq:VnTF \l__nicematrix_letter_for_dotted_lines_str { #1 } { \__nicematrix_patch_preamble_xi:n #1 } { - \bool_lazy_and:nnTF - { \str_if_eq_p:nn { : } { #1 } } - \c__nicematrix_arydshln_loaded_bool + \str_if_eq:VnTF \l__nicematrix_letter_vlism_tl { #1 } { - \tl_gput_right:Nn \g__nicematrix_preamble_tl { : } + \seq_gput_right:Nx \g__nicematrix_cols_vlism_seq + { \int_eval:n { \c@jCol + 1 } } + \tl_gput_right:Nx \g__nicematrix_preamble_tl + { \exp_not:N ! { \skip_horizontal:N \arrayrulewidth } } \__nicematrix_patch_preamble:n } - { \__nicematrix_fatal:nn { unknown~column~type } { #1 } } + { + \bool_lazy_and:nnTF + { \str_if_eq_p:nn { : } { #1 } } + \c__nicematrix_arydshln_loaded_bool + { + \tl_gput_right:Nn \g__nicematrix_preamble_tl { : } + \__nicematrix_patch_preamble:n + } + { \__nicematrix_fatal:nn { unknown~column~type } { #1 } } + } } } } @@ -1576,11 +1610,15 @@ \__nicematrix_Cell: \begin { minipage } [ #1 ] { #3 } \mode_leave_vertical: - \arraybackslash % added in the version 5.8 - \box_use:N \@arstrutbox + \arraybackslash + \vrule height \box_ht:N \@arstrutbox depth 0 pt width 0 pt % v. 5.11 } c - < { \box_use:N \@arstrutbox \end { minipage } \__nicematrix_end_Cell: } + < { + \vrule height 0 pt depth \box_dp:N \@arstrutbox width 0 pt % v. 5.11 + \end { minipage } + \__nicematrix_end_Cell: + } } \int_gincr:N \c@jCol \__nicematrix_patch_preamble_x:n @@ -2062,6 +2100,7 @@ { > { + \cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter_i:n \bool_gset_true:N \g__nicematrix_after_col_zero_bool \__nicematrix_begin_of_row: \hbox_set:Nw \l__nicematrix_cell_box @@ -2106,6 +2145,7 @@ { > { + \cs_set_eq:NN \CodeAfter \__nicematrix_CodeAfter_i:n \bool_gset_true:N \g__nicematrix_last_col_found_bool \int_gincr:N \c@jCol \int_gset_eq:NN \g__nicematrix_col_total_int \c@jCol @@ -2286,6 +2326,14 @@ } \iow_now:Nn \@mainaux \ExplSyntaxOff } + \__nicematrix_create_diag_nodes: + \str_if_empty:NF \l__nicematrix_name_str + { + \pgfpicture + \pgfrememberpicturepositiononpagetrue + \pgfnodealias { \l__nicematrix_name_str - ##1 } { \__nicematrix_env: - ##1 } + \endpgfpicture + } \bool_if:NT \l__nicematrix_parallelize_diags_bool { \int_gzero_new:N \g__nicematrix_ddots_int @@ -2409,6 +2457,19 @@ \cs_if_exist:NT \theiRow { \int_gset_eq:NN \c@iRow \l__nicematrix_old_iRow_int } \cs_if_exist:NT \thejCol { \int_gset_eq:NN \c@jCol \l__nicematrix_old_jCol_int } } +\cs_new_protected:Npn \__nicematrix_create_diag_nodes: + { + \int_step_inline:nn { \int_max:nn \c@iRow \c@jCol + 1 } + { + \pgfpicture + \pgfrememberpicturepositiononpagetrue + \__nicematrix_qpoint:n { row - \int_min:nn { ##1 } { \c@iRow + 1 } } + \dim_set_eq:NN \l_tmpa_dim \pgf@y + \__nicematrix_qpoint:n { col - \int_min:nn { ##1 } { \c@jCol + 1 } } + \pgfcoordinate { \__nicematrix_env: - ##1 } { \pgfpoint \pgf@x \l_tmpa_dim } + \endpgfpicture + } + } \cs_new_protected:Npn \__nicematrix_find_extremities_of_line:nnnn #1 #2 #3 #4 { \cs_set:cpn { __nicematrix _ dotted _ #1 - #2 } { } @@ -3407,7 +3468,7 @@ \cs_if_free_p:c { pgf @ sh @ ns @ \__nicematrix_env: - #2 } } { - \__nicematrix_error:nnn { unknown~cell~for~line~in~code-after } { #1 } { #2 } + \__nicematrix_error:nnn { unknown~cell~for~line~in~CodeAfter } { #1 } { #2 } } { \__nicematrix_draw_line_ii:nn { #1 } { #2 } } } @@ -3537,7 +3598,7 @@ cols .tl_set:N = \l__nicematrix_cols_tl , restart .bool_set:N = \l__nicematrix_rowcolors_restart_bool , restart .default:n = true , - unknown .code:n = \__nicematrix_error:n { Unknown~option~for~rowcolors } + unknown .code:n = \__nicematrix_error:n { Unknown~key~for~rowcolors } } \NewDocumentCommand \__nicematrix_rowcolors { O { } m m m O { } } { @@ -3740,11 +3801,11 @@ { \bool_gset_true:N \g_tmpa_bool \seq_map_inline:Nn \g__nicematrix_pos_of_blocks_seq - { \__nicematrix_test_if_vline_in_block:nnnn ##1 } + { \__nicematrix_test_vline_in_block:nnnn ##1 } \seq_map_inline:Nn \g__nicematrix_pos_of_xdots_seq - { \__nicematrix_test_if_vline_in_block:nnnn ##1 } + { \__nicematrix_test_vline_in_block:nnnn ##1 } \seq_map_inline:Nn \g__nicematrix_pos_of_stroken_blocks_seq - { \__nicematrix_test_if_vline_in_stroken_block:nnnn ##1 } + { \__nicematrix_test_vline_in_stroken_block:nnnn ##1 } \clist_if_empty:NF \l__nicematrix_except_corners_clist \__nicematrix_test_in_corner_v: \bool_if:NTF \g_tmpa_bool @@ -3862,11 +3923,11 @@ { \bool_gset_true:N \g_tmpa_bool \seq_map_inline:Nn \g__nicematrix_pos_of_blocks_seq - { \__nicematrix_test_if_hline_in_block:nnnn ##1 } + { \__nicematrix_test_hline_in_block:nnnn ##1 } \seq_map_inline:Nn \g__nicematrix_pos_of_xdots_seq - { \__nicematrix_test_if_hline_in_block:nnnn ##1 } + { \__nicematrix_test_hline_in_block:nnnn ##1 } \seq_map_inline:Nn \g__nicematrix_pos_of_stroken_blocks_seq - { \__nicematrix_test_if_hline_in_stroken_block:nnnn ##1 } + { \__nicematrix_test_hline_in_stroken_block:nnnn ##1 } \clist_if_empty:NF \l__nicematrix_except_corners_clist \__nicematrix_test_in_corner_h: \bool_if:NTF \g_tmpa_bool { @@ -3986,7 +4047,7 @@ { \__nicematrix_hline:nn { \__nicematrix_succ:n { \c@iRow } } { #1 } } \ifnum 0 = `{ \fi } } -\cs_new_protected:Npn \__nicematrix_test_if_hline_in_block:nnnn #1 #2 #3 #4 +\cs_new_protected:Npn \__nicematrix_test_hline_in_block:nnnn #1 #2 #3 #4 { \bool_lazy_all:nT { @@ -3997,7 +4058,7 @@ } { \bool_gset_false:N \g_tmpa_bool } } -\cs_new_protected:Npn \__nicematrix_test_if_vline_in_block:nnnn #1 #2 #3 #4 +\cs_new_protected:Npn \__nicematrix_test_vline_in_block:nnnn #1 #2 #3 #4 { \bool_lazy_all:nT { @@ -4008,7 +4069,7 @@ } { \bool_gset_false:N \g_tmpa_bool } } -\cs_new_protected:Npn \__nicematrix_test_if_hline_in_stroken_block:nnnn #1 #2 #3 #4 +\cs_new_protected:Npn \__nicematrix_test_hline_in_stroken_block:nnnn #1 #2 #3 #4 { \bool_lazy_all:nT { @@ -4019,7 +4080,7 @@ } { \bool_gset_false:N \g_tmpa_bool } } -\cs_new_protected:Npn \__nicematrix_test_if_vline_in_stroken_block:nnnn #1 #2 #3 #4 +\cs_new_protected:Npn \__nicematrix_test_vline_in_stroken_block:nnnn #1 #2 #3 #4 { \bool_lazy_all:nT { @@ -4176,11 +4237,9 @@ \bool_if:NTF \l__nicematrix_NiceArray_bool \c_zero_dim \arraycolsep + \l__nicematrix_right_margin_dim } - \tl_set:Nn \l_tmpa_tl { ( } - \tl_if_eq:NNF \l__nicematrix_left_delim_tl \l_tmpa_tl + \tl_if_eq:NnF \l__nicematrix_left_delim_tl ( { \dim_gadd:Nn \l__nicematrix_x_initial_dim { 0.5 \l__nicematrix_inter_dots_dim } } - \tl_set:Nn \l_tmpa_tl { ) } - \tl_if_eq:NNF \l__nicematrix_right_delim_tl \l_tmpa_tl + \tl_if_eq:NnF \l__nicematrix_right_delim_tl ) { \dim_gsub:Nn \l__nicematrix_x_final_dim { 0.5 \l__nicematrix_inter_dots_dim } } \tl_set_eq:NN \l__nicematrix_xdots_line_style_tl \c__nicematrix_standard_tl \__nicematrix_draw_line: @@ -4639,7 +4698,7 @@ draw .tl_set:N = \l__nicematrix_draw_tl , draw .default:n = default , color .code:n = - \__nicematrix_error:n { Key~color~for~Block } + \__nicematrix_fatal:n { Key~color~for~Block } \tl_set:Nn \l__nicematrix_fill_tl { #1 } , % color .code:n = \color { #1 } \tl_set:Nn \l__nicematrix_draw_tl { #1 } , color .value_required:n = true , @@ -4668,9 +4727,7 @@ \int_compare:nNnTF { #4 } > { 99 } { \int_set_eq:NN \l__nicematrix_last_col_int \c@jCol } { \int_set:Nn \l__nicematrix_last_col_int { #4 } } - \bool_lazy_or:nnTF - { \int_compare_p:nNn \l__nicematrix_last_row_int > \g__nicematrix_row_total_int } - { \int_compare_p:nNn \l__nicematrix_last_col_int > \g__nicematrix_col_total_int } + \int_compare:nNnTF \l__nicematrix_last_col_int > \g__nicematrix_col_total_int { \int_compare:nTF { \l__nicematrix_last_col_int <= \g__nicematrix_static_num_of_col_int } @@ -4684,7 +4741,11 @@ } { \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } } } - { \__nicematrix_Block_v:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } } + { + \int_compare:nNnTF \l__nicematrix_last_row_int > \g__nicematrix_row_total_int + { \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } } + { \__nicematrix_Block_v:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } } + } } \cs_new_protected:Npn \__nicematrix_Block_v:nnnnnn #1 #2 #3 #4 #5 #6 { @@ -5052,13 +5113,16 @@ { \__nicematrix_math_toggle_token: #6 \__nicematrix_math_toggle_token: } { } { } \endpgfpicture } +\keys_define:nn { NiceMatrix } + { CodeAfter / rules .inherit:n = NiceMatrix / rules } \keys_define:nn { NiceMatrix / CodeAfter } { - sub-matrix .code:n = - \keys_set:nn { NiceMatrix / sub-matrix } { #1 } , + sub-matrix .code:n = \keys_set:nn { NiceMatrix / sub-matrix } { #1 } , sub-matrix .value_required:n = true , - delimiters-color .tl_set:N = \l__nicematrix_delimiters_color_tl , - delimiters-color .value_required:n = true , + delimiters / color .tl_set:N = \l__nicematrix_delimiters_color_tl , + delimiters / color .value_required:n = true , + rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } , + rules .value_required:n = true , unknown .code:n = \__nicematrix_error:n { Unknown~key~for~CodeAfter } } \cs_new:Npn \__nicematrix_CodeAfter: { \omit \__nicematrix_CodeAfter_i:n } @@ -5069,8 +5133,7 @@ } \cs_new_protected:Npn \__nicematrix_CodeAfter_ii:n #1 { - \str_if_eq:eeTF \@currenvir { #1 } - { \end { #1 } } + \str_if_eq:eeTF \@currenvir { #1 } { \end { #1 } } { \tl_gput_right:Nn \g_nicematrix_code_after_tl { \end { #1 } } \__nicematrix_CodeAfter_i:n @@ -5142,18 +5205,22 @@ right-xshift .value_required:n = true , xshift .meta:n = { left-xshift = #1, right-xshift = #1 } , xshift .value_required:n = true , - delimiters-color .tl_set:N = \l__nicematrix_delimiters_color_tl , - delimiters-color .value_required:n = true , + delimiters / color .tl_set:N = \l__nicematrix_delimiters_color_tl , + delimiters / color .value_required:n = true , slim .bool_set:N = \l__nicematrix_submatrix_slim_bool , slim .default:n = true , } \keys_define:nn { NiceMatrix } { - SubMatrix .inherit:n = NiceMatrix /sub-matrix , - CodeAfter / sub-matrix .inherit:n = NiceMatrix / sub-matrix + SubMatrix .inherit:n = NiceMatrix / sub-matrix , + CodeAfter / sub-matrix .inherit:n = NiceMatrix / sub-matrix , } \keys_define:nn { NiceMatrix / SubMatrix } { + hlines .clist_set:N = \l__nicematrix_submatrix_hlines_clist , + hlines .default:n = all , + vlines .clist_set:N = \l__nicematrix_submatrix_vlines_clist , + vlines .default:n = all , name .code:n = \tl_if_empty:nTF { #1 } { \__nicematrix_error:n { Invalid~name~format } } @@ -5169,6 +5236,8 @@ } { \__nicematrix_error:n { Invalid~name~format } } } , + rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } , + rules .value_required:n = true , name .value_required:n = true , unknown .code:n = \__nicematrix_error:n { Unknown~key~for~SubMatrix } } @@ -5186,9 +5255,6 @@ { \int_compare_p:nNn \l_tmpd_tl > \g__nicematrix_col_total_int } { \__nicematrix_error:n { SubMatrix~too~large } } { - \dim_zero_new:N \l__nicematrix_submatrix_extra_height_dim - \dim_zero_new:N \l__nicematrix_submatrix_left_xshift_dim - \dim_zero_new:N \l__nicematrix_submatrix_right_xshift_dim \str_clear_new:N \l__nicematrix_submatrix_name_str \keys_set:nn { NiceMatrix / SubMatrix } { #5 } \pgfpicture @@ -5245,12 +5311,79 @@ \l__nicematrix_submatrix_extra_height_dim - \arrayrulewidth } \dim_set_eq:NN \nulldelimiterspace \c_zero_dim + \group_begin: + \pgfsetlinewidth { 1.1 \arrayrulewidth } + \tl_if_empty:NF \l__nicematrix_rules_color_tl + { \exp_after:wN \__nicematrix_set_CT@arc@: \l__nicematrix_rules_color_tl \q_stop } + \CT@arc@ + \seq_map_inline:Nn \g__nicematrix_cols_vlism_seq + { + \int_compare:nNnT \l_tmpb_tl < { ##1 } + { + \int_compare:nNnT { ##1 } < { \int_eval:n { \l_tmpd_tl + 1 } } + { + \__nicematrix_qpoint:n { col - ##1 } + \pgfpathmoveto { \pgfpoint \pgf@x \l__nicematrix_y_initial_dim } + \pgfpathlineto { \pgfpoint \pgf@x \l__nicematrix_y_final_dim } + \pgfusepathqstroke + } + } + } + \tl_if_eq:NnTF \l__nicematrix_submatrix_vlines_clist { all } + { \int_step_inline:nn { \l_tmpd_tl - \l_tmpb_tl } } + { \clist_map_inline:Nn \l__nicematrix_submatrix_vlines_clist } + { + \bool_lazy_and:nnTF + { \int_compare_p:nNn { ##1 } > 0 } + { \int_compare_p:nNn { ##1 } < { \l_tmpd_tl - \l_tmpb_tl + 1 } } + { + \__nicematrix_qpoint:n { col - \int_eval:n { ##1 + \l_tmpb_tl } } + \pgfpathmoveto { \pgfpoint \pgf@x \l__nicematrix_y_initial_dim } + \pgfpathlineto { \pgfpoint \pgf@x \l__nicematrix_y_final_dim } + \pgfusepathqstroke + } + { \__nicematrix_error:nnn { Wrong~line~in~SubMatrix } { vertical } { ##1 } } + } + \tl_if_eq:NnTF \l__nicematrix_submatrix_hlines_clist { all } + { \int_step_inline:nn { \l_tmpc_tl - \l_tmpa_tl } } + { \clist_map_inline:Nn \l__nicematrix_submatrix_hlines_clist } + { + \bool_lazy_and:nnTF + { \int_compare_p:nNn { ##1 } > 0 } + { \int_compare_p:nNn { ##1 } < { \l_tmpc_tl - \l_tmpa_tl + 1 } } + { + \__nicematrix_qpoint:n { row - \int_eval:n { ##1 + \l_tmpa_tl } } + \group_begin: + \dim_set:Nn \l_tmpa_dim + { \l__nicematrix_x_initial_dim - \l__nicematrix_submatrix_left_xshift_dim } + \str_case:nn { #1 } + { + ( { \dim_sub:Nn \l_tmpa_dim { 0.9 mm } } + [ { \dim_sub:Nn \l_tmpa_dim { 0.2 mm } } + \{ { \dim_sub:Nn \l_tmpa_dim { 0.9 mm } } + } + \pgfpathmoveto { \pgfpoint \l_tmpa_dim \pgf@y } + \dim_set:Nn \l_tmpb_dim + { \l__nicematrix_x_final_dim + \l__nicematrix_submatrix_right_xshift_dim } + \str_case:nn { #4 } + { + ) { \dim_add:Nn \l_tmpb_dim { 0.9 mm } } + ] { \dim_add:Nn \l_tmpb_dim { 0.2 mm } } + \} { \dim_add:Nn \l_tmpb_dim { 0.9 mm } } + } + \pgfpathlineto { \pgfpoint \l_tmpb_dim \pgf@y } + \pgfusepathqstroke + \group_end: + } + { \__nicematrix_error:nnn { Wrong~line~in~SubMatrix } { horizontal } { ##1 } } + } \str_if_empty:NF \l__nicematrix_submatrix_name_str { \__nicematrix_pgf_rect_node:nnnnn \l__nicematrix_submatrix_name_str \l__nicematrix_x_initial_dim \l__nicematrix_y_initial_dim \l__nicematrix_x_final_dim \l__nicematrix_y_final_dim } + \group_end: \begin { pgfscope } \pgftransformshift { @@ -5325,7 +5458,6 @@ { #2 } { } } -%% \medskip \bool_new:N \c__nicematrix_footnotehyper_bool \bool_new:N \c__nicematrix_footnote_bool \__nicematrix_msg_new:nnn { Unknown~option~for~package } @@ -5492,15 +5624,15 @@ Since~you~haven't~loaded~Tikz,~the~only~value~you~can~give~to~'line-style'~ is~'standard'.~If~you~go~on,~this~key~will~be~ignored. } -\__nicematrix_msg_new:nn { Unknown~option~for~xdots } +\__nicematrix_msg_new:nn { Unknown~key~for~xdots } { - As~for~now~there~is~only~three~key~available~here:~'color',~'line-style'~ + As~for~now,~there~is~only~three~key~available~here:~'color',~'line-style'~ and~'shorten'~(and~you~try~to~use~'\l_keys_key_str').~If~you~go~on,~ this~key~will~be~ignored. } -\__nicematrix_msg_new:nn { Unknown~option~for~rowcolors } +\__nicematrix_msg_new:nn { Unknown~key~for~rowcolors } { - As~for~now~there~is~only~two~keys~available~here:~'cols'~and~'respect-blocks'~ + As~for~now,~there~is~only~two~keys~available~here:~'cols'~and~'respect-blocks'~ (and~you~try~to~use~'\l_keys_key_str').~If~you~go~on,~ this~key~will~be~ignored. } @@ -5508,8 +5640,8 @@ { The~key~'color'~for~the~command~\token_to_str:N \Block\ is~deprecated:~you~should~use~'fill'~instead.\\ - You~can~go~on~for~this~time~but~remember~that~that~key~ - will~be~deleted~in~a~future~version. + This~error~is~fatal. + } \__nicematrix_msg_new:nn { ampersand~in~light-syntax } { @@ -5554,6 +5686,12 @@ A~name~must~be~accepted~by~the~regular~expression~[A-Za-z][A-Za-z0-9]*.\\ If~you~go~on,~this~key~will~be~ignored. } +\__nicematrix_msg_new:nn { Wrong~line~in~SubMatrix } + { + You~try~to~draw~a~#1~line~of~number~'#2'~in~a~ + \token_to_str:N \SubMatrix\ of~your~\__nicematrix_full_name_env:\ but~that~ + number~is~not~valid.~If~you~go~on,~it~will~be~ignored. + } \__nicematrix_msg_new:nn { empty~environment } { Your~\__nicematrix_full_name_env:\ is~empty.~This~error~is~fatal. } \__nicematrix_msg_new:nn { Delimiter~with~small } @@ -5562,7 +5700,7 @@ because~the~key~'small'~is~in~force.\\ This~error~is~fatal. } -\__nicematrix_msg_new:nn { unknown~cell~for~line~in~code-after } +\__nicematrix_msg_new:nn { unknown~cell~for~line~in~CodeAfter } { Your~command~\token_to_str:N\line\{#1\}\{#2\}~in~the~'code-after'~ can't~be~executed~because~a~cell~doesn't~exist.\\ @@ -5661,7 +5799,7 @@ (and~not~in~\token_to_str:N \vcenter).\\ This~error~is~fatal. } -\__nicematrix_msg_new:nn { Bad~value~for~letter~for~dotted~lines } +\__nicematrix_msg_new:nn { One~letter~allowed } { The~value~of~key~'\l_keys_key_str'~must~be~of~length~1.\\ If~you~go~on,~it~will~be~ignored. @@ -5685,17 +5823,31 @@ } { The~available~keys~are~(in~alphabetic~order):~ - delimiters-color,~ + delimiters/color,~ + rules~(with~the~subkeys~'color'~and~'width'),~ sub-matrix~(several~subkeys)~ and~xdots~(several~subkeys).~ The~latter~is~for~the~command~\token_to_str:N \line. } -\__nicematrix_msg_new:nn { Unknown~key~for~SubMatrix } +\__nicematrix_msg_new:nnn { Unknown~key~for~SubMatrix } { The~key~'\l_keys_key_str'~is~unknown.\\ - The~only~keys~available~here~are~'delimiters-color',~'extra-height',~ - 'left-xshift',~'name',~'right-xshift',~'slim'~and~'xshift'.\\ If~you~go~on,~this~key~will~be~ignored. \\ + For~a~list~of~the~available~keys~in~\token_to_str:N + \SubMatrix,~type~H~<return>. + } + { + The~available~keys~are~(in~alphabetic~order):~ + 'delimiters/color',~ + 'extra-height',~ + 'hlines',~ + 'left-xshift',~ + 'name',~ + 'right-xshift',~ + 'rules'~(with~the~subkeys~'color'~and~'width'),~ + 'slim',~ + 'vlines'~and~'xshift'~(which~set~both~'left-xshift'~ + and~'right-xshift').\\ } \__nicematrix_msg_new:nnn { Unknown~key~for~notes } { @@ -5735,7 +5887,7 @@ create-extra-nodes,~ create-medium-nodes,~ create-large-nodes,~ - delimiters-color,~ + delimiters/color,~ end-of-row,~ first-col,~ first-row,~ @@ -5752,6 +5904,7 @@ renew-dots,~ renew-matrix,~ right-margin,~ + rules~(with~the~subkeys~'color'~and~'width'),~ small,~ sub-matrix~(several~subkeys), vlines,~ @@ -5782,7 +5935,7 @@ create-extra-nodes,~ create-medium-nodes,~ create-large-nodes,~ - delimiters-color,~ + delimiters/color,~ extra-left-margin,~ extra-right-margin,~ first-col,~ @@ -5800,8 +5953,7 @@ nullify-dots,~ renew-dots,~ right-margin,~ - rules/color,~ - rules/width,~ + rules~(with~the~subkeys~'color'~and~'width'),~ small,~ t,~ vlines,~ @@ -5834,7 +5986,7 @@ create-extra-nodes,~ create-medium-nodes,~ create-large-nodes,~ - delimiters-color,~ + delimiters/color,~ extra-left-margin,~ extra-right-margin,~ first-col,~ @@ -5852,8 +6004,7 @@ r,~ renew-dots,~ right-margin,~ - rules/color,~ - rules/width,~ + rules~(with~the~subkeys~'color'~and~'width'),~ small,~ t,~ vlines,~ @@ -5903,8 +6054,7 @@ nullify-dots,~ renew-dots,~ right-margin,~ - rules/color,~ - rules/width,~ + rules~(with~the~subkeys~'color'~and~'width'),~ t,~ vlines,~ xdots/color,~ diff --git a/Master/texmf-dist/tex/latex/overlays/overlays.sty b/Master/texmf-dist/tex/latex/overlays/overlays.sty index c9efe7af7bd..a36eb71693e 100644 --- a/Master/texmf-dist/tex/latex/overlays/overlays.sty +++ b/Master/texmf-dist/tex/latex/overlays/overlays.sty @@ -1,14 +1,14 @@ -\ProvidesPackage{overlays}[2017/12/21 v2.10 Incremental slides] +\ProvidesPackage{overlays}[2021/02/23 v2.12 Incremental slides] -% Copyright (C) 2017 Andreas Nolda +% Copyright (C) 2021 Andreas Nolda % Author: Andreas Nolda <andreas@nolda.org> -% Version: 2.10 +% Version: 2.12 % 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 +% Project Public License, either version 1.3c of this license or (at your +% option) any later version. The latest version of this license is in +% http://www.latex-project.org/lppl.txt and version 1.3c or later is part of all % distributions of LaTeX version 2005/12/01 or later. % The following code is inspired by Matthias Meister's "present" package. It @@ -139,7 +139,7 @@ \foreach \i in {#2} {\afterassignment\getoverl@yspecb \overl@yspeca=0\i\relax - \pgfmathtruncatemacro\result{(#1>=\overl@yspeca) && (#1<=\overl@yspecb)}% + \pgfmathtruncatemacro\result{and((#1>=\overl@yspeca),(#1<=\overl@yspecb))}% \ifnum\result=1\relax \breakforeach \global\let\inoverl@yspec\@firstoftwo @@ -186,3 +186,11 @@ \newcommand{\psalert}[2]{\overl@y{#1}{{\psset@lertcolor {#2}}}{#2}} + +\newcommand{\alertsoff}{\renewcommand{\alert}[2]{##2}% + \renewcommand{\psalert}[2]{##2}} + +\newcommand{\overlaysoff}{\RenewEnviron{overlays}[1]% + {\maxoverl@y=##1% + \curoverl@y=##1% + \BODY}} diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty new file mode 100644 index 00000000000..60a55ad9c33 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty @@ -0,0 +1,221 @@ +%% +%% This is file `color.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% color.dtx (with options: `package') +%% +%% The source is maintained by the LaTeX Project team and bug +%% reports for it can be opened at https://latex-project.org/bugs/ +%% (but please observe conditions on bug reports sent to that address!) +%% +%% +%% color.dtx Copyright (C) 1994--1999 David Carlisle +%% Copyright (C) 2005-2020 David Carlisle, LaTeX3 Project +%% +%% This file is part of the Standard LaTeX `Graphics Bundle'. +%% It may be distributed under the terms of the LaTeX Project Public +%% License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.3c or, at your option, any later version. +%% +%% This file has the LPPL maintenance status "maintained". +%% +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{color-ltx} + [2021/02/22 v1.2d Standard LaTeX Color (patched for l3color) (DPC)] +\edef\Gin@codes{% + \catcode`\noexpand\^^A\the\catcode`\^^A\relax + \catcode`\noexpand\"\the\catcode`\"\relax + \catcode`\noexpand\*\the\catcode`\*\relax + \catcode`\noexpand\!\the\catcode`\!\relax + \catcode`\noexpand\:\the\catcode`\:\relax} +\catcode`\^^A=\catcode`\% +\catcode`\"=12 +\catcode`\*=11 +\catcode`\!=12 +\catcode`\:=12 +\providecommand\Gin@driver{} +\def\c@lor@error#1{% + \@latex@error{Undefined color #1}\@ehd} +\DeclareOption{monochrome}{% + \def\c@lor@error#1{\PackageInfo{color}{Undefined color #1}}% + \AtEndOfPackage{% + \colors@false + \def\set@color{% + \c@lor@special\m@ne + {color push \current@color}\aftergroup\reset@color}% + \def\reset@color{\c@lor@special\m@ne{color pop}}% + \def\set@page@color{% + \c@lor@special\m@ne{background \current@color}}% + \def\define@color#1#2{% + \c@lor@special\m@ne{define #1 #2}}}} +\DeclareOption{debugshow}{\catcode`\^^A=9 \let\GDebug\typeout} +\newif\ifGin@setpagesize\Gin@setpagesizetrue +\DeclareOption{setpagesize}{\Gin@setpagesizetrue} +\DeclareOption{nosetpagesize}{\Gin@setpagesizefalse} +\DeclareOption{dvips}{\def\Gin@driver{dvips.def}% + \def\c@lor@namefile{dvipsnam.def}} +\DeclareOption{xdvi}{\ExecuteOptions{dvips,monochrome}} +\DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}} +\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfm.def}} +\DeclareOption{dvipdfmx}{\def\Gin@driver{dvipdfmx.def}} +\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}} +\DeclareOption{luatex}{\def\Gin@driver{luatex.def}} +\DeclareOption{dvisvgm}{\def\Gin@driver{dvisvgm.def}} +\DeclareOption{xetex}{\def\Gin@driver{xetex.def}} +\DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}} +\DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}} +\DeclareOption{emtex}{\def\Gin@driver{emtex.def}} +\DeclareOption{dviwin}{\def\Gin@driver{dviwin.def}} +\DeclareOption{oztex}{\ExecuteOptions{dvips}} +\DeclareOption{textures}{\def\Gin@driver{textures.def}} +\DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}} +\DeclareOption{pctexwin}{\def\Gin@driver{pctexwin.def}} +\DeclareOption{pctexhp}{\def\Gin@driver{pctexhp.def}} +\DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}} +\DeclareOption{truetex}{\def\Gin@driver{truetex.def}} +\DeclareOption{tcidvi}{\def\Gin@driver{tcidvi.def}} +\DeclareOption{vtex}{\def\Gin@driver{vtex.def}} +\DeclareOption{dvipsnames}{\def\c@lor@namefile{dvipsnam.def}} +\DeclareOption{nodvipsnames}{\let\c@lor@namefile\relax} +\let\c@lor@usename\@gobble +\DeclareOption{usenames}{% + \def\c@lor@usename#1{% + \expandafter\color@named\csname\string\color @#1\endcsname{#1}}} +\DeclareRobustCommand\color{% + \@ifnextchar[\@undeclaredcolor\@declaredcolor} +\def\@undeclaredcolor[#1]#2{% + \@ifundefined{color@#1}% + {\c@lor@error{model `#1'}}% + {\csname color@#1\endcsname\current@color{#2}% + \set@color}% + \ignorespaces} +\def\@declaredcolor#1{% + \@ifundefined{\string\color @#1}% + {\c@lor@error{`#1'}}% + {\expandafter\let\expandafter\current@color + \csname\string\color @#1\endcsname + \set@color}% + \ignorespaces} +\protected\def\textcolor#1#{\@textcolor{#1}} +\def\@textcolor#1#2#3{\protect\leavevmode{\color#1{#2}#3}} +\protected\def\pagecolor{% + \begingroup + \let\ignorespaces\endgroup + \let\set@color\set@page@color + \color} +\protected\def\nopagecolor{% + \@ifundefined{no@page@color}{% + \PackageInfo{color}{\string\nopagecolor\space is not supported}% + }{% + \no@page@color + }% +} +\protected\def\definecolor#1#2#3{% + \@ifundefined{color@#2}% + {\c@lor@error{model `#2'}}% + {\@ifundefined{\string\color @#1}{}% + {\PackageInfo{color}{Redefining color #1}}% + \csname color@#2\expandafter\endcsname + \csname\string\color @#1\endcsname{#3}}% + \@expl@color@set@@nnn{#1}{#2}{#3}% + } +\protected\def\DefineNamedColor#1#2#3#4{% + \@ifundefined{define@color@#1}% + {\c@lor@error{model `#1'}}% + {\@ifundefined{color@#3}% + {\c@lor@error{model `#3'}}% + {\@ifundefined{col@#2}{}% + {\PackageInfo{color}{Redefining color #2 in named color model}}% + \csname color@#3\endcsname\@tempa{#4}% + \@expl@color@set@@nnn{#2}{#3}{#4}% + \csname define@color@#1\endcsname{#2}\@tempa + \c@lor@usename{#2}}}} +\@onlypreamble\DefineNamedColor +\protected\def\@expl@color@set@@nnn#1#2#3{} +\ifdefined\ExplSyntaxOn + \ExplSyntaxOn + \cs_gset_protected:Npn \@expl@color@set@@nnn #1 #2 #3 + { + \cs_if_exist:NT \color_set:nnn + { \cs_if_exist:cTF { __color_parse_model_ #2 :w } + { + \color_set:nnn {#1}{#2}{#3} + } + { %for dvi mode + \tl_if_eq:nnT{#2}{named} + { + \color_set:nn{#1}{#3} + } + } + } + } + \ExplSyntaxOff +\fi +\newif\ifcolors@ +\colors@true +\def\c@lor@special#1#2{% + \edef\@tempa{\write#1{#2}}\@tempa} +\InputIfFileExists{color.cfg}{}{} +\ProcessOptions +\if!\Gin@driver! + \PackageError{color} + {No driver specified} + {You should make a default driver option in a file \MessageBreak + color.cfg\MessageBreak + eg: \protect\ExecuteOptions{dvips}% + } +\else + \PackageInfo{color}{Driver file: \Gin@driver} + \@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{} +\fi +\@ifundefined{c@lor@namefile}{}{\input{\c@lor@namefile}} +\protected\def\normalcolor{\let\current@color\default@color\set@color} +\AtBeginDocument{\let\default@color\current@color} +\def\color@block#1#2#3{% + {\set@color\rlap{\ifcolors@\vrule\@width#1\@height#2\@depth#3\fi}}} +\protected\def\colorbox#1#{\color@box{#1}} +\def\color@box#1#2{\color@b@x\relax{\color#1{#2}}} +\protected\def\fcolorbox#1#{\color@fbox{#1}} +\def\color@fbox#1#2#3{% + \color@b@x{\fboxsep\z@\color#1{#2}\fbox}{\color#1{#3}}} + +\long\def\color@b@x#1#2#3{% + \leavevmode + \setbox\z@\hbox{\kern\fboxsep{\set@color#3}\kern\fboxsep}% + \dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@ + \dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@ + {#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}% + \box\z@}}} +\def\color@setgroup{\begingroup\set@color} +\let\color@begingroup\begingroup +\def\color@endgroup{\endgraf\endgroup} +\def\color@hbox{\hbox\bgroup\color@begingroup} +\def\color@vbox{\vbox\bgroup\color@begingroup} +\def\color@endbox{\color@endgroup\egroup} +\ifx\color@gray\@undefined + \ifx\color@rgb\@undefined + \else + \definecolor{black}{rgb}{0,0,0} + \definecolor{white}{rgb}{1,1,1} + \fi +\else + \definecolor{black}{gray}{0} + \definecolor{white}{gray}{1} +\fi +\ifx\color@rgb\@undefined\else + \definecolor{red}{rgb}{1,0,0} + \definecolor{green}{rgb}{0,1,0} + \definecolor{blue}{rgb}{0,0,1} +\fi +\ifx\color@cmyk\@undefined\else + \definecolor{cyan}{cmyk}{1,0,0,0} + \definecolor{magenta}{cmyk}{0,1,0,0} + \definecolor{yellow}{cmyk}{0,0,1,0} +\fi +\Gin@codes +\let\Gin@codes\relax +\endinput +%% +%% End of file `color.sty'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def new file mode 100644 index 00000000000..06cb3a8c5db --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def @@ -0,0 +1,3348 @@ +%% +%% This is file `hgeneric-testphase.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% hyperref-generic.dtx (with options: `package') +%% +%% Copyright (C) 2019-2021 The LaTeX Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "LaTeX PDF management testphase bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: hyperref-generic.dtx +\ProvidesFile{hgeneric-testphase.def} + [2021/02/22 v0.95a % + generic Hyperref driver for the LaTeX PDF management testphase bundle] + +\RequirePackage{etoolbox} %why? +\ExplSyntaxOn +\file_input:n {hyperref-colorschemes.def} +\ExplSyntaxOff +\ExplSyntaxOn +\prop_gput:Nnn \g_msg_module_name_prop { hyp }{ hyperref } +\msg_new:nnnn + { hyp } + { missing-resource-management } + { The~PDF~resource~management~is~required~for~this~hyperref~driver! } + { + Activate~it~with \\ + \tl_to_str:n{\RequirePackage{pdfmanagement-testphase}}\\ + \tl_to_str:n{\DeclareDocumentMetadata{<options>}}\\ + before~\tl_to_str:n{\documentclass} + } +\msg_new:nnnn + { hyp } + { pdfversion-disabled } + { + This~hyperref~driver~ignores~the~pdfversion~key!\\ + Set~the~pdfversion~in~\token_to_str:N \DeclareDocumentMetadata + } + { + For example:\\ + \tl_to_str:n + { + \DeclareDocumentMetadata { pdfversion=1.7 } + } + } +\msg_new:nnn + { hyp } + { key-dropped } + { + This~hyperref~driver~ignores~the~key~#1!\\ + Please~check~the~documentation. + } +\msg_new:nnn + { hyp } + { pdfa-no-push-button } + { PDF/A:~Push~button~with~JavaScript~is~prohibited } + +\msg_new:nnn + { hyp } + { pdfa-no-reset-button } + { PDF/A:~Reset~action~is~prohibited } +\msg_new:nnn + { hyp } + { pdfa-no-named-action } + { PDF/A:~Named~action~#1~is~prohibited } +\msg_new:nnn + { hyp } + { empty-destination-name } + { + Empty~destination~name,\\ + using~`#1' + } +\msg_new:nnn + { hyp } + { invalid-destination-value } + { + Invalid~value~`#1'~of~`#2' \\ + is~replaced~by~`Fit'~\msg_line_context:. + } +\msg_new:nnn + { hyp } + { ignore-deprecated-or-unknown-option-in-pdf-version } + { + Option~`#1'~is~unknown~or~deprecated~in\\ + pdf~version~#2.~Ignored. + } +\msg_new:nnn + { hyp } + { ignore-deprecated-or-unknown-value-in-pdf-version } + { + Value~`#1'~is~unknown~or~deprecated~in\\ + pdf~version~#2.~Ignored. + } +\msg_new:nnn + { hyp } + { replace-deprecated-or-unknown-value-in-pdf-version } + { + Value~`#1'~is~unknown~or~deprecated~in\\ + pdf~version~#2. Value~`#3'~is used instead. + } +\msg_new:nnn + { hyp } + { unknown-key } + { + unknown~key~#2~of~module~’#1’~set~to~’#3’. + } +\msg_new:nnn + { hyp } + { unknown-key-to-Hyp } + { + ignored~in~family~Hyp~unknown~key~#1. + } +\cs_new:Npn \__hyp_clist_display:n #1 {*~#1\\} +\msg_new:nnn + { hyp } + { unknown-choice } + { + Value~'#3'~is~invalid~for~key~'#1'.\\ + The~key~accepts~only~the~choices\\ + \clist_map_function:nN { #2 }\__hyp_clist_display:n + } + +\msg_new:nnn + { hyp } + { unknown-choice+empty } + { + Value~'#3'~is~invalid~for~key~'#1'.\\ + The~key~accepts~only~the~choices\\ + \clist_map_function:nN { #2 }\__hyp_clist_display:n + An~empty~value~removes~the~setting. + } + +\msg_new:nnn + { hyp } + { no-bool } + { + Value~'#2'~is~invalid~for~key~'#1'.\\ + The~key~accepts~only~the~choices\\ + *~true\\ + *~false \\ + *~and~an~empty~value~which~removes~the~setting.\\ + No~value~is~equivalent~to~using~`true`. + } +\cs_generate_variant:Nn\pdf_destination:nn {nf} +\chardef\Hy@VersionChecked=1 %don't check the version! +\cs_set_eq:NN \hypercalcbp \dim_to_decimal_in_bp:n +\providecommand\@pdfborder{} +\providecommand\@pdfborderstyle{} +\newcommand\OBJ@OCG@view {} % needed in hyperref +\def\Hy@numberline#1{#1\c_space_tl} %needed by bookmark +\HyPsd@LoadUnicode +\Hy@unicodetrue +\let\HyPsd@pdfencoding\HyPsd@pdfencoding@unicode +\Hy@DisableOption{unicode} +\cs_set_eq:NN \Hy@pdfminorversion \pdf_version_minor: +\cs_set_eq:NN \Hy@pdfmajorversion \pdf_version_major: +\legacy_if:nT { Hy@setpdfversion } + { + \msg_warning:nn { hyp }{ pdfversion-disabled } + } +\Hy@DisableOption{pdfversion} +\RenewDocumentCommand \Acrobatmenu { m m } + { + \hyper@linknamed {#1} {#2} + } +\cs_set_protected:Npn \hypersetup #1 + { + %\kvsetkeys{Hyp} {#1} + \keys_set:nn { hyp / setup }{ #1 } + } +\keys_define:nn { hyp / setup } + { + unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-key } + { hyp~/~setup }{ \l_keys_key_str } { #1 } + } + } +\cs_new_protected:Npn \__hyp_store_metadata:nn #1 #2 %#1 key, #2 value. + { + %\tl_set:cn {@#1}{#2} + \AddToDocumentProperties[hyperref]{#1}{#2} + } +\cs_generate_variant:Nn \__hyp_store_metadata:nn {xn,nx,xx} +\hook_new:n{hyp/link/cite} +\color_set:nnn {hyp/color/cite}{HTML}{2E7E2A} +\color_set:nn {hyp/color/citeborder}{hyp/color/cite!60!white} +\keys_define:nn { hyp / setup } + { + ,citecolor .code:n = {\__hyp_color_set:nn {hyp/color/cite}{#1}} + ,citebordercolor + .code:n = {\__hyp_color_set:nn {hyp/color/citeborder}{#1}} + } +\hook_gput_code:nnn { hyp/link/cite }{hyp/cite} + { + \keys_set:nn { hyp / setup } + { + ,linkbordercolor= hyp/color/citeborder + ,linkcolor = hyp/color/cite + } + } +\bool_lazy_and:nnF + { \cs_if_exist_p:N \pdfmanagement_if_active_p: }{ \pdfmanagement_if_active_p: } + { \msg_error:nn { hyp}{ missing-resource-management } } +\legacy_if:nT { Hy@bookmarks } + { + \AddToHook{begindocument/before}[hyperref/bookmark]{\RequirePackage{bookmark}} + } +\legacy_if:nT {Hy@draft} + { + \PassOptionsToPackage{draft}{bookmark} + } +\cs_new_protected:Npn \__hyp_ref_label:nn #1 #2 %label/attributes + { + \@bsphack + \ref_label:nn{#1}{#2} + \@esphack + } +\cs_generate_variant:Nn \__hyp_ref_label:nn {en} +\prg_new_eq_conditional:NNn \__hyp_ref_if_exist:nn \ref_if_exist:nn { p , T , F, TF } +\prg_generate_conditional_variant:Nnn \__hyp_ref_if_exist:nn {en} { p , T , F, TF } +\cs_new_protected:Npn \__hyp_ref_check:nn #1 #2 %label/attribute + { + \__hyp_ref_if_exist:nnF {#1}{#2} + { + \protect\G@refundefinedtrue + \@latex@warning + { + Reference~`\tl_to_str:n {#1}'~with~attribute~`\tl_to_str:n {#2}'~ + on~page~\thepage~\space undefined + } + } + } +\cs_generate_variant:Nn \__hyp_ref_check:nn {en} +\cs_new:Npn \__hyp_ref_value:nn #1 #2 + { + \ref_value:nn{#1}{#2} + } +\cs_generate_variant:Nn \__hyp_ref_value:nn {en} +\box_new:N \l__hyp_tmpa_box +\tl_new:N \l__hyp_tmpa_tl +\seq_new:N \l__hyp_tmpa_seq +\int_new:N \l__hyp_tmpa_int +\str_new:N \l__hyp_tmpa_str +\tl_new:N \l__hyp_dest_name_tmpa_tl +\tl_new:N \l__hyp_uri_tmpa_tl +\tl_new:N \l__hyp_filename_tmpa_tl +\tl_new:N \l__hyp_para_tmpa_tl +\str_new:N \l__hyp_text_tmpa_str +\str_new:N \g__hyp_text_tmpa_str +\tl_const:Nn \c__hyp_dest_undefined_tl {UNDEFINED} +\seq_const_from_clist:Nn \c__hyp_annot_types_seq + {url,link,file,menu,run} +\prop_const_from_keyval:Nn \c__hyp_map_annot_hyp_prop + { + URI = url, + GoTo = link, + GoToR = file, + Named = menu, + Launch= run + } +\prop_const_from_keyval:Nn \c__hyp_map_hyp_annot_prop + { + url = URI, + link = GoTo, + file = GoToR, + menu = Named, + run = Launch + } + +\tl_new:N \g__hyp_dest_pdfstartpage_tl +\tl_new:N \g__hyp_dest_pdfstartview_tl +\tl_new:N \l__hyp_dest_pdfremotestartview_tl +\tl_new:N \l__hyp_text_enc_uri_print_tl +\tl_new:N \l__hyp_text_enc_info_print_tl +\tl_new:N \l__hyp_text_enc_dest_tl +\tl_new:N \l__hyp_text_enc_dest_print_tl +\tl_new:N \l__hyp_text_enc_file_print_tl +\tl_new:N \l__hyp_text_enc_para_print_tl + +\tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/URI} +\tl_set:Nn \l__hyp_text_enc_info_print_tl {utf16/hex} +\tl_set:Nn \l__hyp_text_enc_dest_tl {utf8/string-raw} +\tl_set:Nn \l__hyp_text_enc_dest_print_tl {utf8/string} +\tl_set:Nn \l__hyp_text_enc_file_print_tl {utf8/string} +\tl_set:Nn \l__hyp_text_enc_para_print_tl {utf8/string} +\tl_new:N \l__hyp_dest_pdfview_tl +\str_new:N \g__hyp_bordercolormodel_str +\seq_map_inline:Nn \c__hyp_annot_types_seq + { + \bool_new:c {l_hyp_annot_color#1_bool} + } +\seq_map_inline:Nn \c__hyp_annot_types_seq + { + \bool_new:c {l_hyp_annot_ocgcolor#1_bool} + } +\seq_map_inline:Nn \c_pdfannot_link_types_seq + { + \bool_new:c {l__hyp_annot_#1_bool} + \bool_set_true:c {l__hyp_annot_#1_bool} + } +\box_new:N \l__hyp_dest_box + +\regex_const:Nn \c__hyp_dest_startview_regex + { + \A\ * + (?: + (?:XYZ (?:\ +(?:(?:\d+|\d*\.\d+)|null)){3}\ ) + | + (?:Fit\b|FitB\b) + | + (?:(?:FitH|FitV|FitBH|FitBV)(?:\ +(?:\d+|\d*\.\d+)|\ +null){1}) + | + (?:FitR (?:\ +\d+|\ +\d*\.\d+){4}\ ) + ) + } +\pdfdict_new:n {l__hyp_page/Trans} +\pdfdict_put:nnn {l__hyp_page/Trans}{Type}{/Trans} + +\hook_new:n {hyp/text/pdfstring} +\cs_new_protected:Npn \__hyp_text_purify:nN #1 #2 %#1 input, #2 str command + { + \str_set:Nx #2 {\text_purify:n { #1 } } + } +\cs_new_protected:Npn \__hyp_text_cleanup:N #1 + { + + } +\cs_new_protected:Npn \__hyp_text_string_from_unicode:nN #1 #2 + { + \pdf_string_from_unicode:nVN { #1 } #2 #2 + } +\cs_new_protected:Npn \__hyp_text_pdfstring:nnN #1 #2 #3 + { + \group_begin: + \Hy@pdfstringtrue + \hook_use:n {hyp/text/pdfstring} + \__hyp_text_purify:nN { #1 } \l__hyp_text_tmpa_str + \__hyp_text_cleanup:N \l__hyp_text_tmpa_str + \__hyp_text_string_from_unicode:nN { #2 } \l__hyp_text_tmpa_str + \str_gset_eq:NN \g__hyp_text_tmpa_str\l__hyp_text_tmpa_str + \group_end: + \str_set_eq:NN #3 \g__hyp_text_tmpa_str + } +\cs_generate_variant:Nn \__hyp_text_pdfstring:nnN {xnN,onN,xoN,ooN,noN} +\cs_new_protected:Npn\Hy@pstringdef #1 #2 + { \__hyp_text_pdfstring:xnN {#2} {utf8/string-raw}#1 } +\cs_new_protected:Npn \__hyp_text_pdfstring_info:nN #1 #2 + { + \__hyp_text_pdfstring:noN { #1 }{ \l__hyp_text_enc_info_print_tl } #2 + } +\cs_new_protected:Npn\__hyp_PageLabels_gpush: + { + \pdfmanagement_add:nnx {Catalog} {PageLabels}{<</Nums[\HyPL@Labels]>>} + } + +\def\Hy@PutCatalog #1 {} + +\legacy_if:nT { Hy@pdfpagelabels } + { + \cs_set_protected:Npn \HyPL@StorePageLabel #1 + { + \tl_gput_right:Nx \HyPL@Labels { \the\Hy@abspage<<#1>> } + \__hyp_PageLabels_gpush: + } + } +\Hy@WrapperDef \__hyp_destination:nn #1 #2 + { + \mode_if_horizontal:T { \@savsf\spacefactor } + \Hy@SaveLastskip %defined in hyperref + \Hy@VerboseAnchor{#1} %defined in hyperref, for debugging + \__hyp_text_pdfstring:xoN + { \HyperDestNameFilter{#1} } + { \l__hyp_text_enc_dest_tl } + \l__hyp_tmpa_tl + \str_if_eq:nnTF {#2} {fitrbox} + { + \exp_args:NV + \pdf_destination:nnnn \l__hyp_tmpa_tl + { \box_wd:N \l__hyp_dest_box } + { \box_ht:N \l__hyp_dest_box } + { \box_dp:N \l__hyp_dest_box } + } + { + \exp_args:NV + \pdf_destination:nf + { \l__hyp_tmpa_tl } + { #2 } + } + \Hy@RestoreLastskip %defined in hyperref + \mode_if_horizontal:T { \spacefactor\@savsf } + } +\cs_new_protected:Npn \hyper@anchor #1 + { + \exp_args:NnV + \__hyp_destination:nn {#1} \l__hyp_dest_pdfview_tl + } + +\cs_new_protected:Npn \hyper@anchorstart #1 + { + \Hy@activeanchortrue + \exp_args:NnV + \__hyp_destination:nn {#1} \l__hyp_dest_pdfview_tl + } + +\cs_new_protected:Npn \hyper@anchorend + { + \Hy@activeanchorfalse + } +\cs_new_protected:Npn \__hyp_link_goto_begin:nw #1 + { + \mode_leave_vertical: + \protected@edef \l__hyp_dest_name_tmpa_tl { #1 } + \tl_if_empty:NTF \l__hyp_dest_name_tmpa_tl + { + \msg_warning:nnx + { hyp } + { empty-destination-name } + { \c__hyp_dest_undefined_tl } + \tl_set_eq:NN \l__hyp_dest_name_tmpa_tl \c__hyp_dest_undefined_tl + } + { + \__hyp_text_pdfstring:xoN + { \exp_args:No \HyperDestNameFilter { \l__hyp_dest_name_tmpa_tl } } + { \l__hyp_text_enc_dest_tl } + \l__hyp_dest_name_tmpa_tl + } + \exp_args:No + \pdfannot_link_goto_begin:nw { \l__hyp_dest_name_tmpa_tl } + } + +\cs_new_protected:Npn \__hyp_link_goto_end: + { + \pdfannot_link_goto_end: + } + + +\cs_new_protected:Npn \hyper@link #1 #2 #3 %#1 context, #2=destination name, #3 content + { + \bool_if:NTF \l__hyp_annot_GoTo_bool + { + \Hy@VerboseLinkStart{#1}{#2} + \group_begin: + \hook_use:n {hyp/link/#1} + \__hyp_link_goto_begin:nw {#2}#3\Hy@xspace@end + \__hyp_link_goto_end: + \group_end: + \Hy@VerboseLinkStop + }{#3} + } + +\cs_new_protected:Npn \hyper@linkstart #1 #2 %#1 context, #2=destination name + { + \bool_if:NT \l__hyp_annot_GoTo_bool + { + \Hy@VerboseLinkStart{#1}{#2}% only for debug + \group_begin: + \hook_use:n {hyp/link/#1} + \__hyp_link_goto_begin:nw {#2} + } + } + +\cs_new_protected:Npn \hyper@linkend + { + \bool_if:NT \l__hyp_annot_GoTo_bool + { + \__hyp_link_goto_end: + \group_end: + \Hy@VerboseLinkStop + } + } +\pdfdict_new:n {l_hyp/annot/A/URI} +\pdfdict_put:nnn {l_hyp/annot/A/URI}{Type}{/Action} +\pdfdict_put:nnn {l_hyp/annot/A/URI}{S}{/URI} + +\cs_new_protected:Npn \hyper@linkurl #1 #2 %#1:link text #2: URI, + { + \bool_if:NTF \l__hyp_annot_URI_bool + { + \group_begin: + \__hyp_text_pdfstring:xoN + { #2} + { \l__hyp_text_enc_uri_print_tl } + \l__hyp_uri_tmpa_tl + \pdfdict_put:nno{l_hyp/annot/A/URI}{URI}{\l__hyp_uri_tmpa_tl} + \ifHy@href@ismap + \pdfdict_put:nnn{l_hyp/annot/A/URI}{IsMap}{true} + \fi + \tl_if_empty:NF \Hy@href@nextactionraw + { + \str_remove_once:Nn \Hy@href@nextactionraw {/Next} + \pdfdict_put:nno{l_hyp/annot/A/Next}{\Hy@href@nextactionraw} + } + \cs_set_eq:NN \# \c_hash_str + \cs_set_eq:NN \% \c_percent_str + \Hy@safe@activestrue + \mode_leave_vertical: + \pdfannot_link:nxn { URI } + { + /A + << + \pdfdict_use:n {l_hyp/annot/A/URI} + >> + } + { + #1 + \Hy@xspace@end + \Hy@VerboseLinkStop %where is the start?? + } + \group_end: + } + {#1} + } + +\pdfdict_new:n {l_hyp/annot/A/GoToR} +\pdfdict_put:nnn {l_hyp/annot/A/GoToR}{Type}{/Action} +\pdfdict_put:nnn {l_hyp/annot/A/GoToR}{S}{/GoToR} + +\cs_new_protected:Npn \hyper@linkfile #1 #2 #3 % link text, filename, destname + { + \bool_if:NTF \l__hyp_annot_GoToR_bool + { + \group_begin: + \tl_set:Nn \l__hyp_filename_tmpa_tl { #2 } + \Hy@CleanupFile \l__hyp_filename_tmpa_tl + \__hyp_text_pdfstring:ooN + { \l__hyp_filename_tmpa_tl } + { \l__hyp_text_enc_file_print_tl } + \l__hyp_filename_tmpa_tl + \pdfdict_put:nno {l_hyp/annot/A/GoToR}{F}{\l__hyp_filename_tmpa_tl} + \__hyp_text_pdfstring:nnN + { #3 } + { \l__hyp_text_enc_dest_print_tl } + \l__hyp_dest_name_tmpa_tl + \Hy@MakeRemoteAction + \tl_if_blank:eTF {#3} + { + \pdfdict_put:nnx {l_hyp/annot/A/GoToR}{D} + {[\Hy@href@page/\l__hyp_dest_pdfremotestartview_tl]} + } + { + \pdfdict_put:nno {l_hyp/annot/A/GoToR}{D}{\l__hyp_dest_name_tmpa_tl} + } + \tl_if_empty:NF \Hy@href@nextactionraw + { + \str_remove_once:Nn \Hy@href@nextactionraw {/Next} + \pdfdict_put:nno{l_hyp/annot/A/Next}{Next}{\Hy@href@nextactionraw} + } + \mode_leave_vertical: + \pdfannot_link:nxn %expansion?? + { GoToR } + { + /A<< + \pdfdict_use:n {l_hyp/annot/A/GoToR} + >> + } + { + #1\Hy@xspace@end + \Hy@VerboseLinkStop %where is the start?? + } + \group_end: + } + {#1} + } +\pdfdict_new:n {l_hyp/annot/A/Launch} +\pdfdict_put:nnn {l_hyp/annot/A/Launch}{Type}{/Action} +\pdfdict_put:nnn {l_hyp/annot/A/Launch}{S}{/Launch} + +\cs_new_protected:Npn \hyper@linklaunch #1 #2 #3 % filename, link text, Parameters + { + \bool_if:NTF \l__hyp_annot_Launch_bool + { + \group_begin: + \__hyp_text_pdfstring:nnN + { #1 } + { \l__hyp_text_enc_file_print_tl } + \l__hyp_filename_tmpa_tl + \pdfdict_put:nno {l_hyp/annot/A/Launch}{F}{\l__hyp_filename_tmpa_tl} + \__hyp_text_pdfstring:noN + { #3 } + { \l__hyp_text_enc_para_print_tl } + \l__hyp_para_tmpa_tl + \bool_if:nTF + { + \str_if_eq_p:Vn \l__hyp_para_tmpa_tl {()} + || + \pdf_version_compare_p:Nn > {1.9} + } + { + \pdfdict_remove:nn {l_hyp/annot/A/Launch}{Win} + } + { + \pdfdict_put:nnx {l_hyp/annot/A/Launch}{Win} + {<</P \l__hyp_para_tmpa_tl /F \l__hyp_filename_tmpa_tl >>} + } + \tl_if_empty:NF \Hy@href@nextactionraw + { + \str_remove_once:Nn \Hy@href@nextactionraw {/Next} + \pdfdict_put:nno{l_hyp/annot/A/Next}{Next}{\Hy@href@nextactionraw} + } + \mode_leave_vertical: + \pdfannot_link:nxn + { Launch } + { + /A + << + \pdfdict_use:n {l_hyp/annot/A/Launch} + >> + } + { + #2\Hy@xspace@end + \Hy@VerboseLinkStop %where is the start?? + } + \group_end: + } + {#2} + } +\use:x + { % filename, anchor text, linkname + \cs_set_protected:Npn \exp_not:N \@hyper@launch run \c_colon_str ##1 \exp_not:N \\ ##2 ##3 + } + { + \hyper@linklaunch {#1}{#2}{#3} + } +\pdfdict_new:n {l_hyp/annot/A/Named} +\pdfdict_put:nnn {l_hyp/annot/A/Named}{Type}{/Action} +\pdfdict_put:nnn {l_hyp/annot/A/Named}{S}{/Named} + +\cs_new_protected:Npn \hyper@linknamed #1 #2 %#1 action, #2 link text + { + \bool_if:NTF \l__hyp_annot_Named_bool + { + \group_begin: + \pdfmeta_standard_verify:nnTF {named_actions}{#1} + { + \mode_leave_vertical: + \pdfdict_put:nnx {l_hyp/annot/A/Named}{N} + {\pdf_name_from_unicode_e:n{#1}} + \tl_if_empty:NF \Hy@href@nextactionraw + { + \str_remove_once:Nn \Hy@href@nextactionraw {/Next} + \pdfdict_put:nno{l_hyp/annot/A/Next}{Next}{\Hy@href@nextactionraw} + } + \pdfannot_link:nxn { Named } + { + /A + << + \pdfdict_use:n { l_hyp/annot/A/Named } + >> + } + { + #2 + \Hy@xspace@end + \Hy@VerboseLinkStop + } + } + { + \msg_warning:nnn { hyp } { pdfa-no-named-action }{#1} + #2 + } + \group_end: + } + {#2} + } + +\cs_new_protected:Npn \__hyp_color_export:nnN #1 #2 #3 + { + \tl_if_head_eq_charcode:nNTF {#1}[ %] + { + \__hyp_colormodel_export:wnnN #1 {#2} #3 + } + { + \color_export:nnN {#1} {#2} #3 + } + } + +\cs_new_protected:Npn \__hyp_colormodel_export:wnnN [#1] #2 #3 #4 + { + \color_export:nnnN {#1}{#2}{#3}#4 + } + +\cs_generate_variant:Nn \__hyp_color_export:nnN {xVN} +\cs_new_protected:Npn \__hyp_color_select:n #1 + { + \tl_if_head_eq_charcode:nNTF {#1}[ %] + { + \__hyp_colormodel_select_aux:wn #1 + } + { + \color_select:n {#1} + } + } + +\cs_new_protected:Npn \__hyp_colormodel_select_aux:wn [#1] #2 + { + \color_select:nn {#1}{#2} + } + +\cs_generate_variant:Nn \__hyp_color_select:n {e} +\cs_new_protected:Npn \__hyp_color_set:nn #1 #2 + { + \tl_if_head_eq_charcode:nNTF {#2}[ %] + { + \__hyp_colormodel_set_aux:nwn { #1 } #2 + } + { + \color_set:nn {#1} {#2} + } + } + +\cs_new_protected:Npn \__hyp_colormodel_set_aux:nwn #1 [#2] #3 + { + \color_set:nnn {#1}{#2}{#3} + } + +\cs_generate_variant:Nn \__hyp_color_set:nn {ne} +\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \hook_gput_code:nnn + {pdfannot/link/#2/begin} + {hyp/color} + { + \bool_if:cT { l_hyp_annot_color#1_bool } + { + \group_begin: + \color_select:n { hyp/color/#1} + } + } + \hook_gput_code:nnn + {pdfannot/link/#2/end} + {hyp/color} + { + \bool_if:cT { l_hyp_annot_color#1_bool } + { + \group_end: + } + } + } +\keys_define:nn { hyp / setup } + { + ,colorlinks .meta:n = + { + ,pdfborder={0~0~0} + ,pdfborderstyle= + ,colorurl =#1 + ,colorlink =#1 + ,colorrun =#1 + ,colormenu =#1 + ,colorfile =#1 + } + ,colorlinks .default:n = {true} + } +\seq_map_inline:Nn \c__hyp_annot_types_seq + { + \keys_define:nn { hyp / setup } + { + ,color#1 .bool_set:c = { l_hyp_annot_color#1_bool } + ,#1color .code:n = { \__hyp_color_set:ne {hyp/color/#1}{##1} } + } + } + +\keys_define:nn { hyp / setup } + { + ,allcolors .meta:n = + { + ,urlcolor=#1 + ,linkcolor=#1 + ,runcolor=#1 + ,filecolor=#1 + ,menucolor=#1 + } + ,allcolors .value_required:n = true + } +\keys_define:nn { hyp / setup } + { + ,bordercolormodel .choices:nn = + {rgb,cmyk} + { \str_gset:Nn \g__hyp_bordercolormodel_str {space-sep-#1}} + ,bordercolormodel .initial:n ={rgb} + } +\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \keys_define:nn { hyp / setup } + { + #1bordercolor .code:n = + { + \tl_if_empty:nTF { ##1 } + { + \pdfannot_dict_remove:nn + {link/#2} + { C } + } + { + \__hyp_color_export:xVN {##1}\g__hyp_bordercolormodel_str \l__hyp_tmpa_tl + \pdfannot_dict_put:nnx + {link/#2} + { C } + { [\l__hyp_tmpa_tl] } + } + } + } + } + +\keys_define:nn { hyp / setup } + { + ,allbordercolors .meta:n = + { + ,linkbordercolor=#1 + ,urlbordercolor =#1 + ,filebordercolor=#1 + ,menubordercolor=#1 + ,runbordercolor =#1 + } + ,allbordercolors .value_required:n = true + } + +\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \keys_define:nn { hyp / setup } + { + #1border .code:n = + { + \tl_if_empty:nTF { ##1 } + { + \pdfannot_dict_remove:nn + {link/#2} + { Border } + } + { + \pdfannot_dict_put:nnn + {link/#2} + { Border } + { [##1] } + } + } + } + } +\keys_define:nn { hyp / setup } + { + ,pdfborder .code:n = + { + \tl_if_empty:nTF { #1 } + { + \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \pdfannot_dict_remove:nn + {link/##2} + { Border } + } + } + { + \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \pdfannot_dict_put:nnn + {link/##2} + { Border } + { [#1] } + } + } + } + ,pdfborder .initial:n = {0~0~1}, + } +\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \keys_define:nn { hyp / setup } + { + #1borderstyle .code:n = + { + \tl_if_empty:nTF { ##1 } + { + \pdfannot_dict_remove:nn + {link/#2} + { BS } + } + { + \pdfannot_dict_put:nnn + {link/#2} + { BS } + { <<##1>> } + } + } + } + } +\keys_define:nn { hyp / setup } + { + ,pdfborderstyle .code:n = + { + \tl_if_empty:nTF { #1 } + { + \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \pdfannot_dict_remove:nn + {link/##2} + { BS } + } + } + { + \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \pdfannot_dict_put:nnn + {link/##2} + { BS } + { <<#1>> } + } + } + } + ,pdfborderstyle .initial:n = {}, + } +\cs_new_protected:Npn \__hyp_ocg_init: + { + \pdf_object_new:nn { l__hyp_ocg_view_dict_obj } { dict } + \pdf_object_new:nn { l__hyp_ocg_print_dict_obj } { dict } + \pdf_object_new:nn { l__hyp_ocg_config_dict_obj } { dict } + \pdf_object_new:nn { l__hyp_ocg_ref_array_obj } { array } + \pdf_object_write:nx { l__hyp_ocg_ref_array_obj } + { + \pdf_object_ref:n { l__hyp_ocg_view_dict_obj } + \c_space_tl + \pdf_object_ref:n { l__hyp_ocg_print_dict_obj } + } + \pdf_object_write:nn { l__hyp_ocg_view_dict_obj } + { + /Type/OCG + /Name(View) + /Usage + << + /Print <</PrintState/OFF>>~ + /View <</ViewState/ON >>~ + >> + } + \pdf_object_write:nn { l__hyp_ocg_print_dict_obj } + { + /Type/OCG + /Name(Print) + /Usage + << + /Print <</PrintState/ON>>~ + /View <</ViewState/OFF>>~ + >> + } + \pdfmanagement_add:nnx { Catalog / OCProperties }{OCGs }{ \pdf_object_ref:n {l__hyp_ocg_view_dict_obj} } + \pdfmanagement_add:nnx { Catalog / OCProperties }{OCGs }{ \pdf_object_ref:n {l__hyp_ocg_print_dict_obj} } + \pdf_object_write:nx { l__hyp_ocg_config_dict_obj } + { + /OFF[\pdf_object_ref:n { l__hyp_ocg_print_dict_obj }] + /AS[ + << + /Event/View + /OCGs\c_space_tl \pdf_object_ref:n { l__hyp_ocg_ref_array_obj } + /Category[/View] + >> + << + /Event/Print + /OCGs\c_space_tl \pdf_object_ref:n { l__hyp_ocg_ref_array_obj } + /Category[/Print] + >> + << + /Event/Export + /OCGs\c_space_tl \pdf_object_ref:n { l__hyp_ocg_ref_array_obj } + /Category[/Print] + >> + ] + } + \pdfmanagement_add:nnx { Catalog / OCProperties }{ D }{ \pdf_object_ref:n { l__hyp_ocg_config_dict_obj} } + \cs_gset:Npn \__hyp_ocg_init: {} + } +\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \hook_gput_code:nnn + {pdfannot/link/#2/begin} + {hyp/ocg} + { + \bool_if:cT { l_hyp_annot_ocgcolor#1_bool } + { + \__hyp_ocg_init: + \group_begin: + \hbox_set:Nw \l__hyp_tmpa_box + } + } + \hook_gput_code:nnn + {pdfannot/link/#2/end} + {hyp/ocg} + { + \bool_if:cT { l_hyp_annot_ocgcolor#1_bool } + { + \hbox_set_end: + \mbox + { + \pdf_bdcobject:nn {OC}{l__hyp_ocg_print_dict_obj} + \hbox_overlap_right:n { \box_use:N \l__hyp_tmpa_box } + \pdf_emc: + \pdf_bdcobject:nn {OC}{l__hyp_ocg_view_dict_obj} + \group_begin: + \color_select:n { hyp/color/#1 } + \box_use_drop:N \l__hyp_tmpa_box + \group_end: + \pdf_emc: + } + \group_end: + } + } + } +\pdf_version_compare:NnTF < {1.5} + { + \keys_define:nn { hyp / setup } + { + ,_ocgcolorlinks .code:n = + { + \msg_warning:nnxx + { hyp } + { ignore-deprecated-or-unknown-option-in-pdf-version } + { ocgcolorlinks } { \pdf_version_major:.\pdf_version_minor: } + } + } + } + { + \keys_define:nn { hyp / setup } + { + ,_ocgcolorlinks .meta:n = + { + ocgcolorlink=#1, + ocgcolorurl=#1, + ocgcolorfile=#1, + ocgcolorrun=#1, + ocgcolormenu=#1 + } + ,_ocgcolorlinks .default:n = true + } + } + +\keys_define:nn { hyp / setup } + { + ,ocgcolorlinks .choice: + ,ocgcolorlinks / true .meta:n = + { + pdfborder ={0~0~0}, + pdfborderstyle ={}, + colorlinks = false, + _ocgcolorlinks = true + } + ,ocgcolorlinks / false .meta:n = + { + _ocgcolorlinks = false + } + ,ocgcolorlinks .default:n = {true} + } + +\seq_map_inline:Nn \c__hyp_annot_types_seq + { + \pdf_version_compare:NnTF < {1.5} + { + \keys_define:nn { hyp / setup } + { + ,ocgcolor#1 .code:n= + { + \msg_warning:nnxx + { hyp } + { ignore-deprecated-or-unknown-option-in-pdf-version } + { ocgcolor#1 } + { \pdf_version_major:.\pdf_version_minor: } + } + } + } + { + \keys_define:nn { hyp / setup } + { + ,ocgcolor#1 .bool_set:c = { l_hyp_annot_ocgcolor#1_bool } + } + } + } +\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \keys_define:nn { hyp / setup } + { + ,#1highlight .choices:nn = + { /I, /N, /O, /P} + { + \pdfannot_dict_put:nnn + {link/#2} + { H } + { ##1 } + + } + ,#1highlight / .code:n = + { + \pdfannot_dict_remove:nn + {link/#2} + { H } + + } + ,#1highlight / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfhighlight } + { /I~(inverse), /N~(no effect), /O~(outline), /P~(inset) } + { \exp_not:n {##1} } + } + } + } + +\keys_define:nn { hyp / setup } + { + ,pdfhighlight .choices:nn = + { /I, /N, /O, /P} + { + \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \pdfannot_dict_put:nnn + {link/####2} + { H } + { #1 } + } + } + ,pdfhighlight / .code:n = + { + \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \pdfannot_dict_remove:nn + {link/##2} + { H } + } + } + ,pdfhighlight .initial:n = {/I}, + ,pdfhighlight / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfhighlight } + { /I~(inverse), /N~(no effect), /O~(outline), /P~(inset) } + { \exp_not:n {#1} } + } + } +\keys_define:nn { hyp / setup } + { + hidelinks .meta:n = + { + ,colorlinks = false + ,ocgcolorlinks = false + ,pdfborder = { 0~0~0 } + ,pdfborderstyle= + } + } + +\seq_map_inline:Nn \c__hyp_annot_types_seq + { + \keys_define:nn { hyp / setup } + { + hide#1 .meta:n = + { + ,color#1 = false + ,ocgcolor#1 = false + ,#1border = { 0~0~0 } + ,#1borderstyle = + } + } + } +\keys_define:nn { hyp / setup } + { + colorscheme .code:n = + { + \prop_map_inline:cn { c__hyp_colorscheme_#1_prop } + { + \keys_set:nn { hyp /setup } + { + ##1 = ##2 + } + } + } + } +\keys_set:nn { hyp / setup } {colorscheme=phelype} +\keys_define:nn { hyp / setup } + { + ,unicode .code:n = {} + ,pdfencoding .code:n = {} + ,pdfversion .code:n = + { + \msg_warning:nn { hyp }{ pdfversion-disabled } + } + } +\keys_define:nn { hyp / setup } + { + ,verbose .choice: + ,verbose / true .code:n = { \Hy@verbosetrue} + ,verbose / false .code:n = { \Hy@verbosefalse} + ,verbose .default:n = {true} + ,debug .meta:n = {verbose=#1} + ,debug .default:n = {true} + } +\keys_define:nn { hyp / setup } + { + ,draft .code:n = + { + \Hy@drafttrue + \PassOptionsToPackage{draft}{bookmark} + } + ,final .code:n = + { + \Hy@finaltrue + \PassOptionsToPackage{final}{bookmark} + } + } +\keys_define:nn { hyp / setup } + { + ,extension .tl_set:N = \XR@ext + ,extension .initial:n= pdf + ,hypertexnames .choice: + ,hypertexnames / true .code:n = { \Hy@hypertexnamestrue} + ,hypertexnames / false .code:n = { \Hy@hypertexnamesfalse} + ,hypertexnames .default:n = {true} + ,linkfileprefix .tl_set:N = \Hy@linkfileprefix + ,localanchorname .choice: + ,localanchorname / true .code:n = { \Hy@localanchornametrue } + ,localanchorname / false .code:n = { \Hy@localanchornamefalse } + ,localanchorname .default:n = {true} + ,naturalnames .choice: + ,naturalnames / true .code:n = { \Hy@naturalnamestrue} + ,naturalnames / false .code:n = { \Hy@naturalnamesfalse} + ,naturalnames .default:n = {true} + ,pageanchor .choice: + ,pageanchor / true .code:n = { \Hy@pageanchortrue} + ,pageanchor / false .code:n = { \Hy@pageanchorfalse} + ,pageanchor .default:n = {true} + ,plainpages .choice: + ,plainpages / true .code:n = { \Hy@plainpagestrue} + ,plainpages / false .code:n = { \Hy@plainpagesfalse} + ,plainpages .default:n = {true} + } + +\keys_define:nn { hyp / setup } + { + ,linktoc .choices:nn = { none, section, all, page } + { + \cs_set_eq:Nc \Hy@linktoc { Hy@linktoc@#1 } + } + ,linktoc / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice } + { linktoc } + { none, section, all, page } + { \exp_not:n {#1} } + } + ,linktocpage .choice: + ,linktocpage / true .meta:n = {linktoc=page} + ,linktocpage / false .meta:n = {linktoc=section} + ,linktocpage .default:n = true + } + +\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop + { + \keys_define:nn { hyp / setup } + { + ,#1 .bool_set:c = {l__hyp_annot_#2_bool} + } + } +\keys_define:nn { hyp / setup } + { + ,baseurl .code:n = + { + \__hyp_text_pdfstring:ooN { #1 } {\l__hyp_text_enc_uri_print_tl} \l__hyp_tmpa_tl + \tl_if_empty:NTF \l__hyp_tmpa_tl + { + \pdfmanagement_remove:nn {Catalog} { URI } + } + { + \pdfmanagement_add:nnx {Catalog} { URI }{ <</Base \l__hyp_tmpa_tl>> } + } + } + %only false does something ... + ,bookmarks .choice: + ,bookmarks / false .code:n = {\RemoveFromHook {begindocument/before}[hyperref/bookmark]} + ,bookmarks / true .code:n = {} + ,bookmarks .default:n = {true} + ,bookmarksnumbered .choice: + ,bookmarksnumbered / false .code:n = { \Hy@bookmarksnumberedfalse } + ,bookmarksnumbered / true .code:n = { \Hy@bookmarksnumberedtrue } + ,bookmarksnumbered .default:n = {true} + ,bookmarksopen .choice: + ,bookmarksopen / false .code:n = { \Hy@bookmarksopenfalse } + ,bookmarksopen / true .code:n = { \Hy@bookmarksopentrue } + ,bookmarksopen .default:n = {true} + ,bookmarksopenlevel .tl_set:N = \@bookmarksopenlevel + ,bookmarkstype .tl_set:N = \Hy@bookmarkstype + ,pdfcenterwindow .choice: + ,pdfcenterwindow / false .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences }{ CenterWindow } + } + ,pdfcenterwindow / true .code:n = + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } { CenterWindow }{ true } + } + ,pdfcenterwindow / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences }{ CenterWindow } + } + ,pdfcenterwindow / unknown .code:n = + { + \msg_warning:nnxx { hyp } { no-bool } + { pdfcenterwindow } + { \exp_not:n {#1} } + } + ,pdfcenterwindow .default:n = true + ,pdfdirection .choice: + ,pdfdirection / L2R .code:n = + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } { Direction }{ /L2R } + } + ,pdfdirection / R2L .code:n = + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } { Direction }{ /R2L } + } + ,pdfdirection / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { Direction } + } + ,pdfdirection / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfdirection } + { L2R , R2L } + { \exp_not:n {#1} } + } + ,pdfdisplaydoctitle .choice: + ,pdfdisplaydoctitle / false .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { DisplayDocTitle } + } + ,pdfdisplaydoctitle / true .code:n = + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } { DisplayDocTitle } { true } + } + ,pdfdisplaydoctitle .default:n = true + ,pdfduplex .choices:nn = + {Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge} + { + \pdf_version_compare:NnTF > {1.6} + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } + { PrintDuplex } { /#1 } + } + { + \msg_warning:nnxx + {hyp} + {ignore-deprecated-or-unknown-option-in-pdf-version} + {pdfduplex} + {\pdf_version:} + } + }% + ,pdfduplex / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { PrintDuplex } + } + ,pdfduplex / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfduplex } + { Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge } + { \exp_not:n {#1} } + } + ,pdffitwindow .choice: + ,pdffitwindow / false .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { FitWindow } + } + ,pdffitwindow / true .code:n = + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } { FitWindow } { true } + } + ,pdffitwindow / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { FitWindow } + } + ,pdffitwindow .default:n = true + ,pdffitwindow / unknown .code:n = + { + \msg_warning:nnxx { hyp } { no-bool } + { pdffitwindow } + { \exp_not:n {#1} } + } + ,pdflinkmargin .code:n = { \pdfannot_link_margin:n { #1 } } + ,pdflinkmargin .initial:n = {1pt} + ,pdfmenubar .choice: + ,pdfmenubar / true .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { HideMenubar } + } + ,pdfmenubar / false .code:n = + { + \pdfmanagement_add:nn {Catalog / ViewerPreferences } + { HideMenubar } { true } + } + ,pdfmenubar / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { HideMenubar } + } + ,pdfmenubar .default:n = true + ,pdfmenubar / unknown .code:n = + { + \msg_warning:nnxx { hyp } { no-bool } + { pdfmenubar } + { \exp_not:n {#1} } + } + ,pdfnewwindow .choice: + ,pdfnewwindow / true .code:n = + { + \pdfdict_put:nnn {l_hyp/annot/A/GoToR}{/NewWindow}{true} + \pdfdict_put:nnn {l_hyp/annot/A/Launch}{/NewWindow}{true} + } + ,pdfnewwindow / false .code:n = + { + \pdfdict_put:nnn {l_hyp/annot/A/GoToR}{/NewWindow}{false} + \pdfdict_put:nnn {l_hyp/annot/A/Launch}{/NewWindow}{false} + } + ,pdfnewwindow / .code:n = + { + \pdfdict_remove:nn {l_hyp/annot/A/GoToR}{/NewWindow} + \pdfdict_remove:nn {l_hyp/annot/A/Launch}{/NewWindow} + } + ,pdfnonfullscreenpagemode .choices:nn = + { UseNone, UseOutlines, UseThumbs, FullScreen, UseOC } %pdf 1.5 + { + \pdfmanagement_add:nnx {Catalog / ViewerPreferences } + { NonFullScreenPageMode} {/#1} + } + ,pdfnonfullscreenpagemode / UseAttachments .code:n = + { + \pdf_version_compare:NnTF < {1.6} + { + %message + } + { + \pdfmanagement_add:nnx {Catalog / ViewerPreferences } + {NonFullScreenPageMode}{/UseAttachments} + } + } + ,pdfnonfullscreenpagemode / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { NonFullScreenPageMode } + } + ,pdfnonfullscreenpagemode / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfnonfullscreenpagemode } + { UseNone, UseOutlines, UseThumbs, FullScreen, UseOC, UseAttachments (PDF 1.6) } + { \exp_not:n {#1} } + } + ,pdfnumcopies .code:n = + { + \pdf_version_compare:NnTF > {1.6} + { + \tl_if_empty:nTF {#1} + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { NumCopies } + } + { + \pdfmanagement_add:nnx {Catalog / ViewerPreferences } + {NumCopies}{#1} + } + } + { + \msg_warning:nnxx + {hyp} + {ignore-deprecated-or-unknown-option-in-pdf-version} + {pdfnumcopies} + {\pdf_version:} + } + } + ,pdfpagelayout .choices:nn = + { SinglePage, OneColumn, TwoColumnLeft, TwoColumnRight, TwoPageLeft, TwoPageRight} + { \pdfmanagement_add:nnx {Catalog} { PageLayout }{ /#1 } } + ,pdfpagelayout / .code:n = + { \pdfmanagement_remove:nn {Catalog} { PageLayout } } + ,pdfpagelayout / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfpagelayout } + { SinglePage, OneColumn, TwoColumnLeft, TwoColumnRight, TwoPageLeft, TwoPageRight } + { \exp_not:n {#1} } + } + ,pdfpagemode .choices:nn = + { UseNone, UseOutlines, UseThumbs, FullScreen, UseOC } %pdf 1.5 + { \pdfmanagement_add:nnx {Catalog} { PageMode }{ /#1 } } + ,pdfpagemode / UseAttachments .code:n = + { + \pdf_version_compare:NnTF > {1.5} + { + \pdfmanagement_add:nnx {Catalog} { PageMode }{ /UseAttachments } + } + { + \msg_warning:nnxx + {hyp} + {ignore-deprecated-or-unknown-value-in-pdf-version} + {UseAttachments} + {\pdf_version:} + } + } + ,pdfpagemode .initial:n = { UseOutlines } %for now ... + ,pdfpagemode / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfpagemode } + { UseNone, UseOutlines, UseThumbs, FullScreen, UseOC, UseAttachments (PDF 1.6) } + { \exp_not:n {#1} } + } + ,pdfpagescrop .code:n = + { + \tl_if_empty:nTF %or blank? + { + \pdfmanagement_remove:nn {Pages} { CropBox } + } + { + \pdfmanagement_add:nnx {Pages} { CropBox } { [#1] } + } + } + ,pdfpicktraybypdfsize .choice: + ,pdfpicktraybypdfsize / true .code:n = + { + \pdf_version_compare:NnTF > {1.6} + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } + { PickTrayByPDFSize } { true } + } + { + \msg_warning:nnxx + {hyp} + {ignore-deprecated-or-unknown-option-in-pdf-version} + {pdfpicktraybypdfsize} + {\pdf_version:} + } + } + ,pdfpicktraybypdfsize / false .code:n = + { + \pdf_version_compare:NnTF > {1.6} + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } + { PickTrayByPDFSize } { false } + } + { + \msg_warning:nnxx + {hyp} + {ignore-deprecated-or-unknown-option-in-pdf-version} + {pdfpicktraybypdfsize} + {\pdf_version:} + } + } + ,pdfpicktraybypdfsize / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { PickTrayByPDFSize } + } + ,pdfpicktraybypdfsize / unknown .code:n = + { + \msg_warning:nnxx { hyp } { no-bool } + { picktraybypdfsize } + { \exp_not:n {#1} } + } + ,pdfprintarea .choices:nn = + { MediaBox, CropBox, BleedBox, TrimBox, ArtBox } + { + \pdf_version_compare:NnTF < {2.0} + { + \pdfmanagement_add:nnx {Catalog / ViewerPreferences } + { PrintArea } { /#1 } + } + { + \msg_warning:nnxx + {hyp} + {ignore-deprecated-or-unknown-option-in-pdf-version} + {pdfprintarea} + {\pdf_version:} + } + }% + ,pdfprintarea / .code:n = + { \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { PrintArea } } + ,pdfprintarea / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfprintarea } + { MediaBox, CropBox, BleedBox, TrimBox, ArtBox } + { \exp_not:n {#1} } + } + ,pdfprintclip .choices:nn = + { MediaBox, CropBox, BleedBox, TrimBox, ArtBox } + { + \pdf_version_compare:NnTF < {2.0} + { + \pdfmanagement_add:nnx {Catalog / ViewerPreferences } + { PrintClip } { /#1 } + } + { + \msg_warning:nnxx + {hyp} + {ignore-deprecated-or-unknown-option-in-pdf-version} + {pdfprintclip} + {\pdf_version:} + } + }% + ,pdfprintclip / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { PrintClip } + } + ,pdfprintclip / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfprintclip } + { MediaBox, CropBox, BleedBox, TrimBox, ArtBox } + { \exp_not:n {#1} } + } + ,pdfprintpagerange .code:n = + { + \pdf_version_compare:NnTF > {1.6} + { + \tl_if_empty:nTF { #1} + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } + { PrintPageRange } + } + { + \pdfmanagement_add:nnx {Catalog / ViewerPreferences } + {PrintPageRange}{[#1]} + } + } + { + \msg_warning:nnxx + {hyp} + {ignore-deprecated-or-unknown-option-in-pdf-version} + {pdfprintpagerange} + {\pdf_version:} + } + } + ,pdfprintscaling .choices:nn = + { None, AppDefault } + { + \pdf_version_compare:NnTF > {1.5} + { + \pdfmanagement_add:nnx {Catalog / ViewerPreferences } + { PrintScaling } { /#1 } + } + { + \msg_warning:nnxx + {hyp} + {ignore-deprecated-or-unknown-option-in-pdf-version} + {pdfprintscaling} + {\pdf_version:} + } + }% + ,pdfprintscaling / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } {PrintScaling } + } + ,pdfprintscaling / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfprintarea } + { None, AppDefault } + { \exp_not:n {#1} } + } + ,pdfremotestartview .code:n = + { + \tl_set:Nx \l__hyp_tmpa_tl {#1~null~null~null~} + \exp_args:NNV + \regex_extract_once:NnNTF \c__hyp_dest_startview_regex \l__hyp_tmpa_tl \l__hyp_tmpa_seq + { + \tl_set:Nx \l__hyp_dest_pdfremotestartview_tl {\seq_item:Nn \l__hyp_tmpa_seq {1}} + } + { + \msg_warning:nnnn {hyp}{invalid-destination-value}{#1}{pdfremotestartview} + \tl_set:Nn \l__hyp_dest_pdfremotestartview_tl {Fit} + } + } + ,pdfremotestartview .initial:n = {Fit} + % pdfstartpage is special as it shares code with pdfstartview + ,pdfstartpage .code:n = + { + \tl_gset:Nx \g__hyp_dest_pdfstartpage_tl { #1 } + \bool_if:nTF + { \tl_if_empty_p:N \g__hyp_dest_pdfstartpage_tl || \tl_if_empty_p:N \g__hyp_dest_pdfstartview_tl } + { + \pdfmanagement_remove:nn {Catalog} { OpenAction } + } + { + \pdfmanagement_add:nnx {Catalog} { OpenAction } + { + [\pdf_pageobject_ref:n {\g__hyp_dest_pdfstartpage_tl}~/\g__hyp_dest_pdfstartview_tl] + } + } + } + ,pdfstartpage .initial:n =1 + ,pdfstartview .code:n = + { + \tl_set:Nx \l__hyp_tmpa_tl {#1~null~null~null~} + \exp_args:NNV + \regex_extract_once:NnNTF \c__hyp_dest_startview_regex \l__hyp_tmpa_tl \l__hyp_tmpa_seq + { + \tl_gset:Nx \g__hyp_dest_pdfstartview_tl {\seq_item:Nn \l__hyp_tmpa_seq {1}} + } + { + \msg_warning:nnnn {hyp}{invalid-destination-value}{#1}{pdfstartview} + \tl_gset:Nn \g__hyp_dest_pdfstartview_tl {Fit} + } + \bool_if:nTF + { \tl_if_empty_p:N \g__hyp_dest_pdfstartpage_tl || \tl_if_empty_p:N \g__hyp_dest_pdfstartview_tl } + { + \pdfmanagement_remove:nn {Catalog} { OpenAction } + } + { + \pdfmanagement_add:nnx {Catalog} { OpenAction } + { + [\pdf_pageobject_ref:n {\g__hyp_dest_pdfstartpage_tl}~/\g__hyp_dest_pdfstartview_tl] + } + } + } + ,pdfstartview .initial:n = Fit + ,pdftoolbar .choice: + ,pdftoolbar / true .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { HideToolbar } + } + ,pdftoolbar / false .code:n = + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } + { HideToolbar } { true } + } + ,pdftoolbar / true .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { HideToolbar } + } + ,pdftoolbar .default:n = true + ,pdftoolbar / unknown .code:n = + { + \msg_warning:nnxx { hyp } { no-bool } + { pdftoolbar } + { \exp_not:n {#1} } + } + % pdfview see below. + ,pdfviewarea .choices:nn = + { MediaBox, CropBox, BleedBox, TrimBox, ArtBox } + { + \pdf_version_compare:NnTF < {2.0} + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } + { ViewArea } { /#1 } + } + { + \msg_warning:nnxx + {hyp} + {ignore-deprecated-or-unknown-option-in-pdf-version} + {pdfviewarea} + {\pdf_version:} + } + }% + ,pdfviewarea / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { ViewArea } + } + ,pdfviewarea / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfviewarea } + { MediaBox, CropBox, BleedBox, TrimBox, ArtBox } + { \exp_not:n {#1} } + } + ,pdfviewclip .choices:nn = + { MediaBox, CropBox, BleedBox, TrimBox, ArtBox } + { + \pdf_version_compare:NnTF < {2.0} + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } + { ViewClip } { /#1 } + } + { + \msg_warning:nnxx + {hyp} + {ignore-deprecated-or-unknown-option-in-pdf-version} + {pdfviewclip} + {\pdf_version:} + } + }% + ,pdfviewclip / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { ViewClip } + } + ,pdfviewclip / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice+empty } + { pdfviewclip } + { MediaBox, CropBox, BleedBox, TrimBox, ArtBox } + { \exp_not:n {#1} } + } + ,pdfwindowui .choice: + ,pdfwindowui / true .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { HideWindowUI } + } + ,pdfwindowui / false .code:n = + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } + { HideWindowUI } { true } + } + ,pdfwindowui / .code:n = + { + \pdfmanagement_remove:nn {Catalog / ViewerPreferences } {HideWindowUI } + } + ,pdfwindowui / unknown .code:n = + { + \msg_warning:nnxx { hyp } { no-bool } + { pdfwindowui } + { \exp_not:n {#1} } + } + ,pdfwindowui .default:n = true + } +\keys_define:nn { hyp / setup } + { + ,pdfview .code:n = + { + \seq_set_split:Nnn \l__hyp_tmpa_seq {~}{#1} + \str_case_e:nnF { \str_lowercase:f{ \seq_item:Nn \l__hyp_tmpa_seq {1} } } + { + { xyz } + { + \int_compare:nNnTF {\seq_count:N \l__hyp_tmpa_seq } > { 1 } + { + \seq_get_right:NN \l__hyp_tmpa_seq \l__hyp_tmpa_tl + \tl_if_eq:NnTF \l__hyp_tmpa_tl {null} + { + \tl_set:Nn \l__hyp_dest_pdfview_tl {xyz} + } + { + \tl_set:Nx \l__hyp_dest_pdfview_tl + { + \fp_eval:n { \l__hyp_tmpa_tl * 100 } + } + } + } + { + \tl_set:Nn \l__hyp_dest_pdfview_tl {xyz} + } + } + { fit } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fit} } + { fitb } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fitb} } + { fitbh } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fitbh}} + { fitbv } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fitbv}} + { fith } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fith} } + { fitv } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fitv} } + { fitr } + { + \int_compare:nNnTF {\seq_count:N \l__hyp_tmpa_seq } = {1} + { + \tl_set:Nn \l__hyp_dest_pdfview_tl {fitr} + } + { + %ensure 4 values ... + \tl_set:Nn \l__hyp_dest_pdfview_tl {fitrbox} + \seq_put_right:Nn \l__hyp_tmpa_seq {0} + \seq_put_right:Nn \l__hyp_tmpa_seq {0} + \seq_put_right:Nn \l__hyp_tmpa_seq {0} + \hbox_set_to_wd:Nnn \l__hyp_dest_box + { + \fp_eval:n + { + round + ( + abs + ( + \seq_item:Nn\l__hyp_tmpa_seq{4} + - + (\seq_item:Nn\l__hyp_tmpa_seq{2}) + ), + 3 + ) + }bp + }{} + \box_set_dp:Nn \l__hyp_dest_box + { + \fp_eval:n + { + round(0 - (\seq_item:Nn\l__hyp_tmpa_seq{3}),3) + }bp + } + \box_set_ht:Nn \l__hyp_dest_box + { + \seq_item:Nn\l__hyp_tmpa_seq{5}bp + } + } + } + } + { + \msg_warning:nnnn {hyp}{invalid-destination-value}{#1}{pdfview} + \tl_set:Nn \l__hyp_dest_pdfview_tl {fit} + } + } + ,pdfview .initial:n = {xyz} + } +\keys_define:nn { hyp / setup } + { + ,pdflang .code:n = + { + \tl_if_empty:nTF { #1 } + { + \pdfmanagement_remove:nn {Catalog} { Lang } + } + { + \pdfmanagement_add:nnx {Catalog} { Lang } { (#1) } + } + \__hyp_store_metadata:nn {pdflang}{#1} + } + } +\cs_new_protected:Npn \__hyp_setup_info_key:nn #1 #2 + { + \keys_define:nn { hyp / setup } + { + pdf#1 .code:n = + { + \tl_if_blank:nTF {##1} + { + \pdfmanagement_remove:nn {Info}{#2} + } + { + \__hyp_text_pdfstring_info:nN {##1}\l__hyp_tmpa_str + \str_if_eq:VnF\l__hyp_tmpa_str{<FEFF>} + { + \pdfmanagement_add:nnx {Info}{#2}{\l__hyp_tmpa_str} + } + } + \__hyp_store_metadata:nn {pdf#1}{##1} + } + } + \keys_define:nn { hyp / info } + { + #2 .code:n = + { + \tl_if_blank:nTF {##1} + { + \pdfmanagement_remove:nn {Info}{#2} + } + { + \__hyp_text_pdfstring_info:nN {##1}\l__hyp_tmpa_str + \str_if_eq:VnF\l__hyp_tmpa_str{<FEFF>} + { + \pdfmanagement_add:nnx {Info}{#2}{\l__hyp_tmpa_str} + } + } + \exp_args:Nx \__hyp_store_metadata:nn {pdf\str_lowercase:n{#1}}{##1} + } + ,unknown .code:n = + { + \__hyp_text_pdfstring_info:nN {##1}\l__hyp_tmpa_str + \str_if_eq:VnF\l__hyp_tmpa_str{<FEFF>} + { + \exp_args:Nno + \pdfmanagement_add:nnx {Info} + { \l_keys_key_str } {\l__hyp_tmpa_str} + } + } + } + } +\__hyp_setup_info_key:nn {author} {Author} +\__hyp_setup_info_key:nn {title} {Title} +\__hyp_setup_info_key:nn {producer} {Producer} +\__hyp_setup_info_key:nn {creator} {Creator} +\__hyp_setup_info_key:nn {subject} {Subject} +\__hyp_setup_info_key:nn {keywords} {Keywords} +\cs_new_protected:Npn \__hyp_setup_info_date_key:nn #1 #2 + { + \keys_define:nn { hyp / setup } + { + pdf#1 .code:n = + { + \tl_if_blank:nTF {##1} + { + \pdfmanagement_remove:nn {Info}{#2} + } + { + \pdfmanagement_add:nnx {Info}{#2}{(\tl_to_str:n {##1})} + } + \__hyp_store_metadata:nn {pdf#1}{##1} + } + } + \keys_define:nn { hyp / info } + { + #2 .code:n = + { + \tl_if_blank:nTF {##1} + { + \pdfmanagement_remove:nn {Info}{#2} + } + { + \pdfmanagement_add:nnx {Info}{#2}{(\tl_to_str:n {##1})} + } + \exp_args:Nx \__hyp_store_metadata:nn {pdf\str_lowercase:n{#1}}{##1} + } + } + } + +\__hyp_setup_info_date_key:nn {creationdate} {CreationDate} +\__hyp_setup_info_date_key:nn {moddate} {ModDate} +\keys_define:nn { hyp / setup } + { + ,pdftrapped .code:n = + { + \exp_args:Nne + \keys_set:nn { hyp / setup } { _pdftrapped = \str_uppercase:n { #1 } } + } + ,_pdftrapped .choices:nn = {TRUE,FALSE,UNKNOWN} + { + \pdfmanagement_add:nnx {Info}{Trapped} + {/ + \str_uppercase:f { \str_head:n { #1 } } + \str_lowercase:f { \str_tail:n { #1 } } + } + \__hyp_store_metadata:nx {pdftrapped} + { + \str_uppercase:f { \str_head:n { #1 } } + \str_lowercase:f { \str_tail:n { #1 } } + } + } + ,_pdftrapped / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice } + { pdftrapped } + { true~(case~insensitive), false~(case~insensitive), unknown~(case~insensitive) } + { \exp_not:n {#1} } + } + } +\keys_define:nn { hyp / setup } + { + pdfinfo .code:n = + { + \keys_set:nn { hyp / info } { #1 } + } + } +\keys_set:nn { hyp / setup} {pdfcreator = LaTeX~with~hyperref} +\keys_set:nn { hyp / setup} {pdfauthor = } +\keys_set:nn { hyp / setup} {pdftitle = } +\keys_set:nn { hyp / setup} {pdfsubject = } +\clist_map_inline:nn + { + ,pdfcopyright + ,pdftype + ,pdflicenseurl + ,pdfauthortitle + ,pdfcaptionwriter + ,pdfmetalang + ,pdfapart + ,pdfaconformance + ,pdfuapart + ,pdfxstandard + ,pdfsource + ,pdfdocumentid + ,pdfinstanceid + ,pdfversionid + ,pdfrendition + ,pdfpublication + ,pdfpubtype + ,pdfbytes + ,pdfnumpages + ,pdfissn + ,pdfeissn + ,pdfisbn + ,pdfbookedition + ,pdfpublisher + ,pdfvolumenum + ,pdfissuenum + ,pdfpagerange + ,pdfdoi + ,pdfurl + ,pdfidentifier + ,pdfsubtitle + ,pdfpubstatus + ,pdfcontactaddress + ,pdfcontactcity + ,pdfcontactregion + ,pdfcontactpostcode + ,pdfcontactcountry + ,pdfcontactphone + ,pdfcontactemail + ,pdfcontacturl + ,pdfdate + } + { + \keys_define:nn { hyp / setup } + { + #1 .code:n= { \__hyp_store_metadata:nn {#1}{##1}} + } + } +\keys_define:nn { hyp / setup } + { + pdfpageduration .code:n = + { + \tl_if_blank:nTF { #1 } + { + \pdfmanagement_remove:nn {Page}{Dur} + } + { + \pdfmanagement_add:nnn {Page}{Dur}{#1} + } + } + } +\keys_define:nn { hyp / setup } + { + pdfpagetransition .code:n = + { + \tl_if_blank:nTF {#1} + { + \pdfmanagement_remove:nn {Page}{Trans} + } + { + \group_begin: + \keys_set:nn { hyp / trans }{style=R,#1} + \pdf_object_unnamed_write:nx { dict } + { + \pdfdict_use:n {l__hyp_page/Trans} + } + \pdfmanagement_add:nnx {Page}{Trans}{\pdf_object_ref_last:} + \group_end: + } + } + } +\keys_define:nn { hyp / trans } + { + ,style .choices:nn = + {Split,Blinds,Box,Wipe,Dissolve,Glitter,R,Fly,Push,Cover,Uncover,Fade} + { \pdfdict_put:nnn {l__hyp_page/Trans}{ S }{/#1} } + ,style / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice } + { trans / style } + { Split,Blinds,Box,Wipe,Dissolve,Glitter,R,Fly,Push,Cover,Uncover,Fade } + { \exp_not:n {#1} } + } + ,duration .code:n = + { + \pdfdict_put:nnn {l__hyp_page/Trans}{ D }{#1} + } + ,direction .choices:nn = + {H,V} + { \pdfdict_put:nnn {l__hyp_page/Trans}{ S }{/#1} } + ,direction .choices:nn = + {0,90,180,270,315} + { \pdfdict_put:nnn {l__hyp_page/Trans}{ DI }{ #1 } } + ,direction / None .code:n = + { \pdfdict_put:nnn {l__hyp_page/Trans}{ DI }{ /None } } + ,direction / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice } + { trans / direction } + { + H~(horizontal,~only~Split,~Blinds), + V~(vertical,~only~Split,~Blinds), + 0~(left~to~right,~only~Wipe,~Glitter,~Fly,~Cover,~Uncover,~Push), + 90~(bottom~to~top,~only~Wipe), + 180~(right~to~left,~only~Wipe), + 270~(top~to~bottom,~only~Wipe,~Glitter,~Fly,~Cover,~Uncover,~Push), + 315~(top~left~to~bottom,~only~Glitter), + None~(only~Fly) + } + { \exp_not:n {#1} } + } + ,motion .choices:nn = + {I,O} + { \pdfdict_put:nnn {l__hyp_page/Trans}{ M }{/#1} } + ,motion / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice } + { trans / motion } + { I~(inwards) , O~(outwards) } + { \exp_not:n {#1} } + } + ,scale .code:n = + { \pdfdict_put:nnn { l__hyp_page/Trans }{ SS }{ #1 } } + ,opaque .choices:nn = {true,false} + { \pdfdict_put:nnn { l__hyp_page/Trans }{ B } { #1} } + ,opaque / unknown .code:n = + { + \msg_warning:nnxxx { hyp } { unknown-choice } + { trans / B } + { true~(opaque~back,~only~Fly), false~(opaque~back,~only~Fly) } + { \exp_not:n {#1} } + } + % try to set unknown keys as style + ,unknown .code:n = + { + % warning ... + \exp_args:Nnx\keys_set:nn {hyp/trans}{ style=\l_keys_key_str } + } + } +\keys_set_known:nv{hyp/setup}{opt@hyperref.sty} +%% Form field code +\NewDocumentCommand \MakeFieldObject { m m } + { + \pdfxform_new:nnn { #2 }{} { #1 } + } + +\prop_new:N \g__hyp_AcroForm_CoFields_prop +\prop_new:N \g__hyp_AcroForm_Fields_prop + +\let\HyField@afields\ltx@empty +\let\HyField@cofields\ltx@empty +%% UF test for old pdftex removed +\def\HyField@AfterAuxOpen{\Hy@AtBeginDocument}% + +\def\HyField@AuxAddToFields#1 + { + \prop_gput:Nnn \g__hyp_AcroForm_Fields_prop {#1}{F} + }% + +\def\HyField@AuxAddToCoFields #1 #2 + { + \prop_gput:Nnn \g__hyp_AcroForm_CoFields_prop {a#1}{#2} + } + +\Hy@AtBeginDocument + { + \if@filesw + \immediate\write\@mainaux{% + \string\providecommand\string\HyField@AuxAddToFields[1]{}% + }% + \immediate\write\@mainaux{% + \string\providecommand\string\HyField@AuxAddToCoFields[2]{}% + }% + \fi + \let\HyField@AfterAuxOpen\@firstofone + }% + +\def\HyField@AddToFields + { + \exp_args:Nx\HyField__hypAddToFields + { + \pdfannot_box_ref_last: + } + \ifx\Fld@calculate@code\ltx@empty + \else + \begingroup + \Hy@safe@activestrue + \edef\Hy@temp{% + \endgroup + \if@filesw + \write\@mainaux + { + \string\HyField@AuxAddToCoFields + { + \Fld@calculate@sortkey + } + { + \pdfannot_box_ref_last: + } + } + \fi + }% + \Hy@temp + \fi + }% + +\def\HyField__hypAddToFields#1{ + \HyField@AfterAuxOpen{% + \if@filesw + \write\@mainaux{% + \string\HyField@AuxAddToFields{#1}% + }% + \fi + }% + }% + +\ExplSyntaxOff +\ExplSyntaxOn +\tl_new:N \l__hyp_CheckmarkYes_tl +\tl_set:Nn \l__hyp_CheckmarkYes_tl { __hyp_xform_CheckMarkYes } +\tl_new:N \l__hyp_CheckmarkOff_tl +\tl_set:Nn \l__hyp_CheckmarkOff_tl { __hyp_xform_CheckMarkOff } + +\def\@Form[#1] + { + \@ifundefined{textcolor}{\let\textcolor\@gobble}{} + \kvsetkeys{Form}{#1} + \pdf@ifdraftmode{} + { + \Hy@FormObjects + \prop_map_inline:Nn \g__hyp_AcroForm_Fields_prop + { + \pdfmanagement_add:nnx { Catalog / AcroForm } { Fields }{##1} + %\pdfmanagement_show:n { Catalog / AcroForm } + } + \prop_if_empty:NF \g__hyp_AcroForm_CoFields_prop + { + \prop_map_inline:Nn \g__hyp_AcroForm_CoFields_prop + { + \seq_put_right:Nn \l__hyp_tmpa_seq {##1} + } + \seq_sort:Nn \l__hyp_tmpa_seq + { + \int_compare:nNnTF { \pdf@strcmp{##1}{##2} } > { 0 } + { \sort_return_swapped: } + { \sort_return_same: } + } + \seq_map_inline:Nn \l__hyp_tmpa_seq + { + \pdfmanagement_add:nnx { Catalog / AcroForm } + { CO } + { + \prop_item:Nn \g__hyp_AcroForm_CoFields_prop {##1} + } + } + } + \pdfmanagement_add:nnx {Catalog / AcroForm/DR/Font } + {ZaDb} {\pdf_object_ref:n {l__hyp_font_zapfdingbats_obj} } + \pdfmanagement_add:nnx {Catalog / AcroForm/DR/Font } + {Helv} {\pdf_object_ref:n {l__hyp_font_helvetica_obj} } + \pdfmanagement_add:nnx {Catalog /AcroForm} + {DA}{(/Helv~10~Tf~0~g)} + \pdfmeta_standard_verify:nTF {form_no_NeedAppearance} + { + \legacy_if:nT { HyField@NeedAppearances } + { + \pdfmanagement_add:nnn {Catalog / AcroForm }{NeedAppearances}{true} + } + } + { + \pdfmanagement_remove:nn {Catalog / AcroForm }{NeedAppearances} + } + } + \MakeFieldObject + { + \group_begin: + \fontfamily{pzd} + \fontencoding{U} + \fontseries{m} + \fontshape{n} + \selectfont + \char123 + \group_end: + } + {__hyp_xform_Ding} + \MakeFieldObject + { + \group_begin: + \fontfamily{pzd} + \fontencoding{U} + \fontseries{m} + \fontshape{n} + \selectfont + \phantom{\char123} + \group_end: + } + {__hyp_xform_DingOff} + \MakeFieldObject + { + \group_begin: + \fontfamily{pzd} + \fontencoding{U} + \fontseries{m} + \fontshape{n} + \selectfont + \char51 + \group_end: + } + {__hyp_xform_CheckMarkYes} + \MakeFieldObject + { + \group_begin: + \fontfamily{pzd} + \fontencoding{U} + \fontseries{m} + \fontshape{n} + \selectfont + \phantom{\char51} %perhaps xetex needs some small glyph .. + \group_end: + } + {__hyp_xform_CheckMarkOff} + \MakeFieldObject + { + \fbox{\textcolor{yellow}{\textsf{Submit}}} %color? + } + {__hyp_xform_Submit} + \MakeFieldObject + { + \fbox{\textcolor{yellow}{\textsf{SubmitP}}} %color? + } + {__hyp_xform_SubmitP} + } +\ExplSyntaxOff +\let\@endForm\ltx@empty +\let\HyAnn@AbsPageLabel\ltx@empty +\let\Fld@pageobjref\ltx@empty + +\ExplSyntaxOn +\newcount\HyAnn@Count +\HyAnn@Count=\ltx@zero +\def\HyAnn@AbsPageLabel + { + \global\advance\HyAnn@Count by\ltx@one + %\zref@labelbyprops{HyAnn@\the\HyAnn@Count}{abspage}% + %\zref@labelbylist {HyAnn@\the\HyAnn@Count} {l3pdf} + %\zref@refused{HyAnn@\the\HyAnn@Count}% + \__hyp_ref_label:en {HyAnn@\the\HyAnn@Count}{abspage} + \__hyp_ref_check:en {HyAnn@\the\HyAnn@Count}{abspage} + }% +\def\Fld@pageobjref + { + \__hyp_ref_if_exist:enT {HyAnn@\the\HyAnn@Count}{abspage} + { + /P~\pdf_pageobject_ref:n + { + \__hyp_ref_value:en{HyAnn@\the\HyAnn@Count}{abspage} + } + } + } +\ExplSyntaxOff +\ExplSyntaxOn +%% check if the attr should be set through +%% hooks. +%% check if options are missing. +\def\@TextField[#1]#2{% parameters, label + \def\Fld@name{#2}% + \let\Fld@default\ltx@empty + \let\Fld@value\@empty + \def\Fld@width{\DefaultWidthofText}% + \def\Fld@height{% + \ifFld@multiline + \DefaultHeightofTextMultiline + \else + \DefaultHeightofText + \fi + }% + \begingroup + \expandafter\HyField@SetKeys\expandafter{% + \DefaultOptionsofText,#1% + }% + \PDFForm@Name + \HyField@FlagsText + \ifFld@hidden\def\Fld@width{1sp}\fi + \ifx\Fld@value\@empty\def\Fld@value{\Fld@default}\fi + \LayoutTextField{#2}{% + \leavevmode + \HyAnn@AbsPageLabel + \Hy@escapeform\PDFForm@Text + \pdfannot_box:nnnn + {\Fld@width} + {\Fld@height} + {0pt} %is this correct? + {\PDFForm@Text} + \MakeTextField{\Fld@width}{\Fld@height} + \HyField@AddToFields + }% + \endgroup +} +\providecommand\@curropt{} +\def\@ChoiceMenu[#1]#2#3{% parameters, label, choices + \def\Fld@name{#2} + \let\Fld@default\relax + \let\Fld@value\relax + \def\Fld@width{\DefaultWidthofChoiceMenu} + \def\Fld@height{\DefaultHeightofChoiceMenu} + \begingroup + \Fld@menulength=0 % + \@tempdima\z@ + \clist_map_variable:nNn { #3 } \@curropt + %\@for\@curropt:=#3\do + {% + \expandafter\Fld@checkequals\@curropt==\\% + \Hy@StepCount\Fld@menulength + \settowidth{\@tempdimb}{\@currDisplay}% + \ifdim\@tempdimb>\@tempdima\@tempdima\@tempdimb\fi + }% + \advance\@tempdima by~15\p@ + \begingroup + \HyField@SetKeys{#1} + \edef\x{\endgroup + \noexpand\expandafter + \noexpand\HyField@SetKeys + \noexpand\expandafter{% + \expandafter\noexpand\csname DefaultOptionsof% + \ifFld@radio + Radio% + \else + \ifFld@combo + \ifFld@popdown + PopdownBox% + \else + ComboBox% + \fi + \else + ListBox% + \fi + \fi + \endcsname + }% + }\x + \HyField@SetKeys{#1}% + \PDFForm@Name + \ifFld@hidden\def\Fld@width{1sp}\fi + \ifx\Fld@value\relax + \let\Fld@value\Fld@default + \fi + \LayoutChoiceField{#2}{% + \ifFld@radio + \HyField@FlagsRadioButton + \__hypRadio{#3}% + \else + \begingroup + \HyField@FlagsChoice + \ifdim\Fld@width<\@tempdima + \ifdim\@tempdima<1cm\@tempdima1cm\fi + \edef\Fld@width{\the\@tempdima}% + \fi + \ifFld@combo + \else + \@tempdima=\the\Fld@menulength\Fld@charsize + \advance\@tempdima by~\Fld@borderwidth bp % + \advance\@tempdima by~\Fld@borderwidth bp % + \edef\Fld@height{\the\@tempdima}% + \fi + \__hypListbox{#3}% + \endgroup + \fi + }% + \endgroup +} +\tl_new:N \l__hyp_RadioYes_tl +\tl_set:Nn \l__hyp_RadioYes_tl { __hyp_xform_Ding } +\def\__hypRadio#1{% + \Fld@listcount=0~% + %\show\Fld@default + \EdefEscapeName\Fld@default{\Fld@default}% + \clist_map_variable:nNn { #1 } \@curropt + %\@for\@curropt:=#1\do + {% + \expandafter\Fld@checkequals\@curropt==\\% + \EdefEscapeName\@currValue{\@currValue}% + \Hy@StepCount\Fld@listcount + \@currDisplay\space + \leavevmode + \HyAnn@AbsPageLabel + \Hy@escapeform\PDFForm@Radio + \pdfannot_box:nnnn + {\Fld@width} + {\Fld@height} + {0pt} %is this correct? + { + \PDFForm@Radio + /AP + << + /N + << + /\@currValue\c_space_tl \pdfxform_ref:o {__hyp_xform_Ding} + %/Off \c_space_tl \pdfxform_ref:n {__hyp_xform_DingOff} %hm + >> + >> + } + {\fbox{ \MakeRadioField{\Fld@width}{\Fld@height}} } + \int_compare:nNnT { \Fld@listcount} = { 1 } + { \HyField@AddToFields } + \c_space_tl % deliberate space between radio buttons + % to do: --> should be configurable + }% +} + +\newcount\Fld@listcount +\def\__hypListbox#1 + { + \HyField@PDFChoices{#1} + \mode_leave_vertical: + \HyAnn@AbsPageLabel + \Hy@escapeform\PDFForm@List + \pdf_link_user:nnn + {widget} %perhaps we need more types?? + {\PDFForm@List} + {\MakeChoiceField{\Fld@width}{\Fld@height}} + \HyField@AddToFields + } + +\def\@PushButton[#1]#2{% parameters, label + \def\Fld@name{#2}% + \group_begin: + \exp_args:No\HyField@SetKeys + { + \DefaultOptionsofPushButton,#1 + } + \PDFForm@Name + \pdfmeta_standard_verify:nnTF {annot_action_A}{JavaScript} + { + \HyField@FlagsPushButton + \legacy_if:nT {Fld@hidden} + { + \def\Fld@width{1sp} + } + \LayoutPushButtonField + { + \mode_leave_vertical: + \HyAnn@AbsPageLabel + \Hy@escapeform\PDFForm@Push + \hbox_set:Nn \l_tmpa_box { \MakeButtonField {#2}} + \pdfannot_box:nnnn + {\box_wd:N\l_tmpa_box} + {\box_ht:N\l_tmpa_box} + {\box_dp:N\l_tmpa_box} %is this correct? + {\PDFForm@Push} + {\box_use:N\l_tmpa_box} + \HyField@AddToFields + } + } + { + \msg_error:nn { hyp }{ pdfa-no-push-button } + \LayoutPushButtonField + { + \mode_leave_vertical: + \MakeButtonField{#2} + } + } + \group_end: +} + +\def\@Submit[#1]#2 + { + \def\Fld@width {\DefaultWidthofSubmit} + \def\Fld@height{\DefaultHeightofSubmit} + \group_begin: + \exp_args:No\HyField@SetKeys + { + \DefaultOptionsofSubmit,#1 + } + \HyField@FlagsPushButton + \HyField@FlagsSubmit + \legacy_if:nT { Fld@hidden } + { + \def\Fld@width{1sp} + } + \mode_leave_vertical: + \HyAnn@AbsPageLabel + \Hy@escapeform\PDFForm@Submit + \hbox_set:Nn \l_tmpa_box { \MakeButtonField {#2}} + \pdfannot_box:nnnn + {\box_wd:N\l_tmpa_box} + {\box_ht:N\l_tmpa_box} + {\box_dp:N\l_tmpa_box} %is this correct? + { + \PDFForm@Submit + /AP<< + /N~\pdfxform_ref:n {__hyp_xform_Submit}~ + /D~\pdfxform_ref:n {__hyp_xform_SubmitP} + >> + } + \HyField@AddToFields + \box_use:N\l_tmpa_box + + \group_end: + } + +\def\@Reset[#1]#2 + { + \def\Fld@width {\DefaultWidthofReset} + \def\Fld@height{\DefaultHeightofReset} + \group_begin: + \exp_args:No\HyField@SetKeys + { + \DefaultOptionsofReset,#1 + } + \mode_leave_vertical: + \pdfmeta_standard_verify:nnTF {annot_action_A}{ResetForm} + { + \HyField@FlagsPushButton + \legacy_if:nT { Fld@hidden } + { \def\Fld@width{1sp} } + \HyAnn@AbsPageLabel + \Hy@escapeform\PDFForm@Reset + \hbox_set:Nn \l_tmpa_box { \MakeButtonField {#2}} + \pdfannot_box:nnnn + {\box_wd:N\l_tmpa_box} + {\box_ht:N\l_tmpa_box} + {\box_dp:N\l_tmpa_box} %is this correct? + { \PDFForm@Reset } + \HyField@AddToFields + \box_use:N \l_tmpa_box + } + { + \msg_error:nn { hyp }{ pdfa-no-reset-button } + \MakeButtonField{#2} + } + \group_end: + } + +\def\@CheckBox[#1]#2 + {% parameters, label + \def\Fld@name{#2} + \def\Fld@default{0} + \group_begin: + \def\Fld@width {\DefaultWidthofCheckBox} + \def\Fld@height{\DefaultHeightofCheckBox} + \exp_args:No\HyField@SetKeys + { + \DefaultOptionsofCheckBox,#1 + } + \PDFForm@Name + \HyField@FlagsCheckBox + \legacy_if:nT { Fld@hidden } + { + \def\Fld@width{1sp} + } + \LayoutCheckField{#2} + { + \mode_leave_vertical: + \HyAnn@AbsPageLabel + \Hy@escapeform\PDFForm@Check + \pdfannot_box:nnnn + {\Fld@width} + {\Fld@height} + {0pt} %is this correct? + {\PDFForm@Check} + \HyField@AddToFields %check if this works with xelatex ... + } + \group_end: + } +\ExplSyntaxOff + +\ExplSyntaxOn +\def\Hy@FormObjects + { + \pdf_object_new:nn {l__hyp_encoding_pdfdoc_obj } { dict } + \pdf_object_new:nn {l__hyp_font_zapfdingbats_obj } { dict } + \pdf_object_new:nn {l__hyp_font_helvetica_obj } { dict } + \pdf_object_write:nx {l__hyp_encoding_pdfdoc_obj } + { + /Type/Encoding + /Differences[ + 24/breve/caron/circumflex/dotaccent/hungarumlaut/ogonek + /ring/tilde + \c_space_tl + 39/quotesingle + \c_space_tl + 96/grave % + \iow_newline: + 128/bullet/dagger/daggerdbl/ellipsis/emdash/endash/florin + /fraction/guilsinglleft/guilsinglright/minus/perthousand + /quotedblbase/quotedblleft/quotedblright/quoteleft + /quoteright/quotesinglbase/trademark/fi/fl/Lslash/OE + /Scaron/Ydieresis/Zcaron/dotlessi/lslash/oe/scaron/zcaron + \iow_newline: + 164/currency + \c_space_tl + 166/brokenbar + \c_space_tl + 168/dieresis/copyright/ordfeminine + \c_space_tl + 172/logicalnot/.notdef/registered/macron/degree/plusminus + /twosuperior/threesuperior/acute/mu + \c_space_tl + 183/periodcentered/cedilla/onesuperior/ordmasculine + \c_space_tl + 188/onequarter/onehalf/threequarters + \iow_newline: + 192/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE + /Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave + /Iacute/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute + /Ocircumflex/Otilde/Odieresis/multiply/Oslash/Ugrave + /Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls + /agrave/aacute/acircumflex/atilde/adieresis/aring/ae + /ccedilla/egrave/eacute/ecircumflex/edieresis/igrave + /iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute + /ocircumflex/otilde/odieresis/divide/oslash/ugrave + /uacute/ucircumflex/udieresis/yacute/thorn/ydieresis + ] + } + \pdf_object_write:nn {l__hyp_font_zapfdingbats_obj } + { + /Type/Font + /Subtype/Type1 + /Name/ZaDb + /BaseFont/ZapfDingbats + } + \pdf_object_write:nx {l__hyp_font_helvetica_obj } + { + /Type/Font + /Subtype/Type1 + /Name/Helv + /BaseFont/Helvetica + /Encoding~\pdf_object_ref:n { l__hyp_encoding_pdfdoc_obj } + } + \global\let\Hy@FormObjects\relax + } +\ExplSyntaxOff +\providecommand*{\Fld@pageobjref}{} +\ifcsname pdf@escapestring\endcsname + \def\Hy@escapeform#1{% + \ifHy@pdfescapeform + \let\Hy@escapestring\pdfescapestring + \else + \let\Hy@escapestring\@firstofone + \fi + }% + \Hy@escapeform{}% +\else + \let\Hy@escapestring\@firstofone + \def\Hy@escapeform#1{% + \ifHy@pdfescapeform + \def\Hy@escapestring##1{% + \noexpand\Hy@escapestring{\noexpand##1}% + }% + \edef\Hy@temp{#1}% + \expandafter\Hy__hypescapeform\Hy@temp\Hy@escapestring{}\@nil + \def\Hy@escapestring##1{% + \@ifundefined{Hy@esc@\string##1}{% + ##1% + \ThisShouldNotHappen + }{% + \csname Hy@esc@\string##1\endcsname + }% + }% + \else + \let\Hy@escapestring\@firstofone + \fi + }% + \def\Hy__hypescapeform#1\Hy@escapestring#2#3\@nil{% + \ifx\\#3\\% + \else + \expandafter + \Hy@pstringdef\csname Hy@esc@\string#2\endcsname{#2}% probably string-hex + \ltx@ReturnAfterFi{% + \Hy__hypescapeform#3\@nil + }% + \fi + }% +\fi +\def\PDFForm@Name{% + \PDFForm__hypName\Fld@name + \ifx\Fld@altname\relax + \else + \PDFForm__hypName\Fld@altname + \fi + \ifx\Fld@mappingname\relax + \else + \PDFForm__hypName\Fld@mappingname + \fi +} +\def\PDFForm__hypName#1{% + \begingroup + \ifnum\Hy@pdfversion<5 % implementation note 117, PDF spec 1.7 + \ifHy@unicode + \Hy@unicodefalse + \fi + \fi + \pdfstringdef\Hy@gtemp#1% + \endgroup + \let#1\Hy@gtemp +} +\def\Fld@X@additionalactions{% + \ifx\Fld@keystroke@code\@empty + \else + /K<</S/JavaScript/JS(\Hy@escapestring{\Fld@keystroke@code})>>% + \fi + \ifx\Fld@format@code\@empty + \else + /F<</S/JavaScript/JS(\Hy@escapestring{\Fld@format@code})>>% + \fi + \ifx\Fld@validate@code\@empty + \else + /V<</S/JavaScript/JS(\Hy@escapestring{\Fld@validate@code})>>% + \fi + \ifx\Fld@calculate@code\@empty + \else + /C<</S/JavaScript/JS(\Hy@escapestring{\Fld@calculate@code})>>% + \fi + \ifx\Fld@onfocus@code\@empty + \else + /Fo<</S/JavaScript/JS(\Hy@escapestring{\Fld@onfocus@code})>>% + \fi + \ifx\Fld@onblur@code\@empty + \else + /Bl<</S/JavaScript/JS(\Hy@escapestring{\Fld@onblur@code})>>% + \fi + \ifx\Fld@onmousedown@code\@empty + \else + /D<</S/JavaScript/JS(\Hy@escapestring{\Fld@onmousedown@code})>>% + \fi + \ifx\Fld@onmouseup@code\@empty + \else + /U<</S/JavaScript/JS(\Hy@escapestring{\Fld@onmouseup@code})>>% + \fi + \ifx\Fld@onenter@code\@empty + \else + /E<</S/JavaScript/JS(\Hy@escapestring{\Fld@onenter@code})>>% + \fi + \ifx\Fld@onexit@code\@empty + \else + /X<</S/JavaScript/JS(\Hy@escapestring{\Fld@onexit@code})>>% + \fi +} +\ExplSyntaxOn +\def\Fld@additionalactions + {% + \exp_args:Ne\str_if_eq:nnF {\Fld@X@additionalactions}{} + { + \pdfmeta_standard_verify:nT {annot_widget_no_AA} + {/AA<<\Fld@X@additionalactions>>} + } + } +\ExplSyntaxOff +\def\Fld@annotnames{% + /T(\Fld@name)% + \ifx\Fld@altname\relax + \else + /TU(\Fld@altname)% + \fi + \ifx\Fld@mappingname\relax + \else + /TM(\Fld@mappingname)% + \fi +} +\ExplSyntaxOn +\def\PDFForm@Check + { + /Subtype/Widget + ~\Fld@annotflags + ~\Fld@pageobjref + ~\Fld@annotnames + /FT/Btn + \Fld@flags + /Q~\Fld@align + /BS<</W~\Fld@borderwidth /S/\Fld@borderstyle>> + /AP + << + /N + << + /Yes~\pdfxform_ref:o{\l__hyp_CheckmarkYes_tl} + /Off~\pdfxform_ref:o{\l__hyp_CheckmarkOff_tl} + >> + >> + /MK<< + \int_compare:nNnF {\Fld@rotation}={0} + { + /R~\Fld@rotation + } + \tl_if_empty:NF\Fld@bordercolor + { + /BC[\Fld@bordercolor] + } + \tl_if_empty:NF\Fld@bcolor + { + /BG[\Fld@bcolor] + } + /CA(\Hy@escapestring{\Fld@cbsymbol})% + >> + /DA + ( + /ZaDb~\strip@pt\Fld@charsize\c_space_tl Tf + \tl_if_empty:NF \Fld@color + { + \c_space_tl \Fld@color + } + ) + /H/P + \legacy_if:nTF {Fld@checked} + { + /V/Yes /AS/Yes + } + { + /V/Off /AS/Off + } + \Fld@additionalactions +} +\ExplSyntaxOff +\ExplSyntaxOn + \def\PDFForm@Push + { + /Subtype/Widget + ~\Fld@annotflags + ~\Fld@pageobjref + ~\Fld@annotnames + /FT/Btn + ~\Fld@flags + /H/P + /BS<</W~\Fld@borderwidth/S/\Fld@borderstyle>> + \bool_if:nT + { + !\int_compare_p:nNn {\Fld@rotation} = {0} + || + \tl_if_exist_p:N \Fld@bordercolor + } + { + /MK + << + \int_compare:nNnF {\Fld@rotation} = {0} + { + /R~\Fld@rotation + } + \tl_if_exist:NT \Fld@bordercolor + { + /BC[\Fld@bordercolor] + } + >> + } + /A<</S/JavaScript/JS(\Hy@escapestring{\Fld@onclick@code})>> + \Fld@additionalactions + } + +\ExplSyntaxOff +\def\PDFForm@List{% + /Subtype/Widget% + \Fld@annotflags + \Fld@pageobjref + \Fld@annotnames + /FT/Ch% + \Fld@flags + /Q \Fld@align + /BS<</W \Fld@borderwidth/S/\Fld@borderstyle>>% + \ifcase0\ifnum\Fld@rotation=\z@ \else 1\fi + \ifx\Fld@bordercolor\relax\else 1\fi + \ifx\fld@bcolor\relax \else 1\fi + \space + \else + /MK<<% + \ifnum\Fld@rotation=\z@ + \else + /R \Fld@rotation + \fi + \ifx\Fld@bordercolor\relax + \else + /BC[\Fld@bordercolor]% + \fi + \ifx\Fld@bcolor\relax + \else + /BG[\Fld@bcolor]% + \fi + >>% + \fi + /DA(/Helv \strip@pt\Fld@charsize\space Tf% + \ifx\Fld@color\@empty\else\space\Fld@color\fi)% + \Fld@choices + \Fld@additionalactions +} +\ExplSyntaxOn +\def\PDFForm@Radio + { + /Subtype/Widget + ~\Fld@annotflags + ~\Fld@pageobjref + ~\Fld@annotnames + /FT/Btn + \Fld@flags + /H/P + /BS<</W~\Fld@borderwidth/S/\Fld@borderstyle>> + /MK<< + \ifnum\Fld@rotation=\z@ + \else + /R~\Fld@rotation + \fi + \ifx\Fld@bordercolor\relax + \else + /BC[\Fld@bordercolor]% + \fi + \ifx\Fld@bcolor\relax + \else + /BG[\Fld@bcolor]% + \fi + /CA(\Hy@escapestring{\Fld@radiosymbol})% + >> + /DA(/ZaDb~\strip@pt\Fld@charsize\space Tf% + \ifx\Fld@color\@empty\else\space\Fld@color\fi)% + \ifx\Fld@default\@empty + /V/Off% + /DV/Off% + \else + /V/\Fld@default + /DV/\Fld@default + \fi + \Fld@additionalactions + } +\ExplSyntaxOff +\ExplSyntaxOn +\def\PDFForm@Text + { + /Subtype/Widget + ~\Fld@annotflags + ~\Fld@pageobjref + ~\Fld@annotnames + /FT/Tx + ~\Fld@flags + /Q~\Fld@align + /BS<</W~\Fld@borderwidth\c_space_tl /S /\Fld@borderstyle>> + \bool_if:nT + { + !\int_compare_p:nNn {\Fld@rotation} = {0} + || + \tl_if_exist_p:N \Fld@bordercolor + || + \tl_if_exist_p:N \Fld@bcolor + } + { + /MK + << + \int_compare:nNnF {\Fld@rotation} = {0} + { + /R~\Fld@rotation + } + \tl_if_exist:NT \Fld@bordercolor + { + /BC[\Fld@bordercolor] + } + \tl_if_exist:NT \Fld@bcolor + { + /BG[\Fld@bcolor] + } + >> + } + /DA + ( + /Helv~\strip@pt\Fld@charsize\c_space_tl Tf + \tl_if_empty:NF {\c_space_tl\Fld@color} + ) + /DV(\Hy@escapestring{\Fld@default}) + /V(\Hy@escapestring{\Fld@value}) + ~\Fld@additionalactions + \int_compare:nNnT { \Fld@maxlen}>{0} + { + /MaxLen~\Fld@maxlen + } + } +\ExplSyntaxOff + +\def\PDFForm@Submit{% + /Subtype/Widget% + \Fld@annotflags + \Fld@pageobjref + \Fld@annotnames + /FT/Btn% + \Fld@flags + /H/P% + /BS<</W \Fld@borderwidth/S/\Fld@borderstyle>>% + \ifcase0\ifnum\Fld@rotation=\z@ \else 1\fi + \ifx\Fld@bordercolor\relax\else 1\fi + \space + \else + /MK<<% + \ifnum\Fld@rotation=\z@ + \else + /R \Fld@rotation + \fi + \ifx\Fld@bordercolor\relax + \else + /BC[\Fld@bordercolor]% + \fi + >>% + \fi + /A<<% + /S/SubmitForm% + /F<<% + /FS/URL% + /F(\Hy@escapestring{\Form@action})% + >>% + \Fld@submitflags + >>% + \Fld@additionalactions +} +\ExplSyntaxOn + \def\PDFForm@Reset{% + /Subtype/Widget% + \Fld@annotflags + \Fld@pageobjref + \Fld@annotnames + /FT/Btn% + \Fld@flags + /H/P% + /DA(/Helv~\strip@pt\Fld@charsize\space Tf~0~0~1~rg)% + \ifcase0\ifnum\Fld@rotation=\z@ \else 1\fi + \ifx\Fld@bordercolor\relax\else 1\fi + \space + \else + /MK<<% + \ifnum\Fld@rotation=\z@ + \else + /R~\Fld@rotation + \fi + \ifx\Fld@bordercolor\relax + \else + /BC[\Fld@bordercolor]% + \fi + >>% + \fi + /BS<</W \Fld@borderwidth/S/\Fld@borderstyle>>% + /A<</S/ResetForm>>% + \Fld@additionalactions + }% + + %these patterns are used in hyperref checks. +\str_case:VnF \c_sys_backend_str + { + { pdfmode } + { + \def\HyPat@ObjRef + { + [0-9]*[1-9][0-9]*~0~R + } + } + { dvipdfmx } + { + \def\HyPat@ObjRef + { + @[^~]+ + } + } + { xdvipdfmx } + { + \def\HyPat@ObjRef + { + @[^~]+ + } + } + } + { %also set in hyperref sty, so probably not needed. + \def\HyPat@ObjRef/{.+} + } + +\ExplSyntaxOff +%% \RequirePackage{rerunfilecheck}[2009/12/10] +%% removed \Hy@OutlineRerunCheck, unneeded with bookmark +%% removed \ReadBookmarks / unneeded with bookmark. +%% removed \Hy@OutlineName +%% removed \check@bm@number +%% removed \calc@bm@number + +\ifHy@implicit +\else + \expandafter\endinput +\fi +\newlength\Hy@SectionHShift +\def\Hy@SectionAnchorHref#1{% + \ifx\protect\@typeset@protect + \Hy__hypSectionAnchor{#1}% + \fi +} +\DeclareRobustCommand*{\Hy__hypSectionAnchor}[1]{% + \leavevmode + \hbox to 0pt{% + \kern-\Hy@SectionHShift + \Hy@raisedlink{% + \hyper@anchorstart{#1}\hyper@anchorend + }% + \hss + }% +} +\let\H@old@ssect\@ssect +\def\@ssect#1#2#3#4#5{% + \Hy@MakeCurrentHrefAuto{section*}% + \setlength{\Hy@SectionHShift}{#1}% + \begingroup + \toks@{\H@old@ssect{#1}{#2}{#3}{#4}}% + \toks\tw@\expandafter{% + \expandafter\Hy@SectionAnchorHref\expandafter{\@currentHref}% + #5% + }% + \edef\x{\endgroup + \the\toks@{\the\toks\tw@}% + }\x +} +\let\H@old@schapter\@schapter +\def\@schapter#1{% + \begingroup + \let\@mkboth\@gobbletwo + \Hy@MakeCurrentHrefAuto{\Hy@chapapp*}% + \Hy@raisedlink{% + \hyper@anchorstart{\@currentHref}\hyper@anchorend + }% + \endgroup + \H@old@schapter{#1}% +} +\ltx@IfUndefined{@chapter}{}{% + \let\Hy@org@chapter\@chapter + \def\@chapter{% + \def\Hy@next{% + \Hy@MakeCurrentHrefAuto{\Hy@chapapp*}% + \Hy@raisedlink{% + \hyper@anchorstart{\@currentHref}\hyper@anchorend + }% + }% + \ifnum\c@secnumdepth>\m@ne + \ltx@IfUndefined{if@mainmatter}% + \iftrue{\csname if@mainmatter\endcsname}% + \let\Hy@next\relax + \fi + \fi + \Hy@next + \Hy@org@chapter + }% +} +\let\H@old@part\@part +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname chapter\endcsname\relax + \let\Hy@secnum@part\z@ +\else + \let\Hy@secnum@part\m@ne +\fi +\def\@part{% + \ifnum\Hy@secnum@part>\c@secnumdepth + \phantomsection + \fi + \H@old@part +} +\let\H@old@spart\@spart +\def\@spart#1{% + \Hy@MakeCurrentHrefAuto{part*}% + \Hy@raisedlink{% + \hyper@anchorstart{\@currentHref}\hyper@anchorend + }% + \H@old@spart{#1}% +} +\let\H@old@sect\@sect +\def\@sect#1#2#3#4#5#6[#7]#8{% + \ifnum #2>\c@secnumdepth + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + {% + \Hy@MakeCurrentHrefAuto{section*}% + \setlength{\Hy@SectionHShift}{#3}% + \begingroup + \toks@{\H@old@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]}% + \toks\tw@\expandafter{% + \expandafter\Hy@SectionAnchorHref\expandafter{\@currentHref}% + #8% + }% + \edef\x{\endgroup + \the\toks@{\the\toks\tw@}% + }\x + }{% + \H@old@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}% + }% +} +\expandafter\def\csname Parent-4\endcsname{} +\expandafter\def\csname Parent-3\endcsname{} +\expandafter\def\csname Parent-2\endcsname{} +\expandafter\def\csname Parent-1\endcsname{} +\expandafter\def\csname Parent0\endcsname{} +\expandafter\def\csname Parent1\endcsname{} +\expandafter\def\csname Parent2\endcsname{} +\expandafter\def\csname Parent3\endcsname{} +\expandafter\def\csname Parent4\endcsname{} +%% +%% End of file `hgeneric-testphase.def'. +%% +%% +%% End of file `hgeneric-testphase.def'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperref-colorschemes.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperref-colorschemes.def new file mode 100644 index 00000000000..e520fbf4475 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperref-colorschemes.def @@ -0,0 +1,144 @@ +%% +%% This is file `hyperref-colorschemes.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% hyperref-generic.dtx (with options: `colorscheme') +%% +%% Copyright (C) 2019-2021 The LaTeX Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "LaTeX PDF management testphase bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: hyperref-generic.dtx + +\prop_const_from_keyval:Nn \c__hyp_colorscheme_original_prop + { + linkcolor = [rgb]{1,0,0}, %red + filecolor = [rgb]{0,1,1}, %cyan + urlcolor = [rgb]{1,0,1}, %magenta + menucolor = [rgb]{1, 0, 0}, %red + runcolor = [rgb]{0,1,1}, %cyan + %------------- + linkbordercolor = [rgb]{1, 0 ,0 }, + filebordercolor = [rgb]{0, .5, .5}, + urlbordercolor = [rgb]{0, 1, 1}, + menubordercolor = [rgb]{1, 0, 0}, + runbordercolor = [rgb]{0, .7, .7} + } + +\prop_const_from_keyval:Nn \c__hyp_colorscheme_daleif_prop + { + linkcolor = [rgb]{0,0.2,0.6}, + filecolor = [rgb]{0.8,0,0.8}, + urlcolor = [rgb]{0.8,0,0.8}, + menucolor = [rgb]{0,0.2,0.6}, + runcolor = [rgb]{0.8,0,0.8}, + %------------- %-------- + linkbordercolor = [rgb]{0,0.2,0.6}, + filebordercolor = [rgb]{0.8,0,0.8}, + urlbordercolor = [rgb]{0.8,0,0.8}, + menubordercolor = [rgb]{0,0.2,0.6}, + runbordercolor = [rgb]{0.8,0,0.8} + } + +\prop_const_from_keyval:Nn \c__hyp_colorscheme_julian_prop + { %two colors: intern/extern + linkcolor = [rgb]{0.79216, 0, 0.12549}, + filecolor = [rgb]{0.01961, 0.44314, 0.6902}, + urlcolor = [rgb]{0.01961, 0.44314, 0.6902}, + menucolor = [rgb]{0.79216, 0, 0.12549 }, + runcolor = [rgb]{0.01961, 0.44314, 0.6902 }, + %------------- %-------- + linkbordercolor = [rgb]{0.79216, 0, 0.12549}, + filebordercolor = [rgb]{0.01961, 0.44314, 0.6902}, + urlbordercolor = [rgb]{0.01961, 0.44314, 0.6902}, + menubordercolor = [rgb]{0.79216, 0, 0.12549 }, + runbordercolor = [rgb]{0.01961, 0.44314, 0.6902 } + } + +\prop_const_from_keyval:Nn \c__hyp_colorscheme_tivv_prop + { %all darkgray + linkcolor = [rgb]{0.4 ,0.4 ,0.4 }, + filecolor = [rgb]{0.4 ,0.4 ,0.4 }, + urlcolor = [rgb]{0.4 ,0.4 ,0.4 }, + menucolor = [rgb]{0.4 ,0.4 ,0.4 }, + runcolor = [rgb]{0.4 ,0.4 ,0.4 }, + %------------- %-------- + linkbordercolor = [rgb]{0.4 ,0.4 ,0.4 }, + filebordercolor = [rgb]{0.4 ,0.4 ,0.4 }, + urlbordercolor = [rgb]{0.4 ,0.4 ,0.4 }, + menubordercolor = [rgb]{0.4 ,0.4 ,0.4 }, + runbordercolor = [rgb]{0.4 ,0.4 ,0.4 } + } + +\prop_const_from_keyval:Nn \c__hyp_colorscheme_szabolcsA_prop + { %dvipsnam.def + linkcolor = [rgb]{0.06, 0.46, 1}, %NavyBlue + filecolor = [rgb]{1, 0, 0}, %Red + urlcolor = [rgb]{0.06, 0.46, 1}, %NavyBlue + menucolor = [rgb]{1, 0, 0}, %Red + runcolor = [rgb]{1, 0, 0}, %Red + %------------- %------------------ + linkbordercolor = [rgb]{0.06, 0.46, 1}, %NavyBlue + filebordercolor = [rgb]{1, 0, 0}, %Red + urlbordercolor = [rgb]{0.06, 0.46, 1}, %NavyBlue + menubordercolor = [rgb]{1, 0, 0}, %Red + runbordercolor = [rgb]{1, 0, 0} %Red + } + +\prop_const_from_keyval:Nn \c__hyp_colorscheme_szabolcsB_prop + { %dvipsnam.def + linkcolor = [rgb]{0.72, 0, 0}, %BrickRed + filecolor = [rgb]{0, 1, 0}, %Green + urlcolor = [rgb]{0.64, 0.08, 0.98}, %Mulberry + menucolor = [rgb]{0.06, 0.46, 1}, %NavyBlue + runcolor = [rgb]{0.64, 0.08, 0.98}, %Mulberry + %------------- %------------------ + linkbordercolor = [rgb]{0.72, 0, 0}, %BrickRed + filebordercolor = [rgb]{0, 1, 0}, %Green + urlbordercolor = [rgb]{0.64, 0.08, 0.98}, %Mulberry + menubordercolor = [rgb]{0.06, 0.46, 1}, %NavyBlue + runbordercolor = [rgb]{0.64, 0.08, 0.98} %Mulberry + } + +\prop_const_from_keyval:Nn \c__hyp_colorscheme_phelype_prop + { + linkcolor = [rgb]{0.50196, 0, 0.02353}, + filecolor = [rgb]{0.07451, 0.09412, 0.46667}, + urlcolor = [rgb]{0.54118, 0, 0.52941}, + menucolor = [rgb]{0.44706, 0.45882, 0}, + runcolor = [rgb]{0.07451, 0.46667, 0.46275}, + %------------- %------------- + linkbordercolor = [rgb]{0.701176, 0.4, 0.414118}, + filebordercolor = [rgb]{0.444706, 0.456472, 0.680002}, + urlbordercolor = [rgb]{0.724708, 0.4, 0.717646}, + menubordercolor = [rgb]{0.668236, 0.675292, 0.4}, + runbordercolor = [rgb]{0.444706, 0.680002, 0.67765} + } + +\prop_const_from_keyval:Nn \c__hyp_colorscheme_henryford_prop + { + linkcolor = [rgb]{0,0,0}, + filecolor = [rgb]{0,0,0}, + urlcolor = [rgb]{0,0,0}, + menucolor = [rgb]{0,0,0}, + runcolor = [rgb]{0,0,0}, + %------------- %-------- + linkbordercolor = [rgb]{0,0,0}, + filebordercolor = [rgb]{0,0,0}, + urlbordercolor = [rgb]{0,0,0}, + menubordercolor = [rgb]{0,0,0}, + runbordercolor = [rgb]{0,0,0} + } +%% +%% +%% End of file `hyperref-colorschemes.def'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty new file mode 100644 index 00000000000..e0cb3a4e1be --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty @@ -0,0 +1,139 @@ +%% This is file `hyperxmp-patches-tmp-ltx.sty" +% Copyright (C) 2019-2021 The LaTeX Project +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file +% +% https://www.latex-project.org/lppl.txt +% +% This file is part of the "pdfmanagement bundle" (The Work in LPPL) +% and all files in that bundle must be distributed together. +% +% ----------------------------------------------------------------------- +% +% The development version of the bundle can be found at +% +% https://github.com/latex3/pdfresources +% +% for those people who are interested. +\NeedsTeXFormat{LaTeX2e}[2020/10/01] +\ProvidesExplPackage{hyperxmp-patches-tmp-ltx} + {2021-02-22} {0.95a} + {Store hyperref metadata in XMP format / temporay patches to test pdfresource management ... UF} + +\cs_if_exist:NT \pdfmanagement_add:nnn + { + \pdfmanagement_if_active:T + { + \renewcommand\hyxmp@embed@packet{\hyxmp@embed@packet@generic} + } + } + +% +\newcommand*{\hyxmp@embed@packet@generic} + {% + \typeout{} + \typeout{!!~new-hyperxmp--generic~packet~command~used!!}{} + \typeout{} + \hyxmp@construct@packet + %or some other command to write a object: + \exp_args:Nnx + \pdf_object_unnamed_write:nn{stream}{{/Type~/Metadata~/Subtype~/XML}{\hyxmp@xml}}% + % reference in the Catalog: + \pdfmanagement_add:nnx {Catalog} {Metadata}{\pdf_object_ref_last:} + } + +% A standard should be retrieved from the document settings. +\cs_new:Npn \__hypxmp_get_Astandard:w #1-#2#3#4\q_stop + { + \tl_if_eq:nnT{#1}{A} + { + \Hy@pdfatrue + \tl_set:Nn \@pdfapart{#2} + \tl_set:Nx \@pdfaconformance{#3} + } + } +\cs_new_protected:Npn \__hyxmp_get_metadata: + { + \exp_last_unbraced:Ne \__hypxmp_get_Astandard:w + {\GetDocumentProperties{document/pdfstandard}}Z-ZZZ\q_stop + \clist_map_inline:nn + { + % hyperxmp keys: + ,pdfcopyright + ,pdftype + ,pdflicenseurl + ,pdfauthortitle + ,pdfcaptionwriter + ,pdfmetalang + %,pdfapart %document + %,pdfaconformance %document + ,pdfuapart %probably document too but later ... + ,pdfxstandard + ,pdfsource + ,pdfdocumentid + ,pdfinstanceid + ,pdfversionid + ,pdfrendition + ,pdfpublication + ,pdfpubtype + ,pdfbytes + ,pdfnumpages + ,pdfissn + ,pdfeissn + ,pdfisbn + ,pdfbookedition + ,pdfpublisher + ,pdfvolumenum + ,pdfissuenum + ,pdfpagerange + ,pdfdoi + ,pdfurl + ,pdfidentifier + ,pdfsubtitle + ,pdfpubstatus + ,pdfcontactaddress + ,pdfcontactcity + ,pdfcontactregion + ,pdfcontactpostcode + ,pdfcontactcountry + ,pdfcontactphone + ,pdfcontactemail + ,pdfcontacturl + ,pdfdate + %hyperref, needs probably special handling + ,pdftitle + ,pdfsubject + ,pdfkeywords + ,pdfproducer + } + { + \tl_if_exist:cF{@##1}{\tl_new:c{@##1}} + \tl_set:cx {@##1}{\GetDocumentProperties{hyperref/##1}} + } + + % pdfauthor, this is only a work around for simple author + % TODO needs improvement + \pdfstringdef\@pdfauthor{\GetDocumentProperties{hyperref/pdfauthor}} + \cs_set_eq:NN\hyxmp@pdfauthor\@pdfauthor + + % pdflang, + \tl_if_exist:cF{@pdflang}{\tl_new:c{@pdflang}} + \tl_set:cx {@pdflang}{\GetDocumentProperties{document/lang}} + } + +% we need to provide a few commands so that hyperxmp stops to overwrite them +% in \AtEndPreamble +\AddToHook{begindocument/before}[pdfmanagement/firstaid/hyperxmp]{% + \def\@pdfauthor{Author}\def\@pdftitle {Title}} + +\DeclareHookRule{begindocument/before}{pdfmanagement/firstaid/hyperxmp}{before}{hyperxmp} + +\AddToHook{enddocument}[pdfmanagement-firstaid]{\__hyxmp_get_metadata:} + +\DeclareHookRule{enddocument}{pdfmanagement-firstaid}{before}{hyperxmp} + + +\endinput diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def new file mode 100644 index 00000000000..3598d8244fb --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def @@ -0,0 +1,377 @@ +%% +%% This is file `l3backend-testphase-dvipdfmx.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3backend-testphase.dtx (with options: `drivers,dvipdfmx') +%% +%% Copyright (C) 2019-2021 The LaTeX Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "LaTeX PDF management testphase bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: l3backend-testphase.dtx +\ProvidesExplFile + {l3backend-testphase-dvipdfmx.def}{2021-02-22}{} + {LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx} +\RequirePackage{l3ref-tmp} +\cs_generate_variant:Nn \ref_label:nn {en} +\cs_generate_variant:Nn \ref_value:nn {en} +\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2 + { + \@bsphack + \ref_label:nn{#1}{abspage} + \@esphack + } +\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2 + { + \ref_value:nn{#1}{#2} + } +\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en} +\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en} + \__kernel_backend_literal:x { dvipdfmx:config~C~ 0x0010 } +\prop_new:N \g__pdf_tmpa_prop +\tl_new:N \l__pdf_tmpa_tl +\box_new:N \l__pdf_backend_tmpa_box +\int_new:N \g__pdf_backend_resourceid_int +\int_new:N \g__pdf_backend_name_int +\int_new:N \g__pdf_backend_page_int +\tl_gput_right:Nn \@kernel@after@shipout@lastpage + { + \g__kernel_pdfmanagement_end_run_code_tl + } +\tl_if_exist:NTF \@kernel@after@shipout@background + { + \g@addto@macro \@kernel@before@shipout@background{\relax} + \g@addto@macro \@kernel@after@shipout@background + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \tl_gput_left:Nn\@kernel@after@shipout@lastpage + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + { + \hook_gput_code:nnn{shipout/background}{pdf} + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \hook_gput_code:nnn {shipout/lastpage} {pdf} + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + +\cs_new_protected:Npn \__pdf_backend_Pages_primitive:n #1 + { + \__pdf_backend:n{put~@pages~<<#1>>} + } + %the primitive +\cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1 + { + \tex_special:D{pdf:~put~@thispage~<<#1>>} + } + % the command to store default values. + % Uses a prop with pdflatex + dvi, + % sets a lua table with lualatex +\cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2 + { + \pdfdict_gput:nnn {g__pdf_Core/Page}{ #1 }{ #2 } + } + % the command to remove a default value. + % Uses a prop with pdflatex + dvi, + % changes a lua table with lualatex +\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1 + { + \pdfdict_gremove:nn {g__pdf_Core/Page}{ #1 } + } + % the command used in the document. + % direct call of the primitive special with dvips/dvipdfmx + % \latelua: fill a page related table with lualatex, merge it with the page + % table and push it directly + % write to aux and store in prop with pdflatex +\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2 + { + \__pdf_backend_Page_primitive:n { /#1~#2 } + } + %the code to push the values, used in shipout + %merges the two props and then fills the register in pdflatex + %merges the two tables (the one is probably still empty) + % and then fills (in lua) in luatex + %issues the values stored in the global prop with dvi +\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1 + { + \exp_args:Nx \__pdf_backend_Page_primitive:n + { \pdfdict_use:n { g__pdf_Core/Page} } + } +\clist_const:Nn \c__pdf_backend_PageResources_clist + { + ExtGState, + ColorSpace, + Pattern, + Shading, + } +\hook_gset_rule:nnnn{shipout/firstpage}{l3backend-dvipdfmx}{after}{pdf} +\clist_map_inline:Nn \c__pdf_backend_PageResources_clist + { + \__pdf_backend_object_new:nn { Page/Resources/#1 } { dict } + \hook_gput_code:nnn{shipout/firstpage}{pdf}{\__pdf_backend_object_write:nn { Page/Resources/#1 } {}} + } +\cs_new_protected:Npn \__pdf_backend_PageResources:n #1 + { + \__pdf_backend:n {put~@resources~<<#1>>} + } +\cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3 + { + % this is not used for output, but there is a test if the resource is empty + \exp_args:Nnx + \prop_gput:cnn { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/#1} } + { \str_convert_pdfname:n {#2} }{ #3 } + %objects are not filled with \pdf_object_write as this is not additive! + \__pdf_backend:x + { + put~\__pdf_backend_object_ref:n {Page/Resources/#1}<</#2~#3>> + } + } + +\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush: {} +\bool_new:N \l__pdf_backend_xform_bool + + \cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name + { + \int_gincr:N \g__pdf_backend_name_int + \__kernel_backend_literal:x + { + pdf:code~/#1/l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC + } + \__kernel_backend_literal:x + { + pdf:put~@resources~ + << + /Properties~ + << + /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl + \__pdf_backend_object_ref:n { #2 } + >> + >> + } + } + \cs_set_protected:Npn \__pdf_backend_bdcobject:n #1 % #1 eg. Span + { + \int_gincr:N \g__pdf_backend_name_int + \__kernel_backend_literal:x + { + pdf:code~/#1/l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC + } + \__kernel_backend_literal:x + { + pdf:put~@resources~ + << + /Properties~ + << + /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl + \__pdf_backend_object_last: + >> + >> + } + } +\cs_set_protected:Npn \__pdf_backend_bmc:n #1 + { + \__kernel_backend_literal:n {pdf:code~/#1~BMC} %pdfbase + } + +\cs_set_protected:Npn \__pdf_backend_bdc_contobj:nn #1 #2 + { + \pdf_object_unnamed_write:nn { dict }{ #2 } + \__pdf_backend_bdcobject:n { #1 } + } + +\cs_set_protected:Npn \__pdf_backend_bdc_contstream:nn #1 #2 + { + \__kernel_backend_literal:n {pdf:code~ /#1~<<#2>>~BDC } + } + +\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2 + { + \bool_if:NTF \g__pdfmanagement_active_bool + {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contobj:nn} + {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contstream:nn} + \__pdf_backend_bdc:nn {#1}{#2} + } +\cs_set_protected:Npn \__pdf_backend_emc: + { + \__kernel_backend_literal:n {pdf:code~EMC} %pdfbase + } + % properties are handled automatically, but the other resources should be added + % at shipout +\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1 + { + \clist_map_inline:Nn \c__pdf_backend_PageResources_clist + { + \prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/##1} } + { + \__kernel_backend_literal:x + { + pdf:put~@resources~ + <</##1~\__pdf_backend_object_ref:n {Page/Resources/##1}>> + } + } + } + } +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content + { + \pdf_object_unnamed_write:nn {dict} { /Names [#1] } + %n or x? + \__pdf_backend:x {put~@names~<</EmbeddedFiles~\pdf_object_ref_last: >>} + } + + +\int_new:N \g__pdf_backend_EmbeddedFiles_int +\cs_new:Npn \__pdf_backend_EmbeddedFiles_name: + { + ( + l3ef + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000} + {0} + \int_use:N \g__pdf_backend_EmbeddedFiles_int + ) + } +\seq_new:N \g__pdf_backend_EmbeddedFiles_seq +\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1 + %#1 object ref + { + \int_gincr:N \g__pdf_backend_EmbeddedFiles_int + \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop + { #1 } + { \__pdf_backend_EmbeddedFiles_name: } + \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq + { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 } + } + + % it needs a bit testing if it really works to set the box to 0 before the special ... + % does it disturb viewing the xobject? + % what happens with the resources (bdc)? (should work as they are specials too) + % xetex requires that the special is in horizontal mode. This means it affects + % typesetting. But we can no delay the whole form code to shipout + % as the object reference and the size is often wanted on the current page. + % so we need to allocate a box - but probably they won't be thousands xform + % in a document so it shouldn't matter. + \cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4 + % #1 name + % #2 attributes + % #3 resources + % #4 content, not necessarily a box! + { + \int_gincr:N \g__pdf_backend_object_int + \int_const:cn + { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + { \g__pdf_backend_object_int } + \box_new:c { g__pdf_backend_xform_#1_box } + \hbox_gset:cn { g__pdf_backend_xform_#1_box } + { + \bool_set_true:N \l__pdf_backend_xform_bool + #4 + } + \tl_const:cx + { c__pdf_backend_xform_wd_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_wd:c { g__pdf_backend_xform_#1_box } } + \tl_const:cx + { c__pdf_backend_xform_ht_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_ht:c { g__pdf_backend_xform_#1_box } } + \tl_const:cx + { c__pdf_backend_xform_dp_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_dp:c { g__pdf_backend_xform_#1_box } } + \box_set_dp:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim } + \box_set_ht:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim } + \box_set_wd:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim } + \hook_gput_next_code:nn {shipout/background} + { + \mode_leave_vertical: %needed, the xform disappears without it. + \__pdf_backend:x + { + bxobj ~ \__pdf_backend_xform_ref:n { #1 } + \c_space_tl width ~ \pdfxform_wd:n { #1 } + \c_space_tl height ~ \pdfxform_ht:n { #1 } + \c_space_tl depth ~ \pdfxform_dp:n { #1 } + } + \box_use_drop:c { g__pdf_backend_xform_#1_box } + \__pdf_backend:x {put ~ @resources ~<<#3>> } + \__pdf_backend:x + { + put~ @resources ~ + << + /ExtGState~ \pdf_object_ref:n { Page/Resources/ExtGState } + >> + } + \__pdf_backend:x + { + put~ @resources ~ + << + /Pattern~ \pdf_object_ref:n { Page/Resources/Pattern } + >> + } + \__pdf_backend:x + { + put~ @resources ~ + << + /Shading~ \pdf_object_ref:n { Page/Resources/Shading } + >> + } + \__pdf_backend:x + { + put~ @resources ~ + << + /ColorSpace~ + \pdf_object_ref:n { Page/Resources/ColorSpace } + >> + } + \exp_args:Nx + \__pdf_backend:x {exobj ~<<#2>>} + } + } + + \cs_new:Npn \__pdf_backend_xform_ref:n #1 + { + @pdf.xform \int_use:c { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + } + + \cs_new_protected:Npn \__pdf_backend_xform_use:n #1 + { + \hbox_set:Nn \l__pdf_backend_tmpa_box + { + \__pdf_backend:x + { + uxobj~ \__pdf_backend_xform_ref:n { #1 } + } + } + \box_set_wd:Nn \l__pdf_backend_tmpa_box { \pdfxform_wd:n { #1 } } + \box_set_ht:Nn \l__pdf_backend_tmpa_box { \pdfxform_ht:n { #1 } } + \box_set_dp:Nn \l__pdf_backend_tmpa_box { \pdfxform_dp:n { #1 } } + \box_use_drop:N \l__pdf_backend_tmpa_box + } +%% all +\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF } + { + \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + { \prg_return_true: } + { \prg_return_false:} + } +\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n + { TF , T , F , p } +%% +%% +%% End of file `l3backend-testphase-dvipdfmx.def'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def new file mode 100644 index 00000000000..13f31d3e3cb --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def @@ -0,0 +1,194 @@ +%% +%% This is file `l3backend-testphase-dvips.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3backend-testphase.dtx (with options: `drivers,dvips') +%% +%% Copyright (C) 2019-2021 The LaTeX Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "LaTeX PDF management testphase bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: l3backend-testphase.dtx +\ProvidesExplFile + {l3backend-testphase-dvips.def}{2021-02-22}{} + {LaTeX~PDF~management~testphase~bundle~backend~support: dvips} +\RequirePackage{l3ref-tmp} +\cs_generate_variant:Nn \ref_label:nn {en} +\cs_generate_variant:Nn \ref_value:nn {en} +\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2 + { + \@bsphack + \ref_label:nn{#1}{abspage} + \@esphack + } +\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2 + { + \ref_value:nn{#1}{#2} + } +\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en} +\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en} +\prop_new:N \g__pdf_tmpa_prop +\tl_new:N \l__pdf_tmpa_tl +\box_new:N \l__pdf_backend_tmpa_box +\int_new:N \g__pdf_backend_resourceid_int +\int_new:N \g__pdf_backend_name_int +\int_new:N \g__pdf_backend_page_int +\tl_gput_right:Nn\@kernel@after@shipout@lastpage + { + \g__kernel_pdfmanagement_end_run_code_tl + } +\tl_if_exist:NTF \@kernel@after@shipout@background + { + \g@addto@macro \@kernel@before@shipout@background{\relax} + \g@addto@macro \@kernel@after@shipout@background + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \tl_gput_left:Nn\@kernel@after@shipout@lastpage + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + { + \hook_gput_code:nnn{shipout/background}{pdf} + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \hook_gput_code:nnn {shipout/lastpage} {pdf} + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + +\cs_new_protected:Npx \__pdf_backend_Pages_primitive:n #1 + { + \tex_special:D{ps:~[#1~/PAGES~pdfmark} %] + } +\cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1 + { + \tex_special:D{ps:~[{ThisPage}<<#1>>~/PUT~pdfmark} %] + } + % the command to store default values. + % Uses a prop with pdflatex + dvi, + % sets a lua table with lualatex +\cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2 + { + \pdfdict_gput:nnn {g__pdf_Core/Page}{ #1 }{ #2 } + } + % the command to remove a default value. + % Uses a prop with pdflatex + dvi, + % changes a lua table with lualatex +\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1 + { + \pdfdict_gremove:nn {g__pdf_Core/Page}{ #1 } + } + % the command used in the document. + % direct call of the primitive special with dvips/dvipdfmx + % \latelua: fill a page related table with lualatex, merge it with the page + % table and push it directly + % write to aux and store in prop with pdflatex +\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2 + { + \__pdf_backend_Page_primitive:n { /#1~#2 } + } + %the code to push the values, used in shipout + %merges the two props and then fills the register in pdflatex + %merges the two tables (the one is probably still empty) + %and then fills (in lua) in luatex + %issues the values stored in the global prop with dvi +\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1 + { + \exp_args:Nx \__pdf_backend_Page_primitive:n + { \pdfdict_use:n { g__pdf_Core/Page} } + } +\clist_const:Nn \c__pdf_backend_PageResources_clist + { + ExtGState, + ColorSpace, + Pattern, + Shading, + } +\cs_new_protected:Npn \__pdf_backend_PageResources:n #1 {} +\cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3 + { %only for the show command TEST!! + \pdfdict_gput:nnn {g__pdf_Core/Page/Resources/#1} { #2 }{ #3 } + } +\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush: {} +\bool_new:N \l__pdf_backend_xform_bool +\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2 % #1 eg. Span, #2: dict_content + { + \__pdf_backend_pdfmark:x{/#1~<<#2>>~/BDC} + } +\cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name + { + \__pdf_backend_pdfmark:x{/#1~\__pdf_backend_object_ref:n{#2}~/BDC} + } +\cs_set_protected:Npn \__pdf_backend_bdcobject:n #1 % #1 eg. Span, + { + \__pdf_backend_pdfmark:x{/#1~\__pdf_backend_object_last:~/BDC} + } +\cs_set_protected:Npn \__pdf_backend_emc: + { + \__pdf_backend_pdfmark:n{/EMC} % + } +\cs_set_protected:Npn \__pdf_backend_bmc:n #1 + { + \__pdf_backend_pdfmark:n{/#1~/BMC} % + } +\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1 {} + + + +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 {} + +\int_new:N \g__pdf_backend_EmbeddedFiles_int +\cs_new:Npn \__pdf_backend_EmbeddedFiles_name: + { + ( + l3ef + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000} + {0} + \int_use:N \g__pdf_backend_EmbeddedFiles_int + ) + } +\seq_new:N \g__pdf_backend_EmbeddedFiles_seq +\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1 + { + \int_gincr:N \g__pdf_backend_EmbeddedFiles_int + \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop + { #1 } + { \__pdf_backend_EmbeddedFiles_name: } + \__pdf_backend_pdfmark:x + { + /Name~\__pdf_backend_EmbeddedFiles_name:~ + /FS~#1~ + /EMBED + } + } +%% all +\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF } + { + \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + { \prg_return_true: } + { \prg_return_false:} + } +\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n + { TF , T , F , p } +%% +%% +%% End of file `l3backend-testphase-dvips.def'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def new file mode 100644 index 00000000000..ba25c996cab --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def @@ -0,0 +1,152 @@ +%% +%% This is file `l3backend-testphase-dvisvgm.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3backend-testphase.dtx (with options: `drivers,dvisvgm') +%% +%% Copyright (C) 2019-2021 The LaTeX Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "LaTeX PDF management testphase bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: l3backend-testphase.dtx +\ProvidesExplFile + {l3backend-testphase-dvisvgm.def}{2021-02-22}{} + {LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm} +\RequirePackage{l3ref-tmp} +\cs_generate_variant:Nn \ref_label:nn {en} +\cs_generate_variant:Nn \ref_value:nn {en} +\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2 + { + \@bsphack + \ref_label:nn{#1}{abspage} + \@esphack + } +\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2 + { + \ref_value:nn{#1}{#2} + } +\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en} +\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en} +\prop_new:N \g__pdf_tmpa_prop +\tl_new:N \l__pdf_tmpa_tl +\box_new:N \l__pdf_backend_tmpa_box +\int_new:N \g__pdf_backend_resourceid_int +\int_new:N \g__pdf_backend_name_int +\int_new:N \g__pdf_backend_page_int +\tl_if_exist:NTF \@kernel@after@shipout@background + { + \g@addto@macro \@kernel@before@shipout@background{\relax} + \g@addto@macro \@kernel@after@shipout@background + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \tl_gput_left:Nn\@kernel@after@shipout@lastpage + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + { + \hook_gput_code:nnn{shipout/background}{pdf} + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \hook_gput_code:nnn {shipout/lastpage} {pdf} + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + +\cs_new_protected:Npn \__pdf_backend_Pages_primitive:n #1 + {} +\cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1 + {} + % Uses a prop with pdflatex + dvi, +\cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2 + { + \pdfdict_gput:nnn {g__pdf_Core/Page}{ #1 }{ #2 } + } + % the command to remove a default value. + % Uses a prop with pdflatex + dvi, +\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1 + { + \pdfdict_gremove:nn {g__pdf_Core/Page}{ #1 } + } + % the command used in the document. +\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2 + {} + %the code to push the values, used in shipout +\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1 + {} +\clist_const:Nn \c__pdf_backend_PageResources_clist + { + ExtGState, + ColorSpace, + Pattern, + Shading, + } +\cs_new_protected:Npn \__pdf_backend_PageResources:n #1 {} +\cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3 + { %only for the show command TEST!! + \pdfdict_gput:nnn {g__pdf_Core/Page/Resources/#1} { #2 }{ #3 } + } +\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush: {} +\bool_new:N \l__pdf_backend_xform_bool +\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2 % #1 eg. Span, #2: dict_content + {} +\cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name + {} +\cs_set_protected:Npn \__pdf_backend_bdcobject:n #1 % #1 eg. Span, + {} +\cs_set_protected:Npn \__pdf_backend_emc: + {} +\cs_set_protected:Npn \__pdf_backend_bmc:n #1 + {} +\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1 {} + + + +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 {} + +\int_new:N \g__pdf_backend_EmbeddedFiles_int +\cs_new:Npn \__pdf_backend_EmbeddedFiles_name: + { + ( + l3ef + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000} + {0} + \int_use:N \g__pdf_backend_EmbeddedFiles_int + ) + } +\seq_new:N \g__pdf_backend_EmbeddedFiles_seq +\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1 + {} +\cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4 {} +\cs_new_protected:Npn \__pdf_backend_xform_use:n #1 {} +\cs_new:Npn \__pdf_backend_xform_ref:n {} +%% all +\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF } + { + \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + { \prg_return_true: } + { \prg_return_false:} + } +\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n + { TF , T , F , p } +%% +%% +%% End of file `l3backend-testphase-dvisvgm.def'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def new file mode 100644 index 00000000000..f3fb34cc91b --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def @@ -0,0 +1,388 @@ +%% +%% This is file `l3backend-testphase-luatex.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3backend-testphase.dtx (with options: `drivers,luatex') +%% +%% Copyright (C) 2019-2021 The LaTeX Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "LaTeX PDF management testphase bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: l3backend-testphase.dtx +\ProvidesExplFile + {l3backend-testphase-luatex.def}{2021-02-22}{} + {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)} +\RequirePackage{l3ref-tmp} +\cs_generate_variant:Nn \ref_label:nn {en} +\cs_generate_variant:Nn \ref_value:nn {en} +\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2 + { + \@bsphack + \ref_label:nn{#1}{abspage} + \@esphack + } +\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2 + { + \ref_value:nn{#1}{#2} + } +\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en} +\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en} +\prop_new:N \g__pdf_tmpa_prop +\tl_new:N \l__pdf_tmpa_tl +\box_new:N \l__pdf_backend_tmpa_box +\int_new:N \g__pdf_backend_resourceid_int +\int_new:N \g__pdf_backend_name_int +\int_new:N \g__pdf_backend_page_int + \directlua { require("l3backend-testphase.lua") } +\tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage + { + \g__kernel_pdfmanagement_end_run_code_tl + } +\tl_if_exist:NTF \@kernel@after@shipout@background + { + \g@addto@macro \@kernel@before@shipout@background{\relax} + \g@addto@macro \@kernel@after@shipout@background + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \tl_gput_left:Nn\@kernel@after@shipout@lastpage + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + { + \hook_gput_code:nnn{shipout/background}{pdf} + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \hook_gput_code:nnn {shipout/lastpage} {pdf} + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + +\sys_if_engine_luatex:T + { + \cs_new_protected:Npn \__pdf_backend_Pages_primitive:n #1 + { + \tex_directlua:D + { + pdf.setpagesattributes( \__pdf_backend_luastring:n { #1 } ) + } + } + } +\cs_new:Npn \__pdf_backend_luastring:n #1 + { + "\tex_luaescapestring:D { \tex_unexpanded:D { #1 } }" + } + %not used, only there for consistency +\cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1 + { + \tex_latelua:D + { + pdf.setpageattributes(\__pdf_backend_luastring:n { #1 }) + } + } + % the command to store default values. + % Uses a prop with pdflatex + dvi, + % sets a lua table with lualatex +\cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2 + { + \tex_directlua:D + { + ltx.__pdf.backend_Page_gput + ( + \__pdf_backend_luastring:n { #1 }, + \__pdf_backend_luastring:n { #2 } + ) + } + } + % the command to remove a default value. + % Uses a prop with pdflatex + dvi, + % changes a lua table with lualatex +\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1 + { + \tex_directlua:D + { + ltx.__pdf.backend_Page_gremove (\__pdf_backend_luastring:n { #1 }) + } + } + % the command used in the document. + % direct call of the primitive special with dvips/dvipdfmx + % \latelua: fill a page related table with lualatex, merge it with the page + % table and push it directly + % write to aux and store in prop with pdflatex +\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2 + { + \tex_latelua:D + { + ltx.__pdf.backend_ThisPage_gput + ( + tex.count["g_shipout_readonly_int"], + \__pdf_backend_luastring:n { #1 }, + \__pdf_backend_luastring:n { #2 } + ) + ltx.__pdf.backend_ThisPage_gpush (tex.count["g_shipout_readonly_int"]) + } + } + %the code to push the values, used in shipout + %merges the two props and then fills the register in pdflatex + %merges the two tables (the one is probably still empty) and then fills (in lua) in luatex + %issues the values stored in the global prop with dvi +\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1 + { + \tex_latelua:D + { + ltx.__pdf.backend_ThisPage_gpush (tex.count["g_shipout_readonly_int"]) + } + } + +\clist_const:Nn \c__pdf_backend_PageResources_clist + { + ExtGState, + ColorSpace, + Pattern, + Shading, + } + %create the backend objects: +\clist_map_inline:Nn \c__pdf_backend_PageResources_clist + { + \__pdf_backend_object_new:nn {Page/Resources/#1} {dict} + \cs_if_exist:NT \tex_directlua:D + { + \tex_directlua:D + { + ltx.__pdf.object["Page/Resources/#1"] + = + "\__pdf_backend_object_ref:n{Page/Resources/#1}" + } + } + } +\cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3 + { + \pdfdict_gput:nnn {g__pdf_Core/Page/Resources/#1} { #2 }{ #3 } + % luatex must also trigger the lua side + \tex_latelua:D{ltx.__pdf.Page.Resources.#1=true} + \tex_latelua:D + { + ltx.pdf.Page_Resources_gpush(tex.count["g_shipout_readonly_int"]) + } + } +\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush: + { + \clist_map_inline:Nn \c__pdf_backend_PageResources_clist + { + \prop_if_empty:cF + { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/##1} } + { + \__pdf_backend_object_write:nx + { Page/Resources/##1 } + { \pdfdict_use:n { g__pdf_Core/Page/Resources/##1} } + } + } + } +\bool_new:N \l__pdf_backend_xform_bool + +\cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name + { + \int_gincr:N \g__pdf_backend_name_int + \exp_args:Nx\__kernel_backend_literal_page:n + { /#1 ~ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC } + \bool_if:NTF \l__pdf_backend_xform_bool + { + \exp_args:Nnx\pdfdict_gput:nnn + { g__pdf_Core/Xform/Resources/Properties } + { l3pdf\int_use:N\g__pdf_backend_name_int } + { \__pdf_backend_object_ref:n { #2 } } + } + { + \exp_args:Nx \tex_latelua:D + { + ltx.pdf.Page_Resources_Properties_gput + ( + tex.count["g_shipout_readonly_int"], + "l3pdf\int_use:N\g__pdf_backend_name_int", + "\__pdf_backend_object_ref:n { #2 }" + ) + } + } + } +\cs_set_protected:Npn \__pdf_backend_bdcobject:n #1% #1 eg. Span + { + \int_gincr:N \g__pdf_backend_name_int + \exp_args:Nx\__kernel_backend_literal_page:n + { /#1 ~ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC } + \bool_if:NTF \l__pdf_backend_xform_bool + { + \exp_args:Nnx\pdfdict_gput:nnn %no handler needed + { g__pdf_Core/Xform/Resources/Properties } + { l3pdf\int_use:N\g__pdf_backend_name_int } + { \__pdf_backend_object_last: } + } + { + \exp_args:Nx \tex_latelua:D + { + ltx.pdf.Page_Resources_Properties_gput + ( + tex.count["g_shipout_readonly_int"], + "l3pdf\int_use:N\g__pdf_backend_name_int", + "\__pdf_backend_object_last:" + ) + } + } + } +\cs_set_protected:Npn \__pdf_backend_bmc:n #1 + { + \__kernel_backend_literal_page:n { /#1~BMC } + } +\cs_set_protected:Npn \__pdf_backend_bdc_contobj:nn #1 #2 + { + \pdf_object_unnamed_write:nn { dict } { #2 } + \__pdf_backend_bdcobject:n { #1 } + } +\cs_set_protected:Npn \__pdf_backend_bdc_contstream:nn #1 #2 + { + \__kernel_backend_literal_page:n { /#1~<<#2>>~BDC } + } +\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2 + { + \bool_if:NTF \g__pdfmanagement_active_bool + {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contobj:nn} + {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contstream:nn} + \__pdf_backend_bdc:nn {#1}{#2} + } +\cs_set_protected:Npn \__pdf_backend_emc: + { + \__kernel_backend_literal_page:n { EMC } + } + +\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1 {} +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content + { + \pdf_object_unnamed_write:nn {dict} {/Names [#1] } + \tex_pdfextension:D~names~{/EmbeddedFiles~\pdf_object_ref_last: } + } + + +\int_new:N \g__pdf_backend_EmbeddedFiles_int +\cs_new:Npn \__pdf_backend_EmbeddedFiles_name: + { + ( + l3ef + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000} + {0} + \int_use:N \g__pdf_backend_EmbeddedFiles_int + ) + } +\seq_new:N \g__pdf_backend_EmbeddedFiles_seq +\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1 + %#1 object ref + { + \int_gincr:N \g__pdf_backend_EmbeddedFiles_int + \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop + { #1 } + { \__pdf_backend_EmbeddedFiles_name: } + \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq + { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 } + } + +\cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4 + { + \hbox_set:Nn \l__pdf_backend_tmpa_box + { + \bool_set_true:N \l__pdf_backend_xform_bool + \prop_gclear:c { \__kernel_pdfdict_name:n { g__pdf_Core/Xform/Resources/Properties } } + #4 + } + \tl_const:cx + { c__pdf_backend_xform_wd_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_wd:N \l__pdf_backend_tmpa_box } + \tl_const:cx + { c__pdf_backend_xform_ht_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_ht:N \l__pdf_backend_tmpa_box } + \tl_const:cx + { c__pdf_backend_xform_dp_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_dp:N \l__pdf_backend_tmpa_box } + %% do we need to test if #2 and #3 are empty?? + \tex_immediate:D \tex_pdfxform:D + ~ attr ~ { #2 } + %% which resources should be default? Is an argument actually needed? + ~ resources ~ + { + #3 + \int_compare:nNnT + {\prop_count:c { \__kernel_pdfdict_name:n { g__pdf_Core/Xform/Resources/Properties } }} + > + { 0 } + { + /Properties~ + << + \pdfdict_use:n { g__pdf_Core/Xform/Resources/Properties } + >> + } + \prop_if_empty:cF + { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/ExtGState } } + { + /ExtGState~ \pdf_object_ref:n { Page/Resources/ExtGState } + } + \prop_if_empty:cF + { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/Pattern } } + { + /Pattern~ \pdf_object_ref:n { Page/Resources/Pattern } + } + \prop_if_empty:cF + { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/Shading } } + { + /Shading~ \pdf_object_ref:n { Page/Resources/Shading } + } + \prop_if_empty:cF + { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/ColorSpace } } + { + /ColorSpace~ \pdf_object_ref:n { Page/Resources/ColorSpace } + } + } + \l__pdf_backend_tmpa_box + \int_const:cn + { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + { \tex_pdflastxform:D } + } + +\cs_new_protected:Npn \__pdf_backend_xform_use:n #1 %protected as with xelatex + { + \tex_pdfrefxform:D \int_use:c + { + c__pdf_backend_xform_ \tl_to_str:n {#1} _int + } + \scan_stop: + } + +\cs_new:Npn \__pdf_backend_xform_ref:n #1 + { \int_use:c { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } ~ 0 ~ R } + +%% all +\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF } + { + \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + { \prg_return_true: } + { \prg_return_false:} + } +\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n + { TF , T , F , p } +%% +%% +%% End of file `l3backend-testphase-luatex.def'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def new file mode 100644 index 00000000000..40ce682e041 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def @@ -0,0 +1,406 @@ +%% +%% This is file `l3backend-testphase-pdftex.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3backend-testphase.dtx (with options: `drivers,pdftex') +%% +%% Copyright (C) 2019-2021 The LaTeX Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "LaTeX PDF management testphase bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: l3backend-testphase.dtx +\ProvidesExplFile + {l3backend-testphase-pdftex.def}{2021-02-22}{} + {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)} +\RequirePackage{l3ref-tmp} +\cs_generate_variant:Nn \ref_label:nn {en} +\cs_generate_variant:Nn \ref_value:nn {en} +\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2 + { + \@bsphack + \ref_label:nn{#1}{abspage} + \@esphack + } +\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2 + { + \ref_value:nn{#1}{#2} + } +\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en} +\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en} +\prop_new:N \g__pdf_tmpa_prop +\tl_new:N \l__pdf_tmpa_tl +\box_new:N \l__pdf_backend_tmpa_box +\int_new:N \g__pdf_backend_resourceid_int +\int_new:N \g__pdf_backend_name_int +\int_new:N \g__pdf_backend_page_int +\tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage + { + \g__kernel_pdfmanagement_end_run_code_tl + } +\tl_if_exist:NTF \@kernel@after@shipout@background + { + \g@addto@macro \@kernel@before@shipout@background{\relax} + \g@addto@macro \@kernel@after@shipout@background + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \tl_gput_left:Nn\@kernel@after@shipout@lastpage + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + { + \hook_gput_code:nnn{shipout/background}{pdf} + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \hook_gput_code:nnn {shipout/lastpage} {pdf} + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + +\cs_new_protected:Npn \__pdf_backend_Pages_primitive:n #1 + { + \tex_global:D \tex_pdfpagesattr:D { #1 } + } + %the primitive + \cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1 + { + \tex_global:D \tex_pdfpageattr:D { #1 } + } + \cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2 %key,value + { + \pdfdict_gput:nnn {g__pdf_Core/Page}{ #1 }{ #2 } + } +\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1 + { + \pdfdict_gremove:nn {g__pdf_Core/Page}{ #1 } + } +\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2 + { + %we need to know the page the resource should be added too. + \int_gincr:N\g__pdf_backend_resourceid_int + %\zref@labelbylist {l3pdf\int_use:N\g__pdf_backend_resourceid_int} {l3pdf} + %\ref_label:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage} + \__pdf_backend_ref_label:en { l3pdf\int_use:N\g__pdf_backend_resourceid_int }{abspage} + \tl_set:Nx \l__pdf_tmpa_tl + { + %\zref@extractdefault + \__pdf_backend_ref_value:en {l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage} + } + \pdfdict_if_exist:nF { g__pdf_Core/backend_Page\l__pdf_tmpa_tl} + { + \pdfdict_new:n { g__pdf_Core/backend_Page\l__pdf_tmpa_tl} + } + %backend_Page has no handler. + \pdfdict_gput:nnn {g__pdf_Core/backend_Page\l__pdf_tmpa_tl}{ #1 }{ #2 } + } +\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1 + { + \prop_gset_eq:Nc \g__pdf_tmpa_prop { \__kernel_pdfdict_name:n { g__pdf_Core/Page } } + \prop_if_exist:cT { \__kernel_pdfdict_name:n { g__pdf_Core/backend_Page#1 } } + { + \prop_map_inline:cn { \__kernel_pdfdict_name:n { g__pdf_Core/backend_Page#1 } } + { + \prop_gput:Nnn \g__pdf_tmpa_prop { ##1 }{ ##2 } + } + } + \exp_args:Nx \__pdf_backend_Page_primitive:n + { + \prop_map_function:NN \g__pdf_tmpa_prop \pdfdict_item:ne + } + } +\clist_const:Nn \c__pdf_backend_PageResources_clist + { + ExtGState, + ColorSpace, + Pattern, + Shading, + } + %create the backend objects: +\clist_map_inline:Nn \c__pdf_backend_PageResources_clist + { + \__pdf_backend_object_new:nn {Page/Resources/#1} {dict} + \cs_if_exist:NT \tex_directlua:D + { + \tex_directlua:D + { + ltx.__pdf.object["Page/Resources/#1"] + = + "\__pdf_backend_object_ref:n{Page/Resources/#1}" + } + } + } + \cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3 + { + \pdfdict_gput:nnn {g__pdf_Core/Page/Resources/#1} { #2 }{ #3 } + } +\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush: + { + \clist_map_inline:Nn \c__pdf_backend_PageResources_clist + { + \prop_if_empty:cF + { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/##1} } + { + \__pdf_backend_object_write:nx + { Page/Resources/##1 } + { \pdfdict_use:n { g__pdf_Core/Page/Resources/##1} } + } + } + } +\bool_new:N \l__pdf_backend_xform_bool + +\cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name + { + \int_gincr:N \g__pdf_backend_name_int + \exp_args:Nx\__kernel_backend_literal_page:n + { /#1 ~ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC } + % code to set the property .... + \int_gincr:N\g__pdf_backend_resourceid_int + \bool_if:NTF \l__pdf_backend_xform_bool + { + \exp_args:Nnxx\pdfdict_gput:nnn %no handler needed + { g__pdf_Core/Xform/Resources/Properties } + { l3pdf\int_use:N\g__pdf_backend_resourceid_int } + { \__pdf_backend_object_ref:n { #2 } } + } + { + %\zref@labelbylist + \__pdf_backend_ref_label:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage} + \tl_set:Nx \l__pdf_tmpa_tl + { + %\zref@extractdefault + %\ref_value:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage} + \__pdf_backend_ref_value:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage} + } + \pdfdict_if_exist:nF { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties } + { + \pdfdict_new:n { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties } + } + \exp_args:Nnxx\pdfdict_gput:nnn + { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties } + { l3pdf\int_use:N\g__pdf_backend_resourceid_int } + { \__pdf_backend_object_ref:n{#2} } + } + } +\cs_set_protected:Npn \__pdf_backend_bdcobject:n #1% #1 eg. Span + { + \int_gincr:N \g__pdf_backend_name_int + \exp_args:Nx\__kernel_backend_literal_page:n + { /#1 ~ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC } + % code to set the property .... + \int_gincr:N\g__pdf_backend_resourceid_int + \bool_if:NTF \l__pdf_backend_xform_bool + { + \exp_args:Nnxx\pdfdict_gput:nnn + { g__pdf_Core/Xform/Resources/Properties } + { l3pdf\int_use:N\g__pdf_backend_resourceid_int } + { \__pdf_backend_object_last: } + } + { + %\zref@labelbylist + %\ref_label:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage} + \__pdf_backend_ref_label:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage} + \tl_set:Nx \l__pdf_tmpa_tl + { + %\zref@extractdefault + % \ref_value:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage} + \__pdf_backend_ref_value:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage} + } + \pdfdict_if_exist:nF { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties } + { + \pdfdict_new:n { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties } + } + \exp_args:Nnxx\pdfdict_gput:nnn + { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties } + { l3pdf\int_use:N\g__pdf_backend_resourceid_int } + { \__pdf_backend_object_last: } + %\pdfdict_show:n { g_backend_Page\l__pdf_tmpa_tl/Resources/Properties } + } + } +\cs_set_protected:Npn \__pdf_backend_bmc:n #1 + { + \__kernel_backend_literal_page:n { /#1~BMC } + } +\cs_set_protected:Npn \__pdf_backend_bdc_contobj:nn #1 #2 + { + \pdf_object_unnamed_write:nn { dict } { #2 } + \__pdf_backend_bdcobject:n { #1 } + } +\cs_set_protected:Npn \__pdf_backend_bdc_contstream:nn #1 #2 + { + \__kernel_backend_literal_page:n { /#1~<<#2>>~BDC } + } +\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2 + { + \bool_if:NTF \g__pdfmanagement_active_bool + {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contobj:nn} + {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contstream:nn} + \__pdf_backend_bdc:nn {#1}{#2} + } +\cs_set_protected:Npn \__pdf_backend_emc: + { + \__kernel_backend_literal_page:n { EMC } + } + +\cs_new:Npn \__pdf_backend_PageResources_gpush_aux:n #1 %#1 ExtGState etc + { + \prop_if_empty:cF + { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/#1} } + { + \pdfdict_item:ne { #1 }{ \pdf_object_ref:n {Page/Resources/#1}} + } + } + +\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1 + { + \exp_args:NNx \tex_global:D \tex_pdfpageresources:D + { + \prop_if_exist:cT + { \__kernel_pdfdict_name:n { g__pdf_Core/backend_Page#1/Resources/Properties } } + { + /Properties~ + << + \prop_map_function:cN + { \__kernel_pdfdict_name:n { g__pdf_Core/backend_Page#1/Resources/Properties } } + \pdfdict_item:ne + >> + } + %% add ExtGState etc + \clist_map_function:NN + \c__pdf_backend_PageResources_clist + \__pdf_backend_PageResources_gpush_aux:n + } + } + +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content + { + \pdf_object_unnamed_write:nn {dict} {/Names [#1] } + \tex_pdfnames:D {/EmbeddedFiles~\pdf_object_ref_last:} + } + + +\int_new:N \g__pdf_backend_EmbeddedFiles_int +\cs_new:Npn \__pdf_backend_EmbeddedFiles_name: + { + ( + l3ef + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000} + {0} + \int_use:N \g__pdf_backend_EmbeddedFiles_int + ) + } +\seq_new:N \g__pdf_backend_EmbeddedFiles_seq +\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1 + %#1 object ref + { + \int_gincr:N \g__pdf_backend_EmbeddedFiles_int + \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop + { #1 } + { \__pdf_backend_EmbeddedFiles_name: } + \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq + { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 } + } + +\cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4 + { + \hbox_set:Nn \l__pdf_backend_tmpa_box + { + \bool_set_true:N \l__pdf_backend_xform_bool + \prop_gclear:c {\__kernel_pdfdict_name:n { g__pdf_Core/Xform/Resources/Properties }} + #4 + } + %store the dimensions + \tl_const:cx + { c__pdf_backend_xform_wd_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_wd:N \l__pdf_backend_tmpa_box } + \tl_const:cx + { c__pdf_backend_xform_ht_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_ht:N \l__pdf_backend_tmpa_box } + \tl_const:cx + { c__pdf_backend_xform_dp_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_dp:N \l__pdf_backend_tmpa_box } + %% do we need to test if #2 and #3 are empty?? + \tex_immediate:D \tex_pdfxform:D + ~ attr ~ { #2 } + %% which other resources should be default? Is an argument actually needed? + ~ resources ~ + { + #3 + \int_compare:nNnT + { \prop_count:c { \__kernel_pdfdict_name:n { g__pdf_Core/Xform/Resources/Properties } } } + > + { 0 } + { + /Properties~ + << + \pdfdict_use:n { g__pdf_Core/Xform/Resources/Properties } + >> + } + + \prop_if_empty:cF + { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/ExtGState } } + { + /ExtGState~ \pdf_object_ref:n { Page/Resources/ExtGState } + } + \prop_if_empty:cF + { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/Pattern } } + { + /Pattern~ \pdf_object_ref:n { Page/Resources/Pattern } + } + \prop_if_empty:cF + { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/Shading } } + { + /Shading~ \pdf_object_ref:n { Page/Resources/Shading } + } + \prop_if_empty:cF + { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/ColorSpace } } + { + /ColorSpace~ \pdf_object_ref:n { Page/Resources/ColorSpace } + } + } + \l__pdf_backend_tmpa_box + \int_const:cn + { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + { \tex_pdflastxform:D } + } + +\cs_new_protected:Npn \__pdf_backend_xform_use:n #1 + { + \tex_pdfrefxform:D + \int_use:c { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + \scan_stop: + } + +\cs_new:Npn \__pdf_backend_xform_ref:n #1 + { + \int_use:c { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } ~ 0 ~ R + } +%% all +\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF } + { + \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + { \prg_return_true: } + { \prg_return_false:} + } +\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n + { TF , T , F , p } +%% +%% +%% End of file `l3backend-testphase-pdftex.def'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def new file mode 100644 index 00000000000..60a336e651b --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def @@ -0,0 +1,377 @@ +%% +%% This is file `l3backend-testphase-xetex.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3backend-testphase.dtx (with options: `drivers,xdvipdfmx') +%% +%% Copyright (C) 2019-2021 The LaTeX Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "LaTeX PDF management testphase bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: l3backend-testphase.dtx +\ProvidesExplFile + {l3backend-testphase-xetex.def}{2021-02-22}{} + {LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX} +\RequirePackage{l3ref-tmp} +\cs_generate_variant:Nn \ref_label:nn {en} +\cs_generate_variant:Nn \ref_value:nn {en} +\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2 + { + \@bsphack + \ref_label:nn{#1}{abspage} + \@esphack + } +\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2 + { + \ref_value:nn{#1}{#2} + } +\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en} +\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en} + \__kernel_backend_literal:x { dvipdfmx:config~C~ 0x0010 } +\prop_new:N \g__pdf_tmpa_prop +\tl_new:N \l__pdf_tmpa_tl +\box_new:N \l__pdf_backend_tmpa_box +\int_new:N \g__pdf_backend_resourceid_int +\int_new:N \g__pdf_backend_name_int +\int_new:N \g__pdf_backend_page_int +\tl_gput_right:Nn \@kernel@after@shipout@lastpage + { + \g__kernel_pdfmanagement_end_run_code_tl + } +\tl_if_exist:NTF \@kernel@after@shipout@background + { + \g@addto@macro \@kernel@before@shipout@background{\relax} + \g@addto@macro \@kernel@after@shipout@background + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \tl_gput_left:Nn\@kernel@after@shipout@lastpage + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + { + \hook_gput_code:nnn{shipout/background}{pdf} + { + \g__kernel_pdfmanagement_thispage_shipout_code_tl + } + \hook_gput_code:nnn {shipout/lastpage} {pdf} + { + \g__kernel_pdfmanagement_lastpage_shipout_code_tl + } + } + +\cs_new_protected:Npn \__pdf_backend_Pages_primitive:n #1 + { + \__pdf_backend:n{put~@pages~<<#1>>} + } + %the primitive +\cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1 + { + \tex_special:D{pdf:~put~@thispage~<<#1>>} + } + % the command to store default values. + % Uses a prop with pdflatex + dvi, + % sets a lua table with lualatex +\cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2 + { + \pdfdict_gput:nnn {g__pdf_Core/Page}{ #1 }{ #2 } + } + % the command to remove a default value. + % Uses a prop with pdflatex + dvi, + % changes a lua table with lualatex +\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1 + { + \pdfdict_gremove:nn {g__pdf_Core/Page}{ #1 } + } + % the command used in the document. + % direct call of the primitive special with dvips/dvipdfmx + % \latelua: fill a page related table with lualatex, merge it with the page + % table and push it directly + % write to aux and store in prop with pdflatex +\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2 + { + \__pdf_backend_Page_primitive:n { /#1~#2 } + } + %the code to push the values, used in shipout + %merges the two props and then fills the register in pdflatex + %merges the two tables (the one is probably still empty) + % and then fills (in lua) in luatex + %issues the values stored in the global prop with dvi +\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1 + { + \exp_args:Nx \__pdf_backend_Page_primitive:n + { \pdfdict_use:n { g__pdf_Core/Page} } + } +\clist_const:Nn \c__pdf_backend_PageResources_clist + { + ExtGState, + ColorSpace, + Pattern, + Shading, + } +\hook_gset_rule:nnnn{shipout/firstpage}{l3backend-xetex}{after}{pdf} +\clist_map_inline:Nn \c__pdf_backend_PageResources_clist + { + \__pdf_backend_object_new:nn { Page/Resources/#1 } { dict } + \hook_gput_code:nnn{shipout/firstpage}{pdf}{\__pdf_backend_object_write:nn { Page/Resources/#1 } {}} + } +\cs_new_protected:Npn \__pdf_backend_PageResources:n #1 + { + \__pdf_backend:n {put~@resources~<<#1>>} + } +\cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3 + { + % this is not used for output, but there is a test if the resource is empty + \exp_args:Nnx + \prop_gput:cnn { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/#1} } + { \str_convert_pdfname:n {#2} }{ #3 } + %objects are not filled with \pdf_object_write as this is not additive! + \__pdf_backend:x + { + put~\__pdf_backend_object_ref:n {Page/Resources/#1}<</#2~#3>> + } + } + +\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush: {} +\bool_new:N \l__pdf_backend_xform_bool + + \cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name + { + \int_gincr:N \g__pdf_backend_name_int + \__kernel_backend_literal:x + { + pdf:code~/#1/l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC + } + \__kernel_backend_literal:x + { + pdf:put~@resources~ + << + /Properties~ + << + /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl + \__pdf_backend_object_ref:n { #2 } + >> + >> + } + } + \cs_set_protected:Npn \__pdf_backend_bdcobject:n #1 % #1 eg. Span + { + \int_gincr:N \g__pdf_backend_name_int + \__kernel_backend_literal:x + { + pdf:code~/#1/l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC + } + \__kernel_backend_literal:x + { + pdf:put~@resources~ + << + /Properties~ + << + /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl + \__pdf_backend_object_last: + >> + >> + } + } +\cs_set_protected:Npn \__pdf_backend_bmc:n #1 + { + \__kernel_backend_literal:n {pdf:code~/#1~BMC} %pdfbase + } + +\cs_set_protected:Npn \__pdf_backend_bdc_contobj:nn #1 #2 + { + \pdf_object_unnamed_write:nn { dict }{ #2 } + \__pdf_backend_bdcobject:n { #1 } + } + +\cs_set_protected:Npn \__pdf_backend_bdc_contstream:nn #1 #2 + { + \__kernel_backend_literal:n {pdf:code~ /#1~<<#2>>~BDC } + } + +\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2 + { + \bool_if:NTF \g__pdfmanagement_active_bool + {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contobj:nn} + {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contstream:nn} + \__pdf_backend_bdc:nn {#1}{#2} + } +\cs_set_protected:Npn \__pdf_backend_emc: + { + \__kernel_backend_literal:n {pdf:code~EMC} %pdfbase + } + % properties are handled automatically, but the other resources should be added + % at shipout +\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1 + { + \clist_map_inline:Nn \c__pdf_backend_PageResources_clist + { + \prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/##1} } + { + \__kernel_backend_literal:x + { + pdf:put~@resources~ + <</##1~\__pdf_backend_object_ref:n {Page/Resources/##1}>> + } + } + } + } +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content + { + \pdf_object_unnamed_write:nn {dict} { /Names [#1] } + %n or x? + \__pdf_backend:x {put~@names~<</EmbeddedFiles~\pdf_object_ref_last: >>} + } + + +\int_new:N \g__pdf_backend_EmbeddedFiles_int +\cs_new:Npn \__pdf_backend_EmbeddedFiles_name: + { + ( + l3ef + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100} + {0} + \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000} + {0} + \int_use:N \g__pdf_backend_EmbeddedFiles_int + ) + } +\seq_new:N \g__pdf_backend_EmbeddedFiles_seq +\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop +\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1 + %#1 object ref + { + \int_gincr:N \g__pdf_backend_EmbeddedFiles_int + \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop + { #1 } + { \__pdf_backend_EmbeddedFiles_name: } + \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq + { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 } + } + + % it needs a bit testing if it really works to set the box to 0 before the special ... + % does it disturb viewing the xobject? + % what happens with the resources (bdc)? (should work as they are specials too) + % xetex requires that the special is in horizontal mode. This means it affects + % typesetting. But we can no delay the whole form code to shipout + % as the object reference and the size is often wanted on the current page. + % so we need to allocate a box - but probably they won't be thousands xform + % in a document so it shouldn't matter. + \cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4 + % #1 name + % #2 attributes + % #3 resources + % #4 content, not necessarily a box! + { + \int_gincr:N \g__pdf_backend_object_int + \int_const:cn + { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + { \g__pdf_backend_object_int } + \box_new:c { g__pdf_backend_xform_#1_box } + \hbox_gset:cn { g__pdf_backend_xform_#1_box } + { + \bool_set_true:N \l__pdf_backend_xform_bool + #4 + } + \tl_const:cx + { c__pdf_backend_xform_wd_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_wd:c { g__pdf_backend_xform_#1_box } } + \tl_const:cx + { c__pdf_backend_xform_ht_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_ht:c { g__pdf_backend_xform_#1_box } } + \tl_const:cx + { c__pdf_backend_xform_dp_ \tl_to_str:n {#1} _tl } + { \tex_the:D \box_dp:c { g__pdf_backend_xform_#1_box } } + \box_set_dp:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim } + \box_set_ht:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim } + \box_set_wd:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim } + \hook_gput_next_code:nn {shipout/background} + { + \mode_leave_vertical: %needed, the xform disappears without it. + \__pdf_backend:x + { + bxobj ~ \__pdf_backend_xform_ref:n { #1 } + \c_space_tl width ~ \pdfxform_wd:n { #1 } + \c_space_tl height ~ \pdfxform_ht:n { #1 } + \c_space_tl depth ~ \pdfxform_dp:n { #1 } + } + \box_use_drop:c { g__pdf_backend_xform_#1_box } + \__pdf_backend:x {put ~ @resources ~<<#3>> } + \__pdf_backend:x + { + put~ @resources ~ + << + /ExtGState~ \pdf_object_ref:n { Page/Resources/ExtGState } + >> + } + \__pdf_backend:x + { + put~ @resources ~ + << + /Pattern~ \pdf_object_ref:n { Page/Resources/Pattern } + >> + } + \__pdf_backend:x + { + put~ @resources ~ + << + /Shading~ \pdf_object_ref:n { Page/Resources/Shading } + >> + } + \__pdf_backend:x + { + put~ @resources ~ + << + /ColorSpace~ + \pdf_object_ref:n { Page/Resources/ColorSpace } + >> + } + \exp_args:Nx + \__pdf_backend:x {exobj ~<<#2>>} + } + } + + \cs_new:Npn \__pdf_backend_xform_ref:n #1 + { + @pdf.xform \int_use:c { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + } + + \cs_new_protected:Npn \__pdf_backend_xform_use:n #1 + { + \hbox_set:Nn \l__pdf_backend_tmpa_box + { + \__pdf_backend:x + { + uxobj~ \__pdf_backend_xform_ref:n { #1 } + } + } + \box_set_wd:Nn \l__pdf_backend_tmpa_box { \pdfxform_wd:n { #1 } } + \box_set_ht:Nn \l__pdf_backend_tmpa_box { \pdfxform_ht:n { #1 } } + \box_set_dp:Nn \l__pdf_backend_tmpa_box { \pdfxform_dp:n { #1 } } + \box_use_drop:N \l__pdf_backend_tmpa_box + } +%% all +\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF } + { + \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } + { \prg_return_true: } + { \prg_return_false:} + } +\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n + { TF , T , F , p } +%% +%% +%% End of file `l3backend-testphase-xetex.def'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3ref-tmp.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3ref-tmp.sty new file mode 100644 index 00000000000..32ec132f775 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3ref-tmp.sty @@ -0,0 +1,131 @@ +%% +%% This is file `l3ref-tmp.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3ref.dtx (with options: `package') +%% +%% Copyright (C) 2020-2021 The LaTeX Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3ref bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: l3ref.dtx +\ProvidesExplPackage{l3ref-tmp}{2020-10-09}{} + {L3 Experimental cross-referencing} +\cs_new_protected:Npn \ref_attribute_gset:nnnn #1#2#3#4 + { + \exp_args:Nx \__ref_attribute_gset:nnnn { \tl_to_str:n {#1} } + {#2} {#3} {#4} + } +\cs_new_protected:Npn \__ref_attribute_gset:nnnn #1#2#3#4 + { + \cs_gset:cpn { __ref_attribute_ #1 : } {#4} + \tl_gclear_new:c { g__ref_default_ #1 _tl } + \tl_gset:cn { g__ref_default_ #1 _tl } {#2} + \bool_if_exist:cF { g__ref_shipout_ #1 _tl } + { \bool_new:c { g__ref_shipout_ #1 _tl } } + \str_case:nnF {#3} + { + { now } { { \bool_gset_false:c { g__ref_shipout_ #1 _tl } } } + { shipout } + { \bool_gset_true:c { g__ref_shipout_ #1 _tl } } + } + { \msg_error:nnnn { ref } { unknown-setpoint } {#1} {#3} } + } +\cs_new_protected:Npn \ref_label:nN #1#2 + { \ref_label:nV {#1} #2 } +\cs_new_protected:Npn \ref_label:nn #1#2 + { \exp_args:Nx \__ref_label:nn { \tl_to_str:n {#1} } {#2} } +\cs_generate_variant:Nn \ref_label:nn { nV } +\cs_new_protected:Npn \__ref_label:nn #1#2 + { + \legacy_if:nT { @filesw } + { + \iow_shipout_x:Nx \@auxout + { + \token_to_str:N \newlabeldata + {#1} + { \clist_map_function:nN {#2} \__ref_label_attribute:n } + } + } + } +\cs_new:Npn \__ref_label_attribute:n #1 + { \exp_args:Ne \__ref_label_attribute_aux:n { \tl_to_str:n {#1} } } +\cs_new:Npn \__ref_label_attribute_aux:n #1 + { + \cs_if_exist:cTF { __ref_attribute_ #1 : } + { + {#1} + { + \bool_if:cTF { g__ref_shipout_ #1 _tl } + { \exp_not:c } + { \use:c } + { __ref_attribute_ #1 : } + } + } + { \msg_expandable_error:nnn { ref } { attribute-not-defined } {#1} } + } +\cs_new:Npn \ref_value:nn #1#2 + { + \exp_args:Nee \__ref_value:nn { \tl_to_str:n {#1} } { \tl_to_str:n {#2} } + } +\cs_new:Npn \__ref_value:nn #1#2 + { + \tl_if_exist:cTF { g__ref_label_ #1 _ #2 _tl } + { \tl_use:c { g__ref_label_ #1 _ #2 _tl } } + { + \tl_if_exist:cTF { g__ref_default_ #2 _tl } + { \tl_use:c { g__ref_default_ #2 _tl } } + { \exp_not:n { \textbf { ?? } } } + } + } +\prg_new_conditional:Npnn \ref_if_exist:nn #1#2 { p , T , F, TF } % #1 label #2 attribute + { + \tl_if_exist:cTF { g__ref_label_ \tl_to_str:n {#1} _ \tl_to_str:n {#2} _tl } + { + \prg_return_true: + } + { + \prg_return_false: + } + } +\cs_new_protected:Npn \newlabeldata #1#2 + { + \__ref_data:nnn {#1} #2 { \q_recursion_tail } { ? } \q_recursion_stop + } +\cs_new_protected:Npn \__ref_data:nnn #1#2#3 + { + \quark_if_recursion_tail_stop:n {#2} + \tl_gclear_new:c { g__ref_label_ #1 _ #2 _tl } + \tl_gset:cn { g__ref_label_ #1 _ #2 _tl } {#3} + \__ref_data:nnn {#1} + } +\ref_attribute_gset:nnnn { abspage } { 0 } { shipout } + { \int_use:N \g_shipout_readonly_int } +\ref_attribute_gset:nnnn { page } { 0 } { shipout } { \thepage } +\clist_new:N \g_ref_main_clist +\clist_gput_right:Nn \g_ref_main_clist { page } +\msg_new:nnnn { ref } { attribute-not-defined } + { Attribute~'#1'~not~defined. } + { + LaTeX~has~been~asked~to~use~attribute~'#1',~but~this~ + name~has~not~been~defined. + } +\msg_new:nnnn { ref } { unknown-setpoint } + { Unknown~keyword~'#3'~for~setting~attribute~'#1'. } + { + LaTeX~has~been~asked~to~set~the~attribute~'#1',~but~the~keyword~ + '#3'~is~not~one~of~the~two~known~values:~'now'~or~'shipout'. + } +%% +%% +%% End of file `l3ref.sty'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty new file mode 100644 index 00000000000..b3ade3f709a --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty @@ -0,0 +1,54 @@ +%% +%% This is file `pdflscape-ltx.sty', +%% +%% Version: 2021/02/22 v0.95a +%% +%% Copyright (C) 2021 The LaTeX Project +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% https://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% https://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 Maintainers of this work are +%% The LaTeX Project +%% +%% +%% This work consists of the main source file pdflscape-ltx.sty +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesExplPackage {pdflscape-ltx}{2021/02/22}{v0.95a} + {Display of landscape pages in PDF - adaption of pdflscape to the PDFmanagement bundle (testphase)} + +\RequirePackage{lscape} +% this always turns in the same direction as pdflscape does too. +% left and right would need +% \pdfmanagement_add:nnn{ThisPage}{Rotate}{..} +% on every page (e.g. in a shipout hook) and some option to control the wanted +% orientation. + +\tl_new:N\g__pdflscape_saverotate_tl +\hook_gput_code:nnn {env/landscape/begin}{pdflscape} + { + \pdfmanagement_get:nnN {Page}{Rotate}\l_tmpa_tl + \tl_gset_eq:NN\g__pdflscape_saverotate_tl\l_tmpa_tl + \clearpage + \pdfmanagement_add:nnn{Page}{Rotate}{90} + } +\hook_gput_code:nnn {env/landscape/after}{pdflscape} + { + \quark_if_no_value:NTF\g__pdflscape_saverotate_tl + {\pdfmanagement_remove:nn{Page}{Rotate}} + {\pdfmanagement_add:nnx{Page}{Rotate}{\g__pdflscape_saverotate_tl}} + } + +\endinput +%% +%% End of file `pdflscape-ltx.sty'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty new file mode 100644 index 00000000000..f1f2b6c81ba --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty @@ -0,0 +1,183 @@ +%% +%% This is file `pdfmanagement-firstaid.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pdfmanagement-firstaid.dtx (with options: `package') +%% +%% Copyright (C) 2019-2021 The LaTeX Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "LaTeX PDF management testphase bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: pdfmanagement-firstaid.dtx +\ProvidesExplPackage {pdfmanagement-firstaid} {2021-02-22} {0.95a} + {LaTeX PDF management testphase bundle / firstaid-patches} + +\clist_map_inline:nn {pgf,transparent,hyperxmp,pdflscape,xcolor,color} + { + \bool_new:c { g__pdfmanagement_firstaid_#1_bool } + \bool_gset_true:c { g__pdfmanagement_firstaid_#1_bool } + } +\clist_map_inline:Nn \g__pdfmanagement_firstaidoff_clist + { + \bool_if_exist:cT { g__pdfmanagement_firstaid_#1_bool } + { + \bool_gset_false:c { g__pdfmanagement_firstaid_#1_bool } + } + } +\msg_new:nnn { pdfmanagement } { firstaid } + { loading~pdfmanagement~firstaid~code~for~#1 } +\@ifundefined{color_set:nn}{ +\RequirePackage{l3color}}{} +\bool_if:NT \g__pdfmanagement_firstaid_color_bool + { + \declare@file@substitution{color.sty}{color-ltx.sty} + } +\@ifundefined{color_set:nn}{ +\RequirePackage{l3color}}{} +\bool_if:NT \g__pdfmanagement_firstaid_xcolor_bool + { + \AddToHook{package/after/xcolor} + {\RequirePackage{xcolor-patches-tmp-ltx}\XC@@names} + } + +\bool_if:NT \g__pdfmanagement_firstaid_pgf_bool + { + \msg_info:nnn{pdfmanagement }{firstaid}{pgf} + \AddToHook{file/after/pgfrcs.sty} + { + \cs_set_eq:NN + \__pdfmanagement_pgfori_pgfutil@setuppdfresources + \pgfutil@setuppdfresources + \def\pgfutil@setuppdfresources + { + \pdfmanagement_if_active:TF + { + \__pdfmanagement_pgf_sys_setuppdfresources_plain: + } + { + \__pdfmanagement_pgfori_pgfutil@setuppdfresources + } + } + } + } +\cs_new_protected:Npn \__pdfmanagement_pgf_sys_setuppdfresources_plain: + { + %objects are already created ... + \def\pgf@sys@pdf@possible@resources + { + /ColorSpace~\pdf_object_ref:n {Page/Resources/ColorSpace} + /Pattern ~\pdf_object_ref:n {Page/Resources/Pattern} + /ExtGState ~\pdf_object_ref:n {Page/Resources/ExtGState} + } + \let\pgf@sys@pdf@check@resources=\relax% + %not sure if needed, but perhaps the lists are used somewhere else ... + \let\pgf@sys@pgf@resource@list@extgs=\pgfutil@empty% + \let\pgf@sys@pgf@resource@list@patterns=\pgfutil@empty% + \let\pgf@sys@pgf@resource@list@colorspaces=\pgfutil@empty% + % the commands to add page resources + \def\pgf@sys@addpdfresource@extgs@plain##1 + { + \exp_after:wN %for transparent which passes a command + \__pdfmanagement_patch_pgfextgs:w ##1\q_stop + } + \def\pgf@sys@addpdfresource@patterns@plain##1 + { + \__pdfmanagement_patch_pgfpatterns:w ##1\q_stop + } + \def\pgf@sys@addpdfresource@colorspaces@plain##1 + { + \__pdfmanagement_patch_pgfcolorspaces:w ##1\q_stop + } + } + +\cs_new:Npn \__pdfmanagement_split_dict_entry_aux:NNw #1 #2 /#3~#4\q_stop + { + \tl_set:Nn #1 {#3} + \tl_set:Nn #2 {#4} + } + +\cs_new:Npn \__pdfmanagement_patch_pgfextgs:w #1/#2<<#3>>#4\q_stop + { + \exp_args:Nne + \__pdf_backend_PageResources_gput:nnn + {ExtGState}{\tl_trim_spaces:n{#2}}{<<#3>>} + } +\cs_new:Npn \__pdfmanagement_patch_pgfpatterns:w #1/#2\space#3\q_stop + { + \exp_args:Nnxx + \__pdf_backend_PageResources_gput:nnn + {Pattern}{\tl_trim_spaces:n{#2}}{#3} + } +\cs_new:Npn \__pdfmanagement_patch_pgfcolorspaces:w #1/#2[#3]#4\q_stop + { + \exp_args:Nne + \__pdf_backend_PageResources_gput:nnn + {ColorSpace}{\tl_trim_spaces:n{#2}}{[#3]} + } + +\bool_if:NT \g__pdfmanagement_firstaid_transparent_bool + { + \declare@file@substitution{transparent.sty}{transparent-ltx.sty} + } +\bool_if:NT \g__pdfmanagement_firstaid_pdflscape_bool + { + \declare@file@substitution{pdflscape.sty}{pdflscape-ltx.sty} + } +\bool_if:NT \g__pdfmanagement_firstaid_hyperxmp_bool + { + \AddToHook + {file/after/hyperxmp.sty} + {\RequirePackage{hyperxmp-patches-tmp-ltx}} + } +\hook_gput_code:nnn {begindocument} {pdf} + { + \tl_if_exist:NT \spc@op + { + \def\spc@Pageresources#1{} + } + + } + +\hook_gput_code:nnn {begindocument/end} {pdf} + { + \tl_if_exist:NT \spc@op + { + \__pdf_backend_object_new:nn {__spc_extgstate_op_false}{dict} + \__pdf_backend_object_write:nn + {__spc_extgstate_op_false} + {/Type /ExtGState~/op~false~/OP~false} + \pdfmanagement_add:nnn + {Page/Resources/ExtGState} + {SPCko} + {\__pdf_backend_object_ref:n {__spc_extgstate_op_false}} + \__pdf_backend_object_new:nn {__spc_extgstate_op_true0}{dict} + \__pdf_backend_object_write:nn + {__spc_extgstate_op_true0} + {/Type /ExtGState~/op~true~/OP~true~/OPM~0}% + \pdfmanagement_add:nnn + {Page/Resources/ExtGState} + {SPCmz} + {\__pdf_backend_object_ref:n {__spc_extgstate_op_true0}} + \__pdf_backend_object_new:nn {__spc_extgstate_op_true1}{dict} + \__pdf_backend_object_write:nn + {__spc_extgstate_op_true1} + {/Type /ExtGState~/op~true~/OP~true~/OPM~1}% + \pdfmanagement_add:nnn + {Page/Resources/ExtGState} + {SPCop} + {\__pdf_backend_object_ref:n {__spc_extgstate_op_true1}} + } + } +%% +%% +%% End of file `pdfmanagement-firstaid.sty'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty new file mode 100644 index 00000000000..7873ac752da --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty @@ -0,0 +1,45 @@ +%% +%% This is file `pdfmanagement-testphase.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pdfmanagement-testphase.dtx (with options: `package') +%% +%% Copyright (C) 2019-2021 The LaTeX Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "LaTeX PDF management testphase bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: pdfmanagement-testphase.dtx +\ProvidesExplPackage {pdfmanagement-testphase} {2021-02-22} {0.95a} + {LaTeX PDF management testphase bundle} +\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} +\IfFormatAtLeastTF{2020-10-01}{}{ + \PackageWarning{pdfmanagement-testphase} + {This~package~needs~LaTeX~2020-10-01~or~newer. + \MessageBreak Loading~is~aborted.}{} + \DeclareOption { debug }{} + \newcommand\DeclareDocumentMetadata[1]{} + \ProcessOptions\relax + } +\IfFormatAtLeastTF{2020-10-01}{}{\endinput} + +\DeclareOption { debug } + { + \msg_redirect_module:nnn { pdf } { none } { warning } + } + +\ProcessOptions\relax +%% can perhaps be combined or made optional ... +\input{pdfmanagement-testphase.ltx} +%% +%% +%% End of file `pdfmanagement-testphase.sty'. diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty new file mode 100644 index 00000000000..be7a2522708 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty @@ -0,0 +1,26 @@ +%% +%% This is file `transparent-ltx.sty', +%% a replacement for transparent sty from Heiko Oberdiek +%% +\NeedsTeXFormat{LaTeX2e}[2020/10/01] +\ProvidesExplPackage{transparent-ltx}% + {2021-02-22}{v0.95a}{Transparency with color stacks (replacement for transparent.sty from Heiko Oberdiek)}% + +\RequirePackage{l3opacity} + +\NewDocumentCommand{\transparent} { m } + { + \opacity_select:n{\fp_eval:n{ min(max(0,#1),1) } } + } + +\NewDocumentCommand{\texttransparent}{m m} + { + \mode_leave_vertical: + \group_begin: + \transparent{#1} + #2 + \group_end: + } + + +\endinput diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty new file mode 100644 index 00000000000..c49a000fa20 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty @@ -0,0 +1,98 @@ +%% LaTeX2e file `xcolor-patches.sty' +%% +\ProvidesPackage{xcolor-patches-tmp-ltx}[2021/02/22 v0.95a patch xcolor for l3color] +\@ifundefined{color_set:nn}{\RequirePackage{l3color}}{} + +\ExplSyntaxOn +\cs_gset_protected:Npn \@expl@xcolor@set@@nnn #1 #2 #3 + { + \cs_if_exist:cTF { __color_parse_model_ #2 :w } + { + \color_set:nnn {#1}{#2}{#3} + } + { + \tl_if_eq:nnTF{#2}{named} + { + \color_set:nn{#1}{#3} + } + { + %this is for multi models, it will break if there is model + %l3 doesn't know, but the case is rare, so accept it for now. + \color_set:nnn{#1}{#2}{#3} + } + } + } + \cs_generate_variant:Nn \color_set:nn {ne} + \cs_new_protected:Npn \@expl@xcolor@set@@ne #1 #2 + { + \exp_args:Nx \__color_if_defined:nT {#2} + { \color_set:ne {#1}{#2} } + } +\ExplSyntaxOff +%\pretocmd{\XC@col@rlet} {\@expl@color@set@@ne{#2}{#4}}{}{\fail} +\def\XC@col@rlet[#1]#2[#3]#4% + {\@expl@xcolor@set@@ne{#2}{#4}% + \begingroup + \edef\@@cls{#1}\XC@edef\@@nam{#2}\XC@sdef\@@mod{#3}\XC@edef\@@clr{#4}% + \XC@info\@@clr\@@tmp\XC@@tstfalse + \ifnum\@@tmp=\@ne\ifx\@@mod\@empty + \ifx\@@cls\@empty + \XC@@tsttrue + \else + \edef\@@tmp + {\expandafter\expandafter\expandafter\@secondoffive + \csname\string\color@\@@clr\endcsname}% + \ifx\@@cls\@@tmp\XC@@tsttrue\fi + \fi + \fi\fi + \ifXC@@tst + \XC@logdef\@@nam\XC@c@l@rlet\@@nam\@@clr + \else + \extractcolorspec\@@clr\@@clr + \ifx\@@mod\@empty\else + \expandafter\convertcolorspec\@@clr\@@mod\@@clr + \edef\@@clr{{\@@mod}{\@@clr}}\fi + \edef\@@tmp{\noexpand\XC@definecolor[\@@cls]{\@@nam}\@@clr}% + \fi + \expandafter\endgroup\@@tmp\xglobal@stop} + +%\pretocmd{\XC@definec@lor}{\@expl@color@set@@nnn{#2}{#4}{#5}}{}{\fail} +\def\XC@definec@lor[#1]#2[#3]#4#5% + {\@expl@xcolor@set@@nnn{#2}{#4}{#5}% + \begingroup + \XC@sdef\@@cls{#1}\XC@edef\@@nam{#2}\edef\colornameprefix{#3}% + \XC@logdef\@@nam + \XC@getmodclr02{#4}{#5}{\let\@@tmp\relax}% + {\ifx\@@mod\XC@mod@named + \XC@c@l@rlet\@@nam\@@clr + \else + \ifx\@@cls\XC@mod@ps + \edef\@@drv{\@@mod\space\@@clr}\def\@@hue{0}% + \edef\@@clr{\@nameuse{XC@clr@\@@mod @white}}% + \else + \ifconvertcolorsD + \let\@@tmp\@@mod\XC@sdef\@@mod{\XC@tgt@mod\@@tmp}% + \convertcolorspec\@@tmp\@@clr\@@mod\@@clr + \fi + \XC@coremodel\@@mod\@@clr + \csname color@\@@mod\expandafter\endcsname + \expandafter\@@drv\expandafter{\@@clr}% + \ifcase\XC@@xcp@ + \immediate\write\XC@@xcp{/\colornameprefix\@@nam{\expandafter + \XC@strip@comma\@@clr,,\@nnil}XC\@@mod}% + \let\@@cls\XC@mod@named + \fi + \ifx\@@cls\@empty\else + \let\@@tmp\@@cls + \@nameuse{define@color@\@@cls}\@@nam\@@drv + \csname color@\@@tmp\expandafter\endcsname + \expandafter\@@drv\expandafter{\@@nam}% + \fi + \fi + \toks@\expandafter{\@@drv}% + \edef\@@tmp + {\ifglobalcolors\global\else\xglobal@\fi + \noexpand\@namedef{\string\color@\@@nam}% + {\noexpand\xcolor@{\@@cls}{\the\toks@}{\@@mod}{\@@clr}}}% + \fi}% + \expandafter\endgroup\@@tmp\xglobal@stop} diff --git a/Master/texmf-dist/tex/latex/spath3/spath3.sty b/Master/texmf-dist/tex/latex/spath3/spath3.sty index 868e648f570..6a136789262 100644 --- a/Master/texmf-dist/tex/latex/spath3/spath3.sty +++ b/Master/texmf-dist/tex/latex/spath3/spath3.sty @@ -15,7 +15,7 @@ \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \RequirePackage{pgf} -\ProvidesExplPackage {spath3} {2021/02/05} {2.2} {Functions for +\ProvidesExplPackage {spath3} {2021/02/21} {2.4} {Functions for manipulating PGF soft paths} \RequirePackage{xparse} \cs_new_protected:Nn \__spath_tl_put_right_braced:Nn @@ -1226,7 +1226,7 @@ manipulating PGF soft paths} { \spath_splice_between:NVnn #1#1{#2}{#3} } -\cs_generate_variant:Nn \spath_splice_between:Nnn {NVV, cnn, cvv, Nvn} +\cs_generate_variant:Nn \spath_splice_between:Nnn {NVV, cnn, cvv, Nvn, NVn} \cs_new_protected_nopar:Npn \spath_gsplice_between:Nnnn #1#2#3#4 { \__spath_splice_between:nnn {#2}{#3}{#4} @@ -1238,7 +1238,7 @@ manipulating PGF soft paths} { \spath_gsplice_between:NVnn #1#1{#2}{#3} } -\cs_generate_variant:Nn \spath_gsplice_between:Nnn {NVV, cnn, cvv} +\cs_generate_variant:Nn \spath_gsplice_between:Nnn {NVV, cnn, cvv, Nvn, NVn} \cs_new_protected_nopar:Npn \__spath_close_with:nn #1#2 { \group_begin: @@ -1355,7 +1355,7 @@ manipulating PGF soft paths} { \spath_append_no_move:NVn #1#1{#2} } -\cs_generate_variant:Nn \spath_append_no_move:Nn {NV, cv, Nv} +\cs_generate_variant:Nn \spath_append_no_move:Nn {NV, cv, Nv, cV} \cs_new_protected_nopar:Npn \spath_gappend_no_move:Nnn #1#2#3 { \__spath_append_no_move:nn {#2}{#3} @@ -1367,7 +1367,7 @@ manipulating PGF soft paths} { \spath_gappend_no_move:NVn #1#1{#2} } -\cs_generate_variant:Nn \spath_gappend_no_move:Nn {NV, cv, Nv} +\cs_generate_variant:Nn \spath_gappend_no_move:Nn {NV, cv, Nv, cV} \cs_new_protected_nopar:Npn \spath_append:Nnn #1#2#3 { \tl_set:Nn #1 {#2} @@ -1378,7 +1378,7 @@ manipulating PGF soft paths} { \spath_append:NVn #1#1{#2} } -\cs_generate_variant:Nn \spath_append:Nn {NV, Nv, cv} +\cs_generate_variant:Nn \spath_append:Nn {NV, Nv, cv, cV} \cs_new_protected_nopar:Npn \spath_gappend:Nnn #1#2#3 { \tl_gset:Nn #1 {#2} @@ -1389,7 +1389,7 @@ manipulating PGF soft paths} { \spath_gappend:NVn #1#1{#2} } -\cs_generate_variant:Nn \spath_gappend:Nn {NV, Nv, cv} +\cs_generate_variant:Nn \spath_gappend:Nn {NV, Nv, cv, cV} \cs_new_protected_nopar:Npn \spath_prepend_no_move:Nnn #1#2#3 { \spath_append_no_move:Nnn #1{#3}{#2} @@ -1596,6 +1596,117 @@ manipulating PGF soft paths} { \spath_gopen:NV #1#1 } +\cs_new_protected_nopar:Npn \__spath_replace_lines:n #1 +{ + \group_begin: + \tl_set:Nn \l__spath_tmpa_tl {#1} + \tl_clear:N \l__spath_tmpb_tl + \dim_set:Nn \l__spath_tmpa_dim {0pt} + \dim_set:Nn \l__spath_tmpb_dim {0pt} + + \bool_do_until:nn + { + \tl_if_empty_p:N \l__spath_tmpa_tl + } + { + \tl_set:Nx \l__spath_tmpc_tl {\tl_item:Nn \l__spath_tmpa_tl {1}} + \tl_set:Nx \l__spath_tmpd_tl {\tl_item:Nn \l__spath_tmpa_tl {2}} + \tl_set:Nx \l__spath_tmpe_tl {\tl_item:Nn \l__spath_tmpa_tl {3}} + + \tl_if_eq:NNTF \l__spath_tmpc_tl \c_spath_lineto_tl + { + \tl_put_right:NV \l__spath_tmpb_tl \c_spath_curvetoa_tl + \tl_put_right:Nx \l__spath_tmpb_tl + { + { + \fp_to_dim:n + { + 2/3 * (\l__spath_tmpa_dim) + + + 1/3 * (\l__spath_tmpd_tl) + } + } + } + \tl_put_right:Nx \l__spath_tmpb_tl + { + { + \fp_to_dim:n + { + 2/3 * (\l__spath_tmpb_dim) + + + 1/3 * (\l__spath_tmpe_tl) + } + } + } + \tl_put_right:NV \l__spath_tmpb_tl \c_spath_curvetob_tl + \tl_put_right:Nx \l__spath_tmpb_tl + { + { + \fp_to_dim:n + { + 1/3 * (\l__spath_tmpa_dim) + + + 2/3 * (\l__spath_tmpd_tl) + } + } + } + \tl_put_right:Nx \l__spath_tmpb_tl + { + { + \fp_to_dim:n + { + 1/3 * (\l__spath_tmpb_dim) + + + 2/3 * (\l__spath_tmpe_tl) + } + } + } + \tl_put_right:NV \l__spath_tmpb_tl \c_spath_curveto_tl + \__spath_tl_put_right_braced:NV \l__spath_tmpb_tl \l__spath_tmpd_tl + \__spath_tl_put_right_braced:NV \l__spath_tmpb_tl \l__spath_tmpe_tl + } + { + \tl_put_right:NV \l__spath_tmpb_tl \l__spath_tmpc_tl + \__spath_tl_put_right_braced:NV \l__spath_tmpb_tl \l__spath_tmpd_tl + \__spath_tl_put_right_braced:NV \l__spath_tmpb_tl \l__spath_tmpe_tl + } + + \dim_set:Nn \l__spath_tmpa_dim {\l__spath_tmpd_tl} + \dim_set:Nn \l__spath_tmpb_dim {\l__spath_tmpe_tl} + + \prg_replicate:nn {3} + { + \tl_set:Nx \l__spath_tmpa_tl {\tl_tail:N \l__spath_tmpa_tl} + } + } + \tl_gset_eq:NN \g__spath_output_tl \l__spath_tmpb_tl + \group_end: +} +\cs_generate_variant:Nn \__spath_replace_lines:n {V} +\cs_new_protected_nopar:Npn \spath_replace_lines:Nn #1#2 +{ + \__spath_replace_lines:n {#2} + \tl_set_eq:NN #1 \g__spath_output_tl + \tl_gclear:N \g__spath_output_tl +} +\cs_generate_variant:Nn \spath_replace_lines:Nn {NV, cV, cv, Nv} +\cs_new_protected_nopar:Npn \spath_replace_lines:N #1 +{ + \spath_replace_lines:NV #1#1 +} +\cs_generate_variant:Nn \spath_replace_lines:N {c} +\cs_new_protected_nopar:Npn \spath_greplace_lines:Nn #1#2 +{ + \__spath_replace_lines:n {#2} + \tl_gset_eq:NN #1 \g__spath_output_tl + \tl_gclear:N \g__spath_output_tl +} +\cs_generate_variant:Nn \spath_greplace_lines:Nn {NV, cV, cv, Nv} +\cs_new_protected_nopar:Npn \spath_greplace_lines:N #1 +{ + \spath_greplace_lines:NV #1#1 +} +\cs_generate_variant:Nn \spath_greplace_lines:N {c} \cs_new_protected_nopar:Npn \__spath_remove_empty_components:n #1 { \group_begin: @@ -3810,7 +3921,6 @@ manipulating PGF soft paths} } } \cs_generate_variant:Nn \spath_show:n {V, v} - \cs_new_protected_nopar:Npn \spath_get_current_path:N #1 { \pgfsyssoftpath@getcurrentpath #1 @@ -3898,6 +4008,7 @@ manipulating PGF soft paths} \tl_clear_new:c {tikz@timer} \tl_set:cn {tikz@timer} { + \pgftransformreset \spath_reallength:Nn \l__spath_tmpa_int {#1} \tl_set_eq:Nc \l__spath_tmpb_tl {tikz@time} \tl_set:Nx \l__spath_tmpb_tl diff --git a/Master/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.tex b/Master/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.tex index 9c1c158e52a..bd81706e3b9 100644 --- a/Master/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.tex +++ b/Master/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.tex @@ -25,7 +25,10 @@ \seq_new:N \g__spath_tmpb_seq \bool_new:N \l__spath_draft_bool \msg_new:nnn { spath3 } { missing soft path } { Soft~ path~ #1~ doesn't~ exist } -\msg_new:nnn { spath3 } { empty soft path } { Soft~ path~ #1~ is~ empty } +\msg_new:nnnn { spath3 } { empty soft path } { Soft~ path~ #1~ is~ empty} +{If~ it~ was~ defined~ inside~ a~ group,~ try~ using~ "save~ global". } +\msg_new:nnn { spath3 } { load intersections } +{ You~ need~ to~ load~ the~ "intersections"~ library~ to~ work~ with~ intersections } \tl_set:Nn \l__spath_prefix_tl {tikz@intersect@path@name@} \tl_set:Nn \l__spath_suffix_tl {} \tl_new:N \g__spath_tikzfinish_tl @@ -68,6 +71,59 @@ \tl_set_eq:NN #1 \g__spath_output_tl \tl_gclear:N \g__spath_output_tl } +\cs_set_eq:NN \__spath_tikzset:n \tikzset +\cs_generate_variant:Nn \__spath_tikzset:n {V, v} +\bool_new:N \l__spath_reverse_bool +\bool_new:N \l__spath_weld_bool +\bool_new:N \l__spath_move_bool +\bool_new:N \l__spath_global_bool +\tl_new:N \l__spath_joinpath_tl +\tl_new:N \l__spath_transformation_tl + +\cs_new_protected_nopar:Npn \__spath_set_bool:Nn #1#2 +{ + \tl_if_eq:nnTF {#2}{false} + { + \bool_set_false:N #1 + } + { + \bool_set_true:N #1 + } +} +\tikzset { + spath/join/.is~ family, + spath/join/.cd, + reverse/.code = { + \__spath_set_bool:Nn \l__spath_reverse_bool {#1} + }, + reverse/.default = true, + weld/.code = { + \__spath_set_bool:Nn \l__spath_weld_bool {#1} + }, + weld/.default = true, + no~ weld/.code = { + \__spath_set_bool:Nn \l__spath_weld_bool {#1} + \bool_set:Nn \l__spath_weld_bool {! \l__spath_weld_bool} + }, + no~ weld/.default = true, + move/.code = { + \__spath_set_bool:Nn \l__spath_move_bool {#1} + }, + move/.default = true, + no~ move/.code = { + \__spath_set_bool:Nn \l__spath_move_bool {#1} + \bool_set:Nn \l__spath_move_bool {! \l__spath_move_bool} + }, + no~ move/.default = true, + global/.code = { + \__spath_set_bool:Nn \l__spath_global_bool {#1} + }, + global/.default = true, + transform/.store~in=\l__spath_transformation_tl, + .unknown/.code = { + \tl_set_eq:NN \l__spath_joinpath_tl \pgfkeyscurrentname + } +} \cs_set_eq:NN \getComponentOf \clist_item:Nn \tikzset{ spath/.is~family, @@ -95,6 +151,15 @@ \l__spath_tmpa_tl } }, + save~ global/.code={ + \tikz@addmode{ + \spath_get_current_path:N \l__spath_tmpa_tl + \spath_bake_round:NV \l__spath_tmpa_tl \l__spath_tmpa_tl + \spath_gsave_path:cV + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \l__spath_tmpa_tl + } + }, clone/.code~ 2~ args={ \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} @@ -123,15 +188,6 @@ \msg_warning:nnn { spath3 } { missing soft path } { #2 } } }, - save~ global/.code={ - \tikz@addmode{ - \spath_get_current_path:N \l__spath_tmpa_tl - \spath_bake_round:NV \l__spath_tmpa_tl \l__spath_tmpa_tl - \spath_gsave_path:cV - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - \l__spath_tmpa_tl - } - }, save~ to~ aux/.code={ \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} @@ -143,67 +199,134 @@ \msg_warning:nnn { spath3 } { missing soft path } { #1 } } }, - restore/.code={ + export~ to~ svg/.code={ \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { - \tl_if_empty:cTF + \spath_export_to_svg:nv {#1} {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - { - \tl_clear:N \l__spath_tmpa_tl - \tl_put_right:NV \l__spath_tmpa_tl \c_spath_moveto_tl - \tl_put_right:Nn \l__spath_tmpa_tl {{0pt}{0pt}} - \spath_set_current_path:V \l__spath_tmpa_tl - \spath_set_tikz_data:V \l__spath_tmpa_tl - \msg_warning:nnn { spath3 } { empty soft path } { #1 } - } - { - \spath_set_current_path:c - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - \spath_set_tikz_data:v - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - } } { - \tl_clear:N \l__spath_tmpa_tl - \tl_put_right:NV \l__spath_tmpa_tl \c_spath_moveto_tl - \tl_put_right:Nn \l__spath_tmpa_tl {{0pt}{0pt}} - \spath_set_current_path:V \l__spath_tmpa_tl - \spath_set_tikz_data:V \l__spath_tmpa_tl \msg_warning:nnn { spath3 } { missing soft path } { #1 } } }, - restore~ reverse/.code={ + use/.code={ + \bool_set_false:N \l__spath_reverse_bool + \bool_set_false:N \l__spath_weld_bool + \bool_set_false:N \l__spath_move_bool + \tl_clear:N \l__spath_joinpath_tl + \tl_clear:N \l__spath_transformation_tl + \tikzset{ + spath/join/.cd, + #1 + } + \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { - \tl_if_empty:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_joinpath_tl + \tl_use:N \l__spath_suffix_tl + } + { + \tl_if_empty:cT + { + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_joinpath_tl + \tl_use:N \l__spath_suffix_tl + } { - \tl_clear:N \l__spath_tmpa_tl - \tl_put_right:NV \l__spath_tmpa_tl \c_spath_moveto_tl - \tl_put_right:Nn \l__spath_tmpa_tl {{0pt}{0pt}} - \spath_set_current_path:V \l__spath_tmpa_tl - \spath_set_tikz_data:V \l__spath_tmpa_tl \msg_warning:nnn { spath3 } { empty soft path } { #1 } } + \tl_set_eq:Nc \l__spath_joinpath_tl { - \spath_reverse:Nv - \l__spath_reverse_tl - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - \spath_set_current_path:N \l__spath_reverse_tl - \spath_set_tikz_data:V \l__spath_reverse_tl + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_joinpath_tl + \tl_use:N \l__spath_suffix_tl + } + \spath_get_current_path:N \l__spath_current_tl + + \bool_if:NT \l__spath_reverse_bool + { + \spath_reverse:N \l__spath_joinpath_tl } + + \tl_if_empty:NF \l__spath_transformation_tl + { + \group_begin: + \pgftransformreset + \__spath_tikzset:V \l__spath_transformation_tl + \pgfgettransform \l__spath_tmpa_tl + \tl_gset:Nn \g__spath_smuggle_tl + { + \spath_transform:Nnnnnnn + \l__spath_joinpath_tl + } + \tl_gput_right:NV \g__spath_smuggle_tl \l__spath_tmpa_tl + \group_end: + \tl_use:N \g__spath_smuggle_tl + } + + \bool_if:NT \l__spath_move_bool + { + \tl_if_empty:NTF \l__spath_current_tl + { + \tl_set:Nn \l__spath_tmpc_tl { {0pt} {0pt} } + } + { + \spath_finalpoint:NV + \l__spath_tmpc_tl + \l__spath_current_tl + } + \spath_translate_to:NV \l__spath_joinpath_tl \l__spath_tmpc_tl + } + + \tl_if_empty:NTF \l__spath_current_tl + { + \tl_if_empty:NTF \l__spath_joinpath_tl + { + \tl_set_eq:NN \l__spath_current_tl \c_spath_moveto_tl + \tl_put_right:Nn \l__spath_current_tl {{0pt}{0pt}} + } + { + \tl_set_eq:NN \l__spath_current_tl \l__spath_joinpath_tl + } + } + { + + \tl_clear:N \l__spath_tmpa_tl + \tl_set:Nn \l__spath_tmpa_tl {spath_} + + \tl_put_right:Nn \l__spath_tmpa_tl {append} + + \bool_if:NT \l__spath_weld_bool + { + \tl_put_right:Nn \l__spath_tmpa_tl {_no_move} + } + \tl_put_right:Nn \l__spath_tmpa_tl {:NV} + + \use:c {\tl_use:N \l__spath_tmpa_tl } + \l__spath_current_tl + \l__spath_joinpath_tl + } + + \spath_set_current_path:N \l__spath_current_tl + \spath_set_tikz_data:V \l__spath_joinpath_tl } { - \tl_clear:N \l__spath_tmpa_tl - \tl_put_right:NV \l__spath_tmpa_tl \c_spath_moveto_tl - \tl_put_right:Nn \l__spath_tmpa_tl {{0pt}{0pt}} - \spath_set_current_path:V \l__spath_tmpa_tl - \spath_set_tikz_data:V \l__spath_tmpa_tl - \msg_warning:nnn { spath3 } { missing soft path } { #1 } + \msg_warning:nnx + { spath3 } + { missing soft path } + {\tl_use:N \l__spath_joinpath_tl } } }, + restore/.style={/tikz/spath/use={#1}}, + restore~ reverse/.style={/tikz/spath/use={reverse, #1}}, + append/.style={/tikz/spath/use={move, weld, #1}}, + append~ no~ move/.style={/tikz/spath/use={weld, #1}}, + append~ reverse/.style={/tikz/spath/use={move, weld, reverse, #1}}, + append~ reverse~ no~ move/.style={/tikz/spath/use={weld, reverse, #1}}, + insert/.style={/tikz/spath/use={#1}}, + insert~ reverse/.style={/tikz/spath/use={reverse, #1}}, show~current~path/.code={ \tikz@addmode{ \pgfsyssoftpath@getcurrentpath\l__spath_tmpa_tl @@ -230,37 +353,94 @@ \msg_warning:nnn { spath3 } { missing soft path } { #1 } } }, - append/.code={ - \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - { - \spath_get_current_path:N \l__spath_current_tl - \spath_finalpoint:NV \l__spath_tmpa_tl \l__spath_current_tl - \tl_set_eq:Nc - \l__spath_tmpb_tl - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - \spath_translate_to:NV \l__spath_tmpb_tl \l__spath_tmpa_tl - \spath_append_no_move:NV \l__spath_current_tl \l__spath_tmpb_tl - \spath_set_current_path:N \l__spath_current_tl - \spath_set_tikz_data:V \l__spath_tmpb_tl - } - { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } - } - }, join~ with/.code~ 2~ args={ \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { + \bool_set_false:N \l__spath_reverse_bool + \bool_set_false:N \l__spath_weld_bool + \bool_set_false:N \l__spath_move_bool + \bool_set_false:N \l__spath_global_bool + \tl_clear:N \l__spath_joinpath_tl + \tl_clear:N \l__spath_transformation_tl + \tikzset{ + spath/join/.cd, + #2 + } + \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} { - \spath_append:cv + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_joinpath_tl + \tl_use:N \l__spath_suffix_tl + } + { + \tl_set_eq:Nc \l__spath_joinpath_tl + { + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_joinpath_tl + \tl_use:N \l__spath_suffix_tl + } + + \bool_if:NT \l__spath_reverse_bool + { + \spath_reverse:N \l__spath_joinpath_tl + } + + \tl_if_empty:NF \l__spath_transformation_tl + { + \group_begin: + \pgftransformreset + \__spath_tikzset:V \l__spath_transformation_tl + \pgfgettransform \l__spath_tmpa_tl + \tl_gset:Nn \g__spath_smuggle_tl + { + \spath_transform:Nnnnnnn + \l__spath_joinpath_tl + } + \tl_gput_right:NV \g__spath_smuggle_tl \l__spath_tmpa_tl + \group_end: + \tl_use:N \g__spath_smuggle_tl + } + + \bool_if:NT \l__spath_move_bool + { + \spath_finalpoint:Nv + \l__spath_tmpc_tl + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \spath_translate_to:NV \l__spath_joinpath_tl \l__spath_tmpc_tl + } + + \tl_clear:N \l__spath_tmpa_tl + \tl_set:Nn \l__spath_tmpa_tl {spath_} + + \bool_if:NT \l__spath_global_bool + { + \tl_put_right:Nn \l__spath_tmpa_tl {g} + } + + \tl_put_right:Nn \l__spath_tmpa_tl {append} + + \bool_if:NT \l__spath_weld_bool + { + \tl_put_right:Nn \l__spath_tmpa_tl {_no_move} + } + \tl_put_right:Nn \l__spath_tmpa_tl {:cV} + + \cs_if_exist:cF {\tl_use:N \l__spath_tmpa_tl} + { + \tl_show:N \l__spath_tmpa_tl + } + + \use:c {\tl_use:N \l__spath_tmpa_tl } {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + \l__spath_joinpath_tl } { - \msg_warning:nnn { spath3 } { missing soft path } { #2 } + \msg_warning:nnx + { spath3 } + { missing soft path } + {\tl_use:N \l__spath_joinpath_tl } } } { @@ -311,88 +491,6 @@ \msg_warning:nnn { spath3 } { missing soft path } { #1 } } }, - append~ reverse/.code={ - \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - { - \spath_reverse:Nv - \l__spath_reverse_tl - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - \spath_get_current_path:N \l__spath_current_tl - \spath_finalpoint:NV \l__spath_tmpa_tl \l__spath_current_tl - \spath_translate_to:NV \l__spath_reverse_tl \l__spath_tmpa_tl - \spath_append_no_move:NV \l__spath_current_tl \l__spath_reverse_tl - \spath_set_current_path:N \l__spath_current_tl - \spath_set_tikz_data:V \l__spath_reverse_tl - } - { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } - } - }, - insert/.code={ - \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - { - \spath_get_current_path:N \l__spath_current_tl - \spath_append:Nv - \l__spath_current_tl - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - \spath_set_current_path:N \l__spath_current_tl - \spath_set_tikz_data:v - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - } - { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } - } - }, - insert~ reverse/.code={ - \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - { - \spath_reverse:Nv - \l__spath_reverse_tl - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - \spath_get_current_path:N \l__spath_current_tl - \spath_append:NV \l__spath_current_tl \l__spath_reverse_tl - \spath_set_current_path:N \l__spath_current_tl - \spath_set_tikz_data:V \l__spath_reverse_tl - } - { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } - } - }, - append~ no~ move/.code={ - \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - { - \spath_get_current_path:N \l__spath_current_tl - \spath_append_no_move:Nv - \l__spath_current_tl - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - \spath_set_current_path:N \l__spath_current_tl - \spath_set_tikz_data:v - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - } - { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } - } - }, - append~ reverse~ no~ move/.code={ - \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - { - \spath_reverse:Nv - \l__spath_reverse_tl - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - \spath_get_current_path:N \l__spath_current_tl - \spath_append_no_move:NV \l__spath_current_tl \l__spath_reverse_tl - \spath_set_current_path:N \l__spath_current_tl - \spath_set_tikz_data:V \l__spath_reverse_tl - } - { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } - } - }, span/.code ~n~ args={3}{ \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} @@ -488,30 +586,89 @@ \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { + \tl_if_head_is_group:nTF {#2} + { + \tl_set:Nx \l__spath_tmpc_tl { \tl_item:nn {#2} {1} } + \tl_set:Nx \l__spath_tmpd_tl { \tl_item:nn {#2} {2} } + } + { + \tl_set:Nn \l__spath_tmpc_tl {#2} + \tl_clear:N \l__spath_tmpd_tl + } \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} { - \spath_spot_weld_components:c - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_tmpc_tl + \tl_use:N \l__spath_suffix_tl + } + { + \tl_if_empty:NT \l__spath_tmpd_tl + { + \spath_spot_weld_components:c + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + } \spath_components_to_seq:Nv \l__spath_tmpa_seq {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \seq_gclear:N \g__spath_tmpa_seq + + \tl_if_empty:NTF \l__spath_tmpd_tl + { + \int_step_inline:nnnn {1}{1} {\seq_count:N \l__spath_tmpa_seq} + { + \seq_gput_right:Nn \g__spath_tmpa_seq {##1} + } + } + { + \foreach \l__spath_tmpa_tl in \l__spath_tmpd_tl + { + \seq_gput_right:NV \g__spath_tmpa_seq \l__spath_tmpa_tl + } + \seq_gsort:Nn \g__spath_tmpa_seq + { + \int_compare:nNnTF {##1} < {##2} + { \sort_return_same: } + { \sort_return_swapped: } + } + } + \seq_pop_left:NN \l__spath_tmpa_seq \l__spath_tmpa_tl + \seq_gpop_left:NN \g__spath_tmpa_seq \l__spath_tmpb_tl - \seq_map_inline:Nn \l__spath_tmpa_seq + \seq_map_indexed_inline:Nn \l__spath_tmpa_seq { - \spath_splice_between:Nvn \l__spath_tmpa_tl - {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} - {##1} + \int_compare:nTF + { + ##1 == \l__spath_tmpb_tl + } + { + \seq_gpop_left:NNF \g__spath_tmpa_seq \l__spath_tmpb_tl + { + \tl_set:Nn \l__spath_tmpb_tl {-1} + } + \spath_splice_between:Nvn \l__spath_tmpa_tl + { + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_tmpc_tl + \tl_use:N \l__spath_suffix_tl + } + {##2} + } + { + \tl_put_right:Nn \l__spath_tmpa_tl {##2} + } } \tl_set_eq:cN {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} \l__spath_tmpa_tl } { - \msg_warning:nnn { spath3 } { missing soft path } { #2 } + \msg_warning:nnx + { spath3 } + { missing soft path } + { \tl_use:N \l__spath_tmpc_tl } } } { @@ -522,30 +679,319 @@ \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { + \tl_if_head_is_group:nTF {#2} + { + \tl_set:Nx \l__spath_tmpc_tl { \tl_item:nn {#2} {1} } + \tl_set:Nx \l__spath_tmpd_tl { \tl_item:nn {#2} {2} } + } + { + \tl_set:Nn \l__spath_tmpc_tl {#2} + \tl_clear:N \l__spath_tmpd_tl + } \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} { - \spath_spot_gweld_components:c + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_tmpc_tl + \tl_use:N \l__spath_suffix_tl + } + { + \tl_if_empty:NT \l__spath_tmpd_tl + { + \spath_spot_weld_components:c + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + } + + \spath_components_to_seq:Nv + \l__spath_tmpa_seq + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + + \seq_gclear:N \g__spath_tmpa_seq + + \tl_if_empty:NTF \l__spath_tmpd_tl + { + \int_step_inline:nnnn {1}{1} {\seq_count:N \l__spath_tmpa_seq} + { + \seq_gput_right:Nn \g__spath_tmpa_seq {##1} + } + } + { + \foreach \l__spath_tmpa_tl in \l__spath_tmpd_tl + { + \seq_gput_right:NV \g__spath_tmpa_seq \l__spath_tmpa_tl + } + \seq_gsort:Nn \g__spath_tmpa_seq + { + \int_compare:nNnTF {##1} < {##2} + { \sort_return_same: } + { \sort_return_swapped: } + } + } + + \seq_pop_left:NN \l__spath_tmpa_seq \l__spath_tmpa_tl + \seq_gpop_left:NN \g__spath_tmpa_seq \l__spath_tmpb_tl + + \seq_map_indexed_inline:Nn \l__spath_tmpa_seq + { + \int_compare:nTF + { + ##1 == \l__spath_tmpb_tl + } + { + \seq_gpop_left:NNF \g__spath_tmpa_seq \l__spath_tmpb_tl + { + \tl_set:Nn \l__spath_tmpb_tl {-1} + } + \spath_splice_between:Nvn \l__spath_tmpa_tl + { + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_tmpc_tl + \tl_use:N \l__spath_suffix_tl + } + {##2} + } + { + \tl_put_right:Nn \l__spath_tmpa_tl {##2} + } + } + \tl_gset_eq:cN {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \l__spath_tmpa_tl + } + { + \msg_warning:nnx + { spath3 } + { missing soft path } + { \tl_use:N \l__spath_tmpc_tl } + } + } + { + \msg_warning:nnn { spath3 } { missing soft path } { #1 } + } + }, + join~ components~ upright~ with/.code~2~args={ + \tl_if_exist:cTF + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + { + \tl_if_head_is_group:nTF {#2} + { + \tl_set:Nx \l__spath_tmpc_tl { \tl_item:nn {#2} {1} } + \tl_set:Nx \l__spath_tmpd_tl { \tl_item:nn {#2} {2} } + } + { + \tl_set:Nn \l__spath_tmpc_tl {#2} + \tl_clear:N \l__spath_tmpd_tl + } + \tl_if_exist:cTF + { + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_tmpc_tl + \tl_use:N \l__spath_suffix_tl + } + { + \tl_if_empty:NT \l__spath_tmpd_tl + { + \spath_spot_weld_components:c + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + } \spath_components_to_seq:Nv \l__spath_tmpa_seq {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \seq_gclear:N \g__spath_tmpa_seq + + \tl_if_empty:NTF \l__spath_tmpd_tl + { + \int_step_inline:nnnn {1}{1} {\seq_count:N \l__spath_tmpa_seq} + { + \seq_gput_right:Nn \g__spath_tmpa_seq {##1} + } + } + { + \foreach \l__spath_tmpa_tl in \l__spath_tmpd_tl + { + \seq_gput_right:NV \g__spath_tmpa_seq \l__spath_tmpa_tl + } + \seq_gsort:Nn \g__spath_tmpa_seq + { + \int_compare:nNnTF {##1} < {##2} + { \sort_return_same: } + { \sort_return_swapped: } + } + } + \seq_pop_left:NN \l__spath_tmpa_seq \l__spath_tmpa_tl + \seq_gpop_left:NN \g__spath_tmpa_seq \l__spath_tmpb_tl - \seq_map_inline:Nn \l__spath_tmpa_seq + \tl_set_eq:Nc \l__spath_tmpc_tl { - \spath_gsplice_between:Nvn \l__spath_tmpa_tl - {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} - {##1} + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_tmpc_tl + \tl_use:N \l__spath_suffix_tl + } + \spath_transform:NVnnnnnn \l__spath_tmpd_tl \l__spath_tmpc_tl {1}{0}{0}{-1}{0pt}{0pt} + + \seq_map_indexed_inline:Nn \l__spath_tmpa_seq + { + \int_compare:nTF + { + ##1 == \l__spath_tmpb_tl + } + { + \seq_gpop_left:NNF \g__spath_tmpa_seq \l__spath_tmpb_tl + { + \tl_set:Nn \l__spath_tmpb_tl {-1} + } + \spath_finalpoint:NV \l__spath_tmpe_tl \l__spath_tmpa_tl + \spath_initialpoint:Nn \l__spath_tmpf_tl {##2} + + \dim_compare:nTF + { + \tl_item:Nn \l__spath_tmpe_tl {1} + > + \tl_item:Nn \l__spath_tmpf_tl {1} + } + { + \spath_splice_between:NVn + \l__spath_tmpa_tl + \l__spath_tmpd_tl + {##2} + } + { + \spath_splice_between:NVn + \l__spath_tmpa_tl + \l__spath_tmpc_tl + {##2} + } + } + { + \tl_put_right:Nn \l__spath_tmpa_tl {##2} + } } \tl_set_eq:cN {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} \l__spath_tmpa_tl } { - \msg_warning:nnn { spath3 } { missing soft path } { #2 } + \msg_warning:nnx + { spath3 } + { missing soft path } + { \tl_use:N \l__spath_tmpc_tl } + } + } + { + \msg_warning:nnn { spath3 } { missing soft path } { #1 } + } + }, + join~ components~ globally~ upright~ with/.code~2~args={ + \tl_if_exist:cTF + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + { + \tl_if_head_is_group:nTF {#2} + { + \tl_set:Nx \l__spath_tmpc_tl { \tl_item:nn {#2} {1} } + \tl_set:Nx \l__spath_tmpd_tl { \tl_item:nn {#2} {2} } + } + { + \tl_set:Nn \l__spath_tmpc_tl {#2} + \tl_clear:N \l__spath_tmpd_tl + } + \tl_if_exist:cTF + { + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_tmpc_tl + \tl_use:N \l__spath_suffix_tl + } + { + \tl_if_empty:NT \l__spath_tmpd_tl + { + \spath_spot_weld_components:c + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + } + + \spath_components_to_seq:Nv + \l__spath_tmpa_seq + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + + \seq_gclear:N \g__spath_tmpa_seq + + \tl_if_empty:NTF \l__spath_tmpd_tl + { + \int_step_inline:nnnn {1}{1} {\seq_count:N \l__spath_tmpa_seq} + { + \seq_gput_right:Nn \g__spath_tmpa_seq {##1} + } + } + { + \foreach \l__spath_tmpa_tl in \l__spath_tmpd_tl + { + \seq_gput_right:NV \g__spath_tmpa_seq \l__spath_tmpa_tl + } + \seq_gsort:Nn \g__spath_tmpa_seq + { + \int_compare:nNnTF {##1} < {##2} + { \sort_return_same: } + { \sort_return_swapped: } + } + } + + \seq_pop_left:NN \l__spath_tmpa_seq \l__spath_tmpa_tl + \seq_gpop_left:NN \g__spath_tmpa_seq \l__spath_tmpb_tl + + \tl_set_eq:Nc \l__spath_tmpc_tl + { + \tl_use:N \l__spath_prefix_tl + \tl_use:N \l__spath_tmpc_tl + \tl_use:N \l__spath_suffix_tl + } + \spath_transform:NVnnnnnn \l__spath_tmpd_tl \l__spath_tmpc_tl {1}{0}{0}{-1}{0pt}{0pt} + + \seq_map_indexed_inline:Nn \l__spath_tmpa_seq + { + \int_compare:nTF + { + ##1 == \l__spath_tmpb_tl + } + { + \seq_gpop_left:NNF \g__spath_tmpa_seq \l__spath_tmpb_tl + { + \tl_set:Nn \l__spath_tmpb_tl {-1} + } + \spath_finalpoint:NV \l__spath_tmpe_tl \l__spath_tmpa_tl + \spath_initialpoint:Nn \l__spath_tmpf_tl {##2} + + \dim_compare:nTF + { + \tl_item:Nn \l__spath_tmpe_tl {1} + > + \tl_item:Nn \l__spath_tmpf_tl {1} + } + { + \spath_splice_between:NVn + \l__spath_tmpa_tl + \l__spath_tmpd_tl + {##2} + } + { + \spath_splice_between:NVn + \l__spath_tmpa_tl + \l__spath_tmpc_tl + {##2} + } + } + { + \tl_put_right:Nn \l__spath_tmpa_tl {##2} + } + } + \tl_gset_eq:cN + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \l__spath_tmpa_tl + } + { + \msg_warning:nnx + { spath3 } + { missing soft path } + { \tl_use:N \l__spath_tmpc_tl } } } { @@ -726,17 +1172,6 @@ \msg_warning:nnn { spath3 } { missing soft path } { #1 } } }, - export~ to~ svg/.code={ - \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - { - \spath_export_to_svg:nv {#1} - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - } - { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } - } - }, transform/.code~ 2~ args={ \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} @@ -781,100 +1216,154 @@ }, split~ at~ intersections~ with/.code~ n~ args={2}{ \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + { + tikz@library@intersections@loaded + } { \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { - \spath_split_path_at_intersections:cv - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + { + \spath_split_path_at_intersections:cv + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + } + { + \msg_warning:nnn { spath3 } { missing soft path } { #2 } + } } { - \msg_warning:nnn { spath3 } { missing soft path } { #2 } + \msg_warning:nnn { spath3 } { missing soft path } { #1 } } } { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } + \msg_warning:nn { spath3 } { load intersections } } }, split~ globally~ at~ intersections~ with/.code~ n~ args={2}{ \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { - \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + tikz@library@intersections@loaded + } + { + \tl_if_exist:cTF + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { - \spath_gsplit_path_at_intersections:cv - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + { + \spath_gsplit_path_at_intersections:cv + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + } + { + \msg_warning:nnn { spath3 } { missing soft path } { #2 } + } } { - \msg_warning:nnn { spath3 } { missing soft path } { #2 } + \msg_warning:nnn { spath3 } { missing soft path } { #1 } } } { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } + \msg_warning:nn { spath3 } { load intersections } } }, split~ at~ intersections/.code~ n~ args={2}{ \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + { + tikz@library@intersections@loaded + } { \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { - \spath_split_at_intersections:cc - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + { + \spath_split_at_intersections:cc + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + } + { + \msg_warning:nnn { spath3 } { missing soft path } { #2 } + } } { - \msg_warning:nnn { spath3 } { missing soft path } { #2 } + \msg_warning:nnn { spath3 } { missing soft path } { #1 } } } { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } + \msg_warning:nn { spath3 } { load intersections } } }, split~ globally~ at~ intersections/.code~ n~ args={2}{ \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + { + tikz@library@intersections@loaded + } { \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { - \spath_gsplit_at_intersections:cc - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + { + \spath_gsplit_at_intersections:cc + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl} + } + { + \msg_warning:nnn { spath3 } { missing soft path } { #2 } + } } { - \msg_warning:nnn { spath3 } { missing soft path } { #2 } + \msg_warning:nnn { spath3 } { missing soft path } { #1 } } } { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } + \msg_warning:nn { spath3 } { load intersections } } }, split~ at~ self~ intersections/.code={ \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { - \spath_split_at_self_intersections:c + tikz@library@intersections@loaded + } + { + \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + { + \spath_split_at_self_intersections:c + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + } + { + \msg_warning:nnn { spath3 } { missing soft path } { #1 } + } } { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } + \msg_warning:nn { spath3 } { load intersections } } }, split~ globally~ at~ self~ intersections/.code={ \tl_if_exist:cTF - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { - \spath_gsplit_at_self_intersections:c + tikz@library@intersections@loaded + } + { + \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + { + \spath_gsplit_at_self_intersections:c + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + } + { + \msg_warning:nnn { spath3 } { missing soft path } { #1 } + } } { - \msg_warning:nnn { spath3 } { missing soft path } { #1 } + \msg_warning:nn { spath3 } { load intersections } } }, get~ components~ of/.code~ 2~ args={ @@ -966,40 +1455,64 @@ \msg_warning:nnn { spath3 } { missing soft path } { #1 } } }, - insert~ gaps~ after~ components/.code~ n~ args={3}{ + insert~ gaps~ after~ components/.code~ 2~ args={ \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { \group_begin: + \tl_if_head_is_group:nTF {#2} + { + \tl_set:Nx \l__spath_tmpc_tl { \tl_item:nn {#2} {1} } + \tl_set:Nx \l__spath_tmpd_tl { \tl_item:nn {#2} {2} } + } + { + \tl_set:Nn \l__spath_tmpc_tl {#2} + \tl_clear:N \l__spath_tmpd_tl + } \seq_gclear:N \g__spath_tmpa_seq \seq_gclear:N \g__spath_tmpb_seq \spath_numberofcomponents:Nv \l__spath_tmpa_int {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - \foreach \l__spath_tmpa_tl in {#3} + + \spath_components_to_seq:Nv + \l__spath_tmpa_seq + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + + \tl_if_empty:NTF \l__spath_tmpd_tl { - \seq_gput_right:NV \g__spath_tmpa_seq \l__spath_tmpa_tl - \seq_gput_right:Nx - \g__spath_tmpb_seq - {\int_eval:n - { - \int_mod:nn { \l__spath_tmpa_tl }{ \l__spath_tmpa_int } + 1 + \int_step_inline:nnnn {1}{1} { \l__spath_tmpa_int - 1 } + { + \seq_gput_right:Nn \g__spath_tmpa_seq {##1} + \seq_gput_right:Nx + \g__spath_tmpb_seq + {\int_eval:n {##1 + 1}} + } + } + { + \foreach \l__spath_tmpa_tl in \l__spath_tmpd_tl + { + \seq_gput_right:NV \g__spath_tmpa_seq \l__spath_tmpa_tl + \seq_gput_right:Nx + \g__spath_tmpb_seq + {\int_eval:n + { + \int_mod:nn { \l__spath_tmpa_tl }{ \l__spath_tmpa_int } + 1 + } } } } - \spath_components_to_seq:Nv - \l__spath_tmpa_seq - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \seq_clear:N \l__spath_tmpb_seq \seq_map_indexed_inline:Nn \l__spath_tmpa_seq { \tl_set:Nn \l__spath_tmpa_tl {##2} \seq_if_in:NnT \g__spath_tmpa_seq {##1} { - \spath_shorten_at_end:Nn \l__spath_tmpa_tl {#2/2} + \spath_shorten_at_end:Nn \l__spath_tmpa_tl {\l__spath_tmpc_tl/2} } \seq_if_in:NnT \g__spath_tmpb_seq {##1} { - \spath_shorten_at_start:Nn \l__spath_tmpa_tl {#2/2} + \spath_shorten_at_start:Nn \l__spath_tmpa_tl {\l__spath_tmpc_tl/2} } \seq_put_right:NV \l__spath_tmpb_seq \l__spath_tmpa_tl } @@ -1014,41 +1527,64 @@ \msg_warning:nnn { spath3 } { missing soft path } { #1 } } }, - insert~ gaps~ globally~ after~ components/.code~ n~ args={3}{ + insert~ gaps~ globally~ after~ components/.code~ 2~ args={ \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} { \group_begin: + \tl_if_head_is_group:nTF {#2} + { + \tl_set:Nx \l__spath_tmpc_tl { \tl_item:nn {#2} {1} } + \tl_set:Nx \l__spath_tmpd_tl { \tl_item:nn {#2} {2} } + } + { + \tl_set:Nn \l__spath_tmpc_tl {#2} + \tl_clear:N \l__spath_tmpd_tl + } \seq_gclear:N \g__spath_tmpa_seq \seq_gclear:N \g__spath_tmpb_seq \spath_numberofcomponents:Nv \l__spath_tmpa_int {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} - \foreach \l__spath_tmpa_tl in {#3} + + \spath_components_to_seq:Nv + \l__spath_tmpa_seq + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + + \tl_if_empty:NTF \l__spath_tmpd_tl { - \seq_gput_right:NV \g__spath_tmpa_seq \l__spath_tmpa_tl - \seq_gput_right:Nx - \g__spath_tmpb_seq + \int_step_inline:nnnn {1}{1} { \l__spath_tmpa_int - 1 } { - \int_eval:n - { - \int_mod:nn { \l__spath_tmpa_tl }{ \l__spath_tmpa_int } + 1 + \seq_gput_right:Nn \g__spath_tmpa_seq {##1} + \seq_gput_right:Nx + \g__spath_tmpb_seq + {\int_eval:n {##1 + 1}} + } + } + { + \foreach \l__spath_tmpa_tl in \l__spath_tmpd_tl + { + \seq_gput_right:NV \g__spath_tmpa_seq \l__spath_tmpa_tl + \seq_gput_right:Nx + \g__spath_tmpb_seq + {\int_eval:n + { + \int_mod:nn { \l__spath_tmpa_tl }{ \l__spath_tmpa_int } + 1 + } } } } - \spath_components_to_seq:Nv - \l__spath_tmpa_seq - {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + \seq_clear:N \l__spath_tmpb_seq \seq_map_indexed_inline:Nn \l__spath_tmpa_seq { \tl_set:Nn \l__spath_tmpa_tl {##2} \seq_if_in:NnT \g__spath_tmpa_seq {##1} { - \spath_shorten_at_end:Nn \l__spath_tmpa_tl {#2/2} + \spath_shorten_at_end:Nn \l__spath_tmpa_tl {\l__spath_tmpc_tl/2} } \seq_if_in:NnT \g__spath_tmpb_seq {##1} { - \spath_shorten_at_start:Nn \l__spath_tmpa_tl {#2/2} + \spath_shorten_at_start:Nn \l__spath_tmpa_tl {\l__spath_tmpc_tl/2} } \seq_put_right:NV \l__spath_tmpb_seq \l__spath_tmpa_tl } @@ -1135,6 +1671,28 @@ \msg_warning:nnn { spath3 } { missing soft path } { #1 } } }, + replace~ lines/.code={ + \tl_if_exist:cTF + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + { + \spath_replace_lines:c + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + } + { + \msg_warning:nnn { spath3 } { missing soft path } { #1 } + } + }, + replace~ lines~ globally/.code={ + \tl_if_exist:cTF + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + { + \spath_greplace_lines:c + {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} + } + { + \msg_warning:nnn { spath3 } { missing soft path } { #1 } + } + }, remove~ components/.code~ 2~ args={ \tl_if_exist:cTF {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} @@ -1403,7 +1961,10 @@ } } { - \msg_warning:nnx { spath3 } { missing soft path } { \tl_use:N \l__spath_tmpa_tl } + \msg_warning:nnx + { spath3 } + { missing soft path } + { \tl_use:N \l__spath_tmpa_tl } \tl_gset_eq:NN \g__spath_smuggle_tl \pgfpointorigin } \group_end: diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-attr-code.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-attr-code.sty index 9bb57f2bb38..03bfb78a98d 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-attr-code.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-attr-code.sty @@ -1,110 +1,129 @@ -\ProvidesExplPackage {tagpdf-attr-code} {2019/07/02} {0.61} - {part of tagpdf - code related to attributes and attribute classes} +%% +%% This is file `tagpdf-attr-code.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf-struct.dtx (with options: `attr') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf-struct.dtx -% the obj is written in tagpdf-tree-code. +\ProvidesExplPackage {tagpdf-attr-code} {2021/02/23} {0.80} + {part of tagpdf - code related to attributes and attribute classes} -\seq_new:N \g__uftag_attr_class_used_seq -\prop_new:N \g__uftag_attr_objnum_prop %will contain obj num of used attributes -\prop_new:N \g__uftag_attr_entries_prop -\tl_new:N \g__uftag_attr_class_content_tl -\tl_new:N \l__uftag_attr_objtmp_tl -\tl_new:N \l__uftag_attr_value_tl +\seq_new:N \g__tag_attr_class_used_seq +\prop_new:N \g__tag_attr_objref_prop %will contain obj num of used attributes +\prop_new:N \g__tag_attr_entries_prop +\tl_new:N \g__tag_attr_class_content_tl +\tl_new:N \l__tag_attr_objtmp_tl +\tl_new:N \l__tag_attr_value_tl -\cs_new_protected:Nn \__uftag_attr_new_entry:nn %#1:name, #2: content - { - \prop_gput:Nnn \g__uftag_attr_entries_prop - {#1}{#2} - } +\cs_new_protected:Nn \__tag_attr_new_entry:nn %#1:name, #2: content + { + \prop_gput:Nnn \g__tag_attr_entries_prop + {#1}{#2} + } -\keys_define:nn { uftag / setup } - { - newattribute .code:n = - { - \__uftag_attr_new_entry:nn #1 - } - } - - -% the key for the structure: -\keys_define:nn { uftag / struct } -{ - attribute-class .code:n = - { - \clist_set:No \l_tmpa_clist { #1 } - \seq_set_from_clist:NN \l_tmpa_seq \l_tmpa_clist - \seq_map_inline:Nn \l_tmpa_seq - { - \prop_if_in:NnF \g__uftag_attr_entries_prop {##1} +\keys_define:nn { __tag / setup } + { + newattribute .code:n = { - \msg_error:nnn { uftag } { attr-unknown } { ##1 } + \__tag_attr_new_entry:nn #1 } - \seq_gput_left:Nn\g__uftag_attr_class_used_seq { ##1} - } - \seq_set_map:NNn \l_tmpb_seq \l_tmpa_seq - { - /##1 - } - \tl_set:Nx \l_tmpa_tl - { - \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{[} - \seq_use:Nn \l_tmpb_seq { \c_space_tl } - \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{]} - } - \int_compare:nT { \seq_count:N \l_tmpa_seq > 0 } - { - \__uftag_prop_gput:cnx - { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } - { C } - { \l_tmpa_tl } - %\prop_show:c { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } - } - } -} + } -\keys_define:nn { uftag / struct } - { - attribute .code:n = % A property (attribute, value currently a dictionary) - { - \clist_set:No \l_tmpa_clist { #1 } - \seq_set_from_clist:NN \l_tmpa_seq \l_tmpa_clist - \tl_set:Nx \l__uftag_attr_value_tl - { - \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{[} +\keys_define:nn { __tag / struct } + { + attribute-class .code:n = + { + \clist_set:No \l_tmpa_clist { #1 } + \seq_set_from_clist:NN \l_tmpa_seq \l_tmpa_clist + \seq_map_inline:Nn \l_tmpa_seq + { + \prop_if_in:NnF \g__tag_attr_entries_prop {##1} + { + \msg_error:nnn { tag } { attr-unknown } { ##1 } + } + \seq_gput_left:Nn\g__tag_attr_class_used_seq { ##1} + } + \seq_set_map:NNn \l_tmpb_seq \l_tmpa_seq + { + /##1 + } + \tl_set:Nx \l_tmpa_tl + { + \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{[} + \seq_use:Nn \l_tmpb_seq { \c_space_tl } + \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{]} + } + \int_compare:nT { \seq_count:N \l_tmpa_seq > 0 } + { + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { C } + { \l_tmpa_tl } + %\prop_show:c { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + } } - \seq_map_inline:Nn \l_tmpa_seq - { - \prop_if_in:NnF \g__uftag_attr_entries_prop {##1} - { - \msg_error:nnn { uftag } { attr-unknown } { ##1 } - } - \prop_if_in:NnF \g__uftag_attr_objnum_prop {##1} - { - \__uftag_pdfreserveobjnum:N \l_tmpa_tl - \__uftag_pdfuseobjnum:Nx \l_tmpa_tl - { - \prop_item:Nn\g__uftag_attr_entries_prop {##1} - } - \prop_gput:NnV \g__uftag_attr_objnum_prop {##1} {\l_tmpa_tl} - } - \tl_put_right:Nx \l__uftag_attr_value_tl + } + +\keys_define:nn { __tag / struct } + { + attribute .code:n = % A property (attribute, value currently a dictionary) { - \c_space_tl - \prop_item:Nn \g__uftag_attr_objnum_prop {##1} - \c_space_tl 0 \c_space_tl R - } - % \tl_show:N \l__uftag_attr_value_tl - } - \tl_put_right:Nx \l__uftag_attr_value_tl - { - \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{]} - } - % \tl_show:N \l__uftag_attr_value_tl - \__uftag_prop_gput:cnx - { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } - { A } - { \l__uftag_attr_value_tl } - }, - } -\endinput + \clist_set:No \l_tmpa_clist { #1 } + \seq_set_from_clist:NN \l_tmpa_seq \l_tmpa_clist + \tl_set:Nx \l__tag_attr_value_tl + { + \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{[}%] + } + \seq_map_inline:Nn \l_tmpa_seq + { + \prop_if_in:NnF \g__tag_attr_entries_prop {##1} + { + \msg_error:nnn { tag } { attr-unknown } { ##1 } + } + \prop_if_in:NnF \g__tag_attr_objref_prop {##1} + {%\prop_show:N \g__tag_attr_entries_prop + \pdf_object_unnamed_write:nx + { dict } + { + \prop_item:Nn\g__tag_attr_entries_prop {##1} + } + \prop_gput:Nnx \g__tag_attr_objref_prop {##1} {\pdf_object_ref_last:} + } + \tl_put_right:Nx \l__tag_attr_value_tl + { + \c_space_tl + \prop_item:Nn \g__tag_attr_objref_prop {##1} + } + % \tl_show:N \l__tag_attr_value_tl + } + \tl_put_right:Nx \l__tag_attr_value_tl + { %[ + \int_compare:nT { \seq_count:N \l_tmpa_seq > 1 }{]}% + } + % \tl_show:N \l__tag_attr_value_tl + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { A } + { \l__tag_attr_value_tl } + }, + } +%% +%% +%% End of file `tagpdf-attr-code.sty'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-checks-code.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-checks-code.sty index 6d224c4164a..d11f1fdda2f 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-checks-code.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-checks-code.sty @@ -1,188 +1,208 @@ -\ProvidesExplPackage {tagpdf-checks-code} {2019/07/02} {0.61} +%% +%% This is file `tagpdf-checks-code.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf-checks.dtx (with options: `checks') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf-checks.dtx +\ProvidesExplPackage {tagpdf-checks-code} {2021/02/23} {0.80} {part of tagpdf - code related to checks and messages} -%messages +\msg_new:nnn { tag } {mc-nested} { nested~marked~content~found~-~mcid~#1 } +\msg_new:nnn { tag } {mc-tag-missing} { required~tag~missing~-~mcid~#1 } +\msg_new:nnn { tag } {mc-label-unknown} { label~#1~unknown~-~rerun } +\msg_new:nnn { tag } {mc-used-twice} { mc~#1~has~been~already~used } +\msg_new:nnn { tag } {mc-not-open} { there~is~no~mc~to~end~at~#1 } -% mc -\msg_new:nnn {uftag} {mc-nested} { nested~marked~content~found~-~mcid~#1 } -\msg_new:nnn {uftag} {mc-tag-missing} { required~tag~missing~-~mcid~#1 } -\msg_new:nnn {uftag} {mc-label-unknown} { label~#1~unknown~-~rerun } -\msg_new:nnn {uftag} {mc-used-twice} { mc~#1~has~been~already~used } -\msg_new:nnn {uftag} {mc-not-open} { there~is~no~mc~to~end~at~#1 } +\msg_new:nnn { tag } {struct-no-objnum} { objnum~missing~for~structure~#1 } +\msg_new:nnn { tag } {struct-faulty-nesting} { there~is~no~open~structure~on~the~stack } +\msg_new:nnn { tag } {struct-missing-tag} { a~structure~must~have~a~tag! } +\msg_new:nnn { tag } {struct-show-closing} { closing~structure~#1~tagged~\prop_item:cn{g__tag_struct_#1_prop}{S} } +\msg_new:nnn { tag } {struct-used-twice} { structure~with~label~#1~has~already~been~used} +\msg_new:nnn { tag } {struct-label-unknown} { structure~with~label~#1~is~unknown~rerun} -% structures -\msg_new:nnn {uftag} {struct-no-objnum} { objnum~missing~for~structure~#1 } -\msg_new:nnn {uftag} {struct-faulty-nesting} { there~is~no~open~structure~on~the~stack } -\msg_new:nnn {uftag} {struct-missing-tag} { a~structure~must~have~a~tag! } -\msg_new:nnn {uftag} {struct-show-closing} { closing~structure~#1~tagged~\prop_item:cn{g__uftag_struct_#1_prop}{S} } -\msg_new:nnn {uftag} {struct-used-twice} { structure~with~label~#1~has~already~been~used} -\msg_new:nnn {uftag} {struct-label-unknown} { structure~with~label~#1~is~unknown~rerun} +\msg_new:nnn { tag } {attr-unknown} { attribute~#1~is~unknown} -% attributes -\msg_new:nnn {uftag} {attr-unknown} { attribute~#1~is~unknown} +\msg_new:nnn { tag } {role-missing} { tag~#1~has~no~role~assigned } +\msg_new:nnn { tag } {role-unknown} { role~#1~is~not~known } +\msg_new:nnn { tag } {role-unknown-tag} { tag~#1~is~not~known } +\msg_new:nnn { tag } {role-new-tag} { adding~new~tag~#1~mapped~to~role~#2 } +\msg_new:nnn { tag } {tree-mcid-index-wrong} {something~is~wrong~with~the~mcid} -%Roles -\msg_new:nnn {uftag} {role-missing} { tag~#1~has~no~role~assigned } -\msg_new:nnn {uftag} {role-unknown} { role~#1~is~not~known } -\msg_new:nnn {uftag} {role-unknown-tag} { tag~#1~is~not~known } -\msg_new:nnn {uftag} {role-new-tag} { adding~new~tag~#1~mapped~to~role~#2 } +\msg_new:nnn { tag } {obj-write-num} {write~obj~#1~to~pdf} +\msg_new:nnn { tag } {sys-no-interwordspace} {engine~#1~doesn't~support~the~interword~spaces} -% trees -\msg_new:nnn {uftag} {tree-mcid-index-wrong} {something~is~wrong~with~the~mcid} -% obj -\msg_new:nnn {uftag} {obj-write-num} {write~obj~#1~to~pdf} - - -%checks -%structures +\cs_new:Nn \__tag_check_structure_has_tag:n %#1 struct num %_protected? + { + \prop_if_in:cnF { g__tag_struct_#1_prop } + {S} + { + \msg_error:nn { tag } {struct-missing-tag} + } + } -\cs_new:Nn \__uftag_check_structure_has_tag:n %#1 struct num - { - \prop_if_in:cnF { g__uftag_struct_#1_prop } - {S} - { - \msg_error:nn {uftag} {struct-missing-tag} - } - } +\cs_new:Nn \__tag_check_structure_tag:N %_protected? + { + \prop_if_in:NoF \g__tag_role_tags_prop {#1} + { + \msg_warning:nnx { tag } {role-unknown-tag} {#1} + } + } -\cs_new:Nn \__uftag_check_structure_tag:N - { - \prop_if_in:NoF \g__uftag_role_tags_prop {#1} - { - \msg_warning:nnx {uftag} {role-unknown-tag} {#1} - } - } +\cs_new_protected:Nn \__tag_check_info_closing_struct:n %#1 struct num + { + \msg_info:nnn { tag } {struct-show-closing} {#1} + } -\cs_new:Nn \__uftag_check_info_closing_struct:n %#1 struct num - { - \msg_info:nnn {uftag} {struct-show-closing} {#1} - } +\cs_generate_variant:Nn \__tag_check_info_closing_struct:n {o,x} -\cs_generate_variant:Nn \__uftag_check_info_closing_struct:n {o,x} +\cs_new_protected:Nn \__tag_check_no_open_struck: + { + \msg_error:nn { tag } {struct-faulty-nesting} + } -\cs_new:Nn \__uftag_check_no_open_struck: - { - \msg_error:nn {uftag} {struct-faulty-nesting} - } +\cs_new_protected:Nn \__tag_check_struct_used:n %#1 label + { + \prop_get:cnNT + {g__tag_struct_\__tag_ref_value:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop} + {P} + \l_tmpa_tl + { + \msg_warning:nnn { tag } {struct-used-twice} {#1} + } + } -\cs_new:Nn \__uftag_check_struct_used:n %#1 label - { - \prop_get:cnNT - {g__uftag_struct_\zref@extractdefault{tagpdfstruct-#1}{tagstruct}{unknown}_prop} - {P} - \l_tmpa_tl - { \msg_warning:nnn {uftag} {struct-used-twice} {#1} } - } -%roles +\cs_new_protected:Nn \__tag_check_add_tag_role:nn %#1 tag, #2 role + { + \tl_if_empty:nTF {#2} + { + \msg_warning:nnn { tag } {role-missing} {#1} + } + { + \prop_get:NnNTF \g__tag_role_tags_prop {#2} \l_tmpa_tl + { + \msg_info:nnnn { tag } {role-new-tag} {#1} {#2} + } + { + \msg_warning:nnn { tag } {role-unknown} {#2} + } + } + } -\cs_new:Nn \__uftag_check_add_tag_role:nn %#1 tag, #2 role - { - \tl_if_empty:nTF {#2} +\cs_new_protected:Nn \__tag_check_mc_if_nested: { - \msg_warning:nnn {uftag} {role-missing} {#1} + \__tag_mc_if_in:T + { + \msg_warning:nnx { tag } {mc-nested} { \__tag_get_mc_abs_cnt: } + } } + +\cs_new_protected:Nn \__tag_check_mc_if_open: { - \prop_get:NnNF \g__uftag_role_tags_prop {#2} \l_tmpa_tl - { - \msg_warning:nnn {uftag} {role-unknown} {#2} - } - { - \msg_info:nnnn {uftag} {role-new-tag} {#1} {#2} - } + \__tag_mc_if_in:F + { + \msg_warning:nnx { tag } {mc-not-open} { \__tag_get_mc_abs_cnt: } + } } - } - -%mc -\cs_new:Nn \__uftag_check_mc_if_nested: - { - \__uftag_mc_if_in:T - { - \msg_warning:nnx {uftag} {mc-nested} { \__uftag_get_mc_abs_cnt: } - } - } - -\cs_new:Nn \__uftag_check_mc_if_open: - { - \__uftag_mc_if_in:F - { - \msg_warning:nnx {uftag} {mc-not-open} { \__uftag_get_mc_abs_cnt: } - } - } - -\cs_new:Nn \__uftag_check_mc_tag:N - { - \tl_if_empty:NT #1 - { - \msg_error:nnx {uftag} {mc-tag-missing} { \__uftag_get_mc_abs_cnt: } - } - \prop_if_in:NoF \g__uftag_role_tags_prop {#1} - { - \msg_warning:nnx {uftag} {role-unknown-tag} {#1} - } - } - -\seq_new:N \g__uftag_check_mc_used_seq -\cs_new:Nn \__uftag_check_mc_used:n - { - \seq_if_in:NnTF \g__uftag_check_mc_used_seq {#1} - { - \msg_warning:nnn {uftag} {mc-used-twice} {#1} - } - { - \seq_gput_right:Nx \g__uftag_check_mc_used_seq {#1} - } - } - - - -\cs_new:Nn \__uftag_check_show_MCID_by_page: - { - \tl_set:Nx \l__uftag_tmpa_tl + +\cs_new:Nn \__tag_check_mc_tag:N %protected?? { - \zref@extractdefault - {LastPage} {abspage} {-1} + \tl_if_empty:NT #1 + { + \msg_error:nnx { tag } {mc-tag-missing} { \__tag_get_mc_abs_cnt: } + } + \prop_if_in:NoF \g__tag_role_tags_prop {#1} + { + \msg_warning:nnx { tag } {role-unknown-tag} {#1} + } } - \int_step_inline:nnnn {1}{1} + +\seq_new:N \g__tag_check_mc_used_seq +\cs_new_protected:Nn \__tag_check_mc_used:n { - \l__uftag_tmpa_tl + \seq_if_in:NnTF \g__tag_check_mc_used_seq {#1} + { + \msg_warning:nnn { tag } {mc-used-twice} {#1} + } + { + \seq_gput_right:Nx \g__tag_check_mc_used_seq {#1} + } } + +\cs_new_protected:Nn \__tag_check_show_MCID_by_page: { - \seq_clear:N \l_tmpa_seq - \int_step_inline:nnnn {1}{1} - { - \zref@extractdefault - {LastPage} {tagmcabs} {-1} - } - { - \int_compare:nT - { - \zref@extractdefault - {mcid-####1} {tagabspage} {-1} - = ##1 - } - { - \seq_gput_right:Nx \l_tmpa_seq + \tl_set:Nx \l__tag_tmpa_tl { - Page##1-####1-\zref@extractdefault - {mcid-####1} {tagmcid} {-1} + \__tag_ref_value_lastpage:nn + {abspage} + {-1} + } + \int_step_inline:nnnn {1}{1} + { + \l__tag_tmpa_tl + } + { + \seq_clear:N \l_tmpa_seq + \int_step_inline:nnnn + {1} + {1} + { + \__tag_ref_value_lastpage:nn + {tagmcabs} + {-1} + } + { + \int_compare:nT + { + \__tag_ref_value:enn + {mcid-####1} + {tagabspage} + {-1} + = + ##1 + } + { + \seq_gput_right:Nx \l_tmpa_seq + { + Page##1-####1- + \__tag_ref_value:enn + {mcid-####1} + {tagmcid} + {-1} + } + } + } + \seq_show:N \l_tmpa_seq } - } - } - \seq_show:N \l_tmpa_seq } - } -\cs_new:Nn \__uftag_check_record_pdfobj_num:n - { - \int_compare:nT { \l__uftag_loglevel_int >= 3 } - { - \msg_info:nnx {uftag} {obj-write-num} {#1} - } - } +\cs_new:Nn \__tag_check_record_pdfobj_num:n %protected? + { + \int_compare:nT { \l__tag_loglevel_int >= 3 } + { + \msg_info:nnx { tag } {obj-write-num} {#1} + } + } -\endinput +%% +%% +%% End of file `tagpdf-checks-code.sty'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-deprecated.def b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-deprecated.def new file mode 100644 index 00000000000..23b95e67664 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-deprecated.def @@ -0,0 +1,24 @@ +%% +%% This is file `tagpdf-deprecated.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf.dtx (with options: `deprecated') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf.dtx +%% +%% +%% End of file `tagpdf-deprecated.def'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def index 5cb16c5216c..d1f772d4279 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def @@ -1,196 +1,101 @@ -\ProvidesExplFile {tagpdf-luatex.def} {2019/07/02} {0.61} +%% +%% This is file `tagpdf-luatex.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf-backend.dtx (with options: `luatex') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf-backend.dtx +\ProvidesExplFile {tagpdf-luatex.def} {2021/02/23} {0.80} {tagpdf~driver~for~luatex} -%\newattribute \g__uftag_mc_type_attr %the value represent the type -%\newattribute \g__uftag_mc_cnt_attr %will hold the \c@g__uftag_MCID_abs_int value +\newattribute \l__tag_mc_type_attr %the value represent the type +\newattribute \l__tag_mc_cnt_attr %will hold the \c@g__tag_MCID_abs_int value -\newattribute \l__uftag_mc_type_attr %the value represent the type -\newattribute \l__uftag_mc_cnt_attr %will hold the \c@g__uftag_MCID_abs_int value +\newattribute \g__tag_interwordspace_attr +\newattribute \g__tag_interwordfont_attr -\newattribute \g__uftag_interwordspace_attr -\newattribute \g__uftag_interwordfont_attr - -% The lua code -% ensure that 10pt font has been loaded: { - \fontencoding{TU}\fontfamily{lmr}\fontseries{m}\fontshape{n}\fontsize{10pt}{10pt}\selectfont + \fontencoding{TU}\fontfamily{lmr}\fontseries{m}\fontshape{n}\fontsize{10pt}{10pt}\selectfont } \directlua { tagpdf=require('tagpdf.lua') } %%%% driver (lualatex) commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% these should be in expl3!!! -\cs_new:Nn \__uftag_pdf_startlink:{ \pdfextension startlink } -\cs_new:Nn \__uftag_pdf_endlink: { \pdfextension endlink } -\cs_new_protected:Nn \__uftag_pdf_lastlink: { \numexpr\pdffeedback lastlink\relax } -\cs_new:Nn \__uftag_pdf_catalog: { \pdfextension catalog } - -% needed for \str_set_convert:Nnon -\tl_new:N \g__uftag_inputencoding_tl -\tl_gset:Nn \g__uftag_inputencoding_tl {} - - -% literals -\cs_new:Nn \__uftag_pdfliteral_page:n {\__uftag_tex_pdfextension:D literal~page {#1}} -\cs_new:Nn \__uftag_pdfcatalog:n {\__uftag_tex_pdfextension:D catalog {#1}} - -%reserve an object num -\cs_new:Nn \__uftag_pdfreserveobjnum:N - { - % #1 = macro name to be populated with object number - \__uftag_tex_pdfextension:D~obj~reserveobjnum - \tl_set:Nx #1 { \__uftag_tex_pdffeedback:D lastobj }% - } - -% use an object num -\cs_new:Nn \__uftag_pdfuseobjnum:Nn - { - % #1 = macro with object number to be populated - % #2 = object contents, as valid PDF - % should #2 be filtered through \pdfstringdef ??? - \__uftag_tex_immediate:D \__uftag_tex_pdfextension:D~obj~useobjnum~#1~{ #2 }% - } - -\cs_new:Nn \__uftag_pdfuseobjnum:nn - { - % #1 = a number - % #2 = object contents, as valid PDF - % should #2 be filtered through \pdfstringdef ??? - \__uftag_tex_immediate:D \__uftag_tex_pdfextension:D~obj~useobjnum~#1~{ #2 }% - } - -% obj num of the dictionary for a page: -% the page count starts by 1 -% pages can referenced before they are actually created -% no error if the page later doesn't exist - -\cs_new:Nn \__uftag_store_pdfpageref:Nn - { - % #1 = macro name to be populated with current page object number - % #2 = number or counter identifying the required page - \tl_set:Nx #1 { \__uftag_tex_pdffeedback:D pageref~#2 }% - } - -% a global version of the command -\cs_new:Nn \__uftag_gstore_pdfpageref:Nn - { - \tl_gset:Nx #1 { \__uftag_tex_pdffeedback:D pageref~#2 }% - } - -\cs_new:Nn \__uftag_pdfobj:Nn - { - % #1 = macro name to refer to this object - % #2 = object contents, as valid PDF - % should #2 be filtered through \pdfstringdef ??? - \__uftag_tex_immediate:D \__uftag_tex_pdfextension:D~obj~{ #2 } - \tl_set:Nx #1 { \__uftag_tex_pdffeedback:D~lastobj }% - } - -% pdfpage**s**attr: for all pages -%% is global needed? Yes. Without it the setting is lost if issued in a group -% -\cs_new:Nn \__uftag_gset_pdfpagesattr:n - { - \__uftag_tex_global:D \__uftag_tex_pdfvariable:D~pagesattr { #1 } - } - -\cs_new:Nn \__uftag_gadd_pdfpagesattr:n - { - \exp_args:No \__uftag_gset_pdfpagesattr:n { \__uftag_tex_the:D \__uftag_tex_pdfvariable:D~pagesattr #1} - } - -% pdfpageattr for one page -% do we need an immediate version?? -\cs_new:Nn \__uftag_gset_pdfpageattr:n - { - \__uftag_tex_global:D \__uftag_tex_pdfvariable:D~pageattr { #1 } - } - -\cs_new:Nn \__uftag_gadd_pdfpageattr:n - { - \exp_args:No \__uftag_gset_pdfpageattr:n { \__uftag_tex_the:D \__uftag_tex_pdfvariable:D~pageattr #1} - } - -\cs_new:Nn \__uftag_get_pdfpageattr:N - { - \tl_set:No #1 { \__uftag_tex_the:D \__uftag_tex_pdfvariable:D~pageattr } - } - - -% I probably want also lua tables -% I put them in the uftag.tables namespaces -% The tables will be named like the variables but without backslash -% To access such a table with a dynamical name create a string and then use -% uftag.tables[string] -% Old code, I'm not quite sure if this was a good idea. Now I have mix of table in -% utftag.tables and uftag.mc/struct. And a lot is probably not needed. - -\cs_new:Nn \__uftag_luatex_get_table_name:Nn - { - \tl_set_rescan:Nnn #1 { \char_set_catcode_ignore:N \\ } { #2 } - } - - -\cs_new:Nn \__uftag_prop_new:N - { - \prop_new:N #1 - \__uftag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } - \directlua { uftag.tables.\l_tmpa_tl = {} } - } - - -\cs_new:Nn \__uftag_seq_new:N - { - \seq_new:N #1 - \__uftag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } - \directlua { uftag.tables.\l_tmpa_tl = {} } - } - - -\cs_new:Nn \__uftag_prop_gput:Nnn - { - \prop_gput:Nnn #1 { #2 } { #3 } - \__uftag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } - \directlua { uftag.tables.\l_tmpa_tl["#2"] = "#3" } - } - - -\cs_new:Nn \__uftag_seq_gput_right:Nn - { - \seq_gput_right:Nn #1 { #2 } - \__uftag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } - \directlua { table.insert(uftag.tables.\l_tmpa_tl, "#2") } - } - -%Hm not quite sure about the naming - -\cs_new:Npn \__uftag_seq_item:cn #1 #2 - { - \directlua { tex.print(uftag.tables.#1[#2]) } - } - -\cs_new:Npn \__uftag_prop_item:cn #1 #2 - { - \directlua { tex.print(uftag.tables.#1["#2"]) } - } - -%for debugging commands that show both the seq/prop and the lua tables -\cs_new:Nn \__uftag_seq_show:N - { - \seq_show:N #1 - \__uftag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } - \directlua { uftag.trace.log ("lua~sequence~array~\l_tmpa_tl",1) } - \directlua { uftag.trace.show_seq (uftag.tables.\l_tmpa_tl) } - } - -\cs_new:Nn \__uftag_prop_show:N - { - \prop_show:N #1 - \__uftag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } - \directlua {uftag.trace.log ("lua~property~table~\l_tmpa_tl",1) } - \directlua {uftag.trace.show_prop (uftag.tables.\l_tmpa_tl) } - } - -\endinput +\cs_new:Nn \__tag_luatex_get_table_name:Nn + { + \tl_set_rescan:Nnn #1 { \char_set_catcode_ignore:N \\ } { #2 } + } + +\cs_new:Nn \__tag_prop_new:N + { + \prop_new:N #1 + \__tag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } + \directlua { ltx.__tag.tables.\l_tmpa_tl = {} } + } + +\cs_new:Nn \__tag_seq_new:N + { + \seq_new:N #1 + \__tag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } + \directlua { ltx.__tag.tables.\l_tmpa_tl = {} } + } + +\cs_new:Nn \__tag_prop_gput:Nnn + { + \prop_gput:Nnn #1 { #2 } { #3 } + \__tag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } + \directlua { ltx.__tag.tables.\l_tmpa_tl["#2"] = "#3" } + } + +\cs_new:Nn \__tag_seq_gput_right:Nn + { + \seq_gput_right:Nn #1 { #2 } + \__tag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } + \directlua { table.insert(ltx.__tag.tables.\l_tmpa_tl, "#2") } + } + + +\cs_new:Npn \__tag_seq_item:cn #1 #2 + { + \directlua { tex.print(ltx.__tag.tables.#1[#2]) } + } + +\cs_new:Npn \__tag_prop_item:cn #1 #2 + { + \directlua { tex.print(ltx.__tag.tables.#1["#2"]) } + } + +\cs_new:Nn \__tag_seq_show:N + { + \seq_show:N #1 + \__tag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } + \directlua { ltx.__tag.trace.log ("lua~sequence~array~\l_tmpa_tl",1) } + \directlua { ltx.__tag.trace.show_seq (ltx.__tag.tables.\l_tmpa_tl) } + } + +\cs_new:Nn \__tag_prop_show:N + { + \prop_show:N #1 + \__tag_luatex_get_table_name:Nn \l_tmpa_tl { #1 } + \directlua {ltx.__tag.trace.log ("lua~property~table~\l_tmpa_tl",1) } + \directlua {ltx.__tag.trace.show_prop (ltx.__tag.tables.\l_tmpa_tl) } + } +%% +%% +%% End of file `tagpdf-luatex.def'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty index 3f6ce228834..984df8a986a 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty @@ -1,285 +1,287 @@ -\ProvidesExplPackage {tagpdf-mc-code-generic} {2019/07/02} {0.61} +%% +%% This is file `tagpdf-mc-code-generic.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf-mc.dtx (with options: `generic') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf-mc.dtx +\ProvidesExplPackage {tagpdf-mc-code-generic} {2021/02/23} {0.80} {part of tagpdf - code related to marking chunks - generic mode} -% for the label system -% tagmcid is the id which should be also in the pdf -% it will be (hopefully) reset by page -\int_new:N \g__uftag_MCID_tmp_bypage_int -\zref@newprop {tagmcid} [0] { \int_use:N \g__uftag_MCID_tmp_bypage_int } -\zref@addprop {uftagzrl} {tagmcid} +\__tag_prop_new:N \g__tag_MCID_byabspage_prop -% will hold the current maximum on a page -% it will contain key-value of type "abspagenum=max mcid on this page" -\__uftag_prop_new:N \g__uftag_MCID_byabspage_prop +\bool_new:N \g__tag_in_mc_bool -%to test nesting mc: -\bool_new:N \g__uftag_in_mc_bool +\prg_new_conditional:Nnn \__tag_mc_if_in: {p,T,F,TF} + { + \bool_if:NTF \g__tag_in_mc_bool + { \prg_return_true: } + { \prg_return_false: } + } -\prg_new_conditional:Nnn \__uftag_mc_if_in: {p,T,F,TF} - { - \bool_if:NTF \g__uftag_in_mc_bool - { \prg_return_true: } - { \prg_return_false: } - } +\prg_new_eq_conditional:NNn \tag_mc_if_in: \__tag_mc_if_in: {p,T,F,TF} -\prg_new_eq_conditional:NNn \uftag_mc_if_in: \__uftag_mc_if_in: {p,T,F,TF} +\prg_new_eq_conditional:NNn \uftag_mc_if_in: \__tag_mc_if_in: {p,T,F,TF} +\cs_new_protected:Nn \__tag_mc_bmc:n + { + \pdf_bmc:n {#1} + } -% this are the low level mc command. -% they insert literals and so a are specific to generic mode -% checking if the type is defined will done somewhere else -% #1 is the type/tag -% change 04.08.2018: I don't try to escape the name, but assume that it is valid. -% Checks/conversions should perhaps be done on a higher level -\cs_new:Nn \__uftag_mc_bmc:n - { - \__uftag_pdfliteral_page:n - { - /#1\c_space_tl BMC - } - } +\cs_new_protected:Nn \__tag_mc_emc: + { + \pdf_emc: + %\__tag_pdfliteral_page:n + } -\cs_new:Nn \__uftag_mc_emc: - { - \__uftag_pdfliteral_page:n - { - EMC - } - } +\cs_new_protected:Nn \__tag_mc_bdc:nn + { + \pdf_bdc:nn { #1 } { #2 } + } + +\cs_generate_variant:Nn \__tag_mc_bdc:nn {nx} + +\tl_new:N \l__tag_mc_ref_abspage_tl %will store the abspage value of label +\tl_new:N \l__tag_mc_tmp_tl -% #1 tag, #2 properties -% change 04.08.2018: I don't escape the name. Also the dictionary content -% must imho be done at a higher level -\cs_new:Nn \__uftag_mc_bdc:nn - { - \__uftag_pdfliteral_page:n - { - /#1\c_space_tl<<#2>>~BDC - } +\cs_new:Nn \__tag_mc_bdc_mcid:nn + { + \int_gincr:N \c@g__tag_MCID_abs_int + \tl_set:Nx \l__tag_mc_ref_abspage_tl + { + \__tag_ref_value:enn %3 args + { + mcid-\int_use:N \c@g__tag_MCID_abs_int + } + { tagabspage } + {-1} + } + \prop_get:NoNTF + \g__tag_MCID_byabspage_prop + { + \l__tag_mc_ref_abspage_tl + } + \l__tag_mc_tmp_tl + { + %key already present, use value for MCID and add 1 for the next + \int_gset:Nn \g__tag_MCID_tmp_bypage_int { \l__tag_mc_tmp_tl } + \__tag_prop_gput:Nxx + \g__tag_MCID_byabspage_prop + { \l__tag_mc_ref_abspage_tl } + { \int_eval:n {\l__tag_mc_tmp_tl +1} } + } + { + %key not present, set MCID to 0 and insert 1 + \int_gzero:N \g__tag_MCID_tmp_bypage_int + \__tag_prop_gput:Nxx + \g__tag_MCID_byabspage_prop + { \l__tag_mc_ref_abspage_tl } + {1} + } + \__tag_ref_label:en + { + mcid-\int_use:N \c@g__tag_MCID_abs_int + } + { mc } + %\exp_args:Nnx + \__tag_mc_bdc:nx + {#1} + { /MCID~\int_eval:n { \g__tag_MCID_tmp_bypage_int }~ \exp_not:n { #2 } } } +\cs_new:Nn \__tag_mc_bdc_mcid:n + { + \__tag_mc_bdc_mcid:nn {#1} {} + } -% bdc with /MCID + more properties -% we need a ref-label system to ensure that the cnt restarts at 0 on a new page +\cs_new:Nn \__tag_mc_bmc_artifact: + { + \__tag_mc_bmc:n {Artifact} + } -\tl_new:N \l__uftag_mc_ref_abspage_tl %will store the abspage value of label -\tl_new:N \l__uftag_mc_tmp_tl +\cs_new:Nn \__tag_mc_bmc_artifact:n + { + \__tag_mc_bdc:nn {Artifact}{/Type/#1} + } -\cs_new:Nn \__uftag_mc_bdc_mcid:nn - { - \int_gincr:N \c@g__uftag_MCID_abs_int - \tl_set:Nx \l__uftag_mc_ref_abspage_tl - { - \zref@extractdefault %3 args - { - mcid-\int_use:N \c@g__uftag_MCID_abs_int - } - {tagabspage} - {-1} - } - \prop_get:NoNTF - \g__uftag_MCID_byabspage_prop - { - \l__uftag_mc_ref_abspage_tl - } - \l__uftag_mc_tmp_tl - { - %key already present, use value for MCID and add 1 for the next - \int_gset:Nn \g__uftag_MCID_tmp_bypage_int { \l__uftag_mc_tmp_tl } - \__uftag_prop_gput:Nxx - \g__uftag_MCID_byabspage_prop - { \l__uftag_mc_ref_abspage_tl } - { \int_eval:n {\l__uftag_mc_tmp_tl +1} } - } - { - %key not present, set MCID to 0 and insert 1 - \int_gzero:N \g__uftag_MCID_tmp_bypage_int - \__uftag_prop_gput:Nxx - \g__uftag_MCID_byabspage_prop - { \l__uftag_mc_ref_abspage_tl } - {1} - } - \zref@labelbylist - { - mcid-\int_use:N \c@g__uftag_MCID_abs_int - } - {uftagzrl} - \__uftag_mc_bdc:nn - {#1} - { /MCID~\int_eval:n { \g__uftag_MCID_tmp_bypage_int }~#2 } - } -% only /MCID -\cs_new:Nn \__uftag_mc_bdc_mcid:n - { - \__uftag_mc_bdc_mcid:nn {#1} {} - } -%artifact without type -\cs_new:Nn \__uftag_mc_bmc_artifact: - { - \__uftag_mc_bmc:n {Artifact} - } +\tl_new:N \l__tag_mc_key_tag_tl +\tl_new:N \g__tag_mc_key_tag_tl %for "outside" queries +\tl_new:N \l__tag_mc_key_properties_tl -%artifact with a type: -\cs_new:Nn \__uftag_mc_bmc_artifact:n - { - \__uftag_mc_bdc:nn {Artifact}{/Type\c_space_tl/#1} - } +\keys_define:nn { __tag / mc } + { + tag .code:n = % the name (H,P,Spa) etc + { + %%????????? \pdfescapename?? + \tl_set:Nx \l__tag_mc_key_tag_tl { #1 } + \tl_gset:Nx \g__tag_mc_key_tag_tl { #1 } + }, + raw .code:n = + { + \tl_put_right:Nx \l__tag_mc_key_properties_tl { #1 } + }, + alttext .code:n = % Alt property + { + \str_set_convert:Nnon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \tl_put_right:Nn \l__tag_mc_key_properties_tl { /Alt~< } + \tl_put_right:No \l__tag_mc_key_properties_tl { \l__tag_tmpa_str>~ } + }, + alttext-o .code:n = % Alt property + { + \str_set_convert:Noon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \tl_put_right:Nn \l__tag_mc_key_properties_tl { /Alt~< } + \tl_put_right:No \l__tag_mc_key_properties_tl { \l__tag_tmpa_str>~ } + }, + actualtext .code:n = % ActualText property + { + \str_set_convert:Nnon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \tl_put_right:Nn \l__tag_mc_key_properties_tl { /ActualText~< } + \tl_put_right:No \l__tag_mc_key_properties_tl { \l__tag_tmpa_str>~ } + }, + actualtext-o .code:n = % ActualText property + { + \str_set_convert:Noon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \tl_put_right:Nn \l__tag_mc_key_properties_tl { /ActualText~< } + \tl_put_right:No \l__tag_mc_key_properties_tl { \l__tag_tmpa_str>~ } + }, + label .tl_set:N = \l__tag_mc_key_label_tl, + artifact .code:n = + { + \exp_args:Nnx + \keys_set:nn + { __tag / mc } + { artifact-bool, artifact-type=#1 } + }, + artifact .default:n = {notype} + } -% perhaps later: more properties for artifacts +\cs_new:Nn \__tag_mc_handle_artifact:N %#1 contains the artifact type + { + \tl_if_empty:NTF #1 + { \__tag_mc_bmc_artifact: } + { \exp_args:No\__tag_mc_bmc_artifact:n {#1} } + } +\cs_new:Nn \__tag_mc_handle_mcid:nn %#1 tag, #2 properties + { + \__tag_mc_bdc_mcid:nn {#1} {#2} + } -% keyval definitions for the user commands: +\cs_generate_variant:Nn \__tag_mc_handle_mcid:nn {VV} -\tl_new:N \l__uftag_mc_key_tag_tl -\tl_new:N \g__uftag_mc_key_tag_tl %for "outside" queries -\tl_new:N \l__uftag_mc_key_properties_tl -%Attention! definitions are different in luamode. -% tag and raw are expanded as \directlua in lua does it too. -\keys_define:nn { uftag / mc } - { - tag .code:n = % the name (H,P,Span etc - { - %%????????? \pdfescapename?? - \tl_set:Nx \l__uftag_mc_key_tag_tl { #1 } - \tl_gset:Nx \g__uftag_mc_key_tag_tl { #1 } - }, - raw .code:n = - { - \tl_put_right:Nx \l__uftag_mc_key_properties_tl { #1 } - } - , - alttext .code:n = % Alt property - { - \str_set_convert:Nnon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \tl_put_right:Nn \l__uftag_mc_key_properties_tl { /Alt~< } - \tl_put_right:No \l__uftag_mc_key_properties_tl { \l__uftag_tmpa_str>~ } - }, - alttext-o .code:n = % Alt property - { - \str_set_convert:Noon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \tl_put_right:Nn \l__uftag_mc_key_properties_tl { /Alt~< } - \tl_put_right:No \l__uftag_mc_key_properties_tl { \l__uftag_tmpa_str>~ } - }, - actualtext .code:n = % ActualText property - { - \str_set_convert:Nnon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \tl_put_right:Nn \l__uftag_mc_key_properties_tl { /ActualText~< } - \tl_put_right:No \l__uftag_mc_key_properties_tl { \l__uftag_tmpa_str>~ } - }, - actualtext-o .code:n = % ActualText property - { - \str_set_convert:Noon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \tl_put_right:Nn \l__uftag_mc_key_properties_tl { /ActualText~< } - \tl_put_right:No \l__uftag_mc_key_properties_tl { \l__uftag_tmpa_str>~ } - }, - label .tl_set:N = \l__uftag_mc_key_label_tl, - artifact .code:n = { \exp_args:Nnx \keys_set:nn { uftag / mc } { artifact-bool, artifact-type=#1 } }, - artifact .default:n = {notype} - } +\cs_new:Nn \__tag_mc_handle_stash:n %1 mcidnum + { + \__tag_check_mc_used:n {#1} + \__tag_struct_kid_mc_gput_right:nn + { \g__tag_struct_stack_current_tl } + {#1} + \prop_gput:Nxx \g__tag_mc_parenttree_prop + {#1} + { \g__tag_struct_stack_current_tl } + } -\cs_new:Nn \__uftag_mc_handle_artifact:N %#1 contains the artifact type - { - \tl_if_empty:NTF #1 - { \__uftag_mc_bmc_artifact: } - { \exp_args:No\__uftag_mc_bmc_artifact:n {#1} } - } +\cs_new_protected:Nn \tag_mc_begin:n + { + \group_begin: %hm + \__tag_check_mc_if_nested: + \bool_gset_true:N \g__tag_in_mc_bool + \keys_set:nn { __tag / mc } {#1} + \bool_if:NTF \l__tag_mc_artifact_bool + { %handle artifact + \__tag_mc_handle_artifact:N \l__tag_mc_artifact_type_tl + } + { %handle mcid type + \__tag_check_mc_tag:N \l__tag_mc_key_tag_tl + \__tag_mc_handle_mcid:VV + \l__tag_mc_key_tag_tl + \l__tag_mc_key_properties_tl + \tl_if_empty:NF {\l__tag_mc_key_label_tl} + { + \__tag_mc_handle_mc_label:n { \l__tag_mc_key_label_tl } + } + \bool_if:NF \l__tag_mc_key_stash_bool + { + \__tag_mc_handle_stash:n { \int_use:N \c@g__tag_MCID_abs_int } + } + } + \group_end: + } -\cs_new:Nn \__uftag_mc_handle_mcid:nn %#1 tag, #2 properties - { - \__uftag_mc_bdc_mcid:nn {#1} {#2} - } +\cs_set_eq:NN \uftag_mc_begin:n \tag_mc_begin:n +\cs_new_protected:Nn \tag_mc_end: + { + \__tag_check_mc_if_open: + \bool_gset_false:N \g__tag_in_mc_bool + \tl_gset:Nn \g__tag_mc_key_tag_tl { } + \__tag_mc_emc: + } -% puts the absolute number of an mcid in the current structure -\cs_new:Nn \__uftag_mc_handle_stash:n %1 mcidnum - { - \__uftag_check_mc_used:n {#1} - \__uftag_struct_kid_mc_gput_right:nn - { \g__uftag_struct_stack_current_tl } - {#1} - \prop_gput:Nxx \g__uftag_mc_parenttree_prop - {#1} - { \g__uftag_struct_stack_current_tl } - } +\cs_set_eq:NN \uftag_mc_end: \tag_mc_end: -\cs_new_protected:Nn \uftag_mc_begin:n - { - \group_begin: - \__uftag_check_mc_if_nested: - \bool_gset_true:N \g__uftag_in_mc_bool - \keys_set:nn { uftag / mc } {#1} - \bool_if:NTF \l__uftag_mc_artifact_bool - { %handle artifact - \__uftag_mc_handle_artifact:N \l__uftag_mc_artifact_type_tl - } - { %handle mcid type - \__uftag_check_mc_tag:N \l__uftag_mc_key_tag_tl - \__uftag_mc_handle_mcid:nn { \l__uftag_mc_key_tag_tl }{\l__uftag_mc_key_properties_tl} - \tl_if_empty:NF {\l__uftag_mc_key_label_tl} +\cs_new_protected:Nn \tag_mc_use:n %#1: label name + { + \tl_set:Nx \l_tmpa_tl { \__tag_ref_value:enn{tagpdf-#1}{tagmcabs}{} } + \tl_if_empty:NTF\l_tmpa_tl { - \__uftag_mc_handle_mc_label:n { \l__uftag_mc_key_label_tl } + \msg_warning:nnn {tag} {mc-label-unknown} {#1} } - \bool_if:NF \l__uftag_mc_key_stash_bool - { - \__uftag_mc_handle_stash:n { \int_use:N \c@g__uftag_MCID_abs_int } - } - } - \group_end: - } - -\cs_new_protected:Nn \uftag_mc_end: - { - \__uftag_check_mc_if_open: - \bool_gset_false:N \g__uftag_in_mc_bool - \tl_gset:Nn \g__uftag_mc_key_tag_tl { } - \__uftag_mc_emc: - } + { + \prop_gput:Nxx + \g__tag_mc_parenttree_prop + { + \__tag_ref_value:enn {tagpdf-#1} {tagmcabs} {} + } + { + \g__tag_struct_stack_current_tl + } + \__tag_struct_kid_mc_gput_right:nn + { + \g__tag_struct_stack_current_tl + } + { + \__tag_ref_value:enn {tagpdf-#1} {tagmcabs} {} + } + } + } -\cs_new_protected:Nn \uftag_mc_use:n %#1: label name - { - \tl_set:Nx \l_tmpa_tl { \zref@extractdefault{tagpdf-#1}{tagmcabs}{} } - \tl_if_empty:NTF\l_tmpa_tl - { - \msg_warning:nnn {uftag} {mc-label-unknown} {#1} - } - { - \prop_gput:Nxx - \g__uftag_mc_parenttree_prop - { - \zref@extractdefault {tagpdf-#1} {tagmcabs} {} - } - { - \g__uftag_struct_stack_current_tl - } - \__uftag_struct_kid_mc_gput_right:nn - { - \g__uftag_struct_stack_current_tl - } - { - \zref@extractdefault {tagpdf-#1} {tagmcabs} {} - } - } - } +\cs_set_eq:NN \uftag_mc_use:n \tag_mc_use:n -\cs_new:Nn \__uftag_get_data_mc_tag: { \g__uftag_mc_key_tag_tl } +\cs_new:Nn \__tag_get_data_mc_tag: { \g__tag_mc_key_tag_tl } -\endinput +%% +%% +%% End of file `tagpdf-mc-code-generic.sty'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty index 4387d3b8085..d55366eed6b 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty @@ -1,280 +1,327 @@ -\ProvidesExplPackage {tagpdf-mc-code-lua} {2019/07/02} {0.61} +%% +%% This is file `tagpdf-mc-code-lua.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf-mc.dtx (with options: `luamode') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf-mc.dtx +\ProvidesExplPackage {tagpdf-mc-code-lua} {2021/02/23} {0.80} {tagpdf - mc code only for the luamode } -% the two attibutes are defined in the driver file. -% it also load the lua (as it can also contain functions needed by generic mode. -% (new) attributes for mc are local: -% \newattribute \l__uftag_mc_type_attr %the value represent the type -% \newattribute \l__uftag_mc_cnt_attr %will hold the \c@g__uftag_MCID_abs_int value -% An attribute for the current structure probably doesn't make sense as mc chunks can be used later. -% \newattribute \g__uftag_struct_type_attr %represent the current structure type. Not sure if needed -% \newattribute \g__uftag_struct_cnt_attr %will hold \c@g__uftag_struct_abs_int a cnt -% handling attribute needs a different system to number the page wise mcid's: -% a tagmcbegin ... tagmcend pair no longer surrounds exactly one mc chunk: it can be split -% at page breaks. We know the included mcid(s) only after the ship out. So for the struct-> mcid mapping we -% need to record struct -> mc-cnt (in \g__uftag_mc_parenttree_prop and/or a lua table -% and at shipout mc-cnt-> {mcid, mcid, ...} (in a table?) -% and when building the trees connect both -% key definitions are overwritten for luatex to store that data in tables -% the data for the mc are in uftag.mc[absnum] -% the fields of the table are -% tag : the type (a string) -% raw : more properties (string) -% label: a string. Do we need a way to retrieve the num from the label from lua?? -% artifact: the presence indicates an artifact, the value (string) is the type. -% kids: a array of tables {1={kid=num2,page=pagenum1}, 2={kid=num2,page=pagenum2},...}, -% this describes the chunks the mc has been split to by the traversing code -% parent: the number of the structure it is in. Needed to build the parent tree. - -% The main function which wanders through the shipout box to inject the literals. -\AtBeginDocument - { - \bool_if:NT\g_uftag_active_mc_bool - { - \AtBeginShipout - { - \directlua{uftag.func.mark_shipout ()} - } - } - } - -\prg_new_conditional:Nnn \__uftag_mc_if_in: {p,T,F,TF} - { - \int_compare:nNnTF {-2147483647}={\l__uftag_mc_type_attr} - { \prg_return_true: } - { \prg_return_false: } - } - -\prg_new_eq_conditional:NNn \uftag_mc_if_in: \__uftag_mc_if_in: {p,T,F,TF} - -% the keys -\tl_new:N \l__uftag_mc_key_tag_tl -\tl_new:N \l__uftag_mc_key_label_tl -\tl_new:N \l__uftag_mc_key_properties_tl - -\keys_define:nn { uftag / mc } - { - tag .code:n = % - {%%????????? \pdfescapename?? - \tl_set:Nx \l__uftag_mc_key_tag_tl { #1 } - \directlua - { - uftag.func.store_mc_data(\__uftag_get_mc_abs_cnt:,"tag","#1") - } - }, - raw .code:n = - { - \tl_put_right:Nx \l__uftag_mc_key_properties_tl { #1 } - \directlua - { - uftag.func.store_mc_data(\__uftag_get_mc_abs_cnt:,"raw","#1") - } - }, - alttext .code:n = % Alt property - { - \str_set_convert:Nnon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \tl_put_right:Nn \l__uftag_mc_key_properties_tl { /Alt~< } - \tl_put_right:No \l__uftag_mc_key_properties_tl { \l__uftag_tmpa_str>~ } - \directlua - { - uftag.func.store_mc_data(\__uftag_get_mc_abs_cnt:,"alt","/Alt~<\str_use:N \l__uftag_tmpa_str>") - } - }, - alttext-o .code:n = % Alt property - { - \str_set_convert:Noon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \tl_put_right:Nn \l__uftag_mc_key_properties_tl { /Alt~< } - \tl_put_right:No \l__uftag_mc_key_properties_tl { \l__uftag_tmpa_str>~ } - \directlua - { - uftag.func.store_mc_data(\__uftag_get_mc_abs_cnt:,"alt","/Alt~<\str_use:N \l__uftag_tmpa_str>") - } - }, - actualtext .code:n = % Alt property - { - \str_set_convert:Nnon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \tl_put_right:Nn \l__uftag_mc_key_properties_tl { /Alt~< } - \tl_put_right:No \l__uftag_mc_key_properties_tl { \l__uftag_tmpa_str>~ } - \directlua - { - uftag.func.store_mc_data(\__uftag_get_mc_abs_cnt:,"actualtext","/ActualText~<\str_use:N \l__uftag_tmpa_str>") - } - }, - actualtext-o .code:n = % Alt property - { - \str_set_convert:Noon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \tl_put_right:Nn \l__uftag_mc_key_properties_tl { /Alt~< } - \tl_put_right:No \l__uftag_mc_key_properties_tl { \l__uftag_tmpa_str>~ } +\hook_gput_code:nnn{begindocument}{tagpdf/mc} + { + \bool_if:NT\g__tag_active_mc_bool + { + \directlua + { + if~luatexbase.callbacktypes.pre_shipout_filter~then~ + luatexbase.add_to_callback("pre_shipout_filter", function(TAGBOX)~ + ltx.__tag.func.mark_shipout(TAGBOX)~return~true~ + end, "tagpdf")~ + end + } + \directlua + { + if~luatexbase.callbacktypes.pre_shipout_filter~then~ + token.get_next()~ + end + }\@secondoftwo\@gobble + { + \hook_gput_code:nnn{shipout/before}{tagpdf/lua} + { + \directlua + { ltx.__tag.func.mark_shipout (tex.box["ShipoutBox"]) } + } + } + } + } + +\prg_new_conditional:Nnn \__tag_mc_if_in: {p,T,F,TF} + { + \int_compare:nNnTF { -2147483647 }={ \l__tag_mc_type_attr } + { \prg_return_false: } + { \prg_return_true: } + } + +\prg_new_eq_conditional:NNn \tag_mc_if_in: \__tag_mc_if_in: {p,T,F,TF} + +\prg_new_eq_conditional:NNn \uftag_mc_if_in: \__tag_mc_if_in: {p,T,F,TF} + +\tl_new:N \l__tag_mc_key_tag_tl +\tl_new:N \l__tag_mc_key_label_tl +\tl_new:N \l__tag_mc_key_properties_tl + +\keys_define:nn { __tag / mc } + { + tag .code:n = % + {%%????????? \pdfescapename?? + \tl_set:Nx \l__tag_mc_key_tag_tl { #1 } + \directlua + { + ltx.__tag.func.store_mc_data(\__tag_get_mc_abs_cnt:,"tag","#1") + } + }, + raw .code:n = + { + \tl_put_right:Nx \l__tag_mc_key_properties_tl { #1 } + \directlua + { + ltx.__tag.func.store_mc_data(\__tag_get_mc_abs_cnt:,"raw","#1") + } + }, + alttext .code:n = % Alt property + { + \str_set_convert:Nnon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \tl_put_right:Nn \l__tag_mc_key_properties_tl { /Alt~< } + \tl_put_right:No \l__tag_mc_key_properties_tl { \l__tag_tmpa_str>~ } + \directlua + { + ltx.__tag.func.store_mc_data + ( + \__tag_get_mc_abs_cnt:,"alt","/Alt~<\str_use:N \l__tag_tmpa_str>" + ) + } + }, + alttext-o .code:n = % Alt property + { + \str_set_convert:Noon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \tl_put_right:Nn \l__tag_mc_key_properties_tl { /Alt~< } + \tl_put_right:No \l__tag_mc_key_properties_tl { \l__tag_tmpa_str>~ } + \directlua + { + ltx.__tag.func.store_mc_data + ( + \__tag_get_mc_abs_cnt:,"alt","/Alt~<\str_use:N \l__tag_tmpa_str>" + ) + } + }, + actualtext .code:n = % Alt property + { + \str_set_convert:Nnon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \tl_put_right:Nn \l__tag_mc_key_properties_tl { /Alt~< } + \tl_put_right:No \l__tag_mc_key_properties_tl { \l__tag_tmpa_str>~ } + \directlua + { + ltx.__tag.func.store_mc_data + ( + \__tag_get_mc_abs_cnt:,"actualtext","/ActualText~<\str_use:N \l__tag_tmpa_str>" + ) + } + }, + actualtext-o .code:n = % Alt property + { + \str_set_convert:Noon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \tl_put_right:Nn \l__tag_mc_key_properties_tl { /Alt~< } + \tl_put_right:No \l__tag_mc_key_properties_tl { \l__tag_tmpa_str>~ } + \directlua + { + ltx.__tag.func.store_mc_data + ( + \__tag_get_mc_abs_cnt:, + "actualtext", + "/ActualText~<\str_use:N \l__tag_tmpa_str>" + ) + } + }, + label .code:n = + { + \tl_set:Nn\l__tag_mc_key_label_tl { #1 } + \directlua + { + ltx.__tag.func.store_mc_data + ( + \__tag_get_mc_abs_cnt:,"label","#1" + ) + } + }, + __artifact-store .code:n = + { + \directlua + { + ltx.__tag.func.store_mc_data + ( + \__tag_get_mc_abs_cnt:,"artifact","#1" + ) + } + }, + artifact .code:n = + { + \exp_args:Nnx + \keys_set:nn + { __tag / mc} + { artifact-bool, artifact-type=#1, tag=Artifact } + \exp_args:Nnx + \keys_set:nn + { __tag / mc } + { __artifact-store=\l__tag_mc_artifact_type_tl } + }, + artifact .default:n = { notype } + } + + +\cs_set_protected:Npn \__tag_attribute_gset:Nn #1 #2 + { + \tex_global:D \setattribute #1 #2 + } + +\cs_set_protected:Npn \__tag_attribute_set:Nn #1 #2 + { + \setattribute #1 #2 + } + +\cs_set_protected:Npn \__tag_attribute_gunset:N #1 + { + \tex_global:D \unsetattribute #1 + } + +\cs_set_protected:Npn \__tag_attribute_unset:N #1 + { + \unsetattribute #1 + } + +\cs_new:Nn \__tag_mc_lua_set_mc_type_attr:n % #1 is a tag name + { + \__tag_attribute_set:Nn \l__tag_mc_type_attr + { + \directlua { ltx.__tag.func.output_num_from ("#1") } + } + \__tag_attribute_set:Nn \l__tag_mc_cnt_attr { \__tag_get_mc_abs_cnt: } + } + +\cs_generate_variant:Nn\__tag_mc_lua_set_mc_type_attr:n { o } + +\cs_new:Nn \__tag_mc_lua_unset_mc_type_attr: + { + \__tag_attribute_unset:N \l__tag_mc_type_attr + \__tag_attribute_unset:N \l__tag_mc_cnt_attr + } + +\cs_new:Nn \__tag_mc_insert_mcid_kids:n + { + \directlua { ltx.__tag.func.mc_insert_kids (#1,0) } + } + +\cs_new:Nn \__tag_mc_insert_mcid_single_kids:n + { + \directlua {ltx.__tag.func.mc_insert_kids (#1,1) } + } + + +\cs_new:Nn \__tag_mc_handle_stash:n %1 mcidnum + { + \__tag_check_mc_used:n { #1 } + \seq_gput_right:cn % Don't fill a lua table due to the command in the item, + % so use the kernel command + { g__tag_struct_kids_\g__tag_struct_stack_current_tl _seq } + { + \__tag_mc_insert_mcid_kids:n {#1}% + } \directlua - { - uftag.func.store_mc_data(\__uftag_get_mc_abs_cnt:,"actualtext","/ActualText~<\str_use:N \l__uftag_tmpa_str>") - } - }, - label .code:n = - { - \tl_set:Nn\l__uftag_mc_key_label_tl { #1 } - \directlua {uftag.func.store_mc_data(\__uftag_get_mc_abs_cnt:,"label","#1")} - }, - __artifact-store .code:n = - { - \directlua {uftag.func.store_mc_data(\__uftag_get_mc_abs_cnt:,"artifact","#1")} - }, - artifact .code:n = - { - \exp_args:Nnx \keys_set:nn {uftag / mc} { artifact-bool, artifact-type=#1, tag=Artifact } - \exp_args:Nnx \keys_set:nn {uftag / mc }{ __artifact-store=\l__uftag_mc_artifact_type_tl } - }, - artifact .default:n = { notype } - } - - -% attributes -% set the mc from a tag name - -\cs_set_protected:Npn \__uftag_attribute_gset:Nn #1 #2 - { - \tex_global:D \setattribute #1 #2 - } - -\cs_set_protected:Npn \__uftag_attribute_set:Nn #1 #2 - { - \setattribute #1 #2 - } - -\cs_set_protected:Npn \__uftag_attribute_gunset:N #1 - { - \tex_global:D \unsetattribute #1 - } - -\cs_set_protected:Npn \__uftag_attribute_unset:N #1 - { - \unsetattribute #1 - } - - -\cs_new:Nn \__uftag_mc_lua_set_mc_type_attr:n % #1 is a tag name - { - \__uftag_attribute_set:Nn \l__uftag_mc_type_attr { \directlua {uftag.func.output_num_from ("#1") } } - \__uftag_attribute_set:Nn \l__uftag_mc_cnt_attr { \__uftag_get_mc_abs_cnt: } - } - -\cs_generate_variant:Nn\__uftag_mc_lua_set_mc_type_attr:n { o } - -\cs_new:Nn \__uftag_mc_lua_unset_mc_type_attr: - { - \__uftag_attribute_unset:N \l__uftag_mc_type_attr - \__uftag_attribute_unset:N \l__uftag_mc_cnt_attr - } - - - -%This command will in the finish code replace the dummy for a mc by the real mcid kids -%we need a variant for the case that it is the only kid, to get the array right -\cs_new:Nn \__uftag_mc_insert_mcid_kids:n - { - \directlua {uftag.func.mc_insert_kids (#1,0) } - } - -\cs_new:Nn \__uftag_mc_insert_mcid_single_kids:n - { - \directlua {uftag.func.mc_insert_kids (#1,1) } - } - - -% we need to pass the info if the kids are alone or already in an array -% so we add a second argument, which should == 1 if the kids are single - - -% puts an mcid absolute number in the current structure -\cs_new:Nn \__uftag_mc_handle_stash:n %1 mcidnum - { - \__uftag_check_mc_used:n { #1 } - \seq_gput_right:cn % Don't fill a lua table due to the command in the item, so the kernel command - { g__uftag_struct_kids_\g__uftag_struct_stack_current_tl _seq } - { - \__uftag_mc_insert_mcid_kids:n {#1}% - } - \directlua - { - uftag.func.store_struct_mcabs(\g__uftag_struct_stack_current_tl,#1) - } - \prop_gput:Nxx - \g__uftag_mc_parenttree_prop - { #1 } - { \g__uftag_struct_stack_current_tl } - } - -\cs_generate_variant:Nn \__uftag_mc_handle_stash:n { o } - -\cs_new_protected:Nn \uftag_mc_begin:n - { - %\group_begin: - %\__uftag_check_mc_if_nested: - %\bool_gset_true:N \g__uftag_in_mc_bool - \int_gincr:N \c@g__uftag_MCID_abs_int - \tl_clear:N\l__uftag_mc_key_properties_tl - \keys_set:nn { uftag / mc }{ label={}, #1 } - %check that a tag or artifact has been used - \__uftag_check_mc_tag:N \l__uftag_mc_key_tag_tl - %set the attributes: - \__uftag_mc_lua_set_mc_type_attr:o { \l__uftag_mc_key_tag_tl } - \bool_if:NF \l__uftag_mc_artifact_bool - { % store the absolute num name in a label: - \tl_if_empty:NF {\l__uftag_mc_key_label_tl} - { - \__uftag_mc_handle_mc_label:n { \l__uftag_mc_key_label_tl } - } - % if not stashed record the absolute number - \bool_if:NF \l__uftag_mc_key_stash_bool { - \exp_args:Nx \__uftag_mc_handle_stash:n { \__uftag_get_mc_abs_cnt: } + ltx.__tag.func.store_struct_mcabs + ( + \g__tag_struct_stack_current_tl,#1 + ) } - } - \bool_set_false:N\l__uftag_mc_artifact_bool - %\group_end: - } - -\cs_new_protected:Nn \uftag_mc_end: - { - %\__uftag_check_mc_if_open: - %\bool_gset_false:N \g__uftag_in_mc_bool - \__uftag_mc_lua_unset_mc_type_attr: - \tl_set:Nn \l__uftag_mc_key_tag_tl { } - } - -\cs_new_protected:Nn \uftag_mc_use:n %#1: label name - { - \tl_set:Nx \l_tmpa_tl { \zref@extractdefault{tagpdf-#1}{tagmcabs}{} } - \tl_if_empty:NTF\l_tmpa_tl - { - \msg_warning:nnn {uftag} {mc-label-unknown} { #1 } - } - { - \__uftag_mc_handle_stash:o { \l_tmpa_tl } - } - } - -\cs_new:Nn \__uftag_get_data_mc_tag: { \l__uftag_mc_key_tag_tl } + \prop_gput:Nxx + \g__tag_mc_parenttree_prop + { #1 } + { \g__tag_struct_stack_current_tl } + } + +\cs_generate_variant:Nn \__tag_mc_handle_stash:n { o } + +\cs_new_protected:Nn \tag_mc_begin:n + { + %\group_begin: + %\__tag_check_mc_if_nested: + %\bool_gset_true:N \g__tag_in_mc_bool + \bool_set_false:N\l__tag_mc_artifact_bool + \int_gincr:N \c@g__tag_MCID_abs_int + \tl_clear:N \l__tag_mc_key_properties_tl + \keys_set:nn { __tag / mc }{ label={}, #1 } + %check that a tag or artifact has been used + \__tag_check_mc_tag:N \l__tag_mc_key_tag_tl + %set the attributes: + \__tag_mc_lua_set_mc_type_attr:o { \l__tag_mc_key_tag_tl } + \bool_if:NF \l__tag_mc_artifact_bool + { % store the absolute num name in a label: + \tl_if_empty:NF {\l__tag_mc_key_label_tl} + { + \__tag_mc_handle_mc_label:n { \l__tag_mc_key_label_tl } + } + % if not stashed record the absolute number + \bool_if:NF \l__tag_mc_key_stash_bool + { + \exp_args:Nx \__tag_mc_handle_stash:n { \__tag_get_mc_abs_cnt: } + } + } + %\bool_set_false:N\l__tag_mc_artifact_bool + %\group_end: + } + +\cs_set_eq:NN \uftag_mc_begin:n \tag_mc_begin:n + +\cs_new_protected:Nn \tag_mc_end: + { + %\__tag_check_mc_if_open: + %\bool_gset_false:N \g__tag_in_mc_bool + \bool_set_false:N\l__tag_mc_artifact_bool + \__tag_mc_lua_unset_mc_type_attr: + \tl_set:Nn \l__tag_mc_key_tag_tl { } + } + +\cs_set_eq:NN \uftag_mc_end: \tag_mc_end: + +\cs_new_protected:Nn \tag_mc_use:n %#1: label name + { + \tl_set:Nx \l_tmpa_tl { \__tag_ref_value:enn{tagpdf-#1}{tagmcabs}{} } + \tl_if_empty:NTF\l_tmpa_tl + { + \msg_warning:nnn {tag} {mc-label-unknown} { #1 } + } + { + \__tag_mc_handle_stash:o { \l_tmpa_tl } + } + } +\cs_set_eq:NN \uftag_mc_use:n \tag_mc_use:n -\endinput +\cs_new:Nn \__tag_get_data_mc_tag: { \l__tag_mc_key_tag_tl } +%% +%% +%% End of file `tagpdf-mc-code-lua.sty'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-shared.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-shared.sty index b9bbe29eb36..49cfbaf69df 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-shared.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-shared.sty @@ -1,47 +1,86 @@ -\ProvidesExplPackage {tagpdf-mc-code-shared} {2019/07/02} {0.61} - {part of tagpdf - code related to marking chunks - code shared by generic and luamode } - -% I use a latex counter for the absolute count, so that it is added to -% \cl@@ckpt and restored e.g. in tabulars and align -% \int_new:N \c@g__uftag_MCID_int and -% \tl_put_right:Nn\cl@@ckpt{\@elt{g_uf_test_int}} -% would work too, but as the name is not expl3 then too, why bother? -% the absolute counter can be used to label and to check if the page -% counter needs a reset. - -\newcounter { g__uftag_MCID_abs_int } -\cs_new:Nn \__uftag_get_mc_abs_cnt: { \int_use:N \c@g__uftag_MCID_abs_int } - -% tagmcabs is the label name of the absolute count which is used to identify the chunk -\zref@newprop {tagmcabs} [0] { \int_use:N \c@g__uftag_MCID_abs_int } -\zref@addprop {uftagzrl} {tagmcabs} -\zref@addprop {LastPage} {tagmcabs} - -%stores labels of mcid. -\cs_new:Nn \__uftag_mc_handle_mc_label:n - { - \zref@labelbylist{tagpdf-#1}{uftagzrl} - } +%% +%% This is file `tagpdf-mc-code-shared.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf-mc.dtx (with options: `shared') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf-mc.dtx +\ProvidesExplPackage {tagpdf-mc-code-shared} {2021/02/23} {0.80} + {part of tagpdf - code related to marking chunks - + code shared by generic and luamode } + +\newcounter { g__tag_MCID_abs_int } +\cs_new:Nn \__tag_get_mc_abs_cnt: { \int_use:N \c@g__tag_MCID_abs_int } + + +\cs_new:Nn \__tag_mc_handle_mc_label:n + { + \__tag_ref_label:en{tagpdf-#1}{mc} + } -% will hold the structure numbers for the parenttree -% key: absolute number of the mc (tagmcabs) -% value: the structure number the mc is in -\__uftag_prop_new:N \g__uftag_mc_parenttree_prop +\__tag_prop_new:N \g__tag_mc_parenttree_prop -%shared keys -%the rest are in the splitted code -\tl_new:N \l__uftag_mc_artifact_type_tl +\tl_new:N \l__tag_mc_artifact_type_tl -\keys_define:nn { uftag / mc } +\keys_define:nn { __tag / mc } + { + stash .bool_set:N = \l__tag_mc_key_stash_bool, + artifact-bool .bool_set:N = \l__tag_mc_artifact_bool, + artifact-type .choice:, + artifact-type / pagination .code:n = + { + \tl_set:Nn \l__tag_mc_artifact_type_tl { Pagination } + }, + artifact-type / layout .code:n = + { + \tl_set:Nn \l__tag_mc_artifact_type_tl { Layout } + }, + artifact-type / page .code:n = + { + \tl_set:Nn \l__tag_mc_artifact_type_tl { Page } + }, + artifact-type / background .code:n = + { + \tl_set:Nn \l__tag_mc_artifact_type_tl { Background } + }, + artifact-type / notype .code:n = + { + \tl_set:Nn \l__tag_mc_artifact_type_tl {} + }, + artifact-type / .code:n = + { + \tl_set:Nn \l__tag_mc_artifact_type_tl {} + }, + } + +\cs_new_protected:Npn \tag_mc_artifact_group_begin:n #1 { - stash .bool_set:N = \l__uftag_mc_key_stash_bool, - artifact-bool .bool_set:N = \l__uftag_mc_artifact_bool, - artifact-type .choice:, - artifact-type / pagination .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Pagination }}, - artifact-type / layout .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Layout }}, - artifact-type / page .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Page }}, - artifact-type / background .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Background }}, - artifact-type / notype .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl {}}, + \tag_mc_begin:n {artifact=#1} + \tag_stop_group_begin: } -\endinput +\cs_new_protected:Npn \tag_mc_artifact_group_end: + { + \tag_stop_group_end: + \tag_mc_end: + } + +\int_new:N \g__tag_MCID_tmp_bypage_int + +%% +%% +%% End of file `tagpdf-mc-code-shared.sty'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-pdftex.def b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-pdftex.def index 55e9e0c3b8a..ab40b3de3a0 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-pdftex.def +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-pdftex.def @@ -1,128 +1,47 @@ -\ProvidesExplFile {tagpdf-pdftex.def} {2019/07/02} {0.61} +%% +%% This is file `tagpdf-pdftex.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf-backend.dtx (with options: `pdftex') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf-backend.dtx +\ProvidesExplFile {tagpdf-pdftex.def} {2021/02/23} {0.80} {tagpdf~driver~for~pdftex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%% driver (pdflatex) commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% these should be in expl3!!! -\cs_new:Nn \__uftag_pdf_startlink:{ \pdfstartlink } -\cs_new:Nn \__uftag_pdf_endlink: { \pdfendlink } -\cs_new:Nn \__uftag_pdf_lastlink: { \pdflastlink } -\cs_new:Nn \__uftag_pdf_catalog: { \pdfcatalog } +\cs_set_eq:NN \__tag_prop_new:N \prop_new:N +\cs_set_eq:NN \__tag_seq_new:N \seq_new:N -% needed for \str_set_convert:Nnon -\tl_new:N \g__uftag_inputencoding_tl -\tl_gset:Nn \g__uftag_inputencoding_tl {utf8} +\cs_set_eq:NN \__tag_prop_gput:Nnn \prop_gput:Nnn +\cs_set_eq:NN \__tag_seq_gput_right:Nn \seq_gput_right:Nn -%literal -\cs_new:Nn \__uftag_pdfliteral_page:n { \__uftag_tex_pdfliteral:D page { #1} } -\cs_new:Nn \__uftag_pdfcatalog:n { \__uftag_tex_pdfcatalog:D { #1 } } +\cs_set_eq:NN \__tag_seq_item:cn \seq_item:cn -% reserve an object num and store the number -\cs_new:Nn \__uftag_pdfreserveobjnum:N % #1 = macro name to be populated with object number - { - \__uftag_tex_pdfobj:D reserveobjnum - \tl_set:Nx #1 { \int_use:N \__uftag_tex_pdflastobj:D }% - } +\cs_set_eq:NN \__tag_prop_item:cn \prop_item:cn -% add content to an object num stored in a macro -\cs_new:Nn \__uftag_pdfuseobjnum:Nn - { - % #1 = macro containing the object number - % #2 = object contents, as valid PDF - % should #2 be filtered through \pdfstringdef ??? - \__uftag_tex_immediate:D \__uftag_tex_pdfobj:D useobjnum~#1~{#2}% - } +\cs_set_eq:NN \__tag_seq_show:N \seq_show:N -\cs_new:Nn \__uftag_pdfuseobjnum:nn - { - % #1 = a number the object number - % #2 = object contents, as valid PDF - % should #2 be filtered through \pdfstringdef ??? - \__uftag_check_record_pdfobj_num:n {#1} - \__uftag_tex_immediate:D \__uftag_tex_pdfobj:D useobjnum~#1~{#2}% - } +\cs_set_eq:NN \__tag_prop_show:N \prop_show:N -% obj num of the dictionary for a page: -% the page count starts by 1 -% pages can referenced before they are actually created -% no error if the page later doesn't exist -\cs_new:Nn \__uftag_store_pdfpageref:Nn - { - % #1 = macro name to be populated with current page object number - % #2 = number or counter identifying the required page - \tl_set:Nx #1 { \__uftag_tex_pdfpageref:D #2}% - } - -% a global version of the command -\cs_new:Nn \__uftag_gstore_pdfpageref:Nn - { - \tl_gset:Nx #1 { \__uftag_tex_pdfpageref:D #2}% - } - -\cs_new:Nn \__uftag_pdfobj:Nn - { - % #1 = macro name to refer to this object - % #2 = object contents, as valid PDF - % should #2 be filtered through \pdfstringdef ??? - \__uftag_tex_immediate:D \__uftag_tex_pdfobj:D { #2 } - \tl_set:Nx #1 {\int_use:N \__uftag_tex_pdflastobj:D }% - } - -% pdfpage**s**attr: for all pages -%% is global needed? Yes. Without it the setting is lost if issued in a group -% -\cs_new:Nn \__uftag_gset_pdfpagesattr:n - { - \__uftag_tex_global:D \__uftag_tex_pdfpagesattr:D { #1 } - } - -\cs_new:Nn \__uftag_gadd_pdfpagesattr:n - { - \exp_args:No \__uftag_gset_pdfpagesattr:n { \__uftag_tex_the:D \__uftag_tex_pdfpagesattr:D #1 } - } - -% pdfpageattr for one page -% I must avoid to overwrite other entries, -% And I must avoid to add more and more /StructParens -% do we need an immediate version?? -\cs_new:Nn \__uftag_gset_pdfpageattr:n - { - \__uftag_tex_global:D \__uftag_tex_pdfpageattr:D { #1 } - } - -\cs_new:Nn \__uftag_gadd_pdfpageattr:n - { - \exp_args:No \__uftag_gset_pdfpageattr:n { \__uftag_tex_the:D \__uftag_tex_pdfpageattr:D #1} - } - -\cs_new:Nn \__uftag_get_pdfpageattr:N - { - \tl_set:No #1 { \__uftag_tex_the:D \__uftag_tex_pdfpageattr:D } - } - - -% These commands are only aliases for pdflatex but are defined differently with luatex -% to get also lua tables. -\cs_set_eq:NN \__uftag_prop_new:N \prop_new:N - -\cs_set_eq:NN \__uftag_seq_new:N \seq_new:N - -\cs_set_eq:NN \__uftag_prop_gput:Nnn \prop_gput:Nnn - -\cs_set_eq:NN \__uftag_seq_gput_right:Nn \seq_gput_right:Nn - -\cs_set_eq:NN \__uftag_seq_item:cn \seq_item:cn - -\cs_set_eq:NN \__uftag_prop_item:cn \prop_item:cn - -\cs_set_eq:NN \__uftag_seq_show:N \seq_show:N - -\cs_set_eq:NN \__uftag_prop_show:N \prop_show:N - - - -\endinput +%% +%% +%% End of file `tagpdf-pdftex.def'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-roles-code.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-roles-code.sty index 212b216c79d..a205e057e36 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-roles-code.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-roles-code.sty @@ -1,126 +1,142 @@ -\ProvidesExplPackage {tagpdf-roles-code} {2019/07/02} {0.61} +%% +%% This is file `tagpdf-roles-code.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf-roles.dtx (with options: `roles') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf-roles.dtx +\ProvidesExplPackage {tagpdf-roles-code} {2021/02/23} {0.80} {part of tagpdf - code related to roles and structure names} -\__uftag_seq_new:N \g__uftag_role_tags_seq %to get names from numbers -\__uftag_prop_new:N \g__uftag_role_tags_prop %to get numbers from names +\__tag_seq_new:N \g__tag_role_tags_seq %to get names from numbers +\__tag_prop_new:N \g__tag_role_tags_prop %to get numbers from names -%The list of standard adobe tags. -\clist_const:Nn \c__uftag_role_sttags_clist - {%possible root elements - Document, %A complete document. This is the root element of any structure tree containing - %multiple parts or multiple articles. - Part, %A large-scale division of a document. - Art, %A relatively self-contained body of text constituting a single narrative or exposition - %subelements - Sect, %A container for grouping related content elements. - Div, %A generic block-level element or group of elements - BlockQuote, %A portion of text consisting of one or more paragraphs attributed to someone other - %than the author of the surrounding text. - Caption, %A brief portion of text describing a table or figure. - TOC, %A list made up of table of contents item entries (structure tag TOCI; see below) - %and/or other nested table of contents entries - TOCI, %An individual member of a table of contents. This entry's children can be any of - %the following structure tags: - %Lbl,Reference,NonStruct,P,TOC - Index, - NonStruct, %probably not needed - H, - H1, - H2, - H3, - H4, - H5, - H6, - P, - L, %list - LI, %list item (around label and list item body) - Lbl, %list label - LBody, %list item body - Table, - TR, %table row - TH, %table header cell - TD, %table data cell - THead, %table header (n rows) - TBody, %table rows - TFoot, %table footer - Span, %generic inline marker - Quote, %inline quote - Note, % footnote, endnote. Lbl can be child - Reference, % A citation to content elsewhere in the document. - BibEntry, %bibentry - Code, % - Link, % - Annot, - Figure, - Formula, - Form, - Artifact - } +\clist_const:Nn \c__tag_role_sttags_clist + {%possible root elements + Document, %A complete document. This is the root element of any structure tree containing + %multiple parts or multiple articles. + Part, %A large-scale division of a document. + Art, %A relatively self-contained body of text constituting a single narrative or exposition + %subelements + Sect, %A container for grouping related content elements. + Div, %A generic block-level element or group of elements + BlockQuote, %A portion of text consisting of one or more paragraphs attributed to someone other + %than the author of the surrounding text. + Caption, %A brief portion of text describing a table or figure. + TOC, %A list made up of table of contents item entries (structure tag TOCI; see below) + %and/or other nested table of contents entries + TOCI, %An individual member of a table of contents. This entry's children can be any of + %the following structure tags: + %Lbl,Reference,NonStruct,P,TOC + Index, + NonStruct, %probably not needed + H, + H1, + H2, + H3, + H4, + H5, + H6, + P, + L, %list + LI, %list item (around label and list item body) + Lbl, %list label + LBody, %list item body + Table, + TR, %table row + TH, %table header cell + TD, %table data cell + THead, %table header (n rows) + TBody, %table rows + TFoot, %table footer + Span, %generic inline marker + Quote, %inline quote + Note, % footnote, endnote. Lbl can be child + Reference, % A citation to content elsewhere in the document. + BibEntry, %bibentry + Code, % + Link, % + Annot, + Figure, + Formula, + Form, + Artifact + } -% get tag name from number: \seq_item:Nn \g__uftag_role_tags_seq { n } -%\seq_gset_from_clist:NN \g__uftag_role_tags_seq \c__uftag_role_tags_clist -\clist_map_inline:Nn \c__uftag_role_sttags_clist - { - \__uftag_seq_gput_right:Nn \g__uftag_role_tags_seq { #1 } - } +\clist_map_inline:Nn \c__tag_role_sttags_clist + { + \__tag_seq_gput_right:Nn \g__tag_role_tags_seq { #1 } + } +\int_step_inline:nnnn { 1 }{ 1 }{ \seq_count:N \g__tag_role_tags_seq } + { + \__tag_prop_gput:Nxn \g__tag_role_tags_prop + { + \seq_item:Nn \g__tag_role_tags_seq { #1 } + } + { #1 } + } -% get tag number from name: \prop_item:Nn \g__uftag_role_tags_prop { name } -\int_step_inline:nnnn { 1 }{ 1 }{ \seq_count:N \g__uftag_role_tags_seq } - { - \__uftag_prop_gput:Nxn \g__uftag_role_tags_prop - { - \seq_item:Nn \g__uftag_role_tags_seq { #1 } - } - { #1 } - } +\cs_new:Nn \__tag_role_get_tag_from_index:nn + { + \__tag_seq_item:cn { #1_seq } { #2 } + } -\cs_new:Nn \__uftag_role_get_tag_from_index:nn - { - \__uftag_seq_item:cn { #1_seq } { #2 } - } +\cs_new:Nn \__tag_role_get_index_from_tag:nn + { + \__tag_prop_item:cn { #1_prop } { #2 } + } -\cs_new:Nn \__uftag_role_get_index_from_tag:nn - { - \__uftag_prop_item:cn { #1_prop } { #2 } - } -% new tags and the rolemap +\__tag_prop_new:N \g__tag_role_rolemap_prop -\__uftag_prop_new:N \g__uftag_role_rolemap_prop +\cs_new_protected:Nn \__tag_role_add_tag:nn %new name, reference to old + { + \__tag_seq_gput_right:Nn \g__tag_role_tags_seq { #1 } + \__tag_prop_gput:Nnx \g__tag_role_tags_prop { #1 } + { + \seq_count:N \g__tag_role_tags_seq + } + \__tag_check_add_tag_role:nn {#1}{#2} + \tl_if_empty:nF { #2 } + { + \__tag_prop_gput:Nnn \g__tag_role_rolemap_prop + { #1 } { #2 } + } + } -\cs_new:Nn \__uftag_role_add_tag:nn %new name, reference to old - { - \__uftag_seq_gput_right:Nn \g__uftag_role_tags_seq { #1 } - \__uftag_prop_gput:Nnx \g__uftag_role_tags_prop { #1 } - { - \seq_count:N \g__uftag_role_tags_seq - } - \__uftag_check_add_tag_role:nn {#1}{#2} - \tl_if_empty:nF { #2 } - { - \__uftag_prop_gput:Nnn \g__uftag_role_rolemap_prop - { #1 } { #2 } - } - } +\cs_generate_variant:Nn \__tag_role_add_tag:nn {xx} -\cs_generate_variant:Nn \__uftag_role_add_tag:nn {xx} - -\keys_define:nn { uftag / setup } - { - add-new-tag .code:n = - { - \seq_set_split:Nnn \l_tmpa_seq { / } {#1/} - \__uftag_role_add_tag:xx - { - \seq_item:Nn \l_tmpa_seq {1} - } +\keys_define:nn { __tag / setup } + { + add-new-tag .code:n = { - \seq_item:Nn \l_tmpa_seq {2} + \seq_set_split:Nnn \l_tmpa_seq { / } {#1/} + \__tag_role_add_tag:xx + { + \seq_item:Nn \l_tmpa_seq {1} + } + { + \seq_item:Nn \l_tmpa_seq {2} + } } - } - } - + } -\endinput +%% +%% +%% End of file `tagpdf-roles-code.sty'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-space-code.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-space-code.sty index c47da0e73d4..bbfee64e8a3 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-space-code.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-space-code.sty @@ -1,45 +1,79 @@ -\ProvidesExplPackage {tagpdf-space-code} {2019/07/02} {0.61} +%% +%% This is file `tagpdf-space-code.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf-space.dtx (with options: `space') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf-space.dtx +\ProvidesExplPackage {tagpdf-space-code} {2021/02/23} {0.80} {part of tagpdf - code related to real space chars} -% luatex uses an attribute (declared in the driver file) and some luacode in tagpdf.lua -% perhaps I will split the code by engine in the future \sys_if_engine_pdftex:T -{ - \pdfglyphtounicode{space}{0020} - \keys_define:nn { uftag / setup } { - interwordspace .choices:nn = { true, on } { \pdfinterwordspaceon }, - interwordspace .choices:nn = { false, off }{ \pdfinterwordspaceon }, - show-spaces .bool_set:N = \l__uftag_showspaces_bool + \pdfglyphtounicode{space}{0020} + \keys_define:nn { __tag / setup } + { + interwordspace .choices:nn = { true, on } { \pdfinterwordspaceon }, + interwordspace .choices:nn = { false, off }{ \pdfinterwordspaceon }, + show-spaces .bool_set:N = \l__tag_showspaces_bool + } } -} - - \sys_if_engine_luatex:T -{ - \keys_define:nn { uftag / setup } { - interwordspace .choices:nn = { true, on } - { \directlua{uftag.func.markspaceon()} }, + \keys_define:nn { __tag / setup } + { + interwordspace .choices:nn = + { true, on } + { \directlua{ltx.__tag.func.markspaceon()} }, + interwordspace .choices:nn = + { false, off } + {\directlua{ltx.__tag.func.markspaceoff()} }, + show-spaces .choice:, + show-spaces / true .code:n = + {\directlua{ltx.__tag.trace.showspaces=true}}, + show-spaces / false .code:n = + {\directlua{ltx.__tag.trace.showspaces=nil}}, + show-spaces .default:n = true + } - interwordspace .choices:nn = { false, off } - {\directlua{uftag.func.markspaceoff()} }, - show-spaces .choice:, - show-spaces / true .code:n = {\directlua{uftag.trace.showspaces=true}}, - show-spaces / false .code:n = {\directlua{uftag.trace.showspaces=nil}}, - show-spaces .default:n = true + \cs_new_protected:Nn \__tag_fakespace: + { + \group_begin: + \setattribute\g__tag_interwordspace_attr{1} + \setattribute\g__tag_interwordfont_attr + { + \directlua{tex.print(\the\catcodetable@latex, font.current())} + } + \skip_horizontal:n{\c_zero_skip} + \group_end: + } } - \cs_new_protected:Nn \__uftag_fakespace: + +\sys_if_engine_xetex:T { - \group_begin: - \setattribute\g__uftag_interwordspace_attr{1} - \setattribute\g__uftag_interwordfont_attr{\directlua{tex.print(\the\catcodetable@latex, font.current())}} - \skip_horizontal:n{\c_zero_skip} - \group_end: + \keys_define:nn { __tag / setup } + { + interwordspace .choices:nn = { true, on } { \msg_warning:nnn {tag}{sys-no-interwordspace}{xetex} }, + interwordspace .choices:nn = { false, off }{ \msg_warning:nnn {tag}{sys-no-interwordspace}{xetex} }, + show-spaces .bool_set:N = \l__tag_showspaces_bool + } } -} - - -\endinput +%% +%% +%% End of file `tagpdf-space-code.sty'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-struct-code.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-struct-code.sty index 2096a937fc9..8fedc841e17 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-struct-code.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-struct-code.sty @@ -1,523 +1,623 @@ -\ProvidesExplPackage {tagpdf-struct-code} {2019/07/02} {0.61} +%% +%% This is file `tagpdf-struct-code.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf-struct.dtx (with options: `struct') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf-struct.dtx +\ProvidesExplPackage {tagpdf-struct-code} {2021/02/23} {0.80} {part of tagpdf - code related to storing structure} -% I will use a latex counter for the structure count -% to have a chance to avoid double structures in align etc -\newcounter { g__uftag_struct_abs_int } -\int_gzero:N \c@g__uftag_struct_abs_int +\newcounter { g__tag_struct_abs_int } +\int_gzero:N \c@g__tag_struct_abs_int -\zref@newprop {tagstruct} [0] { \int_use:N \c@g__uftag_struct_abs_int } -\zref@newlist {uftagzrlstruct} -\zref@addprop {uftagzrlstruct}{tagstruct} -% a sequence stores structnum -> the obj numbers -% to allow easy mapping over the structures +\__tag_seq_new:N \g__tag_struct_objR_seq -\__uftag_seq_new:N \g__uftag_struct_objR_seq +\seq_new:N \g__tag_struct_stack_seq +\seq_gpush:Nn \g__tag_struct_stack_seq {0} -% a sequence for the structure stack. When a sequence is opened it's number is put on the stack. -\seq_new:N \g__uftag_struct_stack_seq -\seq_gpush:Nn \g__uftag_struct_stack_seq {0} +\tl_new:N \l__tag_struct_stack_parent_tmp_tl +\tl_new:N \g__tag_struct_stack_current_tl -%this variables will hold the top entry and the parent on the stack -\tl_new:N \l__uftag_struct_stack_parent_tmp_tl -\tl_new:N \g__uftag_struct_stack_current_tl -% I need at least one structure: the StructTreeRoot -% normally it should have only one kid, e.g. the document element. -% The data of the StructTreeRoot and the StructElem are in properties: -% \g__uftag_struct_0_prop for the root -% \g__uftag_struct_N_prop, N >=1 -% they have all the keys -% objnum - number, -% Type - StructTreeRoot or StructElem -% num - number (identical to the num in the name, or 0 for the root) -% and the keys from the two following lists -% (the root has a special set of properties). -% the values of the prop should be already escaped properly -% when the entries are created (title,lange,alt,E,actualtext) +\seq_const_from_clist:Nn \c__tag_struct_StructTreeRoot_entries_seq + {%p. 857/858 + Type, % always /StructTreeRoot + K, % kid, dictionary or array of dictionaries + IDTree, % currently unused + ParentTree, % required,obj ref to the parent tree + ParentTreeNextKey, %optional + RoleMap, + ClassMap + } +\seq_const_from_clist:Nn \c__tag_struct_StructElem_entries_seq + {%p 858 f + Type, %always /StructElem + S, %tag/type + P, %parent + ID, %optional + Ref, %optional, pdf 2.0 Use? + Pg, %obj num of starting page, optional + K, %kids + A, %attributes, probably unused + C, %class "" + %R, + T, %title, value in () or <> + Lang, %language + Alt, % value in () or <> + E, %abreviation + ActualText, + AF, %pdf 2.0, array of dict, associated files + NS, %pdf 2.0, dict, namespace + PhoneticAlphabet, %pdf 2.0 + Phoneme %pdf 2.0 + } -\seq_const_from_clist:Nn \c__uftag_struct_StructTreeRoot_entries_seq - {%p. 857/858 - Type, % always /StructTreeRoot - K, % kid, dictionary or array of dictionaries - IDTree, % currently unused - ParentTree, % required,obj ref to the parent tree - ParentTreeNextKey, %optional - RoleMap, - ClassMap - } -\seq_const_from_clist:Nn \c__uftag_struct_StructElem_entries_seq - {%p 858 f - Type, %always /StructElem - S, %tag/type - P, %parent - ID, %optional - Pg, %obj num of starting page, optional - K, %kids - A, %attributes, probably unused - C, %class "" - %R, - T, %title, value in () or <> - Lang, %language - Alt, % value in () or <> - E, %abreviation - ActualText +\cs_new:Nn \__tag_struct_output_prop_aux:nn %#1 num, #2 key + { + \prop_if_in:cnT + { g__tag_struct_#1_prop } + { #2 } + { + \c_space_tl/#2~ \prop_item:cn{ g__tag_struct_#1_prop } { #2 } + } } -% I need an output handler for each prop, to get expandable output -% see https://tex.stackexchange.com/questions/424208/expandable-version-of-a-expl3-command/424213#424213 - -\cs_new:Nn \__uftag_struct_output_prop_aux:nn %#1 num, #2 key - { - \prop_if_in:cnT - { g__uftag_struct_#1_prop } - { #2 } - { - \c_space_tl/#2~ \prop_item:cn{ g__uftag_struct_#1_prop } { #2 } - } - } +\cs_new:Nn \__tag_new_output_prop_handler:n + { + \cs_new:cn { __tag_struct_output_prop_#1:n } + { + \__tag_struct_output_prop_aux:nn {#1}{##1} + } + } -\cs_new:Nn \__uftag_new_output_prop_handler:n - { - \cs_new:cn { __uftag_struct_output_prop_#1:n } - { - \__uftag_struct_output_prop_aux:nn {#1}{##1} - } - } +\__tag_prop_new:c { g__tag_struct_0_prop } +\__tag_new_output_prop_handler:n {0} +\tl_gset:Nn \g__tag_struct_stack_current_tl {0} +\__tag_seq_new:c { g__tag_struct_kids_0_seq } -% the first one, the StructTreeRoot is special, so -% created manually: -\__uftag_prop_new:c { g__uftag_struct_0_prop } -\__uftag_new_output_prop_handler:n {0} -\tl_gset:Nn \g__uftag_struct_stack_current_tl {0} -\__uftag_seq_new:c { g__uftag_struct_kids_0_seq} +\__tag_prop_gput:cno + { g__tag_struct_0_prop } + { objref} + { \pdf_object_ref:n { c__tag_struct_0_obj } } -\__uftag_prop_gput:cno - { g__uftag_struct_0_prop } - { objnum} - { \c_uftag_tree_obj_structtreeroot_tl } +\__tag_prop_gput:cno + { g__tag_struct_0_prop } + { Type } + { /StructTreeRoot } -\__uftag_prop_gput:cno - { g__uftag_struct_0_prop } - { Type } - { /StructTreeRoot } +\__tag_prop_gput:cnx + { g__tag_struct_0_prop } + { ParentTree } + { \pdf_object_ref:n { c__tag_tree_parenttree_obj } } -% the constants are defined in the tree code. -\__uftag_prop_gput:cnx - { g__uftag_struct_0_prop } - { ParentTree } - { \c__uftag_tree_obj_parenttree_tl\c_space_tl 0\c_space_tl R } +\__tag_prop_gput:cnx + { g__tag_struct_0_prop } + { RoleMap } + { \pdf_object_ref:n { c__tag_tree_rolemap_obj } } -\__uftag_prop_gput:cnx - { g__uftag_struct_0_prop } - { RoleMap } - { \c__uftag_tree_obj_rolemap_tl\c_space_tl 0\c_space_tl R } +\__tag_prop_gput:cno + { g__tag_struct_0_prop } + { entries } + { StructTreeRoot } -\__uftag_prop_gput:cno - { g__uftag_struct_0_prop } - { entries } - { StructTreeRoot } +\__tag_prop_gput:cno + { g__tag_struct_0_prop } + { num } + { 0 } -\__uftag_prop_gput:cno - { g__uftag_struct_0_prop } - { num } - { 0 } -% commands to store the kids -% I don't compare the page objects number yet, but always add the /Pg key, perhaps later +\cs_new:Nn \__tag_struct_kid_mc_gput_right:nn %#1 structure num, #2 MCID absnum% + { + %\__tag_store_pdfpageref:Nn \l_tmpa_tl { \__tag_ref_value:enn{mcid-#2}{tagabspage}{1} } + \__tag_seq_gput_right:cx + { g__tag_struct_kids_#1_seq } + { + << + /Type \c_space_tl /MCR \c_space_tl + /Pg %\c_space_tl \l_tmpa_tl \c_space_tl 0 \c_space_tl R \c_space_tl + \c_space_tl + \pdf_pageobject_ref:n { \__tag_ref_value:enn{mcid-#2}{tagabspage}{1} } + /MCID \c_space_tl \__tag_ref_value:enn{mcid-#2}{tagmcid}{1} + >> + } + } -\cs_new:Nn \__uftag_struct_kid_mc_gput_right:nn %#1 structure num, #2 MCID absnum% - { - \__uftag_store_pdfpageref:Nn \l_tmpa_tl { \zref@extractdefault{mcid-#2}{tagabspage}{1} } - \__uftag_seq_gput_right:cx - { g__uftag_struct_kids_#1_seq } - { << - /Type\c_space_tl/MCR\c_space_tl - /Pg\c_space_tl\l_tmpa_tl\c_space_tl0\c_space_tl R\c_space_tl - /MCID\c_space_tl\zref@extractdefault{mcid-#2}{tagmcid}{1} - >> - } +\cs_new:Nn\__tag_struct_kid_struct_gput_right:nn %#1 num of parent struct, #2 kid struct + { + \__tag_seq_gput_right:cx + { g__tag_struct_kids_#1_seq } + { + \prop_item:cn + { g__tag_struct_#2_prop } + { objref } + } } -\cs_new:Nn\__uftag_struct_kid_struct_gput_right:nn %#1 num of parent struct, #2 kid struct - { - \__uftag_seq_gput_right:cx - { g__uftag_struct_kids_#1_seq } +\cs_new:Nn\__tag_struct_kid_link_gput_right:nn %#1 num of parent struct, #2 obj reference { - \prop_item:cn - { g__uftag_struct_#2_prop } - { objnum } - \c_space_tl 0 \c_space_tl R + \pdf_object_unnamed_write:nx + { dict } + { + /Type \c_space_tl /OBJR \c_space_tl + /Obj~#2 + } + \__tag_seq_gput_right:cx + { g__tag_struct_kids_#1_seq } + { + \pdf_object_ref_last: + } } - } -\cs_new:Nn\__uftag_struct_kid_link_gput_right:nn %#1 num of parent struct, #2 obj number of link - { - \__uftag_pdfobj:Nn \l__uftag_tmpa_tl +\cs_generate_variant:Nn\__tag_struct_kid_link_gput_right:nn { nx } + +\cs_new:Nn\__tag_struct_exchange_kid_command:N %N= seq { - << - /Type \c_space_tl /OBJR \c_space_tl - /Obj \c_space_tl #2 \c_space_tl 0 \c_space_tl R - >> + \seq_gpop_left:NN #1 \l_tmpa_tl + \regex_replace_once:nnN + { \c{\__tag_mc_insert_mcid_kids:n} } + { \c{\__tag_mc_insert_mcid_single_kids:n} } + \l_tmpa_tl + \seq_gput_left:NV #1 \l_tmpa_tl } - \__uftag_seq_gput_right:cx - { g__uftag_struct_kids_#1_seq } - { - \l__uftag_tmpa_tl \c_space_tl 0 \c_space_tl R - } - } - -\cs_generate_variant:Nn\__uftag_struct_kid_link_gput_right:nn { nx} -\cs_new:Nn\__uftag_struct_exchange_kid_command:N %N= seq - { - \seq_gpop_left:NN #1 \l_tmpa_tl - \regex_replace_once:nnN - {\c{\__uftag_mc_insert_mcid_kids:n}} - {\c{\__uftag_mc_insert_mcid_single_kids:n}} - \l_tmpa_tl - \seq_gput_left:NV #1 \l_tmpa_tl - } -\cs_generate_variant:Nn\__uftag_struct_exchange_kid_command:N { c } +\cs_generate_variant:Nn\__tag_struct_exchange_kid_command:N { c } -\cs_new:Nn \__uftag_struct_fill_kid_key:n %#1 is the struct num - { - \int_case:nnF +\cs_new:Nn \__tag_struct_fill_kid_key:n %#1 is the struct num { - \seq_count:c - { - g__uftag_struct_kids_\prop_item:cn{ g__uftag_struct_#1_prop }{num}_seq - } + \int_case:nnF + { + \seq_count:c + { + g__tag_struct_kids_\prop_item:cn{ g__tag_struct_#1_prop }{num}_seq + } + } + { + { 0 } + { } %no kids, do nothing + { 1 } % 1 kid, insert + { + % in this case we need a special command in + %luamode to get the array right. See issue #13 + \bool_if:NT\g__tag_mode_lua_bool + { + \__tag_struct_exchange_kid_command:c + {g__tag_struct_kids_\prop_item:cn{ g__tag_struct_#1_prop }{num}_seq} + } + \__tag_prop_gput:cnx { g__tag_struct_#1_prop } {K} + { + \seq_item:cn + { + g__tag_struct_kids_\prop_item:cn{ g__tag_struct_#1_prop }{num}_seq + } + {1} + } + } % + } + { %many kids, use an array + \__tag_prop_gput:cnx { g__tag_struct_#1_prop } {K} + { + [ + \seq_use:cn + { + g__tag_struct_kids_\prop_item:cn{ g__tag_struct_#1_prop }{num}_seq + } + { + \c_space_tl + } + ] + } + } } + + +\tl_new:N \l__tag_struct_dict_content_tl + +\cs_new:Nn \__tag_struct_get_dict_content:n { - { 0 } - { } %no kids, do nothing - { 1 } % 1 kid, insert - { - % in this case we in luamode need a special command in luamode to get the array right. See issue #13 - \bool_if:NT\g__uftag_mode_lua_bool + %\tl_set:Nn \l__tag_struct_dict_content_tl {<<} + \tl_clear:N \l__tag_struct_dict_content_tl + \seq_map_inline:cn { - \__uftag_struct_exchange_kid_command:c - {g__uftag_struct_kids_\prop_item:cn{ g__uftag_struct_#1_prop }{num}_seq} + c__tag_struct_\prop_item:cn{ g__tag_struct_#1_prop }{entries}_entries_seq } - \__uftag_prop_gput:cnx { g__uftag_struct_#1_prop } {K} { - \seq_item:cn - { - g__uftag_struct_kids_\prop_item:cn{ g__uftag_struct_#1_prop }{num}_seq - }{1} + \tl_put_right:Nx + \l__tag_struct_dict_content_tl + { + \prop_if_in:cnT + { g__tag_struct_#1_prop } + { ##1 } + { + \c_space_tl/##1~\prop_item:cn{ g__tag_struct_#1_prop } { ##1 } + } + } } - } % - } - { %many kids, use an array - \__uftag_prop_gput:cnx { g__uftag_struct_#1_prop } {K} - { - [ - \seq_use:cn - { - g__uftag_struct_kids_\prop_item:cn{ g__uftag_struct_#1_prop }{num}_seq - } - { - \c_space_tl - } - ] - } + %\tl_put_right:Nn \l__tag_struct_dict_content_tl { >> } } - } -% this command can be used for roots and structure elements -% #1 is a num +\cs_new:Nn \__tag_struct_write_obj:n + { + \prop_if_in:cnTF + { g__tag_struct_#1_prop } + { objref } + { + \__tag_struct_fill_kid_key:n { #1 } + %\prop_show:c { g__tag_struct_#1_prop } + \__tag_struct_get_dict_content:n { #1 } + \exp_args:Nx + \pdf_object_write:nx + { c__tag_struct_#1_obj } + { + \l__tag_struct_dict_content_tl + } + } + { + \msg_error:nnn { tag } { struct-no-objnum } { #1} + } + } -\tl_new:N \l_uftag_struct_dict_content_tl +\keys_define:nn { __tag / struct } + { + label .tl_set:N = \l__tag_struct_key_label_tl, + stash .bool_set:N = \l__tag_struct_elem_stash_bool, + tag .code:n = % S property + {%%????????? \pdfescapename?? + \tl_set:Nx \l__tag_tmpa_tl { #1 } + \bool_if:NT \g__tag_check_tags_bool + { + \__tag_check_structure_tag:N \l__tag_tmpa_tl + } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { S } + { /\exp_not:V\l__tag_tmpa_tl } + }, + title .code:n = % T property + { + \str_set_convert:Nnon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { T } + { <\l__tag_tmpa_str> } + }, + title-o .code:n = % T property + { + \str_set_convert:Nnon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { T } + { <\l__tag_tmpa_str> } + }, + alttext .code:n = % Alt property + { + \str_set_convert:Nnon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { Alt } + { <\l__tag_tmpa_str> } + }, + alttext-o .code:n = % Alt property + { + \str_set_convert:Noon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { Alt } + { <\l__tag_tmpa_str> } + }, + actualtext .code:n = % ActualText property + { + \str_set_convert:Nnon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { ActualText } + { <\l__tag_tmpa_str>} + }, + actualtext-o .code:n = % ActualText property + { + \str_set_convert:Noon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { ActualText } + { <\l__tag_tmpa_str>} + }, + lang .code:n = % Lang property + { + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { Lang } + { (#1) } + }, + ref .code:n = % Lang property + { + \tl_clear:N\l__tag_tmpa_tl + \clist_map_inline:nn {#1} + { + \tl_put_right:Nx \l__tag_tmpa_tl + {~\ref_value:nn{tagpdfstruct-##1}{tagstructobj} } + } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { Ref } + { [\l__tag_tmpa_tl] } + }, + E .code:n = % E property + { + \str_set_convert:Nnon + \l__tag_tmpa_str + { #1 } + { default } + { utf16/hex } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { E } + { <\l__tag_tmpa_str> } + }, + } -\cs_new:Nn \__uftag_struct_get_dict_content:n +\keys_define:nn { __tag / struct } { - \tl_set:Nn \l_uftag_struct_dict_content_tl {<<} - \seq_map_inline:cn - { - c__uftag_struct_\prop_item:cn{ g__uftag_struct_#1_prop }{entries}_entries_seq - } - { - \tl_put_right:Nx - \l_uftag_struct_dict_content_tl - { - \prop_if_in:cnT - { g__uftag_struct_#1_prop } - { ##1 } + AF .code:n = % T property + { + \pdf_object_if_exist:nTF {#1} + { + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { AF } + { \pdf_object_ref:n {#1} } + } + { + + } + }, + ,AFinline .code:n = { - \c_space_tl/##1~\prop_item:cn{ g__uftag_struct_#1_prop } { ##1 } + \group_begin: + \exp_args:Ne + \pdf_object_if_exist:nF {__tag/fileobj\int_use:N\c@g__tag_struct_abs_int} + { + \pdffile_embed_stream:nxx + {#1} + {tag-AFfile\int_use:N\c@g__tag_struct_abs_int.txt} + {__tag/fileobj\int_use:N\c@g__tag_struct_abs_int} + } + \__tag_prop_gput:cnx + { g__tag_struct_\int_use:N\c@g__tag_struct_abs_int _prop } + { AF } + { \pdf_object_ref:e {__tag/fileobj\int_use:N\c@g__tag_struct_abs_int } } + \group_end: } - } - } - \tl_put_right:Nn \l_uftag_struct_dict_content_tl { >> } - } - - -% #1 is the struct num -\cs_new:Nn \__uftag_struct_write_obj:n - { - \prop_if_in:cnTF - { g__uftag_struct_#1_prop } - { objnum } - { - \__uftag_struct_fill_kid_key:n { #1 } - %\prop_show:c { g__uftag_struct_#1_prop } - \__uftag_struct_get_dict_content:n { #1 } - \__uftag_pdfuseobjnum:xx - { \prop_item:cn { g__uftag_struct_#1_prop } {objnum} } + ,AFinline-o .code:n = { - \l_uftag_struct_dict_content_tl + \group_begin: + \exp_args:Ne + \pdf_object_if_exist:nF {__tag/fileobj\int_use:N\c@g__tag_struct_abs_int} + { + \pdffile_embed_stream:oxx + {#1} + {tag-AFfile\int_use:N\c@g__tag_struct_abs_int.txt} + {__tag/fileobj\int_use:N\c@g__tag_struct_abs_int} + } + \__tag_prop_gput:cnx + { g__tag_struct_\int_use:N\c@g__tag_struct_abs_int _prop } + { AF } + { \pdf_object_ref:e {__tag/fileobj\int_use:N\c@g__tag_struct_abs_int } } + \group_end: } - } - { - \msg_error:nnn {uftag} { struct-no-objnum } { #1} - } } -% keys for the user commands -% should I pass the values (e.g. the tag) through an escape command? -\keys_define:nn { uftag / struct } - { - label .tl_set:N = \l__uftag_struct_key_label_tl, - stash .bool_set:N = \l__uftag_struct_elem_stash_bool, - tag .code:n = % S property - {%%????????? \pdfescapename?? - \tl_set:Nx \l__uftag_tmpa_tl { #1 } - \bool_if:NT \g__uftag_check_tags_bool - { - \__uftag_check_structure_tag:N \l__uftag_tmpa_tl - } - \__uftag_prop_gput:cnx - { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } - { S } - { /\exp_not:V\l__uftag_tmpa_tl } - }, - title .code:n = % T property - { - \str_set_convert:Nnon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \__uftag_prop_gput:cnx - { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } - { T } - { <\l__uftag_tmpa_str> } - }, - title-o .code:n = % T property - { - \str_set_convert:Nnon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \__uftag_prop_gput:cnx - { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } - { T } - { <\l__uftag_tmpa_str> } - }, - alttext .code:n = % Alt property - { - \str_set_convert:Nnon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \__uftag_prop_gput:cnx - { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } - { Alt } - { <\l__uftag_tmpa_str> } - }, - alttext-o .code:n = % Alt property - { - \str_set_convert:Noon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \__uftag_prop_gput:cnx - { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } - { Alt } - { <\l__uftag_tmpa_str> } - }, - actualtext .code:n = % ActualText property - { - \str_set_convert:Nnon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \__uftag_prop_gput:cnx - { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } - { ActualText } - { <\l__uftag_tmpa_str>} - }, - actualtext-o .code:n = % ActualText property - { - \str_set_convert:Noon - \l__uftag_tmpa_str - { #1 } - { \g__uftag_inputencoding_tl } - { utf16/hex } - \__uftag_prop_gput:cnx - { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } - { ActualText } - { <\l__uftag_tmpa_str>} - }, -} - - -\cs_new_protected:Nn \uftag_struct_begin:n - { - \group_begin: - \int_gincr:N \c@g__uftag_struct_abs_int - \__uftag_prop_new:c { g__uftag_struct_\int_eval:n { \c@g__uftag_struct_abs_int }_prop } - \__uftag_new_output_prop_handler:n {\int_eval:n { \c@g__uftag_struct_abs_int }} - \__uftag_seq_new:c { g__uftag_struct_kids_\int_eval:n { \c@g__uftag_struct_abs_int }_seq} - \__uftag_pdfreserveobjnum:N \l_tmpa_tl - \__uftag_prop_gput:cno - { g__uftag_struct_\int_eval:n { \c@g__uftag_struct_abs_int }_prop } - { objnum} - { \l_tmpa_tl } - \__uftag_prop_gput:cnx - { g__uftag_struct_\int_eval:n { \c@g__uftag_struct_abs_int }_prop } - { num} - { \int_eval:n { \c@g__uftag_struct_abs_int } } - \__uftag_prop_gput:cno - { g__uftag_struct_\int_eval:n { \c@g__uftag_struct_abs_int }_prop } - { Type } - { /StructElem } - \__uftag_prop_gput:cno - { g__uftag_struct_\int_eval:n { \c@g__uftag_struct_abs_int }_prop } - { entries } - { StructElem } - \keys_set:nn {uftag / struct} { #1 } - \__uftag_check_structure_has_tag:n { \int_eval:n {\c@g__uftag_struct_abs_int} } - \tl_if_empty:NF - {\l__uftag_struct_key_label_tl} - { - \zref@labelbylist{tagpdfstruct-\l__uftag_struct_key_label_tl}{uftagzrlstruct} - } - %get the potential parent from the stack: - \seq_get:NNF - \g__uftag_struct_stack_seq - \l__uftag_struct_stack_parent_tmp_tl - { - \msg_error:nn { uftag } { struct-faulty-nesting } - } - \seq_gpush:NV \g__uftag_struct_stack_seq \c@g__uftag_struct_abs_int - \tl_gset:NV \g__uftag_struct_stack_current_tl \c@g__uftag_struct_abs_int - %\seq_show:N \g__uftag_struct_stack_seq - \bool_if:NF - \l__uftag_struct_elem_stash_bool - {%set the parent - \__uftag_prop_gput:cnx - { g__uftag_struct_\int_eval:n {\c@g__uftag_struct_abs_int}_prop } - { P } +\cs_new_protected:Nn \tag_struct_begin:n + { + \group_begin: + \int_gincr:N \c@g__tag_struct_abs_int + \__tag_prop_new:c { g__tag_struct_\int_eval:n { \c@g__tag_struct_abs_int }_prop } + \__tag_new_output_prop_handler:n {\int_eval:n { \c@g__tag_struct_abs_int }} + \__tag_seq_new:c { g__tag_struct_kids_\int_eval:n { \c@g__tag_struct_abs_int }_seq} + %\__tag_pdfreserveobjnum:N \l_tmpa_tl + \exp_args:Ne + \pdf_object_new:nn + { c__tag_struct_\int_eval:n { \c@g__tag_struct_abs_int }_obj } + { dict } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n { \c@g__tag_struct_abs_int }_prop } + { objref} { - \prop_item:cn { g__uftag_struct_\l__uftag_struct_stack_parent_tmp_tl _prop} { objnum }~0~R + \exp_args:Ne + \pdf_object_ref:n + {c__tag_struct_\int_eval:n { \c@g__tag_struct_abs_int }_obj} } - %record this structure as kid: - %\tl_show:N \g__uftag_struct_stack_current_tl - %\tl_show:N \l__uftag_struct_stack_parent_tmp_tl - \__uftag_struct_kid_struct_gput_right:nn - { \l__uftag_struct_stack_parent_tmp_tl } - { \g__uftag_struct_stack_current_tl } - %\prop_show:c { g__uftag_struct_\g__uftag_struct_stack_current_tl _prop } - %\seq_show:c {g__uftag_struct_kids_\l__uftag_struct_stack_parent_tmp_tl _seq} - } - %\prop_show:c { g__uftag_struct_\g__uftag_struct_stack_current_tl _prop } - %\seq_show:c {g__uftag_struct_kids_\l__uftag_struct_stack_parent_tmp_tl _seq} - \group_end: - } + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n { \c@g__tag_struct_abs_int }_prop } + { num} + { \int_eval:n { \c@g__tag_struct_abs_int } } + \__tag_prop_gput:cno + { g__tag_struct_\int_eval:n { \c@g__tag_struct_abs_int }_prop } + { Type } + { /StructElem } + \__tag_prop_gput:cno + { g__tag_struct_\int_eval:n { \c@g__tag_struct_abs_int }_prop } + { entries } + { StructElem } + \keys_set:nn { __tag / struct} { #1 } + \__tag_check_structure_has_tag:n { \int_eval:n {\c@g__tag_struct_abs_int} } + \tl_if_empty:NF + \l__tag_struct_key_label_tl + { + \__tag_ref_label:en{tagpdfstruct-\l__tag_struct_key_label_tl}{struct} + } + %get the potential parent from the stack: + \seq_get:NNF + \g__tag_struct_stack_seq + \l__tag_struct_stack_parent_tmp_tl + { + \msg_error:nn { tag } { struct-faulty-nesting } + } + \seq_gpush:NV \g__tag_struct_stack_seq \c@g__tag_struct_abs_int + \tl_gset:NV \g__tag_struct_stack_current_tl \c@g__tag_struct_abs_int + %\seq_show:N \g__tag_struct_stack_seq + \bool_if:NF + \l__tag_struct_elem_stash_bool + {%set the parent + \__tag_prop_gput:cnx + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } + { P } + { + \prop_item:cn + { g__tag_struct_\l__tag_struct_stack_parent_tmp_tl _prop} + { objref } + } + %record this structure as kid: + %\tl_show:N \g__tag_struct_stack_current_tl + %\tl_show:N \l__tag_struct_stack_parent_tmp_tl + \__tag_struct_kid_struct_gput_right:nn + { \l__tag_struct_stack_parent_tmp_tl } + { \g__tag_struct_stack_current_tl } + %\prop_show:c { g__tag_struct_\g__tag_struct_stack_current_tl _prop } + %\seq_show:c {g__tag_struct_kids_\l__tag_struct_stack_parent_tmp_tl _seq} + } + %\prop_show:c { g__tag_struct_\g__tag_struct_stack_current_tl _prop } + %\seq_show:c {g__tag_struct_kids_\l__tag_struct_stack_parent_tmp_tl _seq} + \group_end: + } -\cs_new_protected:Nn \uftag_struct_end: - {%take the current structure num from the stack: - %the objects are written later, lua mode hasn't all needed info yet - %\seq_show:N \g__uftag_struct_stack_seq - \seq_gpop:NNTF \g__uftag_struct_stack_seq \l_tmpa_tl - { - \int_compare:nNnT {\l__uftag_loglevel_int} > { 0 } - { - \__uftag_check_info_closing_struct:o { \g__uftag_struct_stack_current_tl } - } - } - { \__uftag_check_no_open_struck: } - % get the previous one, shouldn't be empty as the root should be there - \seq_get:NNTF \g__uftag_struct_stack_seq \l_tmpa_tl - { - \tl_gset:NV \g__uftag_struct_stack_current_tl \l_tmpa_tl - } - { - \__uftag_check_no_open_struck: - } - } +\cs_set_eq:NN \uftag_struct_begin:n \tag_struct_begin:n -\cs_new_protected:Nn \uftag_struct_use:n %#1 is the label - { - \prop_if_exist:cTF - { g__uftag_struct_\zref@extractdefault{tagpdfstruct-#1}{tagstruct}{unknown}_prop } %?????????? - { - \__uftag_check_struct_used:n {#1} - %add the label structure as kid to the current structure (can be the root) - \__uftag_struct_kid_struct_gput_right:nn - { \g__uftag_struct_stack_current_tl } - { \zref@extractdefault{tagpdfstruct-#1}{tagstruct}{0} } - %add the current structure to the labeled one as parents - \__uftag_prop_gput:cnx - { g__uftag_struct_\zref@extractdefault{tagpdfstruct-#1}{tagstruct}{0}_prop } - { P } - { - \prop_item:cn { g__uftag_struct_\g__uftag_struct_stack_current_tl _prop} { objnum }~0~R - } - } - {\msg_warning:nnn{uftag}{struct-label-unknown}{#1}} - } +\cs_new_protected:Nn \tag_struct_end: + { %take the current structure num from the stack: + %the objects are written later, lua mode hasn't all needed info yet + %\seq_show:N \g__tag_struct_stack_seq + \seq_gpop:NNTF \g__tag_struct_stack_seq \l_tmpa_tl + { + \int_compare:nNnT {\l__tag_loglevel_int} > { 0 } + { + \__tag_check_info_closing_struct:o { \g__tag_struct_stack_current_tl } + } + } + { \__tag_check_no_open_struck: } + % get the previous one, shouldn't be empty as the root should be there + \seq_get:NNTF \g__tag_struct_stack_seq \l_tmpa_tl + { + \tl_gset:NV \g__tag_struct_stack_current_tl \l_tmpa_tl + } + { + \__tag_check_no_open_struck: + } + } +\cs_set_eq:NN \uftag_struct_end: \tag_struct_end: + +\cs_new_protected:Nn \tag_struct_use:n %#1 is the label + { + \prop_if_exist:cTF + { g__tag_struct_\__tag_ref_value:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop } %?????????? + { + \__tag_check_struct_used:n {#1} + %add the label structure as kid to the current structure (can be the root) + \__tag_struct_kid_struct_gput_right:nn + { \g__tag_struct_stack_current_tl } + { \__tag_ref_value:enn{tagpdfstruct-#1}{tagstruct}{0} } + %add the current structure to the labeled one as parents + \__tag_prop_gput:cnx + { g__tag_struct_\__tag_ref_value:enn{tagpdfstruct-#1}{tagstruct}{0}_prop } + { P } + { + \prop_item:cn + { g__tag_struct_\g__tag_struct_stack_current_tl _prop} + { objref } + } + } + { + \msg_warning:nnn{ tag }{struct-label-unknown}{#1} + } + } + +\cs_set_eq:NN \uftag_struct_use:n \tag_struct_use:n %%%% Code to tag links %%%% this works for url, see exp-link.pdf. %%%% it must be checked for other links -\cs_new_protected:Nn \__uftag_struct_finish_link: -{ - \bool_if:NT \g_uftag_active_struct_bool - { - %get the number of the parent link structure: - \seq_get:NNF - \g__uftag_struct_stack_seq - \l__uftag_struct_stack_parent_tmp_tl - { - \msg_error:nn { uftag } { struct-faulty-nesting } - } - %put the obj number of link annot in the kid entry: - \__uftag_struct_kid_link_gput_right:nx - { - \l__uftag_struct_stack_parent_tmp_tl - } - { - \int_use:N\__uftag_pdf_lastlink: - } - % add the parent obj number to the parent tree: - \__uftag_parenttree_add_objr:nn - { - \int_use:N\c@g__uftag_parenttree_obj_int - } +\cs_new_protected:Nn \__tag_struct_finish_link: { - \prop_item:cn{ g__uftag_struct_\l__uftag_struct_stack_parent_tmp_tl _prop } - { objnum } + \bool_if:NT \g__tag_active_struct_bool + { + %get the number of the parent link structure: + \seq_get:NNF + \g__tag_struct_stack_seq + \l__tag_struct_stack_parent_tmp_tl + { + \msg_error:nn { tag } { struct-faulty-nesting } + } + %put the obj number of link annot in the kid entry: + \__tag_struct_kid_link_gput_right:nx + { + \l__tag_struct_stack_parent_tmp_tl + } + { + \pdfannot_link_ref_last: + } + % add the parent obj number to the parent tree: + \__tag_parenttree_add_objr:nn + { + \int_use:N\c@g__tag_parenttree_obj_int + } + { + \prop_item:cn + { g__tag_struct_\l__tag_struct_stack_parent_tmp_tl _prop } + { objref } + } + % increase the int: + \stepcounter{ g__tag_parenttree_obj_int } + } } - % increase the int: - \stepcounter{ g__uftag_parenttree_obj_int } - } -} -\endinput + +%% +%% +%% End of file `tagpdf-struct-code.sty'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-tree-code.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-tree-code.sty index af8ec11aa9c..390965ae506 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-tree-code.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-tree-code.sty @@ -1,210 +1,252 @@ -\ProvidesExplPackage {tagpdf-tree-code} {2019/07/02} {0.61} +%% +%% This is file `tagpdf-tree-code.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf-tree.dtx (with options: `tree') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf-tree.dtx +\ProvidesExplPackage {tagpdf-tree-code} {2021/02/23} {0.80} {part of tagpdf - code related to writing trees and dictionaries to the pdf} -%this does the actual finishing: -\AtBeginDocument - { - \bool_if:NT \g_uftag_active_tree_bool - { - \AfterEndDocument { \uftag_finish_structure: } - } - } - - -% the StructTreeRoot -% we better get the object number in any case: -\__uftag_pdfreserveobjnum:N \l_tmpa_tl -\tl_const:Nx \c_uftag_tree_obj_structtreeroot_tl { \l_tmpa_tl } - - -\cs_new:Nn \__uftag_tree_write_structtreeroot: - { - \__uftag_pdfcatalog:n { /StructTreeRoot~\c_uftag_tree_obj_structtreeroot_tl\c_space_tl0~R } - \__uftag_struct_write_obj:n { 0 } - } - -\cs_new:Nn \__uftag_tree_write_structelements: - { - \int_step_inline:nnnn {1}{1}{\c@g__uftag_struct_abs_int} - { - %\prop_show:c {g__uftag_struct_##1_prop} - \__uftag_struct_write_obj:n { ##1 } %write the object - } - } - - -%the ParentTree -\__uftag_pdfreserveobjnum:N \l_tmpa_tl -\tl_const:Nx \c__uftag_tree_obj_parenttree_tl { \l_tmpa_tl } - -% we have two sets of entries in the parent tree: -% page streams and real objects. -% The numbers must be distinct and ordered -% So we rely on abspage and put the real objects at the end -% I use a counter to have a chance to get the correct number -% if code is process twice. -\newcounter { g__uftag_parenttree_obj_int } -\AtBeginDocument - { \int_gset:Nn \c@g__uftag_parenttree_obj_int - { \zref@extractdefault{LastPage}{abspage}{100} } - } - -% we need to record the obj references: - -\tl_new:N \g__uftag_parenttree_objr_tl - -\cs_new:Nn \__uftag_parenttree_add_objr:nn %#1 Structparent number, #2 obj number -{ - \tl_gput_right:Nx \g__uftag_parenttree_objr_tl +\hook_gput_code:nnn{begindocument}{tagpdf} { - #1 \c_space_tl #2\c_space_tl 0 \c_space_tl R\c_space_tl ^^J + \bool_if:NT \g__tag_active_tree_bool + { + \AfterEndDocument { \tag_finish_structure: } + } } -} - -\tl_new:N \l__uftag_parenttree_content_tl - -\cs_new:Nn \__uftag_tree_fill_parenttree: - { - \int_step_inline:nnnn{1}{1}{\zref@extractdefault{LastPage}{abspage}{-1}} %not quite clear if labels are needed. See lua code - { %page ##1\par - \prop_clear:N \l_tmpa_prop - \int_step_inline:nnnn{1}{1}{\zref@extractdefault{LastPage}{tagmcabs}{-1}} - { - %mcid####1 - \int_compare:nT%F - {\zref@extractdefault{mcid-####1}{tagabspage}{-1}=##1} %mcid is on current page - {% yes\par - \prop_put:Nxx \l_tmpa_prop - {\zref@extractdefault{mcid-####1}{tagmcid}{-1}} - {\prop_item:Nn \g__uftag_mc_parenttree_prop {####1}} - } - } - %\prop_show:N \l_tmpa_prop - \tl_put_right:Nx\l__uftag_parenttree_content_tl - {\int_eval:n {##1-1}\c_space_tl[\c_space_tl} %%brackt - \int_step_inline:nnnn {0}{1}{ \prop_map_function:NN \l_tmpa_prop\__uftag_prop_count:nn -1 } - { - \prop_get:NnNTF \l_tmpa_prop {####1} \l_tmpb_tl - {% page#1:mcid##1:\l_tmpb_tl :content - \tl_put_right:Nx \l__uftag_parenttree_content_tl - { - \prop_item:cn { g__uftag_struct_\l_tmpb_tl _prop } {objnum}~0~R~ - } - } - {\msg_warning:nn {uftag} {tree-mcid-index-wrong} } - } - \tl_put_right:Nn \l__uftag_parenttree_content_tl {]^^J} % + + +\pdf_object_new:nn { c__tag_struct_0_obj }{ dict } + + %need to think about the best place ... +\hook_gput_code:nnn{begindocument}{tagpdf} + { + \bool_if:NT \g__tag_active_struct_bool + { + \pdfmanagement_add:nnx + { Catalog } + { StructTreeRoot } + { \pdf_object_ref:n { c__tag_struct_0_obj } } + } + } +\cs_new_protected:Nn \__tag_tree_write_structtreeroot: + { + \__tag_struct_write_obj:n { 0 } + } + +\cs_new_protected:Nn \__tag_tree_write_structelements: + { + \int_step_inline:nnnn {1}{1}{\c@g__tag_struct_abs_int} + { + %\prop_show:c {g__tag_struct_##1_prop} + \__tag_struct_write_obj:n { ##1 } %write the object + } + } + + +\pdf_object_new:nn { c__tag_tree_parenttree_obj }{ dict } + +\newcounter { g__tag_parenttree_obj_int } +\hook_gput_code:nnn{begindocument}{tagpdf} + { + \int_gset:Nn + \c@g__tag_parenttree_obj_int + { \__tag_ref_value_lastpage:nn{abspage}{100} } + } + + +\tl_new:N \g__tag_parenttree_objr_tl + +\cs_new_protected:Nn \__tag_parenttree_add_objr:nn %#1 Structparent number, #2 objref + { + \tl_gput_right:Nx \g__tag_parenttree_objr_tl + { + #1 \c_space_tl #2 ^^J + } + } + +\tl_new:N \l__tag_parenttree_content_tl + +\cs_new_protected:Nn \__tag_tree_fill_parenttree: + { + \int_step_inline:nnnn{1}{1}{\__tag_ref_value_lastpage:nn{abspage}{-1}} %not quite clear if labels are needed. See lua code + { %page ##1\par + \prop_clear:N \l_tmpa_prop + \int_step_inline:nnnn{1}{1}{\__tag_ref_value_lastpage:nn{tagmcabs}{-1}} + { + %mcid####1 + \int_compare:nT%F + {\__tag_ref_value:enn{mcid-####1}{tagabspage}{-1}=##1} %mcid is on current page + {% yes\par + \prop_put:Nxx + \l_tmpa_prop + {\__tag_ref_value:enn{mcid-####1}{tagmcid}{-1}} + {\prop_item:Nn \g__tag_mc_parenttree_prop {####1}} + } + } + %\prop_show:N \l_tmpa_prop + \tl_put_right:Nx\l__tag_parenttree_content_tl + { + \int_eval:n {##1-1}\c_space_tl + [\c_space_tl %] + } + \int_step_inline:nnnn + {0} + {1} + { \prop_map_function:NN \l_tmpa_prop\__tag_prop_count:nn -1 } + { + \prop_get:NnNTF \l_tmpa_prop {####1} \l_tmpb_tl + {% page#1:mcid##1:\l_tmpb_tl :content + \tl_put_right:Nx \l__tag_parenttree_content_tl + { + \prop_item:cn { g__tag_struct_\l_tmpb_tl _prop } {objref} + \c_space_tl + } + %\tl_show:N \l__tag_parenttree_content_tl + } + { + \msg_warning:nn { tag } {tree-mcid-index-wrong} + } + } + \tl_put_right:Nn + \l__tag_parenttree_content_tl + {%[ + ]^^J + } + } + } + +\cs_new_protected:Nn \__tag_tree_lua_fill_parenttree: + { + \tl_set:Nn \l__tag_parenttree_content_tl + { + \directlua + { + ltx.__tag.func.output_parenttree + ( + \int_use:N\g_shipout_readonly_int + ) + } + } + } + +\cs_new_protected:Nn \__tag_tree_write_parenttree: + { + \bool_if:NTF \g__tag_mode_lua_bool + { + \__tag_tree_lua_fill_parenttree: + } + { + \__tag_tree_fill_parenttree: + } + \tl_put_right:NV \l__tag_parenttree_content_tl\g__tag_parenttree_objr_tl + \pdf_object_write:nx { c__tag_tree_parenttree_obj } + { + /Nums\c_space_tl [\l__tag_parenttree_content_tl] + } + } + + +\pdf_object_new:nn { c__tag_tree_rolemap_obj }{ dict } + +\tl_new:N \l__tag_rolemap_content_tl + +\cs_new_protected:Nn \__tag_tree_fill_rolemap: + { + \prop_map_inline:Nn \g__tag_role_rolemap_prop + { + \tl_put_right:Nx \l__tag_rolemap_content_tl + { + /##1\c_space_tl/##2^^J + } + } + } + +\cs_new_protected:Nn \__tag_tree_write_rolemap: + { + \__tag_tree_fill_rolemap: + \pdf_object_write:nx { c__tag_tree_rolemap_obj } + { + \l__tag_rolemap_content_tl + } + } + + +\cs_new_protected:Nn \__tag_tree_write_classmap: + { + \tl_gclear:N \g__tag_attr_class_content_tl + \seq_gremove_duplicates:N \g__tag_attr_class_used_seq + \seq_set_map:NNn \l_tmpa_seq \g__tag_attr_class_used_seq + { + /##1\c_space_tl + << + \prop_item:Nn + \g__tag_attr_entries_prop + {##1} + >> + } + \tl_gset:Nx \g__tag_attr_class_content_tl + { + \seq_use:Nn + \l_tmpa_seq + { \iow_newline: } + } + \tl_if_empty:NF + \g__tag_attr_class_content_tl + { + \pdf_object_new:nn { c__tag_tree_classmap_obj }{ dict } + % \__tag_pdfreserveobjnum:N \l_tmpa_tl + % \tl_const:Nx \c__tag_tree_obj_classmap_tl { \l_tmpa_tl } + \pdf_object_write:nx + { c__tag_tree_classmap_obj } + { \g__tag_attr_class_content_tl } + \__tag_prop_gput:cnx + { g__tag_struct_0_prop } + { ClassMap } + { \pdf_object_ref:n { c__tag_tree_classmap_obj } } + } } - } - -%lua mode must/can do it differently -\cs_new:Nn \__uftag_tree_lua_fill_parenttree: - { - \tl_set:Nn \l__uftag_parenttree_content_tl - { - \directlua{uftag.func.output_parenttree(\int_use:N\g__uftag_abspage_int)} - } - } - - - -\cs_new:Nn \__uftag_tree_write_parenttree: - { - \bool_if:NTF \g__uftag_mode_lua_bool - { - \__uftag_tree_lua_fill_parenttree: - } - { - \__uftag_tree_fill_parenttree: - } - \tl_put_right:NV \l__uftag_parenttree_content_tl\g__uftag_parenttree_objr_tl - \__uftag_pdfuseobjnum:xx { \c__uftag_tree_obj_parenttree_tl } - { - <<\c_space_tl/Nums\c_space_tl [\l__uftag_parenttree_content_tl] \c_space_tl >> - } - } - -%the Rolemap tree -\__uftag_pdfreserveobjnum:N \l_tmpa_tl -\tl_const:Nx \c__uftag_tree_obj_rolemap_tl { \l_tmpa_tl } -\tl_new:N \l__uftag_rolemap_content_tl - -\cs_new:Nn \__uftag_tree_fill_rolemap: - { - \prop_map_inline:Nn \g__uftag_role_rolemap_prop - { - \tl_put_right:Nx \l__uftag_rolemap_content_tl - { - /##1\c_space_tl/##2^^J - } - } - } - -\cs_new:Nn \__uftag_tree_write_rolemap: - { - \__uftag_tree_fill_rolemap: - \__uftag_pdfuseobjnum:xx { \c__uftag_tree_obj_rolemap_tl } - { - <<\l__uftag_rolemap_content_tl >> - } - } - -%classmap, should only be written, if values has been used - -\cs_new_protected:Nn \__uftag_tree_class_write_map: - { - \tl_gclear:N \g__uftag_attr_class_content_tl - \seq_gremove_duplicates:N \g__uftag_attr_class_used_seq - \seq_set_map:NNn \l_tmpa_seq \g__uftag_attr_class_used_seq - { - /##1\c_space_tl - \prop_item:Nn \g__uftag_attr_entries_prop - {##1} - } - \tl_gset:Nx \g__uftag_attr_class_content_tl - { - \seq_use:Nn \l_tmpa_seq - { \iow_newline: } - } - \tl_if_empty:NF \g__uftag_attr_class_content_tl + +\cs_new_protected:Nn \tag_finish_structure: + { + \__tag_tree_write_parenttree: + \__tag_tree_write_rolemap: + \__tag_tree_write_classmap: + \__tag_tree_write_structelements: %this is rather slow!! + \__tag_tree_write_structtreeroot: + } + +\cs_set_eq:NN \uftag_finish_structure: \tag_finish_structure: + +\hook_gput_code:nnn{begindocument}{tagpdf} { - \__uftag_pdfreserveobjnum:N \l_tmpa_tl - \tl_const:Nx \c__uftag_tree_obj_classmap_tl { \l_tmpa_tl } - \__uftag_pdfuseobjnum:Nx \c__uftag_tree_obj_classmap_tl - { <<\g__uftag_attr_class_content_tl>> } - - \__uftag_prop_gput:cnx - { g__uftag_struct_0_prop } - { ClassMap } - { \c__uftag_tree_obj_classmap_tl\c_space_tl0\c_space_tl R } + \bool_if:NT\g__tag_active_tree_bool + { + \hook_gput_code:nnn{shipout/before} { tagpdf/structparents } + { + \pdfmanagement_add:nnx + { Page } + {StructParents} + {\int_eval:n { \g_shipout_readonly_int}} + } + } } - } - - -\cs_new:Nn \uftag_finish_structure: - { - \__uftag_pdfcatalog:n {^^J/MarkInfo\c_space_tl<</Marked\c_space_tl true>> } - \__uftag_tree_write_parenttree: - \__uftag_tree_write_rolemap: - \__uftag_tree_class_write_map: - \__uftag_tree_write_structelements: - \__uftag_tree_write_structtreeroot: - } - - -%StructParents + tabs order. Tabs order should be probably be changeable by page. - -\cs_new:Nn \__uftag_tree_write_pageattr: - { - \__uftag_get_pdfpageattr:N \l_tmpa_tl - \regex_replace_once:nnN {/StructParents\s*\d+} {}\l_tmpa_tl - \regex_replace_once:nnN {/Tabs\s*/[SCR]} {}\l_tmpa_tl - \__uftag_gset_pdfpageattr:x - { - \l_tmpa_tl / StructParents \c_space_tl - \int_eval:n { \g__uftag_abspage_int } - \l__uftag_tree_tabs_order_tl - } - } - -\endinput + +%% +%% +%% End of file `tagpdf-tree-code.sty'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-user.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-user.sty index 5bce390e4f4..8d2569a879b 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-user.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-user.sty @@ -1,102 +1,171 @@ -\ProvidesExplPackage {tagpdf-user} {2019/07/02} {0.61} +%% +%% This is file `tagpdf-user.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf.dtx (with options: `user') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf.dtx +\ProvidesExplPackage {tagpdf-user} {2021/02/23} {0.80} {tagpdf - user commands} \NewDocumentCommand \tagpdfsetup { m } - { - \keys_set:nn { uftag / setup } { #1 } - } + { + \keys_set:nn { __tag / setup } { #1 } + } \cs_set_eq:NN\tagpdfifluatexTF \sys_if_engine_luatex:TF \cs_set_eq:NN\tagpdfifluatexT \sys_if_engine_luatex:T \cs_set_eq:NN\tagpdfifpdftexT \sys_if_engine_pdftex:T -%%% a generic command to retrieve data +%%% stop tagging +\bool_new:N \l__tag_stop_bool -\cs_new:Npn \tagpdfget #1 { \uftag_get:n { #1} } -\cs_new:Npn \uftag_get:n #1 { \use:c {__uftag_get_data_#1: } } +\prg_new_conditional:Nnn \__tag_if_stop: {p,T,F,TF} + { + \bool_if:NTF \l__tag_stop_bool + { \prg_return_true: } + { \prg_return_false: } + } +\prg_new_eq_conditional:NNn \tag_if_stop: \__tag_if_stop: {p,T,F,TF} + +\cs_new_protected:Npn \__tag_stop: + { + \bool_set_true:N \l__tag_stop_bool + \cs_set_eq:NN \tag_mc_begin:n \use_none:n + \cs_set_eq:NN \tag_mc_end: \prg_do_nothing: + \cs_set_eq:NN \tag_mc_use:n \use_none:n + \cs_set_eq:NN \tag_struct_begin:n \use_none:n + \cs_set_eq:NN \tag_struct_end: \prg_do_nothing: + \cs_set_eq:NN \tag_struct_use:n \use_none:n + %deprecated + \cs_set_eq:NN \uftag_mc_begin:n \tag_mc_begin:n + \cs_set_eq:NN \uftag_mc_end: \tag_mc_end: + \cs_set_eq:NN \uftag_mc_use:n \tag_mc_use:n + \cs_set_eq:NN \uftag_struct_begin:n \tag_struct_begin:n + \cs_set_eq:NN \uftag_struct_end: \tag_struct_end: + \cs_set_eq:NN \uftag_struct_use:n \tag_struct_use:n + } + +\cs_new_protected:Npn \tag_stop_group_begin: + { + \group_begin: + \__tag_stop: + } + +\cs_set_eq:NN \tag_stop_group_end: \group_end: + +%%% a generic command to retrieve data + +\cs_new:Npn \tagpdfget #1 { \use:c {__tag_get_data_#1: } } +\cs_new:Npn \tag_get:n #1 { \use:c {__tag_get_data_#1: } } +\cs_new:Npn \uftag_get:n #1 { \use:c {__tag_get_data_#1: } } %%%% mc related user commands \NewDocumentCommand \tagmcifinTF { m m } + { + \__tag_mc_if_in:TF { #1 } { #2 } + } + +\NewDocumentEnvironment{tagmcartifact}{m} { - \__uftag_mc_if_in:TF { #1 } { #2 } + \tag_mc_artifact_group_begin:n { #1}\ignorespaces } - -\NewDocumentCommand \tagmcbegin { m } { - \uftag_mc_begin:n {#1}\ignorespaces + \tag_mc_artifact_group_end: } +\NewDocumentCommand \tagmcbegin { m } + { + \tag_mc_begin:n {#1}\ignorespaces + } \NewDocumentCommand \tagmcend { } - { - \unskip % this unskip appears to mess up some spacing; can we do this in another way? - \uftag_mc_end: - } + { + \unskip % this unskip appears to mess up some spacing; can we do this in another way? + \tag_mc_end: + } \NewDocumentCommand \tagmcuse { m } - { - \uftag_mc_use:n {#1} - } - + { + \tag_mc_use:n {#1} + } %%%% structure related commands \NewDocumentCommand \tagstructbegin { m } - { - \uftag_struct_begin:n {#1} - } + { + \tag_struct_begin:n {#1} + } \NewDocumentCommand \tagstructend { } - { - \uftag_struct_end: - } + { + \tag_struct_end: + } \NewDocumentCommand \tagstructuse { m } - { - \uftag_struct_use:n {#1} - } - - + { + \tag_struct_use:n {#1} + } %%%% debug/show commands -\NewDocumentCommand\showtagpdfmcdata { O {\__uftag_get_mc_abs_cnt:} } - { - \bool_if:NT \g__uftag_mode_lua_bool - { - \sys_if_engine_luatex:T - { - \directlua{uftag.trace.show_all_mc_data(#1)} - } - } - } +\NewDocumentCommand\showtagpdfmcdata { O {\__tag_tag_get_mc_abs_cnt:} } + { + \bool_if:NT \g__tag_mode_lua_bool + { + \sys_if_engine_luatex:T + { + \directlua{ltx.__tag.trace.show_all_mc_data(#1)} + } + } + } \NewDocumentCommand\showtagpdfattributes { } - { - \bool_if:NT \g__uftag_mode_lua_bool - { - \sys_if_engine_luatex:T - { - \directlua - { - uftag.trace.log( - "showtagpdfattributes: MC=>abscnt=\__uftag_get_mc_abs_cnt:=>attr=\the\l__uftag_mc_cnt_attr=>tag=" .. - tostring(uftag.func.get_tag_from (\the\l__uftag_mc_type_attr)) .. - "=\the\l__uftag_mc_type_attr",0 - ) - } - \ignorespaces - } + { + \bool_if:NT \g__tag_mode_lua_bool + { + \sys_if_engine_luatex:T + { + \directlua + { + ltx.__tag.trace.log + ( + "showtagpdfattributes: + MC=>abscnt=\__tag_get_mc_abs_cnt: + =>attr=\the\l__tag_mc_cnt_attr=>tag=" + .. + tostring(ltx.__tag.func.get_tag_from (\the\l__tag_mc_type_attr)) + .. + "=\the\l__tag_mc_type_attr",0 + ) + } + \ignorespaces + } + } } - } \sys_if_engine_luatex:T -{ - \NewDocumentCommand\pdffakespace { } { - \__uftag_fakespace: + \NewDocumentCommand\pdffakespace { } + { + \__tag_fakespace: + } } -} - -\endinput +%% +%% +%% End of file `tagpdf-user.sty'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua b/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua index e3b2373bc05..bc9f440b052 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua @@ -1,17 +1,38 @@ +-- +-- This is file `tagpdf.lua', +-- generated with the docstrip utility. +-- +-- The original source files were: +-- +-- tagpdf-backend.dtx (with options: `lua') +-- +-- Copyright (C) 2019 Ulrike Fischer +-- +-- It may be distributed and/or modified under the conditions of +-- the LaTeX Project Public License (LPPL), either version 1.3c of +-- this license or (at your option) any later version. The latest +-- version of this license is in the file: +-- +-- https://www.latex-project.org/lppl.txt +-- +-- This file is part of the "tagpdf bundle" (The Work in LPPL) +-- and all files in that bundle must be distributed together. +-- +-- File: tagpdf-backend.dtx -- tagpdf.lua -- Ulrike Fischer -local ProvidesLuaModule = { +local ProvidesLuaModule = { name = "tagpdf", - version = "0.61", --TAGVERSION - date = "2019-07-02", --TAGDATE + version = "0.80", --TAGVERSION + date = "2021-02-23", --TAGDATE description = "tagpdf lua code", license = "The LATEX Project Public License 1.3c" } if luatexbase and luatexbase.provides_module then luatexbase.provides_module (ProvidesLuaModule) -end +end --[[ The code has quite probably a number of problems @@ -19,60 +40,58 @@ The code has quite probably a number of problems - the naming is not always consistent due to the development of the code - the traversing of the shipout box must be tested with more complicated setups - it should probably handle more node types - - + - --]] - - --[[ -the main table is named uftag. It contains the functions and also the data +the main table is named ltx.__tag. It contains the functions and also the data collected during the compilation. -uftag.mc will contain mc connected data. -uftag.struct will contain structure related data. -uftag.page will contain page data -uftag.tables contains also data from mc and struct (from older code). This needs cleaning up. +ltx.__tag.mc will contain mc connected data. +ltx.__tag.struct will contain structure related data. +ltx.__tag.page will contain page data +ltx.__tag.tables contains also data from mc and struct (from older code). This needs cleaning up. There are certainly dublettes, but I don't dare yet ... -uftag.func will contain (public) functions. -uftag.trace will contain tracing/loging functions. +ltx.__tag.func will contain (public) functions. +ltx.__tag.trace will contain tracing/loging functions. local funktions starts with __ +functions meant for users will be in ltx.tag functions - uftag.func.get_num_from (tag): takes a tag (string) and returns the id number - uftag.func.output_num_from (tag): takes a tag (string) and prints (to tex) the id number - uftag.func.get_tag_from (num): takes a num and returns the tag - uftag.func.output_tag_from (num): takes a num and prints (to tex) the tag - uftag.func.store_mc_data (num,key,data): stores key=data in uftag.mc[num] - uftag.func.store_mc_label (label,num): stores label=num in uftag.mc.labels - uftag.func.store_mc_kid (mcnum,kid,page): stores the mc-kids of mcnum on page page - uftag.func.store_mc_in_page(mcnum,mcpagecnt,page): stores in the page table the number of mcnum on this page - uftag.func.store_struct_mcabs (structnum,mcnum): stores relations structnum<->mcnum (abs) - uftag.func.mc_insert_kids (mcnum): inserts the /K entries for mcnum by wandering throught the [kids] table - uftag.func.mark_page_elements(box,mcpagecnt,mccntprev,mcopen,name,mctypeprev) : the main function - uftag.func.mark_shipout (): a wrapper around the core function which inserts the last EMC - uftag.func.fill_parent_tree_line (page): outputs the entries of the parenttree for this page - uftag.func.output_parenttree(): outputs the content of the parenttree - uftag.func.markspaceon(), uftag.func.markspaceoff(): (de)activates the marking of positions for space chars - uftag.trace.show_mc_data (num): shows uftag.mc[num] - uftag.trace.show_all_mc_data (max): shows a maximum about mc's - uftag.trace.show_seq: shows a sequence (array) - uftag.trace.show_struct_data (num): shows data of structure num - uftag.trace.show_prop: shows a prop - uftag.trace.log - uftag.trace.showspaces : boolean + ltx.__tag.func.get_num_from (tag): takes a tag (string) and returns the id number + ltx.__tag.func.output_num_from (tag): takes a tag (string) and prints (to tex) the id number + ltx.__tag.func.get_tag_from (num): takes a num and returns the tag + ltx.__tag.func.output_tag_from (num): takes a num and prints (to tex) the tag + ltx.__tag.func.store_mc_data (num,key,data): stores key=data in ltx.__tag.mc[num] + ltx.__tag.func.store_mc_label (label,num): stores label=num in ltx.__tag.mc.labels + ltx.__tag.func.store_mc_kid (mcnum,kid,page): stores the mc-kids of mcnum on page page + ltx.__tag.func.store_mc_in_page(mcnum,mcpagecnt,page): stores in the page table the number of mcnum on this page + ltx.__tag.func.store_struct_mcabs (structnum,mcnum): stores relations structnum<->mcnum (abs) + ltx.__tag.func.mc_insert_kids (mcnum): inserts the /K entries for mcnum by wandering throught the [kids] table + ltx.__tag.func.mark_page_elements(box,mcpagecnt,mccntprev,mcopen,name,mctypeprev) : the main function + ltx.__tag.func.mark_shipout (): a wrapper around the core function which inserts the last EMC + ltx.__tag.func.fill_parent_tree_line (page): outputs the entries of the parenttree for this page + ltx.__tag.func.output_parenttree(): outputs the content of the parenttree + ltx.__tag.func.markspaceon(), ltx.__tag.func.markspaceoff(): (de)activates the marking of positions for space chars + ltx.__tag.trace.show_mc_data (num): shows ltx.__tag.mc[num] + ltx.__tag.trace.show_all_mc_data (max): shows a maximum about mc's + ltx.__tag.trace.show_seq: shows a sequence (array) + ltx.__tag.trace.show_struct_data (num): shows data of structure num + ltx.__tag.trace.show_prop: shows a prop + ltx.__tag.trace.log + ltx.__tag.trace.showspaces : boolean --]] -local mctypeattributeid = luatexbase.registernumber ("l__uftag_mc_type_attr") -local mccntattributeid = luatexbase.registernumber ("l__uftag_mc_cnt_attr") -local iwspaceattributeid = luatexbase.registernumber ("g__uftag_interwordspace_attr") -local iwfontattributeid = luatexbase.registernumber ("g__uftag_interwordfont_attr") - +local mctypeattributeid = luatexbase.registernumber ("l__tag_mc_type_attr") +local mccntattributeid = luatexbase.registernumber ("l__tag_mc_cnt_attr") +local iwspaceattributeid = luatexbase.registernumber ("g__tag_interwordspace_attr") +local iwfontattributeid = luatexbase.registernumber ("g__tag_interwordfont_attr") local catlatex = luatexbase.registernumber("catcodetable@latex") -local tagunmarkedbool= token.create("g__uftag_tagunmarked_bool") -local truebool = token.create("c_true_bool") +local tagunmarkedbool= token.create("g__tag_tagunmarked_bool") +local truebool = token.create("c_true_bool") -local tableinsert = table.insert +local tableinsert = table.insert -- not all needed, copied from lua-visual-debug. local nodeid = node.id @@ -87,7 +106,7 @@ local nodetraverseid = node.traverse_id local nodetraverse = node.traverse local nodeinsertafter = node.insert_after local nodeinsertbefore = node.insert_before -local pdfpageref = pdf.pageref +local pdfpageref = pdf.pageref local HLIST = node.id("hlist") local VLIST = node.id("vlist") @@ -100,46 +119,43 @@ local PENALTY = node.id("penalty") local LOCAL_PAR = node.id("local_par") local MATH = node.id("math") -local function __uftag_get_mathsubtype (mathnode) +local function __tag_get_mathsubtype (mathnode) if mathnode.subtype == 0 then subtype = "beginmath" - else + else subtype = "endmath" - end + end return subtype -end - - +end -uftag = uftag or { } -uftag.mc = uftag.mc or { } -- mc data -uftag.struct = uftag.struct or { } -- struct data -uftag.tables = uftag.tables or { } -- tables created with new prop and new seq. +ltx = ltx or { } +ltx.__tag = ltx.__tag or { } +ltx.__tag.mc = ltx.__tag.mc or { } -- mc data +ltx.__tag.struct = ltx.__tag.struct or { } -- struct data +ltx.__tag.tables = ltx.__tag.tables or { } -- tables created with new prop and new seq. -- wasn't a so great idea ... -uftag.page = uftag.page or { } -- page data, currently only i->{0->mcnum,1->mcnum,...} -uftag.trace = uftag.trace or { } -- show commands -uftag.func = uftag.func or { } -- functions -uftag.conf = uftag.conf or { } -- configuration variables +ltx.__tag.page = ltx.__tag.page or { } -- page data, currently only i->{0->mcnum,1->mcnum,...} +ltx.__tag.trace = ltx.__tag.trace or { } -- show commands +ltx.__tag.func = ltx.__tag.func or { } -- functions +ltx.__tag.conf = ltx.__tag.conf or { } -- configuration variables -local __uftag_log = +local __tag_log = function (message,loglevel) - if (loglevel or 3) <= tex.count["l__uftag_loglevel_int"] then + if (loglevel or 3) <= tex.count["l__tag_loglevel_int"] then texio.write_nl("tagpdf: ".. message) end - end - -uftag.trace.log = __uftag_log + end +ltx.__tag.trace.log = __tag_log -local __uftag_get_mc_cnt_type_tag = function (n) +local __tag_get_mc_cnt_type_tag = function (n) local mccnt = nodegetattribute(n,mccntattributeid) or -1 local mctype = nodegetattribute(n,mctypeattributeid) or -1 - local tag = uftag.func.get_tag_from(mctype) + local tag = ltx.__tag.func.get_tag_from(mctype) return mccnt,mctype,tag end - -local function __uftag_insert_emc_node (head,current) +local function __tag_insert_emc_node (head,current) local emcnode = nodenew("whatsit","pdf_literal") emcnode.data = "EMC" emcnode.mode=1 @@ -147,8 +163,7 @@ local function __uftag_insert_emc_node (head,current) return head end - -local function __uftag_insert_bmc_node (head,current,tag) +local function __tag_insert_bmc_node (head,current,tag) local bmcnode = nodenew("whatsit","pdf_literal") bmcnode.data = "/"..tag.." BMC" bmcnode.mode=1 @@ -156,7 +171,7 @@ local function __uftag_insert_bmc_node (head,current,tag) return head end -local function __uftag_insert_bdc_node (head,current,tag,dict) +local function __tag_insert_bdc_node (head,current,tag,dict) local bdcnode = nodenew("whatsit","pdf_literal") bdcnode.data = "/"..tag.."<<"..dict..">> BDC" bdcnode.mode=1 @@ -165,9 +180,9 @@ local function __uftag_insert_bdc_node (head,current,tag,dict) end -- this is for debugging the space chars -local function __uftag_show_spacemark (head,current,color,height) +local function __tag_show_spacemark (head,current,color,height) local markcolor = color or "1 0 0" - local markheight = height or 10 + local markheight = height or 10 local pdfstring = node.new("whatsit","pdf_literal") pdfstring.data = string.format("q "..markcolor.." RG "..markcolor.." rg 0.4 w 0 %g m 0 %g l S Q",-3,markheight) @@ -177,9 +192,9 @@ end --[[ a function to mark up places where real space chars should be inserted it only sets an attribute. ---]] +--]] -local function __uftag_mark_spaces (head) +local function __tag_mark_spaces (head) local inside_math = false for n in nodetraverse(head) do local id = n.id @@ -190,31 +205,31 @@ local function __uftag_mark_spaces (head) then nodesetattribute(glyph.next,iwspaceattributeid,1) nodesetattribute(glyph.next,iwfontattributeid,glyph.font) - -- for debugging - if uftag.trace.showspaces then - __uftag_show_spacemark (head,glyph) - end + -- for debugging + if ltx.__tag.trace.showspaces then + __tag_show_spacemark (head,glyph) + end elseif glyph.next and (glyph.next.id==KERN) and not inside_math then local kern = glyph.next - if kern.next and (kern.next.id== GLUE) and (kern.next.width >0) + if kern.next and (kern.next.id== GLUE) and (kern.next.width >0) then nodesetattribute(kern.next,iwspaceattributeid,1) nodesetattribute(kern.next,iwfontattributeid,glyph.font) - end + end end elseif id == PENALTY then local glyph = n - -- uftag.trace.log ("PENALTY ".. n.subtype.."VALUE"..n.penalty,3) + -- ltx.__tag.trace.log ("PENALTY ".. n.subtype.."VALUE"..n.penalty,3) if glyph.next and (glyph.next.id == GLUE) and not inside_math and (glyph.next.width >0) and n.subtype==0 then nodesetattribute(glyph.next,iwspaceattributeid,1) -- nodesetattribute(glyph.next,iwfontattributeid,glyph.font) - -- for debugging - if uftag.trace.showspaces then - __uftag_show_spacemark (head,glyph) - end - end + -- for debugging + if ltx.__tag.trace.showspaces then + __tag_show_spacemark (head,glyph) + end + end elseif id == MATH then inside_math = (n.subtype == 0) end @@ -222,30 +237,30 @@ local function __uftag_mark_spaces (head) return head end -local function __uftag_activate_mark_space () +local function __tag_activate_mark_space () if not luatexbase.in_callback ("pre_linebreak_filter","markspaces") then - luatexbase.add_to_callback("pre_linebreak_filter",__uftag_mark_spaces,"markspaces") - luatexbase.add_to_callback("hpack_filter",__uftag_mark_spaces,"markspaces") - end + luatexbase.add_to_callback("pre_linebreak_filter",__tag_mark_spaces,"markspaces") + luatexbase.add_to_callback("hpack_filter",__tag_mark_spaces,"markspaces") + end end -uftag.func.markspaceon=__uftag_activate_mark_space +ltx.__tag.func.markspaceon=__tag_activate_mark_space -local function __uftag_deactivate_mark_space () +local function __tag_deactivate_mark_space () if luatexbase.in_callback ("pre_linebreak_filter","markspaces") then luatexbase.remove_from_callback("pre_linebreak_filter","markspaces") luatexbase.remove_from_callback("hpack_filter","markspaces") end end -- -uftag.func.markspaceoff=__uftag_deactivate_mark_space +ltx.__tag.func.markspaceoff=__tag_deactivate_mark_space local default_space_char = node.new(GLYPH) local default_fontid = font.id("TU/lmr/m/n/10") default_space_char.char = 32 default_space_char.font = default_fontid -local function __uftag_insert_space_char (head,n,fontid) +local function __tag_insert_space_char (head,n,fontid) if luaotfload.aux.slot_of_name(fontid,"space") then local space -- head, space = node.insert_before(head, n, ) -- Set the right font @@ -258,167 +273,168 @@ end Now follows the core function It wades through the shipout box and checks the attributes ARGUMENTS - box: is a box, + box: is a box, mcpagecnt: num, the current page cnt of mc (should start at -1 in shipout box), needed for recursion mccntprev: num, the attribute cnt of the previous node/whatever - if different we have a chunk border - mcopen: num, records if some bdc/emc is open + mcopen: num, records if some bdc/emc is open These arguments are only needed for log messages, if not present are replaces by fix strings: name: string to describe the box mctypeprev: num, the type attribute of the previous node/whatever - + there are lots of logging messages currently. Should be cleaned up in due course. One should also find ways to make the function shorter. --]] -function uftag.func.mark_page_elements (box,mcpagecnt,mccntprev,mcopen,name,mctypeprev) +function ltx.__tag.func.mark_page_elements (box,mcpagecnt,mccntprev,mcopen,name,mctypeprev) local name = name or ("SOMEBOX") local mctypeprev = mctypeprev or -1 - local abspage = tex.count["g__uftag_abspage_int"] --["c@abspage"] - uftag.trace.log ("PAGE " .. abspage,3) - uftag.trace.log ("FUNC ARGS: pagecnt".. mcpagecnt.." prev "..mccntprev .. " type prev "..mctypeprev,4) - uftag.trace.log ("TRAVERSING BOX ".. tostring(name).." TYPE ".. node.type(node.getid(box)),3) - local head = box.head -- AtBeginShipoutBox is a vlist? + local abspage = status.total_pages + 1 -- the real counter is increased inside the box so one off + -- if the callback is not used. + ltx.__tag.trace.log ("PAGE " .. abspage,3) + ltx.__tag.trace.log ("FUNC ARGS: pagecnt".. mcpagecnt.." prev "..mccntprev .. " type prev "..mctypeprev,4) + ltx.__tag.trace.log ("TRAVERSING BOX ".. tostring(name).." TYPE ".. node.type(node.getid(box)),3) + local head = box.head -- ShipoutBox is a vlist? if head then - mccnthead, mctypehead,taghead = __uftag_get_mc_cnt_type_tag (head) - uftag.trace.log ("HEAD " .. node.type(node.getid(head)).. " MC"..tostring(mccnthead).." => TAG "..tostring(mctypehead).." => "..tostring(taghead),3) + mccnthead, mctypehead,taghead = __tag_get_mc_cnt_type_tag (head) + ltx.__tag.trace.log ("HEAD " .. node.type(node.getid(head)).. " MC"..tostring(mccnthead).." => TAG "..tostring(mctypehead).." => "..tostring(taghead),3) else - uftag.trace.log ("HEAD is ".. tostring(head),3) - end + ltx.__tag.trace.log ("HEAD is ".. tostring(head),3) + end for n in node.traverse(head) do - local mccnt, mctype, tag = __uftag_get_mc_cnt_type_tag (n) + local mccnt, mctype, tag = __tag_get_mc_cnt_type_tag (n) local spaceattr = nodegetattribute(n,iwspaceattributeid) or -1 - uftag.trace.log ("NODE ".. node.type(node.getid(n)).." MC"..tostring(mccnt).." => TAG "..tostring(mctype).." => " .. tostring(tag),3) + ltx.__tag.trace.log ("NODE ".. node.type(node.getid(n)).." MC"..tostring(mccnt).." => TAG "..tostring(mctype).." => " .. tostring(tag),3) if n.id == HLIST then -- enter the hlist - mcopen,mcpagecnt,mccntprev,mctypeprev= - uftag.func.mark_page_elements (n,mcpagecnt,mccntprev,mcopen,"INTERNAL HLIST",mctypeprev) - elseif n.id == VLIST then -- enter the vlist - mcopen,mcpagecnt,mccntprev,mctypeprev= - uftag.func.mark_page_elements (n,mcpagecnt,mccntprev,mcopen,"INTERNAL VLIST",mctypeprev) - elseif n.id == GLUE then -- at glue real space chars are inserted, for the rest it is ignored - -- for debugging - if uftag.trace.showspaces and spaceattr==1 then - __uftag_show_spacemark (head,n,"0 1 0") + mcopen,mcpagecnt,mccntprev,mctypeprev= + ltx.__tag.func.mark_page_elements (n,mcpagecnt,mccntprev,mcopen,"INTERNAL HLIST",mctypeprev) + elseif n.id == VLIST then -- enter the vlist + mcopen,mcpagecnt,mccntprev,mctypeprev= + ltx.__tag.func.mark_page_elements (n,mcpagecnt,mccntprev,mcopen,"INTERNAL VLIST",mctypeprev) + elseif n.id == GLUE then -- at glue real space chars are inserted, for the rest it is ignored + -- for debugging + if ltx.__tag.trace.showspaces and spaceattr==1 then + __tag_show_spacemark (head,n,"0 1 0") end - if spaceattr==1 then + if spaceattr==1 then local space local space_char = node.copy(default_space_char) - local curfont = nodegetattribute(n,iwfontattributeid) - uftag.trace.log ("FONT ".. tostring(curfont),3) + local curfont = nodegetattribute(n,iwfontattributeid) + ltx.__tag.trace.log ("FONT ".. tostring(curfont),3) if curfont and luaotfload.aux.slot_of_name(curfont,"space") then space_char.font=curfont end - head, space = node.insert_before(head, n, space_char) -- + head, space = node.insert_before(head, n, space_char) -- n.width = n.width - space.width space.attr = n.attr end - elseif n.id == LOCAL_PAR then -- local_par is ignored + elseif n.id == LOCAL_PAR then -- local_par is ignored elseif n.id == PENALTY then -- penalty is ignored - elseif n.id == KERN then -- kern is ignored - uftag.trace.log ("SUBTYPE KERN ".. n.subtype,3) + elseif n.id == KERN then -- kern is ignored + ltx.__tag.trace.log ("SUBTYPE KERN ".. n.subtype,3) else - -- math is currently only logged. + -- math is currently only logged. -- we could mark the whole as math -- for inner processing the mlist_to_hlist callback is probably needed. - if n.id == MATH then - uftag.trace.log("NODE "..node.type(node.getid(n)).." "..__uftag_get_mathsubtype(n),3) + if n.id == MATH then + ltx.__tag.trace.log("NODE "..node.type(node.getid(n)).." "..__tag_get_mathsubtype(n),3) end -- endmath - uftag.trace.log("CURRENT "..mccnt.." PREV "..mccntprev,3) + ltx.__tag.trace.log("CURRENT "..mccnt.." PREV "..mccntprev,3) if mccnt~=mccntprev then -- a new mc chunk - uftag.trace.log ("NODE ".. node.type(node.getid(n)).." MC"..tostring(mccnt).." <=> PREVIOUS "..tostring(mccntprev),3) + ltx.__tag.trace.log ("NODE ".. node.type(node.getid(n)).." MC"..tostring(mccnt).." <=> PREVIOUS "..tostring(mccntprev),3) if mcopen~=0 then -- there is a chunk open, close it (hope there is only one ... - box.list=__uftag_insert_emc_node (box.list,n) + box.list=__tag_insert_emc_node (box.list,n) mcopen = mcopen - 1 - uftag.trace.log ("INSERT EMC " .. mcpagecnt .. " MCOPEN = " .. mcopen,2) + ltx.__tag.trace.log ("INSERT EMC " .. mcpagecnt .. " MCOPEN = " .. mcopen,2) if mcopen ~=0 then - uftag.trace.log ("!WARNING! open mc" .. " MCOPEN = " .. mcopen,1) - end - end - if uftag.mc[mccnt] then - if uftag.mc[mccnt]["artifact"] then - uftag.trace.log("THIS IS AN ARTIFACT of type "..tostring(uftag.mc[mccnt]["artifact"]),3) - if uftag.mc[mccnt]["artifact"] == "" then - box.list = __uftag_insert_bmc_node (box.list,n,"Artifact") + ltx.__tag.trace.log ("!WARNING! open mc" .. " MCOPEN = " .. mcopen,1) + end + end + if ltx.__tag.mc[mccnt] then + if ltx.__tag.mc[mccnt]["artifact"] then + ltx.__tag.trace.log("THIS IS AN ARTIFACT of type "..tostring(ltx.__tag.mc[mccnt]["artifact"]),3) + if ltx.__tag.mc[mccnt]["artifact"] == "" then + box.list = __tag_insert_bmc_node (box.list,n,"Artifact") else - box.list = __uftag_insert_bdc_node (box.list,n,"Artifact", "/Type /"..uftag.mc[mccnt]["artifact"]) + box.list = __tag_insert_bdc_node (box.list,n,"Artifact", "/Type /"..ltx.__tag.mc[mccnt]["artifact"]) end else - uftag.trace.log("THIS IS A TAG "..tostring(tag),3) + ltx.__tag.trace.log("THIS IS A TAG "..tostring(tag),3) mcpagecnt = mcpagecnt +1 - uftag.trace.log ("INSERT BDC "..mcpagecnt,2) + ltx.__tag.trace.log ("INSERT BDC "..mcpagecnt,2) local dict= "/MCID "..mcpagecnt - if uftag.mc[mccnt]["raw"] then - uftag.trace.log("RAW CONTENT"..tostring(uftag.mc[mccnt]["raw"]),3) - dict= dict .. " " .. uftag.mc[mccnt]["raw"] - end - if uftag.mc[mccnt]["alt"] then - uftag.trace.log("RAW CONTENT"..tostring(uftag.mc[mccnt]["alt"]),3) - dict= dict .. " " .. uftag.mc[mccnt]["alt"] - end - if uftag.mc[mccnt]["actualtext"] then - uftag.trace.log("RAW CONTENT"..tostring(uftag.mc[mccnt]["actualtext"]),3) - dict= dict .. " " .. uftag.mc[mccnt]["actualtext"] - end - box.list = __uftag_insert_bdc_node (box.list,n,tag, dict) - uftag.func.store_mc_kid (mccnt,mcpagecnt,abspage) - uftag.func.store_mc_in_page(mccnt,mcpagecnt,abspage) - uftag.trace.show_mc_data (mccnt) - end + if ltx.__tag.mc[mccnt]["raw"] then + ltx.__tag.trace.log("RAW CONTENT"..tostring(ltx.__tag.mc[mccnt]["raw"]),3) + dict= dict .. " " .. ltx.__tag.mc[mccnt]["raw"] + end + if ltx.__tag.mc[mccnt]["alt"] then + ltx.__tag.trace.log("RAW CONTENT"..tostring(ltx.__tag.mc[mccnt]["alt"]),3) + dict= dict .. " " .. ltx.__tag.mc[mccnt]["alt"] + end + if ltx.__tag.mc[mccnt]["actualtext"] then + ltx.__tag.trace.log("RAW CONTENT"..tostring(ltx.__tag.mc[mccnt]["actualtext"]),3) + dict= dict .. " " .. ltx.__tag.mc[mccnt]["actualtext"] + end + box.list = __tag_insert_bdc_node (box.list,n,tag, dict) + ltx.__tag.func.store_mc_kid (mccnt,mcpagecnt,abspage) + ltx.__tag.func.store_mc_in_page(mccnt,mcpagecnt,abspage) + ltx.__tag.trace.show_mc_data (mccnt) + end mcopen = mcopen + 1 else - uftag.trace.log("THIS HAS NOT BEEN TAGGED",1) - -- perhaps code that tag a artifact can be added ... + ltx.__tag.trace.log("THIS HAS NOT BEEN TAGGED",1) + -- perhaps code that tag a artifact can be added ... if tagunmarkedbool.mode == truebool.mode then - box.list = __uftag_insert_bmc_node (box.list,n,"Artifact") - end - mcopen = mcopen + 1 + box.list = __tag_insert_bmc_node (box.list,n,"Artifact") + mcopen = mcopen + 1 + end end mccntprev = mccnt - end + end end -- end if end -- end for if head then - mccnthead, mctypehead,taghead = __uftag_get_mc_cnt_type_tag (head) - uftag.trace.log ("ENDHEAD " .. node.type(node.getid(head)).. " MC"..tostring(mccnthead).." => TAG "..tostring(mctypehead).." => "..tostring(taghead),3) + mccnthead, mctypehead,taghead = __tag_get_mc_cnt_type_tag (head) + ltx.__tag.trace.log ("ENDHEAD " .. node.type(node.getid(head)).. " MC"..tostring(mccnthead).." => TAG "..tostring(mctypehead).." => "..tostring(taghead),3) else - uftag.trace.log ("ENDHEAD is ".. tostring(head),3) - end - uftag.trace.log ("QUITTING TRAVERSING BOX ".. tostring(name).." TYPE ".. node.type(node.getid(box)),3) + ltx.__tag.trace.log ("ENDHEAD is ".. tostring(head),3) + end + ltx.__tag.trace.log ("QUITTING TRAVERSING BOX ".. tostring(name).." TYPE ".. node.type(node.getid(box)),3) return mcopen,mcpagecnt,mccntprev,mctypeprev -end +end -function uftag.func.mark_shipout () - mcopen = uftag.func.mark_page_elements (tex.box["AtBeginShipoutBox"],-1,-100,0,"Shipout",-1) +function ltx.__tag.func.mark_shipout (box) + mcopen = ltx.__tag.func.mark_page_elements (box,-1,-100,0,"Shipout",-1) if mcopen~=0 then -- there is a chunk open, close it (hope there is only one ... local emcnode = nodenew("whatsit","pdf_literal") - local box = tex.box["AtBeginShipoutBox"].list + local list = box.list emcnode.data = "EMC" emcnode.mode=1 - if box then - box = node.insert_after (box,node.tail(box),emcnode) + if list then + list = node.insert_after (list,node.tail(list),emcnode) mcopen = mcopen - 1 - uftag.trace.log ("INSERT LAST EMC, MCOPEN = " .. mcopen,2) + ltx.__tag.trace.log ("INSERT LAST EMC, MCOPEN = " .. mcopen,2) else - uftag.trace.log ("UPS ",1) + ltx.__tag.trace.log ("UPS ",1) end if mcopen ~=0 then - uftag.trace.log ("!WARNING! open mc" .. " MCOPEN = " .. mcopen,1) - end + ltx.__tag.trace.log ("!WARNING! open mc" .. " MCOPEN = " .. mcopen,1) + end end end -function uftag.trace.show_seq (seq) +function ltx.__tag.trace.show_seq (seq) if (type(seq) == "table") then - for i,v in ipairs(seq) do - __uftag_log ("[" .. i .. "] => " .. tostring(v),1) - end - else - __uftag_log ("sequence " .. tostring(seq) .. " not found",1) - end -end - -local __uftag_pairs_prop = + for i,v in ipairs(seq) do + __tag_log ("[" .. i .. "] => " .. tostring(v),1) + end + else + __tag_log ("sequence " .. tostring(seq) .. " not found",1) + end +end + +local __tag_pairs_prop = function (prop) local a = {} for n in pairs(prop) do tableinsert(a, n) end @@ -433,201 +449,202 @@ local __uftag_pairs_prop = return iter end - -function uftag.trace.show_prop (prop) +function ltx.__tag.trace.show_prop (prop) if (type(prop) == "table") then - for i,v in __uftag_pairs_prop (prop) do - __uftag_log ("[" .. i .. "] => " .. tostring(v),1) - end - else - __uftag_log ("prop " .. tostring(prop) .. " not found or not a table",1) - end - end - + for i,v in __tag_pairs_prop (prop) do + __tag_log ("[" .. i .. "] => " .. tostring(v),1) + end + else + __tag_log ("prop " .. tostring(prop) .. " not found or not a table",1) + end + end -local __uftag_get_num_from = +local __tag_get_num_from = function (tag) - if uftag.tables["g__uftag_role_tags_prop"][tag] then - a= uftag.tables["g__uftag_role_tags_prop"][tag] + if ltx.__tag.tables["g__tag_role_tags_prop"][tag] then + a= ltx.__tag.tables["g__tag_role_tags_prop"][tag] else - a= -1 + a= -1 end - return a - end - -uftag.func.get_num_from = __uftag_get_num_from + return a + end + +ltx.__tag.func.get_num_from = __tag_get_num_from -function uftag.func.output_num_from (tag) - local num = __uftag_get_num_from (tag) +function ltx.__tag.func.output_num_from (tag) + local num = __tag_get_num_from (tag) tex.sprint(catlatex,num) if num == -1 then - __uftag_log ("Unknown tag "..tag.." used") + __tag_log ("Unknown tag "..tag.." used") end -end - -local __uftag_get_tag_from = +end + +local __tag_get_tag_from = function (num) - if uftag.tables["g__uftag_role_tags_seq"][num] then - a = uftag.tables["g__uftag_role_tags_seq"][num] + if ltx.__tag.tables["g__tag_role_tags_seq"][num] then + a = ltx.__tag.tables["g__tag_role_tags_seq"][num] else a= "UNKNOWN" end return a end -uftag.func.get_tag_from = __uftag_get_tag_from +ltx.__tag.func.get_tag_from = __tag_get_tag_from -function uftag.func.output_tag_from (num) - tex.sprint(catlatex,__uftag_get_tag_from (num)) -end +function ltx.__tag.func.output_tag_from (num) + tex.sprint(catlatex,__tag_get_tag_from (num)) +end -function uftag.func.store_mc_data (num,key,data) - uftag.mc[num] = uftag.mc[num] or { } - uftag.mc[num][key] = data - __uftag_log ("storing mc"..num..": "..tostring(key).."=>"..tostring(data)) +function ltx.__tag.func.store_mc_data (num,key,data) + ltx.__tag.mc[num] = ltx.__tag.mc[num] or { } + ltx.__tag.mc[num][key] = data + __tag_log ("storing mc"..num..": "..tostring(key).."=>"..tostring(data)) end -function uftag.trace.show_mc_data (num) - if uftag and uftag.mc and uftag.mc[num] then - for k,v in pairs(uftag.mc[num]) do - __uftag_log ("mc"..num..": "..tostring(k).."=>"..tostring(v),3) +function ltx.__tag.trace.show_mc_data (num) + if ltx.__tag and ltx.__tag.mc and ltx.__tag.mc[num] then + for k,v in pairs(ltx.__tag.mc[num]) do + __tag_log ("mc"..num..": "..tostring(k).."=>"..tostring(v),3) end - if uftag.mc[num]["kids"] then - __uftag_log ("mc" .. num .. " has " .. #uftag.mc[num]["kids"] .. " kids",3) - for k,v in ipairs(uftag.mc[num]["kids"]) do - __uftag_log ("mc ".. num .. " kid "..k.." =>" .. v.kid.." on page " ..v.page,3) + if ltx.__tag.mc[num]["kids"] then + __tag_log ("mc" .. num .. " has " .. #ltx.__tag.mc[num]["kids"] .. " kids",3) + for k,v in ipairs(ltx.__tag.mc[num]["kids"]) do + __tag_log ("mc ".. num .. " kid "..k.." =>" .. v.kid.." on page " ..v.page,3) end end else - __uftag_log ("mc"..num.." not found",3) + __tag_log ("mc"..num.." not found",3) end end -function uftag.trace.show_all_mc_data (max) - for i = 1, max do - uftag.trace.show_mc_data (i) +function ltx.__tag.trace.show_all_mc_data (max) + for i = 1, max do + ltx.__tag.trace.show_mc_data (i) end -end - +end -function uftag.func.store_mc_label (label,num) - uftag.mc["labels"] = uftag.mc["labels"] or { } - uftag.mc.labels[label] = num +function ltx.__tag.func.store_mc_label (label,num) + ltx.__tag.mc["labels"] = ltx.__tag.mc["labels"] or { } + ltx.__tag.mc.labels[label] = num end -function uftag.func.store_mc_kid (mcnum,kid,page) - uftag.trace.log("MC"..mcnum.." STORING KID" .. kid.." on page " .. page,3) - uftag.mc[mcnum]["kids"] = uftag.mc[mcnum]["kids"] or { } +function ltx.__tag.func.store_mc_kid (mcnum,kid,page) + ltx.__tag.trace.log("MC"..mcnum.." STORING KID" .. kid.." on page " .. page,3) + ltx.__tag.mc[mcnum]["kids"] = ltx.__tag.mc[mcnum]["kids"] or { } local kidtable = {kid=kid,page=page} - tableinsert(uftag.mc[mcnum]["kids"], kidtable ) + tableinsert(ltx.__tag.mc[mcnum]["kids"], kidtable ) end - -function uftag.func.mc_num_of_kids (mcnum) +function ltx.__tag.func.mc_num_of_kids (mcnum) local num = 0 - if uftag.mc[mcnum] and uftag.mc[mcnum]["kids"] then - num = #uftag.mc[mcnum]["kids"] + if ltx.__tag.mc[mcnum] and ltx.__tag.mc[mcnum]["kids"] then + num = #ltx.__tag.mc[mcnum]["kids"] end - uftag.trace.log ("MC" .. mcnum .. "has " .. num .. "KIDS",4) + ltx.__tag.trace.log ("MC" .. mcnum .. "has " .. num .. "KIDS",4) return num end - -function uftag.func.mc_insert_kids (mcnum,single) - if uftag.mc[mcnum] then - uftag.trace.log("MC-KIDS test " .. mcnum,4) - if uftag.mc[mcnum]["kids"] then - if #uftag.mc[mcnum]["kids"] > 1 and single==1 then + +function ltx.__tag.func.mc_insert_kids (mcnum,single) + if ltx.__tag.mc[mcnum] then + ltx.__tag.trace.log("MC-KIDS test " .. mcnum,4) + if ltx.__tag.mc[mcnum]["kids"] then + if #ltx.__tag.mc[mcnum]["kids"] > 1 and single==1 then tex.sprint("[") - end - for i,kidstable in ipairs( uftag.mc[mcnum]["kids"] ) do + end + for i,kidstable in ipairs( ltx.__tag.mc[mcnum]["kids"] ) do local kidnum = kidstable["kid"] local kidpage = kidstable["page"] local kidpageobjnum = pdfpageref(kidpage) - uftag.trace.log("MC" .. mcnum .. " insert KID " ..i.. " with num " .. kidnum .. " on page " .. kidpage.."/"..kidpageobjnum,3) + ltx.__tag.trace.log("MC" .. mcnum .. " insert KID " ..i.. " with num " .. kidnum .. " on page " .. kidpage.."/"..kidpageobjnum,3) tex.sprint(catlatex,"<</Type /MCR /Pg "..kidpageobjnum .. " 0 R /MCID "..kidnum.. ">> " ) - end - if #uftag.mc[mcnum]["kids"] > 1 and single==1 then + end + if #ltx.__tag.mc[mcnum]["kids"] > 1 and single==1 then tex.sprint("]") - end + end else - uftag.trace.log("WARN! MC"..mcnum.." has no kids",0) + ltx.__tag.trace.log("WARN! MC"..mcnum.." has no kids",0) + if single==1 then + tex.sprint("null") + end end else - uftag.trace.log("WARN! MC"..mcnum.." doesn't exist",0) + ltx.__tag.trace.log("WARN! MC"..mcnum.." doesn't exist",0) end end - -function uftag.func.store_struct_mcabs (structnum,mcnum) - uftag.struct[structnum]=uftag.struct[structnum] or { } - uftag.struct[structnum]["mc"]=uftag.struct[structnum]["mc"] or { } +function ltx.__tag.func.store_struct_mcabs (structnum,mcnum) + ltx.__tag.struct[structnum]=ltx.__tag.struct[structnum] or { } + ltx.__tag.struct[structnum]["mc"]=ltx.__tag.struct[structnum]["mc"] or { } -- a structure can contain more than on mc chunk, the content should be ordered - tableinsert(uftag.struct[structnum]["mc"],mcnum) - uftag.trace.log("MCNUM "..mcnum.." insert in struct "..structnum,3) + tableinsert(ltx.__tag.struct[structnum]["mc"],mcnum) + ltx.__tag.trace.log("MCNUM "..mcnum.." insert in struct "..structnum,3) -- but every mc can only be in one structure - uftag.mc[mcnum]= uftag.mc[mcnum] or { } - uftag.mc[mcnum]["parent"] = structnum -end - -function uftag.trace.show_struct_data (num) - if uftag and uftag.struct and uftag.struct[num] then - for k,v in ipairs(uftag.struct[num]) do - __uftag_log ("struct "..num..": "..tostring(k).."=>"..tostring(v)) + ltx.__tag.mc[mcnum]= ltx.__tag.mc[mcnum] or { } + ltx.__tag.mc[mcnum]["parent"] = structnum +end + +function ltx.__tag.trace.show_struct_data (num) + if ltx.__tag and ltx.__tag.struct and ltx.__tag.struct[num] then + for k,v in ipairs(ltx.__tag.struct[num]) do + __tag_log ("struct "..num..": "..tostring(k).."=>"..tostring(v)) end - else - __uftag_log ("struct "..num.." not found ") - end + else + __tag_log ("struct "..num.." not found ") + end end -- pay attention: lua counts arrays from 1, tex pages from one --- mcid and arrays in pdf count from 0. -function uftag.func.store_mc_in_page (mcnum,mcpagecnt,page) - uftag.page[page] = uftag.page[page] or {} - uftag.page[page][mcpagecnt] = mcnum - uftag.trace.log("PAGE " .. page .. ": inserting MCID " .. mcpagecnt .. " => " .. mcnum,3) +-- mcid and arrays in pdf count from 0. +function ltx.__tag.func.store_mc_in_page (mcnum,mcpagecnt,page) + ltx.__tag.page[page] = ltx.__tag.page[page] or {} + ltx.__tag.page[page][mcpagecnt] = mcnum + ltx.__tag.trace.log("PAGE " .. page .. ": inserting MCID " .. mcpagecnt .. " => " .. mcnum,3) end -function uftag.func.fill_parent_tree_line (page) - -- we need to get page-> i=kid -> mcnum -> structnum +function ltx.__tag.func.fill_parent_tree_line (page) + -- we need to get page-> i=kid -> mcnum -> structnum -- pay attention: the kid numbers and the page number in the parent tree start with 0! local numsentry ="" local pdfpage = page-1 - if uftag.page[page] and uftag.page[page][0] then - mcchunks=#uftag.page[page] - uftag.trace.log("PAGETREE PAGE "..page.." has "..mcchunks.."+1 Elements ",3) + if ltx.__tag.page[page] and ltx.__tag.page[page][0] then + mcchunks=#ltx.__tag.page[page] + ltx.__tag.trace.log("PAGETREE PAGE "..page.." has "..mcchunks.."+1 Elements ",3) for i=0,mcchunks do - uftag.trace.log("PAGETREE CHUNKS "..uftag.page[page][i],3) + ltx.__tag.trace.log("PAGETREE CHUNKS "..ltx.__tag.page[page][i],3) end - if mcchunks == 0 then + if mcchunks == 0 then -- only one chunk so no need for an array - local mcnum = uftag.page[page][0] - local structnum = uftag.mc[mcnum]["parent"] - local propname = "g__uftag_struct_"..structnum.."_prop" - local objnum = uftag.tables[propname]["objnum"] or "XXXX" - texio.write_nl("=====>"..tostring(objnum)) - numsentry = pdfpage .. " ".. objnum .. " 0 R" - uftag.trace.log("PAGETREE PAGE" .. page.. " NUM ENTRY = ".. numsentry,3) + local mcnum = ltx.__tag.page[page][0] + local structnum = ltx.__tag.mc[mcnum]["parent"] + local propname = "g__tag_struct_"..structnum.."_prop" + local objref = ltx.__tag.tables[propname]["objref"] or "XXXX" + texio.write_nl("=====>"..tostring(objref)) + numsentry = pdfpage .. " [".. objref .. "]" + ltx.__tag.trace.log("PAGETREE PAGE" .. page.. " NUM ENTRY = ".. numsentry,3) else numsentry = pdfpage .. " [" for i=0,mcchunks do - local mcnum = uftag.page[page][i] - local structnum = uftag.mc[mcnum]["parent"] or 0 - local propname = "g__uftag_struct_"..structnum.."_prop" - local objnum = uftag.tables[propname]["objnum"] or "XXXX" - numsentry = numsentry .. " ".. objnum .. " 0 R" + local mcnum = ltx.__tag.page[page][i] + local structnum = ltx.__tag.mc[mcnum]["parent"] or 0 + local propname = "g__tag_struct_"..structnum.."_prop" + local objref = ltx.__tag.tables[propname]["objref"] or "XXXX" + numsentry = numsentry .. " ".. objref end numsentry = numsentry .. "] " - uftag.trace.log("PAGETREE PAGE" .. page.. " NUM ENTRY = ".. numsentry,3) - end + ltx.__tag.trace.log("PAGETREE PAGE" .. page.. " NUM ENTRY = ".. numsentry,3) + end else - uftag.trace.log ("PAGETREE: NO DATA FOR PAGE "..page,3) + ltx.__tag.trace.log ("PAGETREE: NO DATA FOR PAGE "..page,3) end - return numsentry + return numsentry end -function uftag.func.output_parenttree (abspage) +function ltx.__tag.func.output_parenttree (abspage) for i=1,abspage do - line = uftag.func.fill_parent_tree_line (i) .. "^^J" + line = ltx.__tag.func.fill_parent_tree_line (i) .. "^^J" tex.sprint(catlatex,line) end end + +-- +-- End of File `tagpdf.lua'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty index 4163494d313..71daeab6935 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty @@ -1,179 +1,247 @@ -\RequirePackage{expl3}[2019/07/01] -%\RequirePackage[enable-debug]{expl3}[2018/06/14] +%% +%% This is file `tagpdf.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tagpdf.dtx (with options: `package') +%% +%% Copyright (C) 2019 Ulrike Fischer +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% This file is part of the "tagpdf bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: tagpdf.dtx +\ProvidesExplPackage {tagpdf} {2021/02/23} {0.80} + { A package to experiment with pdf tagging } + +\bool_if:nF + { + \bool_lazy_and_p:nn + {\cs_if_exist_p:N \pdfmanagement_if_active_p:} + { \pdfmanagement_if_active_p: } + } + { %error for now, perhaps warning later. + \PackageError{tagpdf} + { + PDF~resource~management~is~no~active!\MessageBreak + tagpdf~will~no~work. + } + { + Activate~it~with \MessageBreak + \string\RequirePackage{pdfmanagement-testphase}\MessageBreak + \string\DeclareDocumentMetadata{<options>}\MessageBreak + before~\string\documentclass + } + } -\ProvidesExplPackage {tagpdf} {2019/07/02} {0.61} - {A package to experiment with pdf tagging} -%\debug_on:n{check-declarations,check-expressions,deprecation} -%map internal tag to package name \prop_if_exist:NT \g_msg_module_name_prop - { - \prop_gput:Nnn \g_msg_module_name_prop { uftag }{ tagpdf } - } + { + \prop_gput:Nnn \g_msg_module_name_prop { tag }{ tagpdf } + } -% storing internal names to my name space: -\cs_set_eq:NN \__uftag_tex_pdffeedback:D \tex_pdffeedback:D -\cs_set_eq:NN \__uftag_tex_pdfextension:D \tex_pdfextension:D -\cs_set_eq:NN \__uftag_tex_immediate:D \tex_immediate:D -\cs_set_eq:NN \__uftag_tex_pdfvariable:D \tex_pdfvariable:D -\cs_set_eq:NN \__uftag_tex_global:D \tex_global:D -\cs_set_eq:NN \__uftag_tex_the:D \tex_the:D -\cs_set_eq:NN \__uftag_tex_pdfliteral:D \tex_pdfliteral:D -\cs_set_eq:NN \__uftag_tex_pdfcatalog:D \tex_pdfcatalog:D -\cs_set_eq:NN \__uftag_tex_pdflastobj:D \tex_pdflastobj:D -\cs_set_eq:NN \__uftag_tex_pdfobj:D \tex_pdfobj:D -\cs_set_eq:NN \__uftag_tex_pdfpageattr:D \tex_pdfpageattr:D -\cs_set_eq:NN \__uftag_tex_pdfpagesattr:D \tex_pdfpagesattr:D -\cs_set_eq:NN \__uftag_tex_pdfpageref:D \tex_pdfpageref:D -\cs_set_eq:NN \__uftag_tex_pdfcompresslevel:D \tex_pdfcompresslevel:D -\cs_set_eq:NN \__uftag_tex_pdfobjcompresslevel:D \tex_pdfobjcompresslevel:D +\cs_set_eq:NN \__tag_tex_global:D \tex_global:D %%% package options -\bool_new:N\g__uftag_mode_lua_bool +\bool_new:N\g__tag_mode_lua_bool -\DeclareOption{luamode} { \sys_if_engine_luatex:T { \bool_gset_true:N \g__uftag_mode_lua_bool } } -\DeclareOption{genericmode}{ \bool_gset_false:N\g__uftag_mode_lua_bool } +\DeclareOption {luamode} { \sys_if_engine_luatex:T { \bool_gset_true:N \g__tag_mode_lua_bool } } +\DeclareOption {genericmode}{ \bool_gset_false:N\g__tag_mode_lua_bool } \ExecuteOptions{luamode} \ProcessOptions %%% some packages -\RequirePackage{xparse} -\RequirePackage{atbegshi} -\RequirePackage{zref-base,zref-lastpage} -\RequirePackage{etoolbox} -\RequirePackage{l3pdf} -%\RequirePackage{pdfescape} %check if needed -%\RequirePackage{pdftexcmds}%check if needed (expandable commands!) - -%\RequirePackage{l3str-convert} -\cs_generate_variant:Nn \str_set_convert:Nnnn {Nonn, Noon, Nnon } - +\RequirePackage{l3ref-tmp} + %================ + % temporary code + % =============== + % faking the LastPage label: + \cs_new_protected:Npn \__tag_lastpagelabel: + { + \legacy_if:nT { @filesw } + { + \exp_args:NNnx \exp_args:NNx\iow_now:Nn \@auxout + { + \token_to_str:N \newlabeldata + {__tag_LastPage} + { + {abspage} { \int_use:N \g_shipout_readonly_int} + {tagmcabs}{ \int_use:N \c@g__tag_MCID_abs_int } + } + } + } + } -%%% absolute page numbers -\int_new:N \g__uftag_abspage_int -\int_gset:Nn \g__uftag_abspage_int { 0 } -\zref@newlist {uftagzrl} %zrl=zreflist -\zref@newprop*{tagabspage} [0] { \int_use:N \g__uftag_abspage_int } -\zref@addprop {uftagzrl} {tagabspage} + \AddToHook{enddocument/afterlastpage} + {\__tag_lastpagelabel:} + % a command to override the general default. See issue in ref + \cs_if_exist:NF \ref_value:nnn + { + \cs_new:Npn \ref_value:nnn #1#2#3 + { + \exp_args:Nee + \__ref_value:nnn + { \tl_to_str:n {#1} } { \tl_to_str:n {#2} } {#3} + } + \cs_new:Npn \__ref_value:nnn #1#2#3 + { + \tl_if_exist:cTF { g__ref_label_ #1 _ #2 _tl } + { \tl_use:c { g__ref_label_ #1 _ #2 _tl } } + { + % test if attribute exist at all? + #3 + } + } + } -%%% tagpdfsetup, -%%% TODO: checks need to be improved -\int_new:N \l__uftag_loglevel_int -\tl_new:N \l__uftag_tree_tabs_order_tl - -\keys_define:nn { uftag / setup } -{ - activate-mc .bool_gset:N = \g_uftag_active_mc_bool, - activate-tree .bool_gset:N = \g_uftag_active_tree_bool, - activate-struct .bool_gset:N = \g_uftag_active_struct_bool, - activate-all .meta:n ={activate-mc,activate-tree,activate-struct}, - check-tags .bool_gset:N = \g__uftag_check_tags_bool, - check-tags .initial:n = true, - log .choice:, - log / none .code:n = {\int_set:Nn \l__uftag_loglevel_int { 0 }}, - log / v .code:n = {\int_set:Nn \l__uftag_loglevel_int { 1 }}, - log / vv .code:n = {\int_set:Nn \l__uftag_loglevel_int { 2 }}, - log / vvv .code:n = {\int_set:Nn \l__uftag_loglevel_int { 3 }}, - log / all .code:n = {\int_set:Nn \l__uftag_loglevel_int { 10 }}, - tagunmarked .bool_gset:N = \g__uftag_tagunmarked_bool, - tagunmarked .initial:n = true, - tabsorder .choice:, - tabsorder / row .code:n = {\tl_set:Nn \l__uftag_tree_tabs_order_tl {/Tabs/R}}, - tabsorder / column .code:n = {\tl_set:Nn \l__uftag_tree_tabs_order_tl {/Tabs/C}}, - tabsorder / structure .code:n = {\tl_set:Nn \l__uftag_tree_tabs_order_tl {/Tabs/S}}, - tabsorder / none .code:n = {\tl_set:Nn \l__uftag_tree_tabs_order_tl {}}, - tabsorder .initial:n = structure, - uncompress .code:n = {\pdf_uncompress: }, - inputencoding .code:n = + %============= + % attributes + %============= +\ref_attribute_gset:nnnn {tagstruct} {0}{now} { \int_use:N \c@g__tag_struct_abs_int } +\ref_attribute_gset:nnnn {tagstructobj} {}{now} + { + \exp_args:Ne + \pdf_object_if_exist:nT {c__tag_struct_ \int_use:N \c@g__tag_struct_abs_int _obj} + { + \pdf_object_ref:e{c__tag_struct_ \int_use:N \c@g__tag_struct_abs_int _obj} + } + } + % replace by abspage?? +\ref_attribute_gset:nnnn {tagabspage}{0}{shipout}{ \int_use:N \g_shipout_readonly_int } +\ref_attribute_gset:nnnn {tagmcabs } {0}{now} { \int_use:N \c@g__tag_MCID_abs_int } +\ref_attribute_gset:nnnn {tagmcid } {0}{now} { \int_use:N \g__tag_MCID_tmp_bypage_int } +\clist_const:Nn \c__tag_refmc_clist {tagabspage,tagmcabs,tagmcid} %mc is new!! +\clist_const:Nn \c__tag_refstruct_clist {tagstruct,tagstructobj} +\cs_generate_variant:Nn \ref_label:nn { nv } +\cs_new_protected:Npn \__tag_ref_label:nn #1 #2 %#1 label, #2 name of list mc or struct + { + \@bsphack + \ref_label:nv {#1}{c__tag_ref#2_clist} + \@esphack + } +\cs_new:Npn \__tag_ref_value:nnn #1 #2 #3 %#1 label, #2 attribute, #3 default + { + \ref_value:nnn {#1}{#2}{#3} + } +\cs_new:Npn \__tag_ref_value_lastpage:nn #1 #2 { - \sys_if_engine_pdftex:T - { \tl_gset:Nn \g__uftag_inputencoding_tl { #1 } } - }, -} + \ref_value:nnn {__tag_LastPage}{#1}{#2} + } -% escape commands are a bit engine specific so have been moved to the backend files. -% commands to escape strings so that they can be safely used in pdf -% currently not much used. But will be needed later, when alt and actualtext are added. -% we probably need the equivalent \pdfescapestring, \pdfescapename \pdfescapehex -% the commands of pdfescape adds an additional layout to allow for babel shorthands -%\cs_set_eq:NN \__uftag_pdf_escape_string:Nn \EdefEscapeString -%\cs_set_eq:NN \__uftag_pdf_escape_name:Nn \EdefEscapeName -%\cs_set_eq:NN \__uftag_pdf_escape_hex:Nn \EdefEscapeHex +\cs_generate_variant:Nn \__tag_ref_label:nn {en} +\cs_generate_variant:Nn \__tag_ref_value:nnn {enn} -%\cs_set_eq:NN \__uftag_pdf_escape_string:n \EdefEscapeString -%\cs_set_eq:NN \__uftag_pdf_escape_name:Nn \EdefEscapeName +\RequirePackage{etoolbox} -%escape command. They are backend specific as \pdf@escapehex would ignore most chars -%outside the "pdflatex" range +\cs_generate_variant:Nn \str_set_convert:Nnnn {Nonn, Noon, Nnon } +%%% tagpdfsetup, +%%% TODO: checks need to be improved +\int_new:N \l__tag_loglevel_int +\tl_new:N \l__tag_tree_tabs_order_tl +\keys_define:nn { __tag / setup } + { + activate-mc .bool_gset:N = \g__tag_active_mc_bool, + activate-tree .bool_gset:N = \g__tag_active_tree_bool, + activate-struct .bool_gset:N = \g__tag_active_struct_bool, + activate-all .meta:n ={activate-mc,activate-tree,activate-struct}, + check-tags .bool_gset:N = \g__tag_check_tags_bool, + check-tags .initial:n = true, + log .choice:, + log / none .code:n = {\int_set:Nn \l__tag_loglevel_int { 0 }}, + log / v .code:n = {\int_set:Nn \l__tag_loglevel_int { 1 }}, + log / vv .code:n = {\int_set:Nn \l__tag_loglevel_int { 2 }}, + log / vvv .code:n = {\int_set:Nn \l__tag_loglevel_int { 3 }}, + log / all .code:n = {\int_set:Nn \l__tag_loglevel_int { 10 }}, + tagunmarked .bool_gset:N = \g__tag_tagunmarked_bool, + tagunmarked .initial:n = true, + tabsorder .choice:, + tabsorder / row .code:n = %{\tl_set:Nn \l__tag_tree_tabs_order_tl {/Tabs/R}}, + \pdfmanagement_add:nnn { Page } {Tabs}{/R}, + tabsorder / column .code:n = %{\tl_set:Nn \l__tag_tree_tabs_order_tl {/Tabs/C}}, + \pdfmanagement_add:nnn { Page } {Tabs}{/C}, + tabsorder / structure .code:n = %{\tl_set:Nn \l__tag_tree_tabs_order_tl {/Tabs/S}}, + \pdfmanagement_add:nnn { Page } {Tabs}{/S}, + tabsorder / none .code:n = %{\tl_set:Nn \l__tag_tree_tabs_order_tl {}}, + \pdfmanagement_remove:nn {Page} {Tabs}, + tabsorder .initial:n = structure, + uncompress .code:n = {\pdf_uncompress: }, + } +\hook_gput_code:nnn{begindocument}{tagpdf} + { + \bool_if:NT \g__tag_active_struct_bool + { + \pdfmanagement_add:nnn { Catalog / MarkInfo } { Marked } { true } + } + } -% a hook for later code and an absolute page counter -% should be executed before counters are resetted. -% is it used? -\cs_new:Nn \__uftag_finish_page_hook: { } +\cs_new:Nn \__tag_finish_page_hook: { } -\AtBeginShipout - { - \__uftag_finish_page_hook: - \bool_if:NT\g_uftag_active_tree_bool - { - \__uftag_tree_write_pageattr: - } - \int_gincr:N \g__uftag_abspage_int - } +\hook_gput_code:nnn + { shipout/before } + { tagpdf/cnt } + { + \__tag_finish_page_hook: + %\int_gincr:N \g__tag_abspage_int + } -%testing the engines and loading the backend files \sys_if_engine_xetex:T - { - \PackageError { tagpdf } { xelatex~is~not~supported~-~aborting } {} - \tex_endinput:D - } + { %lets try with xelatex ... + %\PackageError { tagpdf } { xelatex~is~not~supported~-~aborting } {} + %\tex_endinput:D + \file_input:n {tagpdf-pdftex.def} + } \sys_if_engine_luatex:T - { - \file_input:n {tagpdf-luatex.def} - } + { + \file_input:n {tagpdf-luatex.def} + } \sys_if_engine_pdftex:T - { - \file_input:n {tagpdf-pdftex.def} - } + { + \file_input:n {tagpdf-pdftex.def} + } \sys_if_output_dvi:T - { - \PackageError { tagpdf } { dvi~output~is~not~supported~-~aborting }{} - \tex_endinput:D - } + { + %\PackageError { tagpdf } { dvi~output~is~not~supported~-~aborting }{} + %\tex_endinput:D + } -\cs_generate_variant:Nn \__uftag_prop_gput:Nnn { Nxn , Nxx, Nnx , cnn, cxn, cnx, cno} -\cs_generate_variant:Nn \__uftag_seq_gput_right:Nn { Nx , No, cn, cx } -\cs_generate_variant:Nn \__uftag_prop_new:N { c } -\cs_generate_variant:Nn \__uftag_seq_new:N { c } -\cs_generate_variant:Nn \__uftag_seq_show:N { c } -\cs_generate_variant:Nn \__uftag_prop_show:N { c } +\cs_generate_variant:Nn \__tag_prop_gput:Nnn { Nxn , Nxx, Nnx , cnn, cxn, cnx, cno} +\cs_generate_variant:Nn \__tag_seq_gput_right:Nn { Nx , No, cn, cx } +\cs_generate_variant:Nn \__tag_prop_new:N { c } +\cs_generate_variant:Nn \__tag_seq_new:N { c } +\cs_generate_variant:Nn \__tag_seq_show:N { c } +\cs_generate_variant:Nn \__tag_prop_show:N { c } \cs_generate_variant:Nn \prop_gput:Nnn {Nxx} \cs_generate_variant:Nn \prop_put:Nnn {Nxx} -\cs_generate_variant:Nn \__uftag_pdfuseobjnum:Nn {Nx,No} -\cs_generate_variant:Nn \__uftag_pdfuseobjnum:nn {nx,xx} -\cs_generate_variant:Nn \__uftag_gset_pdfpageattr:n {x} - -% few temp tl -\tl_new:N \g__uftag_tmpa_tl -\tl_new:N \l__uftag_tmpa_tl -\tl_new:N \l__uftag_tmpb_tl -\tl_new:N \l__uftag_tmpc_tl -\tl_new:N \l__uftag_tmpd_tl -\tl_new:N \l__uftag_tmpe_tl -\str_new:N \l__uftag_tmpa_str - -% helper function to get the propcount. -% use as \prop_map_function:NN PROP { \__uftag_prop_count:nn -1 } -\cs_new:Nn\__uftag_prop_count:nn { + 1 } + +\cs_generate_variant:Nn \pdffile_embed_stream:nnn {nxx,oxx} +\cs_generate_variant:Nn \pdf_object_ref:n {e} + +\tl_new:N \g__tag_tmpa_tl +\tl_new:N \l__tag_tmpa_tl +\tl_new:N \l__tag_tmpb_tl +\tl_new:N \l__tag_tmpc_tl +\tl_new:N \l__tag_tmpd_tl +\tl_new:N \l__tag_tmpe_tl +\str_new:N \l__tag_tmpa_str + +\cs_new:Nn\__tag_prop_count:nn { + 1 } %% Loading the tagpdf sub packages \RequirePackage { tagpdf-checks-code } @@ -181,16 +249,17 @@ \RequirePackage { tagpdf-tree-code } \RequirePackage { tagpdf-roles-code } \RequirePackage { tagpdf-attr-code } -% mc-code is split: \RequirePackage { tagpdf-mc-code-shared } -\bool_if:NTF \g__uftag_mode_lua_bool - { - \RequirePackage {tagpdf-mc-code-lua} - } - { - \RequirePackage { tagpdf-mc-code-generic } % - } +\bool_if:NTF \g__tag_mode_lua_bool + { + \RequirePackage {tagpdf-mc-code-lua} + } + { + \RequirePackage { tagpdf-mc-code-generic } % + } \RequirePackage { tagpdf-struct-code } \RequirePackage { tagpdf-space-code } -\endinput +%% +%% +%% End of file `tagpdf.sty'. diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty index d810bef9f1b..2032895ec2a 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty @@ -1,7 +1,7 @@ \RequirePackage{expl3}[2018/06/14] %\RequirePackage[enable-debug]{expl3}[2018/06/14] \RequirePackage{xpatch} -\ProvidesExplPackage {tagpdfdocu-patches} {2019/07/02} {0.61} +\ProvidesExplPackage {tagpdfdocu-patches} {2019/10/15} {0.70} {patches/commands for the tagpdf documentation} % to do : marginnote, perhaps the description macros ... @@ -30,20 +30,20 @@ \NewDocumentCommand\TagP{t{^}} { - \uftag_mc_if_in:T { \uftag_mc_end: } + \tag_mc_if_in:T { \tag_mc_end: } \IfBooleanF{#1} { - \uftag_struct_end: + \tag_struct_end: } - \uftag_struct_begin:n{tag=P} - \uftag_mc_begin:n{tag=P} + \tag_struct_begin:n{tag=P} + \tag_mc_begin:n{tag=P} } % close a mc and one structure \NewDocumentCommand\TagPend{} { - \uftag_mc_if_in:T { \uftag_mc_end: } - \uftag_struct_end: + \tag_mc_if_in:T { \tag_mc_end: } + \tag_struct_end: } @@ -58,15 +58,15 @@ %Marking the toc entries %around the whole entry so only structure: -\newcommand\tagscrtocentry[1]{\uftag_struct_begin:n{tag=TOCI}#1\uftag_struct_end:} +\newcommand\tagscrtocentry[1]{\tag_struct_begin:n{tag=TOCI}#1\tag_struct_end:} %leaf so structure and mc: \newcommand\tagscrtocpagenumber[1]{% - \uftag_struct_begin:n{tag=Reference}% - \uftag_mc_begin:n{tag=Reference}% + \tag_struct_begin:n{tag=Reference}% + \tag_mc_begin:n{tag=Reference}% #1% - \uftag_mc_end: - \uftag_struct_end:} + \tag_mc_end: + \tag_struct_end:} \DeclareTOCStyleEntry[ @@ -85,9 +85,9 @@ \renewcommand{\addtocentrydefault}[3]{% - \ifstr{#3}{}{} + \Ifstr{#3}{}{} {%\ - \ifstr{#2}{} + \Ifstr{#2}{} {% \addcontentsline{toc}{#1} {% @@ -118,7 +118,7 @@ \renewcommand*{\TOCLineLeaderFill}[1][.]{ \leaders\hbox{$\m@th - \mkern \@dotsep mu\hbox{\uftag_mc_begin:n{artifact}#1\uftag_mc_end:}\mkern \@dotsep + \mkern \@dotsep mu\hbox{\tag_mc_begin:n{artifact}#1\tag_mc_end:}\mkern \@dotsep mu$}\hfill } @@ -142,34 +142,34 @@ \tagstructbegin{tag=\prop_item:Nn\g_tag_section_level_prop{#1}} \tl_if_empty:nF{#3} { - \uftag_mc_begin:n {tag=\prop_item:Nn\g_tag_section_level_prop{#1}} + \tag_mc_begin:n {tag=\prop_item:Nn\g_tag_section_level_prop{#1}} #3 - \uftag_mc_end: + \tag_mc_end: } } - {\uftag_mc_begin:n {tag=\prop_item:Nn\g_tag_section_level_prop{#1}} + {\tag_mc_begin:n {tag=\prop_item:Nn\g_tag_section_level_prop{#1}} #4 - \uftag_mc_end:\tagstructend}% + \tag_mc_end:\tagstructend}% } %minisec is simply P, H6 doesn't work .... -\cs_new:Nn \__uftag_docu_tag_minisec:n +\cs_new:Nn \__tag_docu_tag_minisec:n { - \uftag_struct_begin:n {tag=P} - \uftag_mc_begin:n{tag=P} + \tag_struct_begin:n {tag=P} + \tag_mc_begin:n{tag=P} #1 - \uftag_mc_end: - \uftag_struct_end: + \tag_mc_end: + \tag_struct_end: } -\addtokomafont{minisec}{\__uftag_docu_tag_minisec:n} +\addtokomafont{minisec}{\__tag_docu_tag_minisec:n} -\AfterTOCHead{\uftag_struct_begin:n{tag=TOC}} -\AfterStartingTOC{\uftag_struct_end:} %end TOC +\AfterTOCHead{\tag_struct_begin:n{tag=TOC}} +\AfterStartingTOC{\tag_struct_end:} %end TOC %% list -\newcommand\uftag@enit@format@preset[1]{% +\newcommand\tag@enit@format@preset[1]{% \tagstructbegin{tag=LI}% \tagstructbegin{tag=Lbl}% \tagmcbegin{tag=Lbl}% @@ -190,7 +190,7 @@ } \ExplSyntaxOff -\xpatchcmd\enit@preset{\@firstofone}{\uftag@enit@format@preset}{}{\fail} +\xpatchcmd\enit@preset{\@firstofone}{\tag@enit@format@preset}{}{\fail} \ExplSyntaxOn \setlist{ before*=\tagstructbegin{tag=L}, @@ -209,62 +209,95 @@ %%% attention, to get the order right, it is necessary currently to start a new %%% mc after a link! I'm not sure if this can/group be included in the hooks %%% grouping is a bit tricky ... -\cs_if_exist:NT\hook_put_left:nnn -{ - \hook_put_left:nnn - { pdf } - { link_begin_url } - { - \uftag_struct_begin:n{tag=Link} - \uftag_mc_begin:n{tag=Link} - } -\hook_put:nnnn - { pdf } - { link_begin_url_attr } - { /StructParent } - { \int_use:N\c@g__uftag_parenttree_obj_int } - -\hook_put_right:nnn - { pdf } - { link_end_url } - { - \__uftag_struct_finish_link: - \uftag_mc_end: - \uftag_struct_end: - } +%\cs_if_exist:NT\hook_put_left:nnn +%{ +% \hook_put_left:nnn +% { pdf } +% { annot/Link/URI_begin } +% { +% \tag_struct_begin:n{tag=Link} +% \tag_mc_begin:n{tag=Link} +% } + +\cs_generate_variant:Nn \pdfannot_dict_put:nnn {nnx} +\hook_gput_code:nnn + {pdfannot/link/URI/before} + {tagpdf} + { + \tag_struct_begin:n{tag=Link} + \tag_mc_begin:n{tag=Link} + \pdfannot_dict_put:nnx + {link/URI} + { StructParent } + { \int_use:N\c@g__tag_parenttree_obj_int } + } + +%\hook_put_right:nnn +% { pdf } +% { annot/Link/URI_end } +% { +% \__tag_struct_finish_link: +% \tag_mc_end: +% \tag_struct_end: +% } +\hook_gput_code:nnn + {pdfannot/link/URI/after} + {tagpdf} + { + \__tag_struct_finish_link: + \tag_mc_end: + \tag_struct_end: + } + +%\hook_put_left:nnn +% { pdf } +% { annot/Link/GoTo_begin } +% { +% \tag_struct_begin:n{tag=Link} +% \tag_mc_begin:n{tag=Link} +% } + +\hook_gput_code:nnn + {pdfannot/link/GoTo/before} + {tagpdf} + { + \tag_struct_begin:n{tag=Link} + \tag_mc_begin:n{tag=Link} + \pdfannot_dict_put:nnx + {link/GoTo} + { StructParent } + { \int_use:N\c@g__tag_parenttree_obj_int } + } + -\hook_put_left:nnn - { pdf } - { link_begin_link } - { - \uftag_struct_begin:n{tag=Link} - \uftag_mc_begin:n{tag=Link} - } -\hook_put:nnnn - { pdf } - { link_begin_link_attr } - { /StructParent } - { \int_use:N\c@g__uftag_parenttree_obj_int } -\hook_put_right:nnn - { pdf } - { link_end_link } - { - \__uftag_struct_finish_link: - \uftag_mc_end: - \uftag_struct_end: - } + +%\hook_put_right:nnn +% { pdf } +% { annot/link/GoTo_end } +% { +% \__tag_struct_finish_link: +% \tag_mc_end: +% \tag_struct_end: +% } + +\hook_gput_code:nnn + {pdfannot/link/GoTo/after} + {tagpdf} + { + \__tag_struct_finish_link: + \tag_mc_end: + \tag_struct_end: + } % "alternative descriptions " for PAX3. How to get better text here?? -\hook_put:nnnn - { pdf } - { link_begin_url_attr } - { /Contents } +\pdfannot_dict_put:nnx + {link/URI} + { Contents } { (url) } -\hook_put:nnnn - { pdf } - { link_begin_link_attr } - { /Contents } +\pdfannot_dict_put:nnx + {link/GoTo} + { Contents } { (ref) } - } + \endinput diff --git a/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex b/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex index 725b58f571b..8db5f2e37b3 100644 --- a/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex +++ b/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex @@ -12,6 +12,10 @@ %% See http://www.latex-project.org/lppl.txt %% ---------------------------------------------------------------- %% +\ProvidesFile{tikzlibrarytikzmark.code.tex}[% + 2021/02/16 + v1.10 + TikZ library for marking positions in a document] \RequirePackage{expl3, l3keys2e, xparse} \tikzset{% remember picture with id/.style={% @@ -32,6 +36,28 @@ \fi% }, }, + check picture id/.code={ + \ifpgfrememberpicturepositiononpage + \@ifundefined{pgf@sys@pdf@mark@pos@\pgfpictureid}{% + \tikzset{% + name prefix/.get=\tzmk@name@prefix, + name prefix/.prefix=discard-, + execute at end picture={% + \tikzset{name prefix/.expand once=\tzmk@name@prefix}% + }, + }% + }{}% + \fi + }, + maybe define node/.style={% + execute at end picture={% + \ifpgfrememberpicturepositiononpage + \@ifundefined{pgf@sh@pi@\tikz@pp@name{#1}}{% + \pgfnodealias{\tikz@pp@name{#1}}{discard-\tikz@pp@name{#1}}% + }{}% + \fi + }% + }, save picture id/.code={% \protected@write\pgfutil@auxout{}{% \string\savepointas% @@ -65,10 +91,14 @@ \@ifundefined{save@pt@\tikzmark@pp@name{#1}}{% \pgfkeysalso{#3}% }{% - \@ifundefined{save@pg@\csname save@pt@\tikzmark@pp@name{#1}\endcsname}{% + \@ifundefined{% + save@pg@\csname save@pt@\tikzmark@pp@name{#1}\endcsname + }{% \pgfkeysalso{#3}% }{% - \ifnum\csname save@pg@\csname save@pt@\tikzmark@pp@name{#1}\endcsname\endcsname=\the\value{page}\relax% + \ifnum\csname save@pg@% + \csname save@pt@\tikzmark@pp@name{#1}\endcsname% + \endcsname=\the\value{page}\relax% \pgfkeysalso{#2}% \else \pgfkeysalso{#3}% @@ -80,10 +110,14 @@ \@ifundefined{save@pt@\tikzmark@pp@name{#1}}{% \pgfkeysalso{#4}% }{% - \@ifundefined{save@pg@\csname save@pt@\tikzmark@pp@name{#1}@label\endcsname}{% + \@ifundefined{% + save@pg@\csname save@pt@\tikzmark@pp@name{#1}@label\endcsname% + }{% \pgfkeysalso{#4}% }{% - \ifnum\csname save@pg@\csname save@pt@\tikzmark@pp@name{#1}\endcsname\endcsname=#2\relax% + \ifnum\csname save@pg@% + \csname save@pt@\tikzmark@pp@name{#1}\endcsname% + \endcsname=#2\relax% \pgfkeysalso{#3}% \else \pgfkeysalso{#4}% @@ -143,7 +177,12 @@ \@ifundefined{save@pg@\csname save@pt@\tmk@label\endcsname}{}{% \@ifundefined{save@pg@\pgfpictureid}{}{% \pgfkeysvalueof{/tikz/next page vector}% - \edef\tmk@pg{\the\numexpr \csname save@pg@\csname save@pt@\tmk@label\endcsname\endcsname - \csname save@pg@\pgfpictureid\endcsname\relax}% + \edef\tmk@pg{% + \the\numexpr \csname save@pg@% + \csname save@pt@\tmk@label\endcsname\endcsname% + - + \csname save@pg@\pgfpictureid\endcsname\relax% + }% \ifnum \tmk@pg > 0 \relax \advance \pgf@xa by \pgf@x\relax \advance \pgf@ya by \pgf@y\relax @@ -161,13 +200,15 @@ }% } \newcommand\tikzmark@outside[2][]{% +\tikzset{external/export next/.try=false}% \tikz[remember picture with id=#2]{#1}% } \def\tikzmark@inside#1#2{% \tikzset{remember picture}% \tikz@scan@one@point\pgfutil@firstofone#2\relax \protected@write\pgfutil@auxout{}{% - \string\savepointas{\tikzmark@pp@name{#1}}{\pgfpictureid}{\the\pgf@x}{\the\pgf@y}}% + \string\savepointas% + {\tikzmark@pp@name{#1}}{\pgfpictureid}{\the\pgf@x}{\the\pgf@y}}% } \def\tikzmark{% \ifx\pgfpictureid\@undefined @@ -234,7 +275,9 @@ \@ifundefined{save@pg@\csname save@pt@\tikzmark@pp@name{#1}\endcsname}{% \tikzmark@false }{% - \ifnum\csname save@pg@\csname save@pt@\tikzmark@pp@name{#1}\endcsname\endcsname=#2\relax% + \ifnum\csname save@pg@% + \csname save@pt@\tikzmark@pp@name{#1}\endcsname% + \endcsname=#2\relax% \tikzmark@true \else \tikzmark@false @@ -250,7 +293,9 @@ \@ifundefined{save@pg@\csname save@pt@\tikzmark@pp@name{#1}\endcsname}{% \tikzmark@false }{% - \ifnum\csname save@pg@\csname save@pt@\tikzmark@pp@name{#1}\endcsname\endcsname=\the\value{page}\relax% + \ifnum\csname save@pg@% + \csname save@pt@\tikzmark@pp@name{#1}\endcsname% + \endcsname=\the\value{page}\relax% \tikzmark@true \else \tikzmark@false @@ -356,10 +401,13 @@ } \def\tikzmarknode@#1#2#3{% +\tikzset{external/export next/.try=false}% \tikz[% remember picture, - baseline=(#2.base), save picture id={#2}, + check picture id, + maybe define node={#2}, + baseline=(#2.base), every tikzmarknode picture/.try ] { \node[ @@ -394,25 +442,25 @@ \expandafter\ifx\csname\tzmk@pic\endcsname\relax \edef\tzmk@pic{\tzmk@prfx\the\numexpr\the\pgf@picture@serial@count-3\relax}% \expandafter\ifx\csname\tzmk@pic\endcsname\relax - \pgfutil@ifundefined{pgf@sh@ns@#2}{% - \pgfnodealias{#2}{#2-t}% - \tikzmarkalias{#2}{#2-t}% + \pgfutil@ifundefined{pgf@sh@ns@\tikz@pp@name{#2}}{% + \pgfnodealias{\tikz@pp@name{#2}}{\tikz@pp@name{#2-t}}% + \tikzmarkalias{\tikzmark@pp@name{#2}}{\tikzmark@pp@name{#2-t}}% }{}% \else - \pgfnodealias{#2}{#2-d}% - \tikzmarkalias{#2}{#2-d}% + \pgfnodealias{\tikz@pp@name{#2}}{\tikz@pp@name{#2-d}}% + \tikzmarkalias{\tikzmark@pp@name{#2}}{\tikzmark@pp@name{#2-d}}% \fi \else - \pgfnodealias{#2}{#2-t}% - \tikzmarkalias{#2}{#2-t}% + \pgfnodealias{\tikz@pp@name{#2}}{\tikz@pp@name{#2-t}}% + \tikzmarkalias{\tikzmark@pp@name{#2}}{\tikzmark@pp@name{#2-t}}% \fi \else - \pgfnodealias{#2}{#2-s}% - \tikzmarkalias{#2}{#2-s}% + \pgfnodealias{\tikz@pp@name{#2}}{\tikz@pp@name{#2-s}}% + \tikzmarkalias{\tikzmark@pp@name{#2}}{\tikzmark@pp@name{#2-s}}% \fi \else - \pgfnodealias{#2}{#2-ss}% - \tikzmarkalias{#2}{#2-ss}% + \pgfnodealias{\tikz@pp@name{#2}}{\tikz@pp@name{#2-ss}}% + \tikzmarkalias{\tikzmark@pp@name{#2}}{\tikzmark@pp@name{#2-ss}}% \fi \else \tikzmarknode@{#1}{#2}{#3}% @@ -772,7 +820,7 @@ } \ExplSyntaxOff %% -%% Copyright (C) 2011-2018 by Andrew Stacey <loopspace@mathforge.org> +%% Copyright (C) 2011-2021 by Andrew Stacey <loopspace@mathforge.org> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License (LPPL), either diff --git a/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex b/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex index 085323e146d..2692b3fa8f6 100644 --- a/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex +++ b/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex @@ -13,7 +13,8 @@ %% ---------------------------------------------------------------- %% \@ifpackageloaded{listings}{% - \newif\iflst@linemark + \newif\iflst@linemark + \lst@linemarktrue \lst@AddToHook{EveryLine}{% \begingroup \advance\c@lstnumber by 1\relax @@ -47,7 +48,7 @@ \PackageError{tikzmark listings}{The listings package has not been loaded.}{} } %% -%% Copyright (C) 2011-2018 by Andrew Stacey <loopspace@mathforge.org> +%% Copyright (C) 2011-2021 by Andrew Stacey <loopspace@mathforge.org> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License (LPPL), either diff --git a/Master/texmf-dist/tex/latex/tuda-ci/beamercolorthemeTUDa.sty b/Master/texmf-dist/tex/latex/tuda-ci/beamercolorthemeTUDa.sty index 00ddfe3e5d0..19cc8d4de95 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/beamercolorthemeTUDa.sty +++ b/Master/texmf-dist/tex/latex/tuda-ci/beamercolorthemeTUDa.sty @@ -1,4 +1,4 @@ -%% This is file `beamercolorthemeTUDa.sty' version 3.10 (2021/02/05), +%% This is file `beamercolorthemeTUDa.sty' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{beamercolorthemeTUDa} [\filedate\space\fileversion] diff --git a/Master/texmf-dist/tex/latex/tuda-ci/beamerfontthemeTUDa.sty b/Master/texmf-dist/tex/latex/tuda-ci/beamerfontthemeTUDa.sty index 3b37cab7fd3..b92e3307834 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/beamerfontthemeTUDa.sty +++ b/Master/texmf-dist/tex/latex/tuda-ci/beamerfontthemeTUDa.sty @@ -1,4 +1,4 @@ -%% This is file `beamerfontthemeTUDa.sty' version 3.10 (2021/02/05), +%% This is file `beamerfontthemeTUDa.sty' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{beamerfontthemeTUDa} [\filedate\space\fileversion] diff --git a/Master/texmf-dist/tex/latex/tuda-ci/beamerinnerthemeTUDa.sty b/Master/texmf-dist/tex/latex/tuda-ci/beamerinnerthemeTUDa.sty index 7f601653e8e..1b530ac6623 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/beamerinnerthemeTUDa.sty +++ b/Master/texmf-dist/tex/latex/tuda-ci/beamerinnerthemeTUDa.sty @@ -1,4 +1,4 @@ -%% This is file `beamerinnerthemeTUDa.sty' version 3.10 (2021/02/05), +%% This is file `beamerinnerthemeTUDa.sty' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \ProvidesExplPackage{beamerinnerthemeTUDa}{\filedate}{\fileversion}{Inner~beamer~theme~of~tuda-ci} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/beamerouterthemeTUDa.sty b/Master/texmf-dist/tex/latex/tuda-ci/beamerouterthemeTUDa.sty index c5f13e92963..28fef7810b8 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/beamerouterthemeTUDa.sty +++ b/Master/texmf-dist/tex/latex/tuda-ci/beamerouterthemeTUDa.sty @@ -1,4 +1,4 @@ -%% This is file `beamerouterthemeTUDa.sty' version 3.10 (2021/02/05), +%% This is file `beamerouterthemeTUDa.sty' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \ProvidesExplPackage{beamerouterthemeTUDa}{\filedate}{\fileversion}{Outer~beamer~theme~of~tuda-ci} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/beamerthemeTUDa-mecheng.sty b/Master/texmf-dist/tex/latex/tuda-ci/beamerthemeTUDa-mecheng.sty index aaf6d668e8d..2e9f46a7ba1 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/beamerthemeTUDa-mecheng.sty +++ b/Master/texmf-dist/tex/latex/tuda-ci/beamerthemeTUDa-mecheng.sty @@ -1,4 +1,4 @@ -%% This is file `beamerthemeTUDa-mecheng.sty' version 3.10 (2021/02/05), +%% This is file `beamerthemeTUDa-mecheng.sty' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \RequirePackage{expl3} \ProvidesExplPackage{beamerthemeTUDa-mecheng}{\filedate}{\fileversion}{specific tudabeamer configuration for the department of mechanical engineering} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/beamerthemeTUDa.sty b/Master/texmf-dist/tex/latex/tuda-ci/beamerthemeTUDa.sty index c02aa76dc4c..b330a9fab0e 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/beamerthemeTUDa.sty +++ b/Master/texmf-dist/tex/latex/tuda-ci/beamerthemeTUDa.sty @@ -1,4 +1,4 @@ -%% This is file `beamerthemeTUDa.sty' version 3.10 (2021/02/05), +%% This is file `beamerthemeTUDa.sty' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{beamerthemeTUDa} [\filedate\space\fileversion\space beamer theme using the Corporate Design of TU Darmstadt] diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a0paper.clo b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a0paper.clo index b35377871ef..c49620928f2 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a0paper.clo +++ b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a0paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a0paper.clo' version 3.10 (2021/02/05), +%% This is file `tuda-a0paper.clo' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \ProvidesExplFile{tuda-a0paper.clo}{\filedate}{\fileversion}{tuda-ci~size~adjustments~for~a0paper} \cs_set:Nn \ptxcd_setup_title_sizes: { \cs_set:Nn \ptxcd_title_fontsize: {{125pt}{165pt}} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a1paper.clo b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a1paper.clo index d0482d01dd6..81dcccc6841 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a1paper.clo +++ b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a1paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a1paper.clo' version 3.10 (2021/02/05), +%% This is file `tuda-a1paper.clo' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \ProvidesExplFile{tuda-a1paper.clo}{\filedate}{\fileversion}{tuda-ci~size~adjustments~for~a0paper} \cs_set:Nn \ptxcd_setup_title_sizes: { \cs_set:Nn \ptxcd_title_fontsize: {{86pt}{120pt}} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a2paper.clo b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a2paper.clo index 55cb9ce12ed..914e856fd8c 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a2paper.clo +++ b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a2paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a2paper.clo' version 3.10 (2021/02/05), +%% This is file `tuda-a2paper.clo' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \ProvidesExplFile{tuda-a2paper.clo}{\filedate}{\fileversion}{tuda-ci~size~adjustments~for~a0paper} \cs_set:Nn \ptxcd_setup_title_sizes: { \cs_set:Nn \ptxcd_title_fontsize: {{65pt}{82pt}} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a3paper.clo b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a3paper.clo index d9cacf17191..337e6ddf8a1 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a3paper.clo +++ b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a3paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a3paper.clo' version 3.10 (2021/02/05), +%% This is file `tuda-a3paper.clo' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \ProvidesExplFile{tuda-a3paper.clo}{\filedate}{\fileversion}{tuda-ci~size~adjustments~for~a3paper} \cs_set:Nn \ptxcd_setup_title_sizes: { \cs_set:Nn \ptxcd_title_fontsize: {{47pt}{61pt}} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a4paper.clo b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a4paper.clo index 9517e882a83..ebd934e1af9 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a4paper.clo +++ b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a4paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a4paper.clo' version 3.10 (2021/02/05), +%% This is file `tuda-a4paper.clo' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \ProvidesExplFile{tuda-a4paper.clo}{\filedate}{\fileversion}{tuda-ci~size~adjustments~for~a4paper} \cs_set:Nn \ptxcd_setup_title_sizes: { \cs_set:Nn \ptxcd_title_fontsize: {{36pt}{47pt}} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a5paper.clo b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a5paper.clo index 155fc7915ba..59d522b883d 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tuda-a5paper.clo +++ b/Master/texmf-dist/tex/latex/tuda-ci/tuda-a5paper.clo @@ -1,4 +1,4 @@ -%% This is file `tuda-a5paper.clo' version 3.10 (2021/02/05), +%% This is file `tuda-a5paper.clo' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \ProvidesExplFile{tuda-a5paper.clo}{\filedate}{\fileversion}{tuda-ci~size~adjustments~for~a5paper} \cs_set:Nn \ptxcd_setup_title_sizes: { \cs_set:Nn \ptxcd_title_fontsize: {{22pt}{28pt}} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tuda-pgfplots.sty b/Master/texmf-dist/tex/latex/tuda-ci/tuda-pgfplots.sty index 06047ba14f7..9871b594e9b 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tuda-pgfplots.sty +++ b/Master/texmf-dist/tex/latex/tuda-ci/tuda-pgfplots.sty @@ -1,4 +1,4 @@ -%% This is file `tuda-pgfplots.sty' version 3.10 (2021/02/05), +%% This is file `tuda-pgfplots.sty' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} % Special thanks to: Sebastian Schöps Institut Theorie Elektromagnetischer Felder (TEMF), TU Darmstadt % The original version of this file has been inspired by the colorscheme in the Metropolis beamer theme by Matthias Vogelgesang https://github.com/matze/mtheme \ProvidesPackage{tuda-pgfplots}[\filedate\space\fileversion\space tuda-ci pgfplots color schemes] diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudabeamer.cls b/Master/texmf-dist/tex/latex/tuda-ci/tudabeamer.cls index 88ec0b5b887..1d97c48c7c1 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudabeamer.cls +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudabeamer.cls @@ -1,4 +1,4 @@ -%% This is file `tudabeamer.cls' version 3.10 (2021/02/05), +%% This is file `tudabeamer.cls' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{tudabeamer} [\filedate\space\fileversion\space] diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudacolors.def b/Master/texmf-dist/tex/latex/tuda-ci/tudacolors.def index 28f535c5543..398c2036940 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudacolors.def +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudacolors.def @@ -1,4 +1,4 @@ -%% This is file `tudacolors.def' version 3.10 (2021/02/05), +%% This is file `tudacolors.def' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \ProvidesFile{tudacolors.def} [\filedate\space\fileversion\space Color definitions for tuda-ci] diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudacolors.sty b/Master/texmf-dist/tex/latex/tuda-ci/tudacolors.sty index b9b76f849ce..10db98d9bc1 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudacolors.sty +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudacolors.sty @@ -1,4 +1,4 @@ -%% This is file `tudacolors.sty' version 3.10 (2021/02/05), +%% This is file `tudacolors.sty' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplPackage{tudacolors}{\filedate}{\fileversion}{Color definition for TU Darmstadt's tuda-ci bundle} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudaexercise.cls b/Master/texmf-dist/tex/latex/tuda-ci/tudaexercise.cls index fd0dabed9c8..a39fd6a7825 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudaexercise.cls +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudaexercise.cls @@ -1,4 +1,4 @@ -%% This is file `tudaexercise.cls' version 3.10 (2021/02/05), +%% This is file `tudaexercise.cls' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplClass{tudaexercise} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudafonts.sty b/Master/texmf-dist/tex/latex/tuda-ci/tudafonts.sty index 6b02df7ce16..e0136bf889e 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudafonts.sty +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudafonts.sty @@ -1,4 +1,4 @@ -%% This is file `tudafonts.sty' version 3.10 (2021/02/05), +%% This is file `tudafonts.sty' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{tudafonts} [\filedate\space\fileversion\space diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudaleaflet.cls b/Master/texmf-dist/tex/latex/tuda-ci/tudaleaflet.cls index 35813f97b55..1f801d7a9e6 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudaleaflet.cls +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudaleaflet.cls @@ -1,4 +1,4 @@ -%% This is file `tudaleaflet.cls' version 3.10 (2021/02/05), +%% This is file `tudaleaflet.cls' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplPackage{tudaleaflet}{\filedate}{\fileversion}{Leaflets using the Corporate Design of TU Darmstadt} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudaletter.cls b/Master/texmf-dist/tex/latex/tuda-ci/tudaletter.cls index 91dfdec967e..109b275ddc2 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudaletter.cls +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudaletter.cls @@ -1,4 +1,4 @@ -%% This is file `tudaletter.cls' version 3.10 (2021/02/05), +%% This is file `tudaletter.cls' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplClass{tudaletter} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudalettersize10pt.clo b/Master/texmf-dist/tex/latex/tuda-ci/tudalettersize10pt.clo index 4baa0d2e0e2..b8f6d04c012 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudalettersize10pt.clo +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudalettersize10pt.clo @@ -1,4 +1,4 @@ -%% This is file `tudalettersize10pt.clo' version 3.10 (2021/02/05), +%% This is file `tudalettersize10pt.clo' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudamecheng.cfg b/Master/texmf-dist/tex/latex/tuda-ci/tudamecheng.cfg index dc824490f4a..477a8144b48 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudamecheng.cfg +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudamecheng.cfg @@ -1,4 +1,4 @@ -%% This is file `tudamecheng.cfg' version 3.10 (2021/02/05), +%% This is file `tudamecheng.cfg' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \RequirePackage{expl3} \ProvidesExplFile{tudamecheng.cfg} {\filedate}{\fileversion}{Special Features the department of mechanical engineering of Darmstadt's Corporate Design (tuda-ci)} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudaposter.cls b/Master/texmf-dist/tex/latex/tuda-ci/tudaposter.cls index a5a614ceb12..29a73328c00 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudaposter.cls +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudaposter.cls @@ -1,4 +1,4 @@ -%% This is file `tudaposter.cls' version 3.10 (2021/02/05), +%% This is file `tudaposter.cls' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplPackage{tudaposter}{\filedate}{\fileversion}{Poster Layouts for the Corporate Design of TU Darmstadt} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudapub.cls b/Master/texmf-dist/tex/latex/tuda-ci/tudapub.cls index 852a87a9630..a25e53aad10 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudapub.cls +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudapub.cls @@ -1,4 +1,4 @@ -%% This is file `tudapub.cls' version 3.10 (2021/02/05), +%% This is file `tudapub.cls' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplClass{tudapub} @@ -195,12 +195,6 @@ \ProcessKeysOptions{ptxcd/pub} - -%Option adjustments required for valid PDF/A -\bool_if:NT \g_ptxcd_pdfa_bool { - \PassOptionsToPackage{RGB}{xcolor} -} - \exp_args:Nx \tl_if_eq:nnT {\prop_item:Nn \g_ptxcd_clsopts_prop {fontsize}} {9pt} { \prop_if_in:NnF \g_ptxcd_unknown_clsopts_prop {DIV} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudarules.sty b/Master/texmf-dist/tex/latex/tuda-ci/tudarules.sty index 50efbc4b852..cae04dfe936 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudarules.sty +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudarules.sty @@ -1,4 +1,4 @@ -%% This is file `tudarules.sty' version 3.10 (2021/02/05), +%% This is file `tudarules.sty' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplPackage{tudarules}{\filedate}{\fileversion}{Creation of colored bars for tuda-ci bundle} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudasciposter.cls b/Master/texmf-dist/tex/latex/tuda-ci/tudasciposter.cls index 1ce4463ae76..97a1243c4c3 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudasciposter.cls +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudasciposter.cls @@ -1,4 +1,4 @@ -%% This is file `tudasciposter.cls' version 3.10 (2021/02/05), +%% This is file `tudasciposter.cls' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplPackage{tudasciposter}{\filedate}{\fileversion}{Scientific Poster Layout for TU Darmstadt} diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudasize9pt.clo b/Master/texmf-dist/tex/latex/tuda-ci/tudasize9pt.clo index bba5540d3c4..06480200770 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudasize9pt.clo +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudasize9pt.clo @@ -1,4 +1,4 @@ -%% This is file `tudasize9pt.clo' version 3.10 (2021/02/05), +%% This is file `tudasize9pt.clo' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudathesis.cfg b/Master/texmf-dist/tex/latex/tuda-ci/tudathesis.cfg index 60aa5ecbc9b..2e4c1b77593 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudathesis.cfg +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudathesis.cfg @@ -1,4 +1,4 @@ -%% This is file `tudathesis.cfg' version 3.10 (2021/02/05), +%% This is file `tudathesis.cfg' version 3.11 (2021/02/22), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.10} -\def\filedate{2021/02/05} +\def\fileversion{3.11} +\def\filedate{2021/02/22} \RequirePackage{expl3} \ProvidesExplFile{tudathesis.cfg} {\filedate}{\fileversion}{Special Features for publication type 'thesis' using TU Darmstadt's Corporate Design (tuda-ci)} diff --git a/Master/texmf-dist/tex/latex/udesoftec/udesoftec-bibcommon.sty b/Master/texmf-dist/tex/latex/udesoftec/udesoftec-bibcommon.sty index 9d57ce4ace8..2d56018a0ef 100644 --- a/Master/texmf-dist/tex/latex/udesoftec/udesoftec-bibcommon.sty +++ b/Master/texmf-dist/tex/latex/udesoftec/udesoftec-bibcommon.sty @@ -1,7 +1,7 @@ % !Mode:: "TeX:UTF-8" %% udesoftec-biblatex.sty %% Copyright 2015 J. Peter M. Schuler -%% 2020/03/09 v1.7.0 udesoftec +%% 2021/02/22 v1.7.1 udesoftec % % This work may be distributed and/or modified under the @@ -40,7 +40,7 @@ % http://mirrors.ctan.org/macros/latex/contrib/udesoftec/udesoftec-doc.pdf \NeedsTeXFormat{LaTeX2e}% -\ProvidesPackage{udesoftec-bibcommon}[2020/03/09 v1.6.6 udesoftec-bibcommon.sty udesoftec bibstyle configuration commons]% +\ProvidesPackage{udesoftec-bibcommon}[2021/02/22 v1.7.1 udesoftec-bibcommon.sty udesoftec bibstyle configuration commons]% \newif\ifprimaryDocumentLanguageGerman @@ -62,6 +62,8 @@ \RequirePackage{hyperref} % support doi-links \RequirePackage{hyphenat} % prevent author names and quotations from hyphenating %%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[doipre={doi:}]{uri} + \providecaptionname{ngerman}{\bbland}{und }% \providecaptionname{english}{\bbland}{and }% \providecaptionname{british}{\bbland}{and }% @@ -165,8 +167,8 @@ \textbf{\emph{BibError: #2 -- #1}}% } \fi -\providecommand{\bblyear}[1]{\ifnumber{#1}{#1}{\bblnoyear}} -\providecommand{\bbledGenerateEdition}[1]{\ifnumber{#1}{\bbledOrdinal{#1}\bbledn}{#1}} +\providecommand{\bblyear}[1]{\Ifnumber{#1}{#1}{\bblnoyear}} +\providecommand{\bbledGenerateEdition}[1]{\Ifnumber{#1}{\bbledOrdinal{#1}\bbledn}{#1}} \providecommand{\englishordinal}[1]{\ifcase #1\or 1\textsuperscript{st}\or 2\textsuperscript{nd}\or 3\textsuperscript{rd}\else #1\textsuperscript{th}\fi} \providecommand{\germanordinal}[1]{#1.} @@ -179,12 +181,9 @@ } -% http://tex.stackexchange.com/questions/262103/interpret-tex-commands-and-remove-curly-braces-from-href-content/262133#262133 +% taken from pkg:uri \providecommand{\bbldoi}[1]{% - \def\tmpdoi{#1}% - \xpatchcmd*\tmpdoi{{_}}{_}{}{}% - \def\tmpdoitext{\detokenize\expandafter{\tmpdoi}}% - \href{http://dx.doi.org/\tmpdoi}{doi:\tmpdoitext}% + \doi{#1}% }% \RequirePackage{xstring} diff --git a/Master/texmf-dist/tex/latex/udesoftec/udesoftec-biblatex.sty b/Master/texmf-dist/tex/latex/udesoftec/udesoftec-biblatex.sty index 031bf9924c8..157f42d7b8b 100644 --- a/Master/texmf-dist/tex/latex/udesoftec/udesoftec-biblatex.sty +++ b/Master/texmf-dist/tex/latex/udesoftec/udesoftec-biblatex.sty @@ -1,7 +1,7 @@ % !Mode:: "TeX:UTF-8" %% udesoftec-biblatex.sty %% Copyright 2015 J. Peter M. Schuler -%% 2020/03/09 v1.7.0 udesoftec +%% 2021/02/22 v1.7.1 udesoftec % % This work may be distributed and/or modified under the @@ -40,7 +40,7 @@ % http://mirrors.ctan.org/macros/latex/contrib/udesoftec/udesoftec-doc.pdf \NeedsTeXFormat{LaTeX2e}% -\ProvidesPackage{udesoftec-biblatex}[2020/03/09 v1.6.6 udesoftec-biblatex.sty udesoftec bibstyle configuration for biblatex]% +\ProvidesPackage{udesoftec-biblatex}[2021/02/22 v1.7.1 udesoftec-biblatex.sty udesoftec bibstyle configuration for biblatex]% % % \newif\ifprimaryDocumentLanguageGerman @@ -228,13 +228,13 @@ references = {\bblheading}, } -\providebibmacro*{date+extrayear}{} +\providebibmacro*{date+extradate}{} \def\bbx@opt@mergedate@true{\bbx@opt@mergedate@compact} % merge date/issue with date label \def\bbx@opt@mergedate@maximum{% - \renewbibmacro*{date+extrayear}{% + \renewbibmacro*{date+extradate}{% \iffieldundef{\thefield{datelabelsource}year} {} {\printtext[parens]{% @@ -243,20 +243,20 @@ references = {\bblheading}, \iffieldsequal{year}{\thefield{datelabelsource}year} {\printdateextralabel}% {\printfield{labelyear}% - \printfield{extrayear}}}}}% + \printfield{extradate}}}}}% \renewbibmacro*{date}{}% \renewbibmacro*{issue+date}{}} % merge date with date label \def\bbx@opt@mergedate@compact{% - \renewbibmacro*{date+extrayear}{% + \renewbibmacro*{date+extradate}{% \iffieldundef{\thefield{datelabelsource}year} {} {\printtext[parens]{% \iffieldsequal{year}{\thefield{datelabelsource}year} {\printdateextralabel}% {\printfield{labelyear}% - \printfield{extrayear}}}}}% + \printfield{extradate}}}}}% \renewbibmacro*{date}{}% \renewbibmacro*{issue+date}{% \iffieldundef{issue} @@ -266,12 +266,12 @@ references = {\bblheading}, % merge year-only date with date label \def\bbx@opt@mergedate@basic{% - \renewbibmacro*{date+extrayear}{% + \renewbibmacro*{date+extradate}{% \iffieldundef{\thefield{datelabelsource}year} {} {\printtext[parens]{% \printfield{\thefield{datelabelsource}year}% - \printfield{extrayear}}}}% + \printfield{extradate}}}}% \renewbibmacro*{date}{% \iffieldundef{month} {} @@ -291,17 +291,17 @@ references = {\bblheading}, % merge year-only date with year-only date label \def\bbx@opt@mergedate@minimum{% - \renewbibmacro*{date+extrayear}{% + \renewbibmacro*{date+extradate}{% \iffieldundef{\thefield{datelabelsource}year} {} {\printtext[parens]{% \printfield{\thefield{datelabelsource}year}% - \printfield{extrayear}}}}% + \printfield{extradate}}}}% \renewbibmacro*{date}{% \ifboolexpr{ test {\iffieldundef{month}} and - test {\iffieldundef{extrayear}} + test {\iffieldundef{extradate}} } {} {\printdate}}% @@ -311,7 +311,7 @@ references = {\bblheading}, and test {\iffieldundef{month}} and - test {\iffieldundef{extrayear}} + test {\iffieldundef{extradate}} } {} {\printtext[parens]{% @@ -322,12 +322,12 @@ references = {\bblheading}, % don't merge date/issue with date label \def\bbx@opt@mergedate@false{% - \renewbibmacro*{date+extrayear}{% + \renewbibmacro*{date+extradate}{% \iffieldundef{\thefield{datelabelsource}year} {} {\printtext[parens]{% \printfield{\thefield{datelabelsource}year}% - \printfield{extrayear}}}}% + \printfield{extradate}}}}% \renewbibmacro*{date}{\printdate}% \renewbibmacro*{issue+date}{% \printtext[parens]{% @@ -359,7 +359,7 @@ references = {\bblheading}, {\global\undef\bbx@lasthash \usebibmacro{labeltitle}% \setunit*{\addspace}}% -\bblFontYearInList{\usebibmacro{date+extrayear}}} +\bblFontYearInList{\usebibmacro{date+extradate}}} \renewbibmacro*{in:}{\printtext{\bblin}} \renewbibmacro*{editor}{% \usebibmacro{bbx:editor}{editorstrg}} @@ -385,7 +385,7 @@ references = {\bblheading}, {\global\undef\bbx@lasthash \usebibmacro{labeltitle}% \setunit*{\addspace}}% -\bblFontYearInList{\usebibmacro{date+extrayear}}} +\bblFontYearInList{\usebibmacro{date+extradate}}} % erst publisher, dann location \renewbibmacro*{publisher+location+date}{% \printlist{publisher}% diff --git a/Master/texmf-dist/tex/latex/udesoftec/udesoftec-bst.sty b/Master/texmf-dist/tex/latex/udesoftec/udesoftec-bst.sty index 895e3a0e77f..1a18aee178f 100644 --- a/Master/texmf-dist/tex/latex/udesoftec/udesoftec-bst.sty +++ b/Master/texmf-dist/tex/latex/udesoftec/udesoftec-bst.sty @@ -1,7 +1,7 @@ % !Mode:: "TeX:UTF-8" %% udesoftec-bst.sty %% Copyright 2015 J. Peter M. Schuler -%% 2020/03/09 v1.7.0 udesoftec +%% 2021/02/22 v1.7.1 udesoftec % % This work may be distributed and/or modified under the @@ -40,7 +40,7 @@ % http://mirrors.ctan.org/macros/latex/contrib/udesoftec/udesoftec-doc.pdf \NeedsTeXFormat{LaTeX2e}% -\ProvidesPackage{udesoftec-bst}[2020/03/09 v1.6.6 udesoftec-bst.sty udesoftec bibstyle configuration for bibtex]% +\ProvidesPackage{udesoftec-bst}[2021/02/22 v1.7.1 udesoftec-bst.sty udesoftec bibstyle configuration for bibtex]% \newif\ifprimaryDocumentLanguageGerman diff --git a/Master/texmf-dist/tex/latex/udesoftec/udesoftec-extra.sty b/Master/texmf-dist/tex/latex/udesoftec/udesoftec-extra.sty index ed558f9e279..e1791cf7fff 100644 --- a/Master/texmf-dist/tex/latex/udesoftec/udesoftec-extra.sty +++ b/Master/texmf-dist/tex/latex/udesoftec/udesoftec-extra.sty @@ -1,7 +1,7 @@ % !Mode:: "TeX:UTF-8" %% udesoftec-extra.sty %% Copyright 2013-2015 J. Peter M. Schuler -%% 2020/03/09 v1.6.6 udesoftec +%% 2021/02/22 v1.7.1 udesoftec % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -38,6 +38,6 @@ % and % http://mirrors.ctan.org/macros/latex/contrib/udesoftec/udesoftec-doc.pdf \NeedsTeXFormat{LaTeX2e}% -\ProvidesPackage{udesoftec-extra}[2020/03/09 v1.6.6 udesoftec-extra.sty additions which are currently optional and may break former behaviour]% +\ProvidesPackage{udesoftec-extra}[2021/02/22 v1.7.1-alpha udesoftec-extra.sty additions which are currently optional and may break former behaviour]% %%%%%%%%%%%%%%%%%%%%%%%%% % empty - everything from 1.4.x is merged into main files
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/udesoftec/udesoftec.cls b/Master/texmf-dist/tex/latex/udesoftec/udesoftec.cls index c13ddae7ce0..25e3b099745 100644 --- a/Master/texmf-dist/tex/latex/udesoftec/udesoftec.cls +++ b/Master/texmf-dist/tex/latex/udesoftec/udesoftec.cls @@ -1,7 +1,7 @@ % !Mode:: "TeX:UTF-8" %% udesoftec.cls %% Copyright 2013-2015 J. Peter M. Schuler -%% 2020/03/09 v1.7.0 udesoftec +%% 2021/02/22 v1.7.1 udesoftec % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -39,7 +39,7 @@ % http://mirrors.ctan.org/macros/latex/contrib/udesoftec/udesoftec-doc.pdf \NeedsTeXFormat{LaTeX2e}% -\ProvidesClass{udesoftec}[2020/03/09 v1.6.6 udesoftec.cls Thesis class and bibstyle for UDE SOFTEC]% +\ProvidesClass{udesoftec}[2021/02/22 v1.7.1 udesoftec.cls Thesis class and bibstyle for UDE SOFTEC]% % class is based on KOMA-script http://www.ctan.org/pkg/koma-script \LoadClass{scrbook} @@ -270,7 +270,7 @@ \labelRespectConfidentiality{(Sperrvermerk beachten)} \academicfield{Wirtschaftsinformatik} \institution{Vorgelegt der Fakult\"at f\"ur Wirtschaftswissenschaften der\par Universit\"at Duisburg-Essen} -\semester{\udesoftec@academicfield -- Sommersemester 2016} +\semester{\udesoftec@academicfield -- Sommersemester 2022} \entitle{Englischer Titel der Arbeit} \confidentialitySource{Name der Firma, die auf die Vertraulichkeitserkl\"arung besteht} \date{Dokumentversion: \today \linebreak Templateversion: @@ -285,8 +285,6 @@ Gutacher:&Prof. Dr. Stefan Eicker\\ &Prof. Dr. John Doe\\ \\ - Betreuer:&Dipl.-Wirt.-Inf Some Body\\ - \\ \end{tabularx} } @@ -300,7 +298,7 @@ \labelRespectConfidentiality{(Adhere confidentially clause --- Sperrvermerk beachten)} \academicfield{Business Information Systems} \institution{Presented to the Faculty of Economics and Business Administration of\par University of Duisburg-Essen} - \semester{\udesoftec@academicfield{} -- Summer semester 2016} + \semester{\udesoftec@academicfield{} -- Summer semester 2022} \confidentialitySource{Name of Company which wants the statutory declaration} \date{Document version: \today \linebreak Template version: \udesoftecversion{} (with \udesoftec@bblengine)} @@ -313,8 +311,6 @@ Examiner:&Prof. Dr. Stefan Eicker\\ &Prof. Dr. John Doe\\ \\ - Supervisor:&Dipl.-Wirt.-Inf Some Body\\ - \\ \end{tabularx} } \fi @@ -782,9 +778,9 @@ % default page behaviour: header has line, chap.section left; page right \pagestyle{scrheadings} -\clearscrheadings -\clearscrplain -\clearscrheadfoot +\clearmainofpairofpagestyles +\clearplainofpairofpagestyles +\clearpairofpagestyles % change color of headsepline \addtokomafont{headsepline}{\color{Headsepline}} % deprecating following line @@ -1067,6 +1063,11 @@ colorinlistoftodos hyperindex,linktoc=section,pdfstartview=FitV, pdfpagelabels, bookmarks=true,bookmarksopen=true,bookmarksopenlevel=1,bookmarksnumbered=true]{hyperref}% +\usepackage[ +open, +openlevel=1, +numbered=true +]{bookmark} \AfterEndPreamble{\def\subsectionautorefname{\sectionautorefname}} \AfterEndPreamble{\def\subsubsectionautorefname{\sectionautorefname}} % change url font type to "inherit" @@ -1082,10 +1083,13 @@ bookmarks=true,bookmarksopen=true,bookmarksopenlevel=1,bookmarksnumbered=true]{h % for glossary and acronyms; instead of package acronym % special: glossary after hyperref % special:\AtEndDocument{\printglossary} before usepackage to suppress warning of missing printglossary -%\usepackage[footnote,printonlyused]{acronym} +\AtEndDocument{% + \printglossary% +} \usepackage[acronym,nonumberlist,section=chapter,toc,nowarn]{glossaries} \deftranslation[to=ngerman]{Acronyms}{Abkürzungsverzeichnis} \deftranslation[to=ngerman]{Glossary}{Glossar} +\GlsSetQuote{+} \makeglossaries \newglossarystyle{myAcronymStyle}{% % put the glossary in the itemize environment: @@ -1105,9 +1109,6 @@ bookmarks=true,bookmarksopen=true,bookmarksopenlevel=1,bookmarksnumbered=true]{h } -%\AtEndDocument{% -% \printglossary% -%} \newcommand{\figref}[1]{\autoref{fig:#1}} \newcommand{\eng}[1]{engl.: \emph{\english{#1}}} \newcommand{\entode}[1]{engl. für \emph{\english{#1}}} diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def index ff6683c71c7..a008e370ef2 100644 --- a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def +++ b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def @@ -11,7 +11,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesFile{pxjahyper-ajm.def}[2021/02/13 v0.7] +\ProvidesFile{pxjahyper-ajm.def}[2021/02/23 v0.7a] %% avoid multiple loading \csname pxjahyperajmLoaded\endcsname diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty index b8724de6382..b1c1eee2b0d 100644 --- a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty +++ b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty @@ -10,7 +10,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesPackage{pxjahyper-enc}[2021/02/13 v0.7] +\ProvidesPackage{pxjahyper-enc}[2021/02/23 v0.7a] \def\pxhe@pkgname{pxjahyper-enc} \providecommand{\bxDebug}[1]{} diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty index f7a8699dc4b..003c27138fb 100644 --- a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty +++ b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty @@ -10,7 +10,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesPackage{pxjahyper}[2021/02/13 v0.7] +\ProvidesPackage{pxjahyper}[2021/02/23 v0.7a] \def\pxhy@pkgname{pxjahyper} \providecommand{\bxDebug}[1]{} @@ -540,7 +540,7 @@ pxhy@driver = \the\pxhy@driver^^J% }% \ifpxhy@otfmacros \ifx\ajSnowman\@undefined\else % ajmacros is loaded - \makeatletter + \chardef\pxhy@tmp@orgcc=\catcode`\@ \InputIfFileExists{pxjahyper-ajm.def}{% \PackageInfo\pxhy@pkgname {Loaded 'pxjahyper-ajm.def'\@gobble}% @@ -548,7 +548,7 @@ pxhy@driver = \the\pxhy@driver^^J% \PackageWarning\pxhy@pkgname {File 'pxjahyper-ajm.def' not found\@gobble}% }% - \makeatother + \catcode`\@=\pxhy@tmp@orgcc \fi \fi } |