%%
%% This is file `scrhack.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% scrhack.dtx  (with options: `package')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from scrhack.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file scrhack.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\providecommand\DeclareRelease[3]{}
\providecommand\DeclareCurrentRelease[2]{}
\DeclareRelease{v3.41}{2023-07-07}{scrhack-2023-07-07.sty}
\DeclareCurrentRelease{}{2023-07-15}
\ProvidesPackage{scrhack}
             [2024-09-04 v3.42
              scrhack emulation package]
\ifnum 0=\ifcsname IfFormatAtLeastTF\endcsname
    \IfFormatAtLeastTF{2022-06-01}{1}{0}%
  \else
    0%
  \fi\relax
  \PackageError{scrhack}{LaTeX kernel too old}{%
    The package needs at least LaTeX 2022-06-01.\MessageBreak
    This error is fatal. Loading will be aborted.%
  }%
  \endinput
\fi
\ExplSyntaxOn
\msg_new:nnn { scrhack } { option-too-late }
  {
    option~`#1'~after~loading~package~`#2'~ignored.
  }
\msg_new:nnn { scrhack } { deprecated-option }
  {
    deprecated~option~`#1'~ignored.
  }
\DeclareKeys{%
  float .code      = \__scrhack_switch_float:n { #1 },
  float .default:n = true,
  float .usage     = preamble,
}
\bool_new:N \__scrhack_float_bool

\cs_new:Nn \__scrhack_switch_float:n
  {
    \str_case_e:nnF { \str_foldcase:n { #1 } }
      {
        {true}  {
                  \@ifpackageloaded { floatbytocbasic }
                    {
                      \msg_info:nnnn { scrhack } { option-too-late }
                        { float = true } { floatbytocbasic }
                    }
                    {
                      \bool_if:NF \__scrhack_float_bool
                        {
                          \hook_gput_code:nnn { package/float/after } { scrhack }
                            {
                              \RequirePackage { floatbytocbasic }
                            }
                          \bool_gset_true:N \__scrhack_float_bool
                        }
                    }
                }
        {false} {
                  \@ifpackageloaded { floatbytocbasic }
                    {
                      \msg_warning:nnnn { scrhack } { option-too-late }
                        { float=false } { floatbytocbasic }
                    }
                    {
                      \bool_if:NT \__scrhack_float_bool
                        {
                          \hook_gremove_code:nn { package/float/after } { scrhack }
                        }
                      \bool_gset_false:N \@s@_float_bool
                    }
                }
      }
      {
        \msg_warning:nnn { keys } { boolean-values-only } { float }
      }
  }
\SetKeys{float=true}
\DeclareKeys{%
  floatrow .code      = \__scrhack_switch_floatrow:n { #1 },
  floatrow .default:n = true,
  floatrow .usage     = preamble,
}
\bool_new:N \__scrhack_floatrow_bool

\cs_new:Nn \__scrhack_switch_floatrow:n
  {
    \str_case_e:nnF { \str_foldcase:n { #1 } }
      {
        {true}  {
                  \@ifpackageloaded { floatrowbytocbasic }
                    {
                      \msg_info:nnnn { scrhack } { option-too-late }
                        { floatrow = true } { floatrowbytocbasic }
                    }
                    {
                      \bool_if:NF \__scrhack_floatrow_bool
                        {
                          \hook_gput_code:nnn { package/floatrow/after }
                                              { scrhack }
                            {
                              \RequirePackage { floatrowbytocbasic }
                            }
                          \bool_gset_true:N \__scrhack_floatrow_bool
                        }
                    }
                }
        {false} {
                  \@ifpackageloaded { floatrowbytocbasic }
                    {
                      \msg_warning:nnnn { scrhack } { option-too-late }
                        { floatrow=false } { floatrowbytocbasic }
                    }
                    {
                      \bool_if:NT \__scrhack_floatrow_bool
                        {
                          \hook_gremove_code:nn { package/floatrow/after }
                                                { scrhack }
                        }
                      \bool_gset_false:N \@s@_floatrow_bool
                    }
                }
      }
      {
        \msg_warning:nnn { keys } { boolean-values-only } { floatrow }
      }
  }
\SetKeys{floatrow=true}
\DeclareKeys{%
  hyperref .code      = \__scrhack_switch_hyperref:n { #1 },
  hyperref .default:n = true,
  hyperref .usage     = preamble,
}
\cs_new:Nn \__scrhack_switch_hyperref:n
  {
    \str_case_e:nnF { \str_foldcase:n { #1 } }
      {
        {true}  {
                  \msg_warning:nnn { scrhack } { deprecated-option }
                                   { hyperref=#1 }
                }
        {false} {
                  \msg_info:nnn { scrhack } { deprecated-option }
                                { hyperref=#1 }
                }
      }
      {
        \msg_warning:nnn { keys } { boolean-values-only } { hyperref }
      }
  }
\DeclareKeys{%
  listings .code      = \__scrhack_switch_listings:n { #1 },
  listings .default:n = true,
  listings .usage     = preamble,
}
\cs_new:Nn \__scrhack_switch_listings:n
  {
    \str_case_e:nnF { \str_foldcase:n { #1 } }
      {
        {true}  {
                  \msg_warning:nnn { scrhack } { deprecated-option }
                                   { listings=#1 }
                }
        {false} {
                  \msg_info:nnn { scrhack } { deprecated-option }
                                { listings=#1 }
                }
      }
      {
        \msg_warning:nnn { keys } { boolean-values-only } { listings }
      }
  }
\DeclareKeys{%
  lscape .code      = \__scrhack_switch_lscape:n { #1 },
  lscape .default:n = true,
  lscape .usage     = preamble,
}
\bool_new:N \__scrhack_lscape_bool

\cs_new:Nn \__scrhack_switch_lscape:n
  {
    \str_case_e:nnF { \str_foldcase:n { #1 } }
      {
        {true}  {
                  \@ifpackageloaded { lscapeenhanced }
                    {
                      \msg_info:nnnn { scrhack } { option-too-late }
                        { lscape = true } { lscapeenhanced }
                    }
                    {
                      \bool_if:NF \__scrhack_lscape_bool
                        {
                          \hook_gput_code:nnn { package/lscape/after }
                                              { scrhack }
                            {
                              \RequirePackage { lscapeenhanced }
                            }
                          \bool_gset_true:N \__scrhack_lscape_bool
                        }
                    }
                }
        {false} {
                  \@ifpackageloaded { lscapeenhanced }
                    {
                      \msg_warning:nnnn { scrhack } { option-too-late }
                        { lscape=false } { lscapeenhanced }
                    }
                    {
                      \bool_if:NT \__scrhack_lscape_bool
                        {
                          \hook_gremove_code:nn { package/lscape/after }
                                                { scrhack }
                        }
                      \bool_gset_false:N \@s@_lscape_bool
                    }
                }
      }
      {
        \msg_warning:nnn { keys } { boolean-values-only } { lscape }
      }
  }
\SetKeys{lscape=true}
\DeclareKeys{%
  nomencl .code      = \__scrhack_switch_nomencl:n { #1 },
  nomencl .default:n = true,
  nomencl .usage     = preamble,
}
\cs_new:Nn \__scrhack_switch_nomencl:n
  {
    \str_case_e:nnF { \str_foldcase:n { #1 } }
      {
        {true}  {
                  \msg_warning:nnn { scrhack } { deprecated-option }
                                   { nomencl=#1 }
                }
        {false} {
                  \msg_info:nnn { scrhack } { deprecated-option }
                                { nomencl=#1 }
                }
      }
      {
        \msg_warning:nnn { keys } { boolean-values-only } { nomencl }
      }
  }
\DeclareKeys{%
  setspace .code      = \__scrhack_switch_setspace:n { #1 },
  setspace .default:n = true,
  setspace .usage     = preamble,
}
\bool_new:N \__scrhack_setspace_bool

\cs_new:Nn \__scrhack_switch_setspace:n
  {
    \str_case_e:nnF { \str_foldcase:n { #1 } }
      {
        {true}  {
                  \@ifpackageloaded { setspaceenhanced }
                    {
                      \msg_info:nnnn { scrhack } { option-too-late }
                        { setspace = true } { setspaceenhanced }
                    }
                    {
                      \bool_if:NF \__scrhack_setspace_bool
                        {
                          \hook_gput_code:nnn { package/setspace/after } { scrhack }
                            {
                              \exp_last_unbraced:Ne \RequirePackage
                                {
                                  [ \use:c { @raw@opt@setspace.sty },
                                    byselectfont,
                                    keepfontsize ]
                                }
                                { setspaceenhanced }
                            }
                          \bool_gset_true:N \__scrhack_setspace_bool
                        }
                    }
                }
        {false} {
                  \@ifpackageloaded { setspaceenhanced }
                    {
                      \msg_warning:nnnn { scrhack } { option-too-late }
                        { setspace=false } { setspaceenhanced }
                    }
                    {
                      \bool_if:NT \__scrhack_setspace_bool
                        {
                          \hook_gremove_code:nn { package/setspace/after } { scrhack }
                        }
                      \bool_gset_false:N \@s@_setspace_bool
                    }
                }
      }
      {
        \msg_warning:nnn { keys } { boolean-values-only } { setspace }
      }
  }
\SetKeys{setspace=true}
\DeclareKeys{%
  standardsections .code      = \__scrhack_switch_standardsectioning:n { #1 },
  standardsections .default:n = true,
  standardsections .usage     = preamble,
}
\bool_new:N \__scrhack_standardsectioning_bool

\cs_new:Nn \__scrhack_switch_standardsectioning:n
  {
    \str_case_e:nnF { \str_foldcase:n { #1 } }
      {
        {true}  {
                  \@ifpackageloaded { standardsectioning }
                    {
                      \msg_info:nnnn { scrhack } { option-too-late }
                        { standardsectioning = true } { standardsectioning }
                    }
                    {
                      \bool_if:NF \__scrhack_standardsectioning_bool
                        {
                          \str_set:Nx \l_tmpa_str { \cs_meaning:N \normalsize }
                          \str_if_in:NnTF
                            \l_tmpa_str
                            { \@latex@error }
                            {
                              \hook_gput_code:nnn { class/after } { scrhack }
                                {
                                  \RequirePackage { standardsectioning }
                                  \exp_args:Nnnx \hook_gput_code:nnn
                                    { begindocument/before } { scrhack }
                                    {
                                      \exp_not:N \cs_gset:Npn
                                      \exp_after:wN \exp_not:N
                                      \cs:w ver@standardsectioning.sty \cs_end:
                                        {
                                          \cs:w ver@standardsectioning.sty \cs_end:
                                        }
                                    }
                                  \cs_undefine:c { var@standardsectioning.sty }
                                }
                              \bool_gset_true:N \__scrhack_standardsectioning_bool
                            }
                            {
                              \RequirePackage{ standardsectioning }
                              \bool_gset_false:N \__scrhack_standardsectioning_bool
                            }
                        }
                    }
                }
        {false} {
                  \@ifpackageloaded { standardsectioning }
                    {
                      \msg_warning:nnnn { scrhack } { option-too-late }
                        { standardsectioning=false } { standardsectioning }
                    }
                    {
                      \bool_if:NT \__scrhack_standardsectioning_bool
                        {
                          \hook_gremove_code:nn { class/after } { scrhack }
                        }
                      \bool_gset_false:N \@s@_standardsectioning_bool
                    }
                }
      }
      {
        \msg_warning:nnn { keys } { boolean-values-only } { standardsectioning }
      }
  }
\ExplSyntaxOff
\ProcessKeyOptions\relax
\endinput
%%
%% End of file `scrhack.sty'.
