2

I am formatting my thesis using the classicthesis configuration for scrreprt class; the default header for this configuration is the chapter name or section name in the outerhead depending if it is an odd or even page, excepting pages like TOC or chapter pages where it does not show a header at all.chapter page with no header

I added this code and it seems to work (it also puts the page number in the bottom).

\clearscrheadfoot
\automark[section]{chapter}
\renewcommand*\chaptermarkformat{\chaptername{} \thechapter:\quad}
\rohead[\rightmark]{\rightmark}
\lehead[\leftmark]{\leftmark}
\rofoot[\pagemark]{\pagemark}
\lefoot[\pagemark]{\pagemark}

But now it shows the header in pages like TOC, bibliography, etc.header in everypage

What I want to do is to put "Chapter #" before chapter name without putting a header in every page. I mean I dont want a header in pages like TOC, bibliographies and chapter pages

Heres a MWE:

\RequirePackage{fix-cm} % fix some latex issues see: http://texdoc.net/texmf-dist/doc/latex/base/fixltx2e.pdf
\documentclass[ twoside,openright,titlepage,numbers=noenddot,headinclude,%1headlines,% letterpaper a4paper
                footinclude=true,cleardoublepage=empty,abstractoff, % <--- obsolete, remove (todo)
                BCOR=5mm,paper=a4,fontsize=11pt,%11pt,a4paper,%
                dottedtoc,spanish%
                ]{scrreprt}
\input{classicthesis-config}

\clearscrheadfoot
\automark[section]{chapter}
\renewcommand*\chaptermarkformat{\chaptername{} \thechapter:\quad}
\rohead[\rightmark]{\rightmark}
\lehead[\leftmark]{\leftmark}
\rofoot[\pagemark]{\pagemark}
\lefoot[\pagemark]{\pagemark}

\begin{document}
\frenchspacing
\raggedbottom
\selectlanguage{spanish} 

\tableofcontents
\pagenumbering{Roman}
\setcounter{page}{1}
\listoffigures
\listoftables
\cleardoubleemptypage
\newpage
\pagenumbering{arabic}
\setcounter{page}{1}

\chapter{Ensayo de Tensión}
\newpage
\section{Metodología utilizada}
\newpage
\section{análisis de resultados}    
\end{document}

I think it would be more suitable to modify the classicthesis.sty file, it has a "headlines" section with this code:

% ********************************************************************                
% headlines
% ********************************************************************  
%\PassOptionsToPackage{automark}{scrpage2}
\PassOptionsToPackage{automark}{scrlayer-scrpage}
    %\RequirePackage{scrpage2} % provides headers and footers (KOMA Script)
    \RequirePackage{scrlayer-scrpage} % provides headers and footers (KOMA Script)
    \clearscrheadings
    %\setheadsepline{0pt}
    \ifthenelse{\boolean{@nochapters}}%
        {\relax}%
        {\renewcommand{\chaptermark}[1]{\markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}}}
    \renewcommand{\sectionmark}[1]{\markright{\thesection\enspace\spacedlowsmallcaps{#1}}} 
    \lehead{\mbox{\llap{\small\thepage\kern2em}\headmark\hfil}}
    \rohead{\mbox{\hfil{\headmark}\rlap{\small\kern2em\thepage}}}
    \renewcommand{\headfont}{\small}  
%    \DeclareRobustCommand{\fixBothHeadlines}[2]{} % <--- ToDo
    % hack to get the content headlines right (thanks, Lorenzo!)
        \def\toc@heading{%
            \ifthenelse{\boolean{@nochapters}}%
            {\section*{\contentsname}}%nochapters
            {\chapter*{\contentsname}}%chapters
            \@mkboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}}

But I don´t know what to do here


The classicthesis files can be found here Classicthesis files, I haven´t modified any of them except for the .tex one until now.


I may have found a solution, I added \chaptername{} \thechapter:\quad in{\markboth{here\spacedlowsmallcaps{#1}} in the {\renewcommand{\chaptermark}[1]{\markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}} line and I think it worked

  • added, I haven´t done any major modifications there, I proposed to modify the .sty file wich I did and I think I may have found the solution I was looking for, please check my edited question and tell me what do you think – Paul Lara Jan 4 '18 at 9:29
1

I'm gonna post how I solved this case here:

Open the classicthesis.sty file that comes when you download the classic thesis template, then search for the "headlines section".

Delete that section and insert this instead:

% ********************************************************************                
% headlines
% ********************************************************************  
%\PassOptionsToPackage{automark}{scrpage2}
\PassOptionsToPackage{automark}{scrlayer-scrpage}
    %\RequirePackage{scrpage2} % provides headers and footers (KOMA Script)
    \RequirePackage{scrlayer-scrpage} % provides headers and footers (KOMA Script)
    \clearscrheadings
    %\setheadsepline{0pt}
    \ifthenelse{\boolean{@nochapters}}%
        {\relax}%
        {\renewcommand{\chaptermark}[1]{\markboth{\chaptername{} \thechapter:\enspace\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}}}
    \renewcommand{\sectionmark}[1]{\markright{\thesection\enspace\spacedlowsmallcaps{#1}}} 
    \lehead{\mbox{\llap{\small\thepage\kern2em}\headmark\hfil}}
    \rohead{\mbox{\hfil{\headmark}\rlap{\small\kern2em\thepage}}}
    \renewcommand{\headfont}{\small}  
%    \DeclareRobustCommand{\fixBothHeadlines}[2]{} % <--- ToDo
    % hack to get the content headlines right (thanks, Lorenzo!)
        \def\toc@heading{%
            \ifthenelse{\boolean{@nochapters}}%
            {\section*{\contentsname}}%nochapters
            {\chapter*{\contentsname}}%chapters
            \@mkboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}}

I actually only modified one line but I think that copying this will decrease the possibility of making a mistake (Also I edited my question explainning what changes I made).

Note: If you are using the TOC that comes for default in the classicthesis template this won't work. Why? Because for some reason somebody redefined the headlines in that section and that affects all the document. However if you delete everything in that section and insert the following code we get the desired output.

%*******************************************************
% Table of Contents
%*******************************************************
%\phantomsection
\refstepcounter{dummy}
\pdfbookmark[1]{\contentsname}{tableofcontents}
\setcounter{tocdepth}{2} % <-- 2 includes up to subsections in the ToC
\setcounter{secnumdepth}{3} % <-- 3 numbers up to subsubsections
\manualmark
\markboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}
\tableofcontents 
\automark[section]{chapter}
\renewcommand{\chaptermark}[1]{\markboth{\chaptername{} \thechapter:\enspace\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\enspace\spacedlowsmallcaps{#1}}}
%*******************************************************
% List of Figures and of the Tables
%*******************************************************
\clearpage

\begingroup 
    \let\clearpage\relax
    \let\cleardoublepage\relax
    \let\cleardoublepage\relax
    %*******************************************************
    % List of Figures
    %*******************************************************    
    %\phantomsection 
    \refstepcounter{dummy}
    %\addcontentsline{toc}{chapter}{\listfigurename}
    \pdfbookmark[1]{\listfigurename}{lof}
    \listoffigures

    \vspace{8ex}

    %*******************************************************
    % List of Tables
    %*******************************************************
    %\phantomsection 
    \refstepcounter{dummy}
    %\addcontentsline{toc}{chapter}{\listtablename}
    \pdfbookmark[1]{\listtablename}{lot}
    \listoftables

    \vspace{8ex}
%   \newpage

    %*******************************************************
    % List of Listings
    %*******************************************************      
      %\phantomsection 
    \refstepcounter{dummy}
    %\addcontentsline{toc}{chapter}{\lstlistlistingname}
    \pdfbookmark[1]{\lstlistlistingname}{lol}
    \lstlistoflistings 

    \vspace{8ex}

    %*******************************************************
    % Acronyms
    %*******************************************************
    %\phantomsection 
    \refstepcounter{dummy}
    \pdfbookmark[1]{Acronyms}{acronyms}
    \markboth{\spacedlowsmallcaps{Acronyms}}{\spacedlowsmallcaps{Acronyms}}
    \chapter*{Acronyms}
    \begin{acronym}[UMLX]
        \acro{DRY}{Don't Repeat Yourself}
        \acro{API}{Application Programming Interface}
        \acro{UML}{Unified Modeling Language}
    \end{acronym}                     
\endgroup

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.