0

I am sorry that I have to ask in a new post again, but my reputation is not high enough to write a comment..

I have a problem with the classicthesis style. The name of one section is too long for one line which causes problems in the header. I tried to fix this with a new header using \sectionmark, but this works only for the next pages and not for the page where the section occurs for the first time. In the Toc should appear the normal long version of the section.

I got the hint that classicthesis destroys the possibility to change the header: https://tex.stackexchange.com/questions/295176/classicthesis-header-too-long

Does anyone has an idea to solve this?

\documentclass[headinclude,footinclude=true,cleardoublepage=empty,ngerman,american]{scrreprt}

\input{classicthesis-config}
\begin{document}
\pagestyle{scrheadings}
\chapter{Nice chapter}
\newpage
\section[short and nice]{overlong title} \sectionmark{short and nice}

\newpage
Useless text
\end{document}
3
  • 3
    And why are you not editing your original post then?
    – user31729
    Feb 22, 2016 at 18:39
  • You are always allowed to edit your own questions and comment on them. But it seems you have two different accounts, meaning you can't. The Stack Exchange staff can merge them together for you.
    – Johannes_B
    Feb 23, 2016 at 9:47
  • Sorry for this, I will know this for the future.
    – user98959
    Feb 23, 2016 at 19:01

1 Answer 1

2

Because classicthesis uses package titlesec the normal KOMA-Script solution (using option headings=headings=optiontoheadandtoc) does not work.

If you use

\section{overlong title}\sectionmark{short}

first the \section command sets a right mark and then \sectionmark sets a new right mark. But normally the first right mark on a page goes to the page header. So \sectionmark changes the header entry only on the following pages.

With

\let\rightmark\rightbotmark

in your preamble the last right mark instead the first right mark would be used on every page.

\documentclass[headinclude,footinclude=true,cleardoublepage=empty,ngerman,american]{scrreprt}
\usepackage{blindtext}% dummy text
\input{classicthesis-config}
\let\rightmark\rightbotmark
\begin{document}
\pagestyle{scrheadings}
\chapter{Nice chapter}
\Blindtext
\section{overlong title}\sectionmark{short}
\Blindtext[10]
\section{Test 1}
\section{Test 2}
\end{document}

But note that then on a page with two or more new sections the last one will be in the header, see page 5 of the example above.

AFAIK classicthesis loads package scrlayer-scrheadings. If you want to use \rightbotmark only for some section headings you can define a new page style:

\newpairofpagestyles[scrheadings]{userightbotmark}{\let\rightmark\rightbotmark}

and use it with

\section{overlong title}\sectionmark{short}\thispagestyle{userightbotmark}

enter image description here

Code:

\documentclass[headinclude,footinclude=true,cleardoublepage=empty,ngerman,american]{scrreprt}
\usepackage{blindtext}
\input{classicthesis-config}
\newpairofpagestyles[scrheadings]{userightbotmark}{\let\rightmark\rightbotmark}
\begin{document}
\pagestyle{scrheadings}
\chapter{Nice chapter}
\Blindtext
\section{overlong title}\sectionmark{short}\thispagestyle{userightbotmark}
\Blindtext[10]
\section{Test 1}
\section{Test 2}
\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .