From d2d86e5041a7b35d055ccfa595df7b1252234d4b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 28 Jun 2021 20:36:34 +0000 Subject: koma-script (28jun21) git-svn-id: svn://tug.org/texlive/trunk@59737 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/koma-script/scrlayer-notecolumn.dtx | 94 ++++++++++++++-------- 1 file changed, 59 insertions(+), 35 deletions(-) (limited to 'Master/texmf-dist/source/latex/koma-script/scrlayer-notecolumn.dtx') diff --git a/Master/texmf-dist/source/latex/koma-script/scrlayer-notecolumn.dtx b/Master/texmf-dist/source/latex/koma-script/scrlayer-notecolumn.dtx index d0c33a8c927..e169ac4772f 100644 --- a/Master/texmf-dist/source/latex/koma-script/scrlayer-notecolumn.dtx +++ b/Master/texmf-dist/source/latex/koma-script/scrlayer-notecolumn.dtx @@ -1,7 +1,7 @@ % \iffalse^^A meta-comment % ====================================================================== % scrlayer-notecolumn.dtx -% Copyright (c) Markus Kohm, 2013-2020 +% Copyright (c) Markus Kohm, 2013-2021 % % This file is part of the LaTeX2e KOMA-Script bundle. % @@ -19,7 +19,7 @@ % This work consists of all files listed in manifest.txt. % ---------------------------------------------------------------------- % scrlayer-notecolumn.dtx -% Copyright (c) Markus Kohm, 2013-2020 +% Copyright (c) Markus Kohm, 2013-2021 % % Diese Datei ist Teil der LaTeX2e KOMA-Script-Sammlung. % @@ -38,7 +38,7 @@ % Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien. % ====================================================================== % -%%% From File: $Id: scrlayer-notecolumn.dtx 3533 2020-09-11 13:32:10Z kohm $ +%%% From File: $Id: scrlayer-notecolumn.dtx 3601 2021-05-30 19:11:44Z kohm $ %%%% (run: identify) %%%% (run: init) %%%% (run: options) @@ -48,9 +48,9 @@ \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi \begingroup \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}} - \filedate$Date: 2020-09-11 15:32:10 +0200 (Fri, 11 Sep 2020) $ + \filedate$Date: 2021-05-30 21:11:44 +0200 (Sun, 30 May 2021) $ \def\filerevision$#1: #2 ${\gdef\filerevision{v0.3.#2}} - \filerevision$Revision: 3533 $ + \filerevision$Revision: 3601 $ \edef\reserved@a{% \noexpand\endgroup \noexpand\ProvidesFile{scrlayer-notecolumn.dtx}% @@ -211,8 +211,8 @@ % % Here we test the used pdf\TeX{} primitives. % \changes{v0.1}{2015/10/07}{ready for renaming \cs{pdfsavepos} and -% \cs{pdflastypos} in luaTeX}%^^A -% \changes{v0.1.2483}{2016/06/28}{grouping fixed}%^^A +% \cs{pdflastypos} in luaTeX} +% \changes{v0.1.2483}{2016/06/28}{grouping fixed} % \begin{macrocode} \@tempswatrue \scr@ifundefinedorrelax{pdfsavepos}{% @@ -292,7 +292,7 @@ % text width. So we can use a macro too. Both will be initialised to the % normal marginal note column later. % \changes{3.27}{2019/02/14}{initialization of one colour stack per note -% column}%^^A +% column} % For colour support we also need one colour stack per note column. A colour % stack is a feature only available for pdf\TeX{} and lua\TeX{}. % \begin{macrocode} @@ -363,7 +363,7 @@ } % \end{macrocode} % \begin{macro}{\slnc@initial@black} -% \changes{v0.2.3085}{2019/02/14}{new internal}%^^A +% \changes{v0.2.3085}{2019/02/14}{new internal} % The initial black is the colour used to initialize the colour stacks. As long % as only pdf\TeX{} and lua\TeX{} provide colour stacks, we can initialize it % with \texttt{0 g 0 G}. However it may be better to use the initial @@ -642,11 +642,11 @@ % % \begin{macro}{\tf@slnc} % \changes{v0.1.2395}{2016/03/25}{write to \texttt{aux}-file with -% \cs{if@filesw}}%^^A +% \cs{if@filesw}} % \begin{macro}{\slnc@initwrite} % \begin{macro}{\slnc@openwrite} % \changes{v0.1.2928}{2018/02/02}{use \cs{closein} instead of \cs{closeout} -% to close \cs{slnc@file}}%^^A +% to close \cs{slnc@file}} % First of all we need a file to write the notes to. We use the % \File{aux}-file to write into the file, because we need to read the file % while the document will be typeset and the same time we need to write into @@ -678,9 +678,9 @@ % calculate the md5 checksum of the \File{slnc}-file. If it has been changed % we set |\if@tempswa| to |\iftrue| to provocate a rerun message. % \changes{v0.1.2872}{2018/01/17}{usage of Lua function -% \texttt{slncmdfivesum}}%^^A +% \texttt{slncmdfivesum}} % \changes{v0.1.2972}{2018/04/01}{usage of not yet documented Xe\TeX{} -% primitive \cs{mdfivesum}}%^^A +% primitive \cs{mdfivesum}} % \begin{macrocode} \AfterReadingMainAux{% \immediate\closeout\tf@slnc @@ -688,7 +688,7 @@ \scr@ifundefinedorrelax{pdfmdfivesum}{% \scr@ifundefinedorrelax{mdfivesum}{% \ifdefined\directlua - \edef\reserved@a{\directlua{slncmdfivesum("\jobname.slnc")}}% + \edef\reserved@a{\directlua{slnc.mdfivesum(slnc.slncfile)}}% \else \let\reserved@a\relax \fi @@ -732,6 +732,18 @@ } % % \end{macrocode} +% \changes{v0.3.3600}{2021/05/30}{use of \textsf{scrwfile}'s never list}% +% The easiest way to make it compatible with \Package{scrwfile} is to put it +% on the \emph{never} list. +% \begin{macrocode} +%<*body> +\AfterPackage*{scrwfile}{% + \@ifundefined{scrwfile@never}{\def}{\g@addto@macro}% + \scrwfile@never{slnc}% +} +% +% \end{macrocode} +% % \end{macro}%^^A \slnc@openwrite % \end{macro}%^^A \slnc@initwrite % \end{macro}%^^A \tf@slnc @@ -749,9 +761,9 @@ % There is a star variant with the same parameters, that writes the % \meta{code} un-expanded. To do so, we need some internal commands. % \begin{macro}{\slnc@unexpanded} -% \changes{0.1.2583}{2017/02/08}{new (internal)}%^^A +% \changes{v0.1.2583}{2017/02/08}{new (internal)} % \begin{macro}{\slnc@makenote} -% \changes{0.1.2583}{2017/02/08}{new (internal)}%^^A +% \changes{v0.1.2583}{2017/02/08}{new (internal)} % \begin{macrocode} %<*body> \newcommand*{\slnc@unexpanded}{} @@ -847,7 +859,7 @@ \expandafter\hsize\csname slnc@#1@width\endcsname \normalfont\normalsize % \end{macrocode} -% \changes{v0.2.3085}{2019/02/14}{using colour stack if available}%^^A +% \changes{v0.2.3085}{2019/02/14}{using colour stack if available} % If a color stack is available we switch to it before changing the font. So a % color definition inside the font would overwrite every color change inside % the column! But if we don't have a color stack, color switching is not @@ -864,7 +876,7 @@ \fi % \end{macrocode} % \changes{v0.1}{2015/10/07}{ready for renaming \cs{pdfpageheight} in -% luaTeX}%^^A +% luaTeX} % From lua\TeX~0.80.1 \cs{pdfpageheight} will be renamed into % \cs{pageheight}. So we have to do an extra test for the new primitive. % \begin{macrocode} @@ -920,7 +932,7 @@ \ifdim\@tempdima>\z@ \kern\@tempdima\fi \fi % \end{macrocode} -% \changes{v0.1.2582}{2017/02/08}{restore several commands}%^^A +% \changes{v0.1.2582}{2017/02/08}{restore several commands} % Some commands have to be restored when processing the note. % \begin{macrocode} \slnc@restoreinnote @@ -967,7 +979,7 @@ \splitmaxdepth\baselineskip % \end{macrocode} % Bring back the colours: -% \changes{v0.2.3085}{2019/02/14}{\cs{slnc@switchcolorstack} added}%^^A +% \changes{v0.2.3085}{2019/02/14}{\cs{slnc@switchcolorstack} added} % \begin{macrocode} \usekomafont{notecolumn.#1}{% \expandafter\vsplit\csname slnc@#1@box\endcsname to @@ -986,7 +998,7 @@ % % \end{macrocode} % Bring back the colours: -% \changes{v0.2.3085}{2019/02/14}{\cs{slnc@switchcolorstack} added}%^^A +% \changes{v0.2.3085}{2019/02/14}{\cs{slnc@switchcolorstack} added} % \begin{macrocode} \usekomafont{notecolumn.#1}{% \slnc@switchcolorstack{#1}% @@ -1001,7 +1013,7 @@ } % \end{macrocode} % \begin{macro}{\slnc@switchcolorstack} -% \changes{v0.2.3085}{2019/02/14}{new internal}%^^A +% \changes{v0.2.3085}{2019/02/14}{new internal} % This either redefines \cs{set@color} or switches to the colour stack of the % note column given by the argument. % \begin{macrocode} @@ -1050,9 +1062,9 @@ % \end{macrocode} % \end{macro}%^^A \slnc@switchcolorstack % \begin{macro}{\restoreinnote} -% \changes{0.1.2582}{2017/02/08}{new command}%^^A +% \changes{v0.1.2582}{2017/02/08}{new command} % \begin{macro}{\slnc@restoreinnote} -% \changes{0.1.2582}{2017/02/08}{new (internal)}%^^A +% \changes{v0.1.2582}{2017/02/08}{new (internal)} % Some commands have to be restored while processing the notes. By default % these are \cs{label}, \cs{index}, \cs{glossary}. More can be added using % \cs{restoreinnote}. The storage is \cs{slnc@restoreinnote}. @@ -1080,7 +1092,7 @@ % \Macro{slnc@note} or \Macro{slnc@sync} in the file is greater than % \Counter{slncpage}. Put all these to the corresponding unprocessed list. % \begin{macro}{\slnc@catcodes} -% \changes{v0.3}{2019/03/02}{new internal}%^^A +% \changes{v0.3}{2019/03/02}{new internal} % We need a helper macro \cs{slnc@catcodes} to restore (some of) the catcodes % before reading from file. % \begin{macrocode} @@ -1193,12 +1205,15 @@ % \begin{macro}{\slnc@file} % The input file with the unprocessed notes. % \changes{v0.1.2928}{2018/02/02}{use \cs{closein} instead of \cs{closeout} -% to close \cs{slnc@file}}%^^A +% to close \cs{slnc@file}} % \begin{macro}{\slnc@mdfivesum} % \changes{v0.1.2872}{2018/01/17}{definition and usage of Lua function -% \texttt{slncmdfivesum}}%^^A +% \texttt{slncmdfivesum}} % \changes{v0.1.2972}{2018/04/01}{usage of not yet documented Xe\TeX{} -% primitive \cs{mdfivesum}}%^^A +% primitive \cs{mdfivesum}} +% \changes{v0.3.3591}{2021/03/25}{Lua function name changed to +% \texttt{slnc.mdfivesum}} +% \changes{v0.3.3591}{2021/03/25}{new Lua variable \texttt{slnc.slncfile}} % The MD5 sum of the file before opening it for reading. % \begin{macrocode} %<*body> @@ -1208,7 +1223,8 @@ \scr@ifundefinedorrelax{mdfivesum}{% \ifdefined\directlua \directlua{% - function slncmdfivesum(filename) + slnc = slnc or {} + function slnc.mdfivesum(filename) local fh = io.open(filename,"rb") if fh then local sum=md5.sumhexa(fh:read("*a")) @@ -1216,8 +1232,16 @@ fh:close() end end + if (string.sub(tex.jobname,1,1) == '"') + and (string.sub(tex.jobname,string.len(tex.jobname),-1) == '"') + then + slnc.slncfile = string.sub(tex.jobname,2,-2) + else + slnc.slncfile = tex.jobname + end + slnc.slncfile = slnc.slncfile .. '.slnc' }% - \xdef\slnc@mdfivesum{\directlua{slncmdfivesum("\jobname.slnc")}}% + \xdef\slnc@mdfivesum{\directlua{slnc.mdfivesum(slnc.slncfile)}}% \fi }{% \xdef\slnc@mdfivesum{\mdfivesum file {\jobname.slnc}}% @@ -1410,8 +1434,8 @@ % \end{macro}%^^A \clearnotecolumn % % \begin{macro}{\clearnotecolumns} -% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} added}%^^A -% \changes{v3.26}{2018/08/29}{removed spurious \cs{expandafter}}%^^A +% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} added} +% \changes{v3.26}{2018/08/29}{removed spurious \cs{expandafter}} % \begin{description} % \item[\OParameter{string list}:] comma separated list of note column names % (must be fully expandable and each element must expand to a string only, @@ -1572,8 +1596,8 @@ % synchronisation of the text with the note. % % \begin{macro}{\syncwithnotecolumn} -% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} added}%^^A -% \changes{v3.26}{2018/08/29}{removed spurious \cs{expandafter}}%^^A +% \changes{v3.26}{2018/08/29}{\cs{scr@trim@spaces} added} +% \changes{v3.26}{2018/08/29}{removed spurious \cs{expandafter}} % \begin{description} % \item[\OParameter{string}:] the name of the note column to sync with (this % must be fully expandable and expand to the name of a note column). By @@ -1696,7 +1720,7 @@ }% % \end{macrocode} % \changes{v0.1}{2015/10/07}{ready for renaming \cs{pdfpageheight} in -% luaTeX}%^^A +% luaTeX} % From lua\TeX~0.80.1 \cs{pdfpageheight} will be renamed into % \cs{pageheight}. So we have to do an extra test for the new primitive. % \begin{macrocode} -- cgit v1.2.3