summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/koma-script/source/scrwfile.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/koma-script/source/scrwfile.dtx')
-rw-r--r--macros/latex/contrib/koma-script/source/scrwfile.dtx73
1 files changed, 54 insertions, 19 deletions
diff --git a/macros/latex/contrib/koma-script/source/scrwfile.dtx b/macros/latex/contrib/koma-script/source/scrwfile.dtx
index 26e3b0af9e..7228e756ab 100644
--- a/macros/latex/contrib/koma-script/source/scrwfile.dtx
+++ b/macros/latex/contrib/koma-script/source/scrwfile.dtx
@@ -1,8 +1,7 @@
-% \CheckSum{306}
% \iffalse meta-comment
% ======================================================================
% scrwfile.dtx
-% Copyright (c) Markus Kohm, 2010-2020
+% Copyright (c) Markus Kohm, 2010-2021
%
% This file is part of the LaTeX2e KOMA-Script bundle.
%
@@ -29,7 +28,7 @@
% at least three times.
% ----------------------------------------------------------------------
% scrwfile.dtx
-% Copyright (c) Markus Kohm, 2010-2020
+% Copyright (c) Markus Kohm, 2010-2021
%
% Diese Datei ist Teil des LaTeX2e KOMA-Script-Pakets.
%
@@ -75,7 +74,7 @@
% Right brace \} Tilde \~}
%
% \iffalse
-%%% From File: $Id: scrwfile.dtx 3453 2020-02-25 07:33:30Z kohm $
+%%% From File: $Id: scrwfile.dtx 3600 2021-05-30 19:00:56Z kohm $
%<*dtx>
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\ProvidesFile{scrwfile.dtx}
@@ -84,7 +83,7 @@
%<package&identify>\ProvidesPackage{scrwfile}
%<driver>\ProvidesFile{scrwfile.drv}
%<*dtx|(package&identify)|driver>
- [2013/08/05 v0.1f-alpha KOMA-Script package (write and clone files)]
+ [2021/05/30 v0.1.9-alpha KOMA-Script package (write and clone files)]
%</dtx|(package&identify)|driver>
%<*dtx>
\ifx\documentclass\undefined
@@ -158,7 +157,8 @@
% \selectlanguage{english}
%
% \changes{v0.1}{2010/10/01}{start of new package}
-% \changes{v0.1g}{2014/10/13}{manual moved to \KOMAScript{} manual}
+% \changes{v0.1.7}{2014/10/13}{manual moved to \KOMAScript{} manual}
+% \changes{v0.1.9}{2021/05/30}{version number scheme changed}
%
% \StopEventually{%
% \clearpage
@@ -210,17 +210,27 @@
\RequirePackage{scrbase}[2010/09/17]
% \end{macrocode}
%
-% Package \textsf{tocbasic} is needed for the lists of cloned TOCs.
-% \begin{macrocode}
-\RequirePackage{tocbasic}[2010/10/01]
-% \end{macrocode}
-%
% Package \textsf{scrlfile} is needed because of the \texttt{aux} file
% handling and \verb|\protected@immediate@write|.
% \begin{macrocode}
\RequirePackage{scrlfile}[2010/09/30]
% \end{macrocode}
%
+% \subsubsection{Is is needed?}
+%
+% \changes{v0.1.9}{2021/05/30}{with Lua\LaTeX{} using is not recommended}
+% If the user uses Lua\LaTeX{} usage of \textsf{scrwfile} should not be
+% needed.
+% \begin{macrocode}
+\scr@ifluatex{%
+ \PackageInfoNoLine{scrwfile}{LuaLaTeX detected.\MessageBreak
+ With LuaLaTeX you should never get an error message:\MessageBreak
+ \space\space`No room for a new \string\write'.\MessageBreak
+ So scrwfile could make much more harm than benefit\MessageBreak
+ and using it is not recommended}%
+}{}
+% \end{macrocode}
+%
% \subsubsection{\LaTeX{} Kernel Patchs}
%
% For some features we need to patch \LaTeX{} kernel macros. Those features
@@ -249,7 +259,7 @@
\if@tempswa
\scr@ifundefinedorrelax{scrwfile@never}{}{%
\edef\reserved@b{#1}%
- \@for\reserved@a:=\scrwfile@only\do
+ \@for\reserved@a:=\scrwfile@never\do
{\ifx\reserved@a\reserved@b\@tempswafalse\fi}%
}%
\fi
@@ -356,13 +366,35 @@
\fi
}
% \end{macrocode}
+% \changes{v0.1.8}{2021/05/30}{added order rule for
+% \textsf{scrlayer-notecolumn}}
+% Note: Here we use a \LaTeX{} version test, because a do-nothing-definition
+% like the one of \textsf{latexrelease} wouldn't be correct, if the command is
+% not supported by the current \LaTeX{} kernel version setting.
+% \begin{macrocode}
+\IfLTXAtLeastTF{2020/10/01}{%
+ \DeclareHookRule{enddocument/afteraux}%
+ {scrwfile}{before}{scrlayer-notecolumn}%
+}{%
+ \@ifpackageloaded{scrlayer-notecolumn}{%
+ \PackageWarningNoLine{scrwfile}{%
+ Dangerous package order detected!\MessageBreak
+ As a general rule, you should load scrwfile as soon\MessageBreak
+ as possible, maybe even before `\string\documentclass'\MessageBreak
+ (using `\string\RequirePackage' instead of
+ `\string\usepackage').\MessageBreak
+ Following packages should be loaded after scrwfile:\MessageBreak
+ \space - scrlayer-notecolumn}%
+ }{}%
+}
+% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@starttoc}
% We have to add the single handle feature to this.
% \begin{macro}{\scrwfile@saved@starttoc}
-% \changes{v0.1e}{2013/07/24}{take care for unfriendly \textsl{hyperref}}
+% \changes{v0.1.5}{2013/07/24}{take care for unfriendly \textsl{hyperref}}
% This is the original definition, that will be used, if the file is not under
% \texttt{scrwfile}'s control. Because of package \textsl{hyperref}, that does
% a hard redefinition without any care for changed definitions, we have to
@@ -449,12 +481,13 @@
% \end{macro}
%
% \begin{macro}{\TOCclone}
-% \changes{v3.28}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
-% \changes{v3.28}{2019/11/19}{\cs{ifattoclist} replaced by
-% \cs{Ifattoclist}}%^^A
-% \changes{v3.28}{2019/11/19}{\cs{iftocfeature} replaced by
-% \cs{Iftocfeature}}%^^A
-% \changes{v3.30}{2020/02/25}{spurious space in warning message removed}%^^A
+% \changes{v0.1.8}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}
+% \changes{v0.1.8}{2019/11/19}{\cs{ifattoclist} replaced by \cs{Ifattoclist}}
+% \changes{v0.1.8}{2019/11/19}{\cs{iftocfeature} replaced by
+% \cs{Iftocfeature}}
+% \changes{v0.1.8}{2020/02/25}{spurious space in warning message removed}
+% \changes{v0.1.9}{2021/05/30}{requires package \textsf{tocbasic}}
+% \changes{v0.1.9}{2021/05/30}{can be used only in preamble}
% Clone the entries from the second (first mandatory) argument TOC to the
% third (second mandatory) argument TOC. If the first (optional) argument was
% given, define |\listof#3name| to this and also define |\listof#3| and clone
@@ -465,6 +498,7 @@
% extensions.
% \begin{macrocode}
\newcommand*{\TOCclone}[3][]{%
+ \RequirePackage{tocbasic}%
\scr@ifundefinedorrelax{scrwfile@clone@#2}{%
\expandafter\protected@edef\csname scrwfile@clone@#2\endcsname{%
#3,\protect\csname scrwfile@clone@#3\endcsname
@@ -499,6 +533,7 @@
\Iftocfeature{#2}{totoc}{\setuptoc{#3}{totoc}}{}%
}%
}
+\@onlypreamble\TOCClone
% \end{macrocode}
% \end{macro}
%