2

I have some problems with the headers for some of my chapters within my Latex document. I’m using a password secured template so I’m a bit afraid to post every detail below. Just considering the heading on every page: Nearly all my chapters starts with a blanc heading (just pagenumber and horizontal line, but no chapter names), followed by the chapter name on every even page and the section name on every odd page (twoside in documentclass). For the following automatically created “chapters” the heading already appears on the first page (or even before: see below): \tableofcontents \listoffigures \listoftables

A part of my document:

\documentclass[twoside,open=right, DIV12, 1.1headlines, paper=a4, fontsize=11pt, automark, headsepline, bibliography=totoc, liststotoc, chapterprefix, numbers=noenddot]{scrreprt}
…

% load KOMA script pagestyle package
\usepackage[headsepline,plainheadsepline]{scrpage2}
\let\endgraph\endgraf % necessary for "chapterprefix" in \documentclass call
% Header and footer definition
\clearscrheadfoot % clear header and footer
\ohead[\pagemark]{\pagemark} % page number on the upper right side
\ihead[\headmark]{\headmark} % chapter names at top
\pagestyle{scrheadings} % choose page style
% Factor for the line spacing
%\linespread{1.06}
%\renewcommand{\baselinestretch}{1.0}
% sets the indent of and gap between paragraphs
\setlength\parindent{0cm}
\setlength\parskip{1.5ex plus 0.3ex}
\usepackage[hang,small,bf]{caption}
…

begin{document}
…
\tableofcontents
\chapter{Introduction} text text text
\chapter{xyz} text text text
…
\chapter{last chaper: summary} text text text

\listoffigures

\listoftables

\clearpage
\iflanguage{ngerman}
{\addchap{Abk\"urzungsverzeichnis}}
{\addchap{Acronyms}} \label{chp:acro}
\protect\markboth{Abk\"urzungsverzeichnis}{Abk\"urzungsverzeichnis}
\begin{acronym} … \end{acronym}

\iflanguage{ngerman}
{\renewcommand{\nomname}{Symbolverzeichnis}
\phantomsection
\protect\markboth{Symbolverzeichnis}{Symbolverzeichnis}
\protect\addcontentsline{toc}{chapter}{Symbolverzeichnis}}
{\renewcommand{\nomname}{List of Symbols}
\phantomsection
\protect\markboth{List of Symbols}{List of Symbols}
\protect\addcontentsline{toc}{chapter}{List of Symbols}}
\printnomenclature \label{chp:symbol}

…

\appendix
\chapter{proof1} text text text
…
\chapter{last proof} text text text
\end{document}

My questions:

  • How may I clear the heading on the first page for the toc, lof, lot
  • My last entry of my acronyms is on an odd page, so a blanc page is added before the lof starts (twoside), but on this blanc page in the heading “List of figures” is written instead of “Acronyms”. This also leads to an entry in the TOC with a wrong page number (74 instead of 75). The heading is correctly placed on page 75. How may I change & correct this?
  • I’d like to keep the page numbering and a horizontal line in all headings, so please don’t advise me to totally clear the problematic headings.

If I need to add any command, please be so kind and tell me where to put it exactly.

Thanks in advance

[EDIT] I know this is not a MINIMUM working exaple, but I'm not sure about any issues as a result of a combination.

Code: https://www.dropbox.com/s/dv1mo8hfrinmmdl/Test1.tex

Output: https://www.dropbox.com/s/s2jk9bnxvuaz8v9/Test1.pdf

Please have a closer look to the header of page 16. I'd like to get an output for the toc,tof,... as I get for chaper 1, 2, ...! [\EDIT]

  • Please provide an MWE that compiles. – Sveinung May 23 '14 at 13:08
  • I edited my question and added two links. Hope that helps. – Kris May 26 '14 at 15:55
3

You instructed LaTeX to set the headmark on plain pages. If you omit that, your first problem is solved.

You are using some deprecated KOMA-options making KOMA run in backwards compatibility mode. The pages you describe as falsely marked should be completely empty in the typographical sense. KOMA takes care of this.

Additionally, i patched the nomenclature to use addchap. Now KOMA takes care of the TOC-entry, the right linking and the marking.

Instead of \newpage, please use the more appropriate \clearpage

By the way, you should split your problems up into small pieces, each problem on it's own. Preparing a minimal working example is easier, helping is easier and, more importantly, faster.

One closing remark: The code you posted here (not the linked code) has some really shaky stuff. I defined some commands below, use them or you might (will) run into trouble in the future.

\documentclass[
 twoside,
 open=right,
%% DIV12,%JB: deprecatedd
 DIV=12,
% 1.1headlines,
 headlines=1.1,
 paper=a4,
 fontsize=11pt,
% automark,%JB: Set this with scrpage2 or its successor
 headsepline,
 bibliography=totoc,
%% liststotoc,%JB: deprecatedd
 listof=totoc,
 chapterprefix,
 numbers=noenddot]{scrreprt}
\usepackage[ngerman,english]{babel}
\usepackage[utf8]{inputenc}
%\newcommand{\langselect}{ngerman}%JB: pretty awkward command
\usepackage[printonlyused]{acronym}
\usepackage[english,german,
%intoc%JB: If you want to have this in your toc
]{nomencl}
\makenomenclature

\usepackage{etoolbox}
\makeatletter
\patchcmd{\thenomenclature}{%
  {
    \chapter*{\nomname}
    \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
  }%
  }{%
  {
    \if@intoc\addchap{\nomname}\else
    \chapter*{\nomname}\fi
  }%

  }{\typeout{Kris/JB/Succes}}{\typeout{Kris/JB/fail}}
\makeatother

\input{multido}

\usepackage[automark,headsepline,plainheadsepline]{scrpage2}
\clearscrheadfoot            
\ohead[\pagemark]{\pagemark} 
\ihead%[\headmark]
{\headmark} 
\pagestyle{scrheadings}      


%\setlength\parindent{0cm}%JB: bad idea. Use the
%\setlength\parskip{1.5ex plus 0.3ex}%JB: appropriate option
\KOMAoption{parskip}{half}%sorry @egreg
\usepackage[%ps2pdf,
pdfpagelabels,breaklinks=true]{hyperref}


%JB:It seems to me, that stuff like the following 
%JB: could be useful for you
\newcaptionname{ngerman}{\nomname}{Symbolverzeichnis}
\newcaptionname{english}{\nomname}{List of Symbols}
\newcaptionname{ngerman}{\acronymname}{Abk\"urzungen}
\newcaptionname{english}{\acronymname}{Acronyms}


\begin{document}
%\selectlanguage{ngerman}
\tableofcontents

\chapter{One}
Some text of another chapter. This is an acronym \ac{LP}.

\multido{\i=1+1}{100}{%
    \captionof{figure}{figure caption number \i}
    \captionof{table}{table caption \i}
}

\listoffigures

\listoftables

\addchap{\acronymname}
\begin{acronym}
\acro{LP} {Low Pass}
\end{acronym}
\clearpage\null%JB: hack to get another page *filled*


\let\abk\nomenclature
\abk{$x$}{Input Signal}

%\renewcommand{\nomname}{List of Symbols}
%JB: You don't need this vvvv anymore
%JB: It was patched above
%\phantomsection
%\protect\markboth{List of Symbols}{List of Symbols}
%JB: vvvv this was never needed, just set the right option
%\protect\addcontentsline{toc}{chapter}{List of Symbols}
\printnomenclature

\appendix
\chapter{A chapter in the appendix}
An example text.
\end{document}

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.