summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/koma-script/scrlayer-notecolumn.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/koma-script/scrlayer-notecolumn.dtx')
-rw-r--r--Master/texmf-dist/source/latex/koma-script/scrlayer-notecolumn.dtx91
1 files changed, 64 insertions, 27 deletions
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 9a2061791b2..46ea2cc8e9f 100644
--- a/Master/texmf-dist/source/latex/koma-script/scrlayer-notecolumn.dtx
+++ b/Master/texmf-dist/source/latex/koma-script/scrlayer-notecolumn.dtx
@@ -1,4 +1,4 @@
-% \CheckSum{1715}
+% \CheckSum{1740}
% \iffalse^^A meta-comment
% ======================================================================
% scrlayer-notecolumn.dtx
@@ -57,7 +57,7 @@
% Right brace \} Tilde \~}
%
% \iffalse^^A meta-comment
-%%% From File: $Id: scrlayer-notecolumn.dtx 2670 2017-08-11 09:31:30Z kohm $
+%%% From File: $Id: scrlayer-notecolumn.dtx 2928 2018-02-02 17:10:27Z kohm $
%<identify>%%% (run: identify)
%<init>%%% (run: init)
%<options>%%% (run: options)
@@ -67,9 +67,9 @@
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\begingroup
\def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
- \filedate$Date: 2017-08-11 11:31:30 +0200 (Fri, 11 Aug 2017) $
+ \filedate$Date: 2018-02-02 18:10:27 +0100 (Fri, 02 Feb 2018) $
\def\filerevision$#1: #2 ${\gdef\filerevision{v0.1.#2}}
- \filerevision$Revision: 2670 $
+ \filerevision$Revision: 2928 $
\edef\reserved@a{%
\noexpand\endgroup
\noexpand\ProvidesFile{scrlayer-notecolumn.dtx}%
@@ -686,10 +686,12 @@
% to put contents into the note columns and to output the note columns.
%
% \begin{macro}{\tf@slnc}
-% \changes{v0.1.2395}{2016/03/25}{write to \texttt{aux}-file with
-% \cs{if@filesw}}^^A
+% \changes{v0.1.2395}{2016/03/25}{write to \texttt{aux}-file with
+% \cs{if@filesw}}^^A
% \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
% 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
@@ -711,7 +713,7 @@
\scrlayerAddToInterface\slnc@initwrite{}%
\scrlayerAddToInterface\slnc@openwrite{%
\newcommand*{\slnc@openwrite}{%
- \immediate\closeout\slnc@file
+ \immediate\closein\slnc@file
%<*trace>
\PackageInfo{scrlayer-notecolumn}{%
Opening `\jobname.slnc'\MessageBreak
@@ -720,21 +722,36 @@
\immediate\openout\tf@slnc\jobname.slnc
}%
}
+% \end{macrocode}
+% After reading the main \File{aux}-file at |\end{document}|, we again
+% 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
+% \begin{macrocode}
\AfterReadingMainAux{%
\immediate\closeout\tf@slnc
- \scr@ifundefinedorrelax{pdfmdfivesum}{%
- \PackageWarningNoLine{scrlayer-notecolumn}{%
- \string\pdfmdfivesum\space unavailable.\MessageBreak
- The package needs \string\pdfmdfivesum\space to test\MessageBreak
- whether or not one more LaTeX run will\MessageBreak
- be needed to make the note columns\MessageBreak
- right. If this command is unavailable\MessageBreak
- you have to do the decision without\MessageBreak
- this help of the package.%
- }%
- }{%
- \begingroup
+ \begingroup
+ \scr@ifundefinedorrelax{pdfmdfivesum}{%
+ \ifdefined\directlua
+ \edef\reserved@a{\directlua{slncmdfivesum("\jobname.slnc")}}%
+ \else
+ \let\reserved@a\relax
+ \fi
+ }{%
\edef\reserved@a{\pdfmdfivesum file {\jobname.slnc}}%
+ }%
+ \ifx\reserved@a\relax
+ \PackageWarningNoLine{scrlayer-notecolumn}{%
+ \string\pdfmdfivesum\space unavailable.\MessageBreak
+ The package needs \string\pdfmdfivesum\space or LuaTeX\MessageBreak
+ to test whether or not one more LaTeX run\MessageBreak
+ will be needed to make the note columns\MessageBreak
+ right. If this command is unavailable\MessageBreak
+ you have to do the decision without\MessageBreak
+ this help of the package%
+ }%
+ \else
\ifx \slnc@mdfivesum\reserved@a
%<*trace>
\PackageInfo{scrlayer-notecolumn}{%
@@ -747,14 +764,14 @@
MD5 of slnc-file changed.\MessageBreak
Last: \slnc@mdfivesum\MessageBreak
New: \space \reserved@a\MessageBreak
- At least one more LaTeX rerun need to\MessageBreak
+ At least one more LaTeX rerun needed to\MessageBreak
make note columns right%
}%
%</trace>
\aftergroup\@tempswatrue
\fi
- \endgroup
- }%
+ \fi
+ \endgroup
}
%</body>
% \end{macrocode}
@@ -873,7 +890,7 @@
}%
\else
\ifnum ##2<\value{slncpage}\relax
- \PackageWarning{scrlayer-notecolumn}{note of type `#1' delayed.}%
+ \PackageWarning{scrlayer-notecolumn}{note of type `#1' delayed}%
\fi
\boxmaxdepth\maxdepth
\expandafter\setbox\csname slnc@#1@box\endcsname\vbox{%
@@ -1104,7 +1121,7 @@
\PackageWarning{scrlayer-notecolumn}{%
column `\reserved@b' undefined.\MessageBreak
You should declare the column before the usage.\MessageBreak
- Notes will be lost
+ Notes will be lost%
}%
}{%
\expandafter\g@addto@macro
@@ -1160,7 +1177,11 @@
% \end{macrocode}
% \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
% \begin{macro}{\slnc@mdfivesum}
+% \changes{v0.1.2872}{2018/01/17}{definition and usage of Lua function
+% \texttt{slncmdfivesum}}^^A
% The MD5 sum of the file before opening it for reading.
% \begin{macrocode}
%<*body>
@@ -1168,17 +1189,33 @@
\let\slnc@mdfivesum\@empty
}
\scrlayerAddToInterface\slnc@file{%
- \scr@ifundefinedorrelax{pdfmdfivesum}{}{%
+ \scr@ifundefinedorrelax{pdfmdfivesum}{%
+ \ifdefined\directlua
+ \directlua{%
+ function slncmdfivesum(filename)
+ local fh = io.open(filename,"rb")
+ if fh then
+ local sum=md5.sumhexa(fh:read("*a"))
+ tex.sprint(sum)
+ fh:close()
+ end
+ end
+ }%
+ \xdef\slnc@mdfivesum{\directlua{slncmdfivesum("\jobname.slnc")}}%
+ \fi
+ }{%
\xdef\slnc@mdfivesum{\pdfmdfivesum file {\jobname.slnc}}%
+ }%
%<*trace>
+ \scr@ifundefinedorrelax{slnc@mdfivesum}{}{%
\PackageInfo{scrlayer-notecolumn}{%
MD5 of last `\jobname.slnc':\MessageBreak
\slnc@mdfivesum}%
-%</trace>
}%
+%</trace>
\newread\slnc@file
\immediate\openin\slnc@file \jobname.slnc
- \scrlayerOnAutoRemoveInterface{\immediate\closeout\slnc@file}%
+ \scrlayerOnAutoRemoveInterface{\immediate\closein\slnc@file}%
}
%</body>
% \end{macrocode}