%%
%% This is file `scrlfile-patcholdlatex.sty',
%% generated with the docstrip utility, extended by scrdocstrip.
%%
%% The original source files were:
%%
%% scrlfile-patcholdlatex.dtx  (with options: `package')
%% scrlogo.dtx  (with options: `logo')
%% 
%% Copyright (c) 2002-2026 Markus Kohm [komascript at gmx info]
%% 
%% This file was generated from file(s) of the KOMA-Script bundle.
%% ---------------------------------------------------------------
%% 
%% It may be distributed under the conditions of the
%% LaTeX Project Public License in the version distributed together
%% with KOMA-Script, see file `lppl.txt' or `lppl-de.txt'.
%% 
%% This file may only be distributed together with a copy of the
%% KOMA-Script bundle.  You may however distribute the
%% KOMA-Script bundle without all such generated files.  See also
%% `lppl.txt' or `lppl-de.txt' for additional information.
%% 
%% The list of files belonging to KOMA-Script distribution is given in
%% the file `MANIFEST.md'.  See also `lppl.txt' or `lppl-de.txt' for
%% additional information.
%% 
%% If this file is a beta version, you may not be allowed to distribute
%% it.  Look at the comments below to see if this is the case.
%% 
%% English and German manuals are part of KOMA-Script bundle.
%% ----------------------------------------------------------
%% 
%% See `README'.
%% 
%% The KOMA-Script bundle (but maybe not this file) was based upon the
%% LaTeX 2.09 Script family created by Frank Neukam 1993 and the LaTeX2e
%% standard classes created by The LaTeX3 Project 1994-1996.  You can
%% find a complete unmodified copy of LaTeX2e at
%% <http://mirror.ctan.org/tex-archive/macros/latex/base/>.
%% 
%%% From File: $Id: scrlfile-patcholdlatex.dtx 3874 2022-06-05 10:38:02Z kohm $
\ProvidesPackage{scrlfile-patcholdlatex}[%
  2026/02/02 v3.49.2 KOMA-Script
  package
  (patching old LaTeX kernels)]
\@ifundefined{IfFormatAtLeastTF}{}{%
  \IfFormatAtLeastTF{2020/10/01}{%
    \PackageError{scrlfile-hook}{LaTeX too young for this package}{%
      It seems this package has been loaded directly using a LaTeX
      version\MessageBreak
      2020-10-01 or newer. This is not recommended. Please always load
      package\MessageBreak
      scrlfile instead of scrlfile-patcholdlatex.\MessageBreak
      If you would continue, I will try to load scrlfile-hook%
      \IfFormatAtLeast{2021/11/15}{}{-3.34}%
    }%
    \IfFormatAtLeastTF{2021/11/15}{%
      \RequirePackage{scrlfile-hook}%
    }{%
      \RequirePackage{scrlfile-hook-3.34}%
    }%
    \endinput
  }{}%
}
\@ifclassloaded{memoir}{%
  \PackageInfo{scrlfile}{class `memoir' detected.\MessageBreak
    Using a compatible redefinition of \string\InputIfFileExists,\MessageBreak
    but always robust and with the fix of the\MessageBreak
    argument order bug even for old versions of the\MessageBreak
    LaTeX kernel%
  }%
}{%
  \long\def\reserved@a#1#2{%
    \IfFileExists{#1}%
      {#2\@addtofilelist{#1}\@@input \@filef@und}}%
  \ifx\reserved@a\InputIfFileExists\else
    \expandafter\CheckCommand\expandafter*\expandafter\InputIfFileExists
    \expandafter{%
      \expandafter\protect\csname InputIfFileExists \endcsname
    }%
    \expandafter\CheckCommand \csname InputIfFileExists \endcsname[2]{%
      \IfFileExists {#1}{%
        \expandafter \@swaptwoargs \expandafter {\@filef@und }%
        {#2\@addtofilelist {#1}\@@input }%
      }%
    }%
  \fi
}
\expandafter\renewcommand\expandafter*\expandafter\InputIfFileExists
\expandafter{\expandafter
  \protect\csname InputIfFileExists \endcsname}%
\expandafter\long\expandafter\def\csname InputIfFileExists \endcsname#1#2{%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname #1-@alias\endcsname\relax
    \expandafter\@secondoftwo
  \else
    \scr@replacefile@msg{\csname #1-@alias\endcsname}{#1}%
    \expandafter\@firstoftwo
  \fi
  {%
    \expandafter\InputIfFileExists\expandafter{\csname
      #1-@alias\endcsname}{#2}%
  }%
  {\IfFileExists{#1}{%
      \expandafter\scr@input@withhook\expandafter{\@filef@und}{#1}{#2}%
    }}%
}
\@ifclassloaded{memoir}{%
  \newcommand{\scr@input@withhook}[3]{%
    \scr@load@hook{before}{#2}%
    #3\@addtofilelist{#2}%
    \@ifundefined{m@matbeginf}{}{\m@matbeginf{#2}}%
    \@@input #1%
    \@ifundefined{m@matendf}{}{\m@matendf{#2}}%
    \@ifundefined{killm@matf}{}{\killm@matf{#2}}%
    \scr@load@hook{after}{#2}%
  }%
}{%
  \newcommand{\scr@input@withhook}[3]{%
    \scr@load@hook{before}{#2}%
    #3\@addtofilelist{#2}%
    \@@input #1%
    \scr@load@hook{after}{#2}%
  }%
}
\newcommand*{\scr@@loadwithoptions}{}
\newcommand*{\scr@loadwithoptions}{}
\let\scr@loadwithoptions\@loadwithoptions
\renewcommand*{\@loadwithoptions}[3]{%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname #3.#1-@aliasname\endcsname\relax
    \def\scr@@loadwithoptions{\scr@loadwithoptions{#1}{#2}{#3}}%
  \else
    \scr@replacefile@msg{\csname #3.#1-@aliasname\endcsname.#1}{#3.#1}%
    \def\scr@@loadwithoptions{%
      \@loadwithoptions{#1}{#2}{\csname #3.#1-@aliasname\endcsname}%
    }%
  \fi
  \scr@@loadwithoptions
}
\newcommand*{\scr@onefilewithoptions}{}
\let\scr@onefilewithoptions\@onefilewithoptions
\def\@onefilewithoptions#1[#2][#3]#4{%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname #1.#4-@aliasname\endcsname\relax
    \def\scr@@onefilewithoptions{\scr@onefilewithoptions{#1}}%
  \else
    \scr@replacefile@msg{\csname #1.#4-@aliasname\endcsname.#4}{#1.#4}%
    \edef\scr@@onefilewithoptions{%
      \noexpand\@onefilewithoptions{\csname #1.#4-@aliasname\endcsname}}%
  \fi
  \scr@@onefilewithoptions[{#2}][{#3}]{#4}%
  \scr@load@hook{lateafter}{#1.#4}%
}
\newcommand*{\scr@replacefile@msg}[2]{%
  \PackageInfo{scrlfile}{inputing `#1' instead of `#2'}%
}
\newcommand*{\scr@load@hook}[2]{%
  \ifx\@begindocumenthook\@undefined\else
    \edef\scrlfile@hookname{#1}%
    \def\scrlfile@cmp@hook{before}%
    \ifx\scrlfile@hookname\scrlfile@cmp@hook
      \expandafter\def\csname #2-l@ading\endcsname{#2}%
    \fi
    \let\scrlfile@cmp@hook\@undefined
  \fi
  \@ifundefined{#2-@#1}{}{%
    \@nameuse{#2-@#1}%
    \expandafter\let\csname #2-@#1\endcsname\relax
  }%
  \ifx\@begindocumenthook\@undefined\else
    \edef\scrlfile@hookname{#1}%
    \def\scrlfile@cmp@hook{after}%
    \ifx\scrlfile@hookname\scrlfile@cmp@hook
      \expandafter\let\csname #2-l@ading\endcsname\@undefined
    \fi
    \let\scrlfile@cmp@hook\@undefined
    \let\scrlfile@hookname\@undefined
  \fi
}
\newcommand*{\scr@set@load@hook}[2]{%
  \@ifundefined{#2-@#1}{\@namedef{#2-@#1}{}}{}%
  \expandafter\g@addto@macro\csname #2-@#1\endcsname
}
\newcommand*{\BeforeFile}{\scr@set@load@hook{before}}
\newcommand*{\AfterFile}{\scr@set@load@hook{after}}
\newcommand*{\BeforeClass}[1]{%
  \scr@set@load@hook{before}{#1.\@clsextension}%
}
\newcommand*{\scrlfile@AfterClass}{%
  \kernel@ifstar \@sAfterClass\@AfterClass
}
\newcommand*{\AfterClass}{\scrlfile@AfterClass}
\newcommand*{\@AfterClass}[1]{%
  \scr@set@load@hook{after}{#1.\@clsextension}%
}
\newcommand*{\@sAfterClass}[1]{%
  \@ifclassloaded{#1}{%
    \@secondoftwo
  }{%
    \@AfterClass
  }%
  {#1}%
}
\newcommand*{\AfterAtEndOfClass}{%
  \kernel@ifstar \@sAfterAtEndOfClass\@AfterAtEndOfClass
}
\newcommand*{\@AfterAtEndOfClass}[1]{%
  \scr@set@load@hook{lateafter}{#1.\@clsextension}%
}
\newcommand*{\@sAfterAtEndOfClass}[1]{%
  \@ifundefined{#1.\@clsextension-l@ading}{%
    \@ifclassloaded{#1}{%
      \@secondoftwo
    }{%
      \@AfterAtEndOfClass
    }%
  }{%
    \@AfterAtEndOfClass
  }%
  {#1}%
}
\newcommand*{\BeforePackage}[1]{%
  \scr@set@load@hook{before}{#1.\@pkgextension}%
}
\newcommand*{\scrlfile@AfterPackage}{%
  \kernel@ifstar \@sAfterPackage\@AfterPackage
}
\newcommand*{\AfterPackage}{\scrlfile@AfterPackage}
\newcommand*{\@AfterPackage}[1]{%
  \scr@set@load@hook{after}{#1.\@pkgextension}%
}
\newcommand*{\@sAfterPackage}[1]{%
  \@ifpackageloaded{#1}{%
    \@secondoftwo
  }{%
    \@AfterPackage
  }%
  {#1}%
}
\newcommand*{\AfterAtEndOfPackage}{%
  \kernel@ifstar \@sAfterAtEndOfPackage\@AfterAtEndOfPackage
}
\newcommand*{\@sAfterAtEndOfPackage}[1]{%
  \@ifundefined{#1.\@pkgextension-l@ading}{%
    \@ifpackageloaded{#1}{%
      \@secondoftwo
    }{%
      \@@AfterAtEndOfPackage
    }%
  }{%
    \@@AfterAtEndOfPackage
  }%
  {#1}%
}
\newcommand*{\@AfterAtEndOfPackage}[1]{%
  \@ifpackageloaded{#1}{%
    \@ifundefined{#1.\@pkgextension-l@ading}{%
      \@gobbletwo
    }{%
      \@@AfterAtEndOfPackage
    }%
  }{%
    \@@AfterAtEndOfPackage
  }%
  {#1}%
}
\newcommand*{\@@AfterAtEndOfPackage}[1]{%
  \scr@set@load@hook{lateafter}{#1.\@pkgextension}%
}
\newcommand*{\ReplaceInput}[2]{%
  \expandafter\edef\csname #1-@alias\endcsname{#2}%
}
\newcommand*{\ReplaceFile}{%
  \PackageError{scrlfile}{%
    usage of not documented command `\string\ReplaceFile'%
  }{%
    Command `\string\ReplaceFile' has been implemented accidentally in
    KOMA-Script 2.96\MessageBreak
    and replaced by `\string\ReplaceInput' in KOMA-Script 3.12.\MessageBreak
    You should replace `\string\ReplaceFile' by `\string\ReplaceInput' to
    avoid this error\MessageBreak
    message%
  }%
  \ReplaceInput
}
\newcommand*{\UnReplaceInput}[1]{%
  \ifcsname #1-@alias\endcsname
    \expandafter\let\csname #1-@alias\endcsname\relax
  \fi
}
\newcommand*{\@replacefilewithext}[3]{%
  \expandafter\xdef\csname #1.#3-@aliasname\endcsname{#2}%
}
\newcommand*{\ReplacePackage}[2]{%
  \@replacefilewithext{#1}{#2}\@pkgextension
}
\newcommand*{\ReplaceClass}[2]{%
  \@replacefilewithext{#1}{#2}\@clsextension
}
\newcommand*{\@unreplacefilewithext}[2]{%
  \ifcsname #1.#2-@aliasname\endcsname
    \expandafter\global\expandafter\let\csname #1.#2-@aliasname\endcsname\relax
  \fi
}
\newcommand*{\UnReplacePackage}[1]{%
  \@unreplacefilewithext{#1}\@pkgextension
}
\newcommand*{\UnReplaceClass}[1]{%
  \@unreplacefilewithext{#1}\@clsextension
}
\newcommand*{\scrlfile@excludedpackages}{}
\let\scrlfile@excludedpackages\@empty
\newcommand*{\scrlfile@saved@RequirePackage}{}
\newcommand*{\PreventPackageFromLoading}{%
  \kernel@ifstar{\@PreventPackageFromLoading\PackageInfo}%
          {\@PreventPackageFromLoading\PackageWarning}%
}
\newcommand*{\@PreventPackageFromLoading}[1]{%
  \kernel@ifnextchar [%]
    {\@@PreventPackageFromLoading#1}{\@@PreventPackageFromLoading#1[]}%
}
\newcommand*{\@@PreventPackageFromLoading}{}
\def\@@PreventPackageFromLoading#1[#2]#3{%
  \edef\reserved@b{\zap@space#3 \@empty}%
  \ifx \reserved@b\@empty
    #1{scrlfile}{%
      \string\PreventPackageFromLoading\space with empty packages\MessageBreak
      argument ignored%
    }%
  \else
    \ifx\scrlfile@excludedpackages\@empty
      \global\let\scrlfile@saved@RequirePackage\RequirePackage
      \global\let\RequirePackage\scrlfile@RequirePackage
      \def\reserved@a##1##{%
        \@latex@error
        {\noexpand \usepackage before \string\documentclass}%
        {\noexpand \usepackage may only appear in the document
          preamble, i.e.,\MessageBreak
          between \noexpand\documentclass and
          \string\begin{document}.}%
        \@gobble}%
      \ifx\reserved@a\usepackage\else
        \ifx\usepackage\scrlfile@saved@RequirePackage\else
          \PackageWarning{scrlfile}{%
            Maybe serious problem: unexpected definition of\MessageBreak
            \string\usepackage
          }%
        \fi
        \global\let\usepackage\RequirePackage
      \fi
    \fi
    \@for\reserved@a:=\reserved@b\do {%
      \ifx\reserved@a\@empty
        #1{scrlfile}{%
          empty package argument for
          \string\PreventPackageFromLoading\MessageBreak
          ignored%
        }%
      \else
        \expandafter\@ifpackageloaded\expandafter{\reserved@a}{%
          #1{scrlfile}{%
            package `\reserved@a' already loaded.\MessageBreak
            Cannot prevent it from beeing loaded%
          }%
        }{%
          \ifx\scrlfile@excludedpackages\@empty
            \global\let\scrlfile@excludedpackages\reserved@a
          \else
            \xdef\scrlfile@excludedpackages{\scrlfile@excludedpackages,%
              \reserved@a}%
          \fi
          \if\relax\detokenize{#2}\relax\else
            \@ifundefined{scrlfile@exclude@package@\reserved@a @do}{%
              \@namedef{scrlfile@exclude@package@\reserved@a @do}{}%
            }{}%
            \expandafter\gdef
            \csname scrlfile@exclude@package@\reserved@a
                    @do\expandafter\expandafter\expandafter\endcsname
            \expandafter\expandafter\expandafter{%
              \csname scrlfile@exclude@package@\reserved@a @do\endcsname
              #2%
            }%
          \fi
        }%
      \fi
    }%
    \ifx\scrlfile@excludedpackages\@empty
      \ResetPreventPackageFromLoading
    \fi
  \fi
}
\@onlypreamble\PreventPackageFromLoading
\newcommand*{\ResetPreventPackageFromLoading}{%
  \global\let\scrlfile@excludedpackages\@empty
  \ifx\RequirePackage\scrlfile@RequirePackage
    \ifx\usepackage\RequirePackage
      \global\let\usepackage\scrlfile@saved@RequirePackage
    \fi
    \global\let\RequirePackage\scrlfile@saved@RequirePackage
  \fi
}
\@onlypreamble\ResetPreventPackageFromLoading
\newcommand*{\StorePreventPackageFromLoading}[1]{%
  \let#1\scrlfile@excludedpackages
}
\@onlypreamble\StorePreventPackageFromLoading
\newcommand*{\UnPreventPackageFromLoading}{%
  \kernel@ifstar {\@tempswatrue\@UnPreventPackageFromLoading}%
           {\@tempswafalse\@UnPreventPackageFromLoading}%
}
\newcommand*{\@UnPreventPackageFromLoading}[1]{%
  \edef\reserved@b{\zap@space#1 \@empty}%
  \if@tempswa
    \@for\reserved@a:=\reserved@b\do {%
      \ifx\reserved@a\@empty \else
        \ifcsname scrlfile@exclude@package@\reserved@a @do\endcsname
          \expandafter\let
          \csname scrlfile@exclude@package@\reserved@a @do\endcsname
          \undefined
        \fi
      \fi
    }%
  \fi
  \ifcsname scrlfile@excludedpackages\endcsname
    \let\reserved@a\scrlfile@excludedpackages
    \let\scrlfile@excludedpackages\@empty
    \expandafter\@for\expandafter\reserved@c
    \expandafter:\expandafter=\reserved@a
    \do{%
      \ifx\reserved@c\@empty\else
        \@expandtwoargs\in@{,\reserved@c,}{,\reserved@b,}%
        \ifin@
        \else
          \ifx\scrlfile@excludepackages\@empty
            \global\let\scrlfile@excludepackages\reserved@c
          \else
            \xdef\scrlfile@excludedpackages{%
              \scrlfile@excludedpackages,\reserved@c
            }%
          \fi
        \fi
      \fi
    }%
    \ifx\scrlfile@excludedpackages\@empty\ResetPreventPackageFromLoading\fi
  \fi
}
\newcommand*{\scrlfile@RequirePackage}[2][]{%
  \let\reserved@c\@empty
  \let\reserved@d\@empty
  \edef\reserved@b{\zap@space#2 \@empty}%
  \expandafter\@for\expandafter\reserved@b\expandafter:\expandafter=\reserved@b
  \do {%
    \begingroup
      \@tempswatrue
      \@for\reserved@a:=\scrlfile@excludedpackages\do {%
        \ifx\reserved@a\reserved@b
          \@tempswafalse
        \fi
      }%
      \if@tempswa
        \xdef\reserved@c{\reserved@c,\reserved@b}%
      \else
        \ifx\reserved@b\@empty\else
          \PackageInfo{scrlfile}{Excluding package `\reserved@b'\MessageBreak
            from loading}%
          \@ifundefined{scrlfile@exclude@package@\reserved@b @do}{%
          }{%
            \expandafter\g@addto@macro\expandafter\reserved@d
            \csname scrlfile@exclude@package@\reserved@b @do\endcsname
          }%
        \fi
      \fi
    \endgroup
  }%
  \ifx\reserved@c\@empty
    \let\reserved@a\scr@gobbleopt
  \else
    \edef\reserved@a{\noexpand\scrlfile@saved@RequirePackage[#1]{%
        \expandafter\@gobble\reserved@c\@empty}}%
  \fi
  \expandafter\reserved@d
  \reserved@a
}
\providecommand{\scr@gobbleopt}[1][]{}
\providecommand*\kernel@ifstar[1]{\kernel@ifnextchar*{\@firstoftwo{#1}}}
\AtEndDocument{%
  \let\scr@saved@checkend=\@checkend
  \renewcommand*{\@checkend}[1]{%
    \def\reserved@a{#1}\def\reserved@b{document}%
    \scr@saved@checkend{#1}%
    \ifx\reserved@a\reserved@b
      \let\scr@saved@clearpage=\clearpage
      \renewcommand*{\clearpage}{\scr@saved@clearpage
        \scr@hook@bcma
        \scr@restore@newpage
        \let\clearpage=\scr@saved@clearpage}%
    \fi%
    \let\scr@saved@dofilelist\@dofilelist
    \def\@dofilelist{%
      \scr@hook@acma
      \let\@dofilelist\scr@saved@dofilelist
      \scr@saved@dofilelist
    }%
  }%
}
\newcommand*{\scr@saved@checkend}{}
\newcommand*{\scr@saved@dofilelist}{}
\newcommand*{\scr@redefine@newpage}{%
  \let\scr@saved@newpage\newpage
  \def\scr@restore@newpage{%
    \renewcommand*{\newpage}{%
      \PackageWarningNoLine{%
        scrlfile%
      }{%
        \string\newpage\space at main aux file!\MessageBreak
        You have output material at the main aux file.\MessageBreak
        Note, that the \string\BeforeClosingMainAux\space commands\MessageBreak
        are processed before the output from aux file%
      }%
      \let\newpage\scr@saved@newpage
      \newpage
    }%
  }%
  \renewcommand*{\newpage}{%
    \PackageError{%
      scrlfile%
    }{%
      \string\newpage\space at \string\BeforeClosingMainAux
    }{%
      You should never use \string\newpage\space or
      \string\clear(double)page or other output material at the\MessageBreak
      argument of \string\BeforeClosingMainAux!\MessageBreak
      If you'll continue, the \string\newpage\space will be ignored to
      avoid corruption of\MessageBreak
      every prior use of \string\BeforeClosingMainAux.
    }%
  }%
}
\newcommand*{\scr@restore@newpage}{}
\newcommand*{\scr@hook@bcma}{}
\newcommand*{\scr@hook@acma}{}
\newcommand*{\BeforeClosingMainAux}{%
  \ifx\scr@hook@bcma\@empty
    \gdef\scr@hook@bcma{%
      \renewcommand*{\BeforeClosingMainAux}[1]{####1}%
      \let\protected@write\protected@immediate@write
      \scr@redefine@newpage
    }%
  \fi
  \g@addto@macro\scr@hook@bcma%
}
\newcommand*{\AfterReadingMainAux}{%
  \ifx\scr@hook@acma\@empty
    \gdef\scr@hook@acma{%
      \renewcommand*{\AfterReadingMainAux}[1]{####1}%
      \let\protected@write\protected@immediate@write
    }%
  \fi
  \g@addto@macro\scr@hook@acma%
}
\long\def\protected@immediate@write#1#2#3{%
  \begingroup
    #2%
    \let\protect\@unexpandable@protect
    \edef\reserved@a{\immediate\write#1{#3}}%
    \reserved@a
  \endgroup
  \if@nobreak\ifvmode\nobreak\fi\fi
}
%%% From File: $Id: scrlogo.dtx 4032 2023-04-17 09:45:11Z kohm $
\RequirePackage{scrlogo}
\endinput
%%
%% End of file `scrlfile-patcholdlatex.sty'.
