# automatically change geometry with KOMA-pagestyles

I'm trying to change the geometry (namely the top/head height) automatically depending on the selected pagestyle.

The goal is to have a bigger backgroundpicture in the header for every new chapter. Like for example: the eyes of the tiger in regular headers and the whole head in headers with a new chapter on the page. (For the pictures I'm using layers.)

I'm using the KOMA-package scrlayer-scrpage to add the geometry to the pagestyle-pair. I puzzled this together reading the KOMA-documentation, although I have to add I did'nt read the whole thing.

The result though is that the geometry defined last is kept globaly and the text is shifted downward (even out of the page) if a geometry with bigger top-value is called:

\documentclass[11pt,a4paper]{scrreprt}

% multiple columns with the multicols-environment
\usepackage{multicol}

% language-settings similar to babel
\usepackage{polyglossia}
\setdefaultlanguage[spelling=new]{german}

% type area and margins
\usepackage[showframe]{geometry}
\savegeometry{plaingeometry}
\geometry{left=3cm,right=2.5cm,top=3.5cm,bottom=3.75cm}

% KOMA pagestyles
\usepackage{scrlayer-scrpage}
% should call \loadgeometry every time plain.scrheadings is selected, eg. with a new chapter

\automark[section]{chapter}

% testing
\usepackage{lipsum}

\begin{document}
\begin{multicols}{2}

\chapter{Chapter}
\section{Section}
\lipsum[1]
\subsection{{Subsection}}
\lipsum[2-4]

\subsubsection{Subsubsection}
\lipsum[5-11]

\chapter{And back again}
\lipsum[12-17]

\end{multicols}
\end{document}


Either if you know a way to fix this, or to change geometry synchronised with changes of pagestyle I would appreciate it.(Maybe a change every time \chapter ist called would suffice to, but seems a bit to ugly to me.)

PS: First time I switched from reading to writing in this really helpfull community. I hope my autodidactic aproach doesn't hurt to bad.

• You shouldn't do this. If you want this on chapter pages it is quite enough to move the chapter text down but leave the geometry unchanged. – Ulrike Fischer Mar 13 '19 at 19:32
• thanks for your fast reply. – has Mar 13 '19 at 20:31
• I assume youe had something in the lines of '\newcommand{\mychapter}[1]{\par \vspace*{3cm} \chapter{#1}}' in mind. – has Mar 13 '19 at 20:42
• The KOMA-classes have better tools to change the spacing before a chapter. – Ulrike Fischer Mar 13 '19 at 20:43
• wrong timing. pagestyle are often set on a page, while geometry must normally be set before the page. Beside this changes of the geometry are suspicious anyway. You need them seldom. – Ulrike Fischer Mar 13 '19 at 20:47

Like Ulrike Fischer and Schweinebacke suggested I used KOMA functionality like \RedeclareSectionCommand to achive more or less, what I wanted.

Thanks for your advice, it helped me to get the bigger picture.

Thats what I've done with the picturestuff left out.

\documentclass[11pt,a4paper]{scrreprt}

% language-settings similar to babel
\usepackage{polyglossia}
\setdefaultlanguage[spelling=new]{german}

% type area and margins
\usepackage[showframe]{geometry}
\geometry{left=3cm,right=2.5cm,top=3.5cm,bottom=3.75cm}

\RedeclareSectionCommand[%
beforeskip = -2.5cm plus 2mm minus 1mm,%
afterskip  = 2.5cm plus 1mm minus 1mm%
]{chapter}

% KOMA pagestyles
\usepackage{scrlayer-scrpage}

\automark[section]{chapter}

% testing
\usepackage{lipsum}

\begin{document}
\chapter{Chapter}
\section{Section}
\lipsum[1]
\subsection{{Subsection}}
\lipsum[2-4]

\subsubsection{Subsubsection}
\lipsum[5-11]

\chapter{And back again}
\lipsum[12-17]

\end{document}


What exactly each of the lengths in

\RedeclareSectionCommand[% beforeskip = -2.5cm plus 2mm minus 1mm,% afterskip = 2.5cm plus 1mm minus 1mm% ]{chapter}

does, keeps slipping my mind though.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5855295062065125, "perplexity": 4961.953090037012}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-25/segments/1623487617599.15/warc/CC-MAIN-20210615053457-20210615083457-00623.warc.gz"}