1

I have to following setup

\documentclass[12pt,a4paper]{scrreprt}

\usepackage[automark,headsepline]{scrlayer-scrpage}
\automark[chapter]{chapter}
\renewcommand{\chaptermarkformat}{}
\cfoot[\pagemark]{\pagemark}
\rehead{Chapter \thechapter}
\lohead{\headmark} %% <--- This results in too long marks

\begin{document}
\chapter[xxx really long title xxx xxx really long title xxx xxx really long title xxx]{Study 1}
\label{study1}
\section*{xxx really long title xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx}
\end{document}

Since automark uses the TOC entry in \lohead, it gets 3 lines long which is too much. Is there a way to somehow tweak some latex variables that instead of the long TOC entry the Study 1 would be taken?

  • Hi @Gabriel, did my answer solved you problem? If yes, it would be nice if you accept it. If no, why not? – Tobi Oct 8 at 21:02
2

If you activate the klasse option headings=optiontohead|optiontotoc|optiontoheadandtoc*, you can use the options head={…} and tocentry={…} in the optional argument of sectioning macros.

\documentclass[12pt,a4paper,headings=optiontohead]{scrreprt}

\usepackage[automark,headsepline]{scrlayer-scrpage}
\automark[chapter]{chapter}

\usepackage{lipsum}% only for demonstration

\begin{document}
\tableofcontents
\chapter[tocentry={Only in ToC (A)},head={Only in Head (A)}]{Only in Text (A)}
\lipsum
\chapter[Only in Head (B)]{In ToC and Text (B)}
\lipsum
\chapter[head={Only in Head (C)}]{In ToC and Text (C)}
\lipsum
\chapter[tocentry={Only in ToC (D)}]{In Head and Text (D)}
\lipsum
\chapter{Everywhere (E)}
\lipsum
\end{document}

(*) all possible three settings activate the extended support for the optional argument of sectioning macros. The option you give defines what happens when you use the optional argument as usual. (the fourth possible value optiontotocandhead is just a synonym of optiontoheadandtoc)

  • I still need to try that out, thanks for the nice repsponse! – Gabriel Oct 21 at 16:22
  • @Gabriel thanks for your feedback. Let me know if I can help ... – Tobi Oct 22 at 21:17
  • 1
    Yes, perfect! I used headings=optiontohead – Gabriel Oct 30 at 12:39

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.