%%
%% This is file `lscapeenhanced.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lscapeenhanced.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 lscapeenhanced.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file lscapeenhanced.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.)
\ProvidesPackage{lscapeenhanced}
             [2024-04-16 v1.0
              improved lscape package]
\ifnum 0=\ifcsname IfFormatAtLeastTF\endcsname
    \IfFormatAtLeastTF{2022-06-01}{1}{0}%
  \else
    0%
  \fi\relax
  \PackageError{lscapeenhanced}{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
\providecommand*{\@lscapeenhanced@req@packages}{lscape}
\DeclareKeys{%
  pdflscape .code              = {
    \renewcommand*{\@lscapeenhanced@req@packages}{lscape,pdflscape}
                                 },
  pdflscape .usage             = load,
  pdflscape .value_forbidden:n = true
}
\newif\if@lscapeenhanced@lscape \@lscapeenhanced@lscapetrue
\DeclareKeys{%
  lscape .if    = @lscapeenhanced@lscape,
  lscape.usage  = general,
}
\ExplSyntaxOff
\ProcessKeyOptions\relax
\expandafter\RequirePackage\expandafter{\@lscapeenhanced@req@packages}
\RequirePackage{xpatch}
\xpatchcmd{\landscape}{\textheight=\vsize}{%
  \if@lscapeenhanced@lscape
    \@lscapeenhanced@textheight=\vsize
    \let\@lscapeenhanced@outputpage\@outputpage
    \def\@outputpage{%
      \@lscapeenhanced@outputpage\global\@colht\@lscapeenhanced@textheight
    }%
  \else
    \textheight=\vsize
  \fi
}{%
  \PackageInfo{lscapeenhanced}{\string\landscape\space patched to make
    \string\textheight\space change optional}%
}{%
  \PackageWarning{lscapeenhanced}{Cannot patch \string\landscape!\MessageBreak
    Maybe you are using a unsupported lscape version}%
  \@lscapeenhanced@lscapefalse
}
\newlength{\@lscapeenhanced@textheight}
\endinput
%%
%% End of file `lscapeenhanced.sty'.
