TransWikia.com

Setting koma script option from within ones own class file

TeX - LaTeX Asked on July 3, 2021

I asked a question on how to set up the footer in koma script to get the right distance between page number and text using scrlayer-scrpage (https://tex.stackexchange.com/a/559567/18561). The solution works if komascript is loaded directly, but I cannot get it to work if I load komascript in a separate class file.

%    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}

This is the self-defined class:

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


LoadClass[
  footlines=1,
  ]{scrbook}




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

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

The footline=1 option is simply ignored.

One Answer

Option footline and option footheight are options of package typearea which is loaded by the KOMA-Script classes automatically. But if you use this options in the argument of LoadClass, package typearea will not see them.

You could use either

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

or

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

Correct answer by esdd on July 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP