TransWikia.com

Remove section name from header only from pages where the section starts

TeX - LaTeX Asked on May 6, 2021

I would like to remove the section name from my header only on pages where a section starts. Also I would like to keep using scrlayer-scrpage because it’s already implemented in my code. Of course I am also open for simpler solutions.

Thanks for your help.
Cheers,
Benson

documentclass{scrartcl}
usepackage[T1]{fontenc} 

usepackage[headsepline,automark, draft = false]{scrlayer-scrpage}
clearpairofpagestyles
ihead{headmark}
rohead{pagemark}

addtokomafont{pageheadfoot}{upshape}
KOMAoptions{onpsinit={linespread{1}selectfont}}

usepackage{blindtext}

begin{document}

section{First Section}
blindtext[11]

newpage

section{Second Section}
blindtext[11]

end{document}

One Answer

Is this what you want?

enter image description here

enter image description here

documentclass{scrartcl}
usepackage[T1]{fontenc} 

usepackage[headsepline,automark,draft=false]{scrlayer-scrpage}
clearpairofpagestyles
ihead[]{headmark}
ohead*{pagemark}
addtokomafont{pageheadfoot}{upshape}
KOMAoptions{onpsinit={linespread{1}selectfont}}

AddtoDoHook{heading/endgroup/section}{thispagestyle{plain}}

usepackage{blindtext}

begin{document}
    
    section{First Section}
    blindtext[11]
    
    clearpage
    
    section{Second Section}
    blindtext[11]
    
end{document}

Edit:

If you want the rule to appear in the plain header as well, add the option plainheadsepline:

documentclass{scrartcl}
usepackage[T1]{fontenc} 

usepackage[headsepline,plainheadsepline,automark,draft=false]{scrlayer-scrpage}
clearpairofpagestyles
ihead[]{headmark}
ohead*{pagemark}
addtokomafont{pageheadfoot}{upshape}
KOMAoptions{onpsinit={linespread{1}selectfont}}

AddtoDoHook{heading/endgroup/section}{thispagestyle{plain}}

usepackage{blindtext}

begin{document}
    
    section{First Section}
    blindtext[11]
    
    clearpage
    
    section{Second Section}
    blindtext[11]
    
end{document}

enter image description here enter image description here

Answered by schoekling on May 6, 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