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.

I working on an edition with various author. How can I set the author of the actual essay to the left page header an the title of the actual section to the right pages header? I tried like this:

\documentclass[12pt,twoside]{scrbook}
\usepackage[german]{babel}
\usepackage{blindtext}
\usepackage[ansinew]{inputenc} 
\usepackage{scrpage2}

%%
% Kopf- und Fußzeile
%%
\clearscrheadfoot
\lehead{\pagemark}
\chead[]{\rightmark}
\rohead{\pagemark}
\cfoot[\pagemark]{}
\pagestyle{scrheadings}
%\manualmark

%%
% Titel
%%
\renewcommand*{\chaptermarkformat}{}
\renewcommand*{\chapterheadstartvskip}{\vspace*{0.5\baselineskip}}
\renewcommand*{\chapterheadendvskip}{\vspace*{1\baselineskip}}
\makeatletter
\newcommand*{\orgichapter}{}
\let\orgichapter\chapter
\renewcommand*{\chapter}[1]{%
  \gdef\chapterauthor{#1}% 
  \orgichapter
}
\renewcommand*{\chapterformat}{}


\newlength{\authorindent}
\renewcommand*{\chapterheadendvskip}{%
  \ifx\chapterauthor\@empty\else
      \markboth{"Test"}{\chapterauthor}%
      \vskip\baselineskip\nobreak
      \settowidth{\authorindent}{{%
      \usekomafont{sectioning}\usekomafont{chapter}\chapterformat
    }}%
    \noindent\begin{large}\textit{\chapterauthor}\par\nobreak
    \global\let\chapterauthor\@empty \end{large}
 \fi
  \noindent\par\nobreak\vskip 1\baselineskip%
}
\makeatother


%%
% Dokumentenbeginn
%%
\begin{document}
\chapter{Harmann von Aue}[]{Das ist ein Test-Dokument}

\section{Sage es niemand, nur den Weisen}
\blindtext
\Blindtext\Blindtext
\section{Weil die Menge gleich verhöhnt}
\Blindtext


\end{document}

The problem seems to be, that \section overrides \marboth. I could use \manualmark in the header but that would have the site effect that sections would not appear in the header at all.

share|improve this question
    
Welcome to TeX.sx! –  texenthusiast Apr 12 '13 at 14:50
2  
You might want to have a look at the package fancyhdr ... –  Dominikus K. Apr 12 '13 at 14:53
1  
I would recommend documentclass memoir for large publications. It has built-in commands for customizing headers (and many other things). –  remus Apr 12 '13 at 14:56

1 Answer 1

up vote 3 down vote accepted

Use the package fancyhdr

\usepackage{fancyhdr}

Put this after \begin{document}

\pagestyle{fancy}
\fancyhf{}                    % Use fancyhdr
\fancyhead[LE]{\author}       %L for Left, E for Even page
\fancyhead[RE]{\rightmark}    %R for Right  E for Odd page

I hope it'll help you !

share|improve this answer

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.