Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Here's my code:

\documentclass{scrbook}

\usepackage[english]{babel}
\usepackage{blindtext}

\usepackage[markuppercase]{scrpage2}
\pagestyle{scrheadings}
\automark[chapter]{part}

\begin{document}

% This works as expected
\part{Ancient writing and its influence}
\chapter{The origin of writing}
\section{Introduction}

\blindtext[15]

% But this doesn't
\addpart{Modern writing and its influence}
\addchap{The end of writing}
\addsec{Conclusion}

\blindtext[15]

\end{document}

The problem is that the headmarks in the unnumbered document half keep running like [section]{chapter} and I want them running like [chapter]{part}. What am I doing wrong?

share|improve this question
    
I doubt this is a minimal example. Also, does this happen if you use \section etc instead of \addsec etc –  Seamus Jul 28 '11 at 15:42
    
@Seamus What do you mean? –  Gastón Jul 28 '11 at 16:04
1  
@lockstep I think you should have left in the markuppercase option, since the non-working marks are appearing not in uppercase while the working ones are... –  Seamus Jul 28 '11 at 16:22
1  
@lockstep Also, change the names of the two sets of headings so we can see that the marks are actually referring to the correct headings, just not referring to them correctly. –  Seamus Jul 28 '11 at 16:23
1  
I have edited the question title and the body to show that the right sections are being marked, just the wrong marks are being used. –  Seamus Jul 28 '11 at 16:28
show 3 more comments

3 Answers

up vote 2 down vote accepted

A normal \part issues a \partmark command to store the mark. \partmark stores more or less \thepart parttitle, that means it stores also the number. And so \partmark can't be used with \addpart. Same with the other \add-commands. So all of them use some hardcoded \mark-commands which are not suited for your example.

You will have to set the mark manually:

\addchap{The end of writing}
\markboth{\MakeUppercase{Modern writing and its influence}}{\MakeUppercase{The end of writing}}
\addsec{Conclusion}
\markboth{\MakeUppercase{Modern writing and its influence}}{\MakeUppercase{The end of writing}}

I also think it would be a good idea to show your example to the author of KOMA. It would be much better if one could separate the question if a sectioning command should set a left/right/both-mark from the question of the content of the mark.

share|improve this answer
    
Thank you! It works fine. –  Gastón Jul 28 '11 at 18:21
add comment

I answer my own question. I found in Koma-Script doc the following solution (a little bit dingy).

\documentclass[a5paper,DIV=11, headings=small,numbers=enddot,pagesize,11pt]{scrbook}
\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage[automark,markuppercase]{scrpage2}
\clearscrheadfoot
\pagestyle{scrheadings}
\automark[chapter]{part}
\cfoot[\pagemark]{\pagemark}
\chead{\headmark}
\renewcommand*{\partpagestyle}{empty}
\setkomafont{pageheadfoot}{\small\rmfamily\upshape}
\setkomafont{pagenumber}{\large\rmfamily\upshape}
\renewcommand*{\chapterformat}{}
\renewcommand*{\chaptermarkformat}{}
\renewcommand*{\chapterformat}{}
\renewcommand*{\chaptermarkformat}{}
\renewcommand*{\partformat}{}
\renewcommand*{\partmarkformat}{}

\begin{document}
\part{Ancient writing and its influence}
\chapter{The origin of writing}
\section{Introduction}
\blindtext[15]
\end{document}
share|improve this answer
add comment

Maybe you have to declare the heading and footer and then choose the page style. From your example:

\usepackage[automark,markuppercase]{scrpage2}
\pagestyle{scrheadings}
\clearscrheadings
\automark[chapter]{part}
\cfoot[\pagemark]{\pagemark}
\chead{\headmark}

Edit: Sorry and thanks Seamus for spoting the obvius mistake. And that wasn't obviously my code.

share|improve this answer
1  
I don't think you tested this code did you? First, if you don't set the pagestyle to scrheadings the headings won't be set by scrpage2's commands. Second, calling \clearscrheadings after setting all the headings just removes them all again... –  Seamus Jul 28 '11 at 16:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.