0

I have a quick question concerning the separation line to the header. I use a very weird template for my thesis, but now everything's functioning quite well.. so I guess I will stick with this template :) However, some conflicts emerge with respect to the header and the headsepline. This is the package I use:

\usepackage[automark,plainheadsepline]{scrpage2}
\pagestyle{scrheadings}

So I have on every page this plainheadsepline, which is great, but I don't need it in the sections "acknowledgement" and "abstract". I used the code \thispagestyle{empty} for the title page. But I cannot use this code for the sections acknowledgement and abstract since it also deletes the page number. Here are the codes for the 2 sections:

%Acknowledgement
\newpage
\pagestyle{plain}
\pagenumbering{roman}  
\setcounter{page}{1}   
\input{acknowledgement}
%---------------------------------------
%Abstract
\newpage
\input{abstract}

Can someone help me with this problem? I need to get rid of the plainheadspline in both sections but I still need the page number.

Johannes_B
  • 24,235
  • 10
  • 93
  • 248
ha.ze
  • 51

2 Answers2

2

Unfortunaly there is no MWE in the question. So I do not know if scrartcl, scrreprt, scrbook or another class is used.

scrlayer-scrpage

Note that package scrpage2 is outdated. With its successor scrlayer-scrpage you can disable plainheadsepline using \KOMAoptions{plainheadsepline=false} and enable it again using \KOMAoptions{plainheadsepline}.

In the following example the plainheadsepline is disabled locally.

\documentclass[headsepline]{scrreprt}
\usepackage{blindtext}% dummy text
\usepackage[automark,plainheadsepline]{scrlayer-scrpage}

\begin{document}
\tableofcontents
\clearpage
\pagenumbering{roman}
\begingroup
  \KOMAoptions{plainheadsepline=false}
  \pagestyle{plain}
  \addsec{Acknowledgement}
  \Blindtext
  \clearpage
  \addsec{Abstract}
  \Blindtext
  \clearpage
\endgroup
\blinddocument
\end{document}

enter image description here


scrpage2 (outdated)

With the older package scrpage2 you can not disable plainheadsepline. As a workaround you can change the width of the headsepline to 0pt.

\documentclass[headsepline]{scrreprt}
\usepackage{blindtext}% dummy text

\usepackage[automark,plainheadsepline]{scrpage2}
\pagestyle{scrheadings}

\begin{document}
\tableofcontents
\clearpage
\pagenumbering{roman}
\begingroup
  \setheadsepline{0pt}
  \pagestyle{plain}
  \addsec{Acknowledgement}
  \Blindtext
  \clearpage
  \addsec{Abstract}
  \Blindtext
  \clearpage
\endgroup
\pagenumbering{arabic}
\blinddocument
\end{document}

enter image description here


Because of a comment here are additional examples with article class:

scrlayer-scrpage

\documentclass{article}
\usepackage{blindtext}% dummy text
\usepackage[automark,headsepline,plainheadsepline]{scrlayer-scrpage}

\begin{document}
\tableofcontents
\clearpage
\pagenumbering{roman}
\begingroup
  \KOMAoptions{plainheadsepline=false}
  \pagestyle{plain}
  \section*{Acknowledgement}
  \Blindtext
  \clearpage
  \section*{Abstract}
  \Blindtext
  \clearpage
\endgroup
\blinddocument
\end{document}

scrpage2 (outdated)

\documentclass{article}
\usepackage{blindtext}% dummy text

\usepackage[automark,headsepline,plainheadsepline]{scrpage2}
\pagestyle{scrheadings}

\begin{document}
\tableofcontents
\clearpage
\pagenumbering{roman}
\begingroup
  \setheadsepline{0pt}
  \pagestyle{plain}
  \section*{Acknowledgement}
  \Blindtext
  \clearpage
  \section*{Abstract}
  \Blindtext
  \clearpage
\endgroup
\pagenumbering{arabic}
\blinddocument
\end{document}
esdd
  • 85,675
  • as i said, untested ;-) good answer – Johannes_B Mar 20 '16 at 17:34
  • Thank you for your answer. Does it also work for \documentclass{article} ? – ha.ze Mar 20 '16 at 19:21
  • @ha.ze See my updated answer. But if you are using \documentclass{article} - are there really any pages with \pagestyle{plain} and a sepline under then page header? For pages with page style scrheadings option headsepline is enough. – esdd Mar 20 '16 at 20:15
  • That titlesec question on golatex ... titlesec fails with KOMA 3.20.2386. Is that a current bug or will this stay? Do you know something? – Johannes_B Mar 21 '16 at 11:55
  • Not KOMA thing at all, sorry for the noise. titlesec is the cause. YEAH, let the reports roll in. – Johannes_B Mar 21 '16 at 13:53
  • @Johannes_B No problem, I saw this yesterday: http://tex.stackexchange.com/q/299969/43317 – esdd Mar 21 '16 at 14:08
  • Saw this one too, but this example returns a missing number error. This will cause some trouble. – Johannes_B Mar 21 '16 at 14:16
  • Ah, ok. But as you said at the moment it seems to be not a KOMA problem. – esdd Mar 21 '16 at 15:11
0

Thank you for your answers. I could solve the problem. Now, another problem emerged. I have now for every section (list of figures, list of tables, etc.) the corresponding header. However, since I have created my own list of abbreviations, the header does not say list of abbreviations, but it says "Contents". Here is my code:

\documentclass[a4paper,12pt]{article}
% define topline
\usepackage[headsepline,plainheadsepline, markcase=Upper]{scrlayer-scrpage}
    \ohead{\headmark}
    \automark{section}
    %\clearscrplain
    \lohead{\headmark}
    \automark{section}
    \ohead{\headmark}
    \automark{section}
    \lohead[{\headmark}]{\headmark}
\begin{document}
\newpage
\pagestyle{plain}
\pagenumbering{roman}   % define page number in roman style
\setcounter{page}{1}    % start page numbering
\input{acknowledgement}

\newpage
\input{abstract}

\newpage
\tableofcontents
\clearpage

\newpage
\addcontentsline{toc}{section}{List of Abbreviations}
\input{abbreviations}

\newpage
\addcontentsline{toc}{section}{List of Figures}
\listoffigures

\newpage
\addcontentsline{toc}{section}{List of Tables}
\listoftables
\end{document}

I am aware of the fact that I'm using a very strange template, but I worked with it since the beginning. As I am not a latex expert, I really wanna keep it that way and don't want to change anything. Can someone help me to bring a header "List of abbreviations" to the corresponding section instead of "Contents"? Thank you in advance!!

Stefan Pinnow
  • 29,535
ha.ze
  • 51