1

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}
\KOMAoptions{titlepage=false,twoside, headinclude=false}

% 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}
\geometry{left=3cm,right=2.5cm,top=10cm,head=5cm,bottom=3.75cm}
\savegeometry{plaingeometry}
\geometry{left=3cm,right=2.5cm,top=3.5cm,bottom=3.75cm}
\savegeometry{scrheadingsgeometry} 

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

% set headmarks
\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.

  • 4
    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
  • 1
    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
1

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}
\KOMAoptions{titlepage=false,twoside, headinclude=false, twocolumn}

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

% set headmarks
\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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.