在自己的类文件中设置 koma 脚本选项

在自己的类文件中设置 koma 脚本选项

我问了一个问题,关于如何使用 scrlayer-scrpage 在 koma 脚本中设置页脚,以便获得页码和文本之间的正确距离(https://tex.stackexchange.com/a/559567/18561)。如果直接加载 komascript,则解决方案有效,但如果我在单独的类文件中加载 komascript,则无法使其工作。

%    \documentclass[footlines=1]{scrbook}            
\documentclass{debug-langscibook}            

%    \usepackage{scrlayer-scrpage}
%\usepackage{scrpage2}

\usepackage{showframe}

\usepackage{lipsum}% only for dummy text

\begin{document}

\lipsum[1-20]

\end{document}

这是自定义的类:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%     Class
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\LoadClass[
  footlines=1,
  ]{scrbook}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    Header and footer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{datetime}
\usepackage{scrlayer-scrpage}
%\usepackage{scrpage2}

footline=1 选项被忽略。

答案1

Optionfootline和 optionfootheight是包的选项typearea,由 KOMA-Script 类自动加载。但如果在 的参数中使用这些选项\LoadClass,包typearea将看不到它们。

您可以使用

\PassOptionsToPackage{footlines=1}{typearea}
\LoadClass{scrbook}
\RequirePackage{scrlayer-scrpage}

或者

\LoadClass{scrbook}
\KOMAoptions{footlines=1}
\recalctypearea
\RequirePackage{scrlayer-scrpage}

相关内容