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'm writing a document using scrbook document class and while I was able to set up all header and footer apparence, I can't find a way to set headsepline length (seems to follow \textwidth settings, while I need it to be slightly longer). Is there a way to make it without using external packages, maybe changing something in class file?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

As lockstep remarked, my short answer was way to short, so here's a more elaborate one:

Setting the headsepline can be done with the scrpage2 package, which provides the macro

\setheadsepline[<length>]{width}

To be able to use a notation like \textwidth+20pt, e.g. to do calculations, you'll need e.g. the calc package. The scrpage2 package also provides a new pagestyle (scrheadings), I made a little example below: The pageheads automatically alternate between the current chapter and section headings. Also you can see that the headsepline is longer than the headtopline. It protudes on both left and right, I don't know if you want that or just one side.

The code

\documentclass{scrbook}
\usepackage[inner=10mm,outer=30mm,top=30mm,bottom=10mm,a4paper,twoside]{geometry}
\usepackage{calc}

\usepackage{lipsum}

\usepackage{scrpage2}
\pagestyle{scrheadings}
\clearscrheadfoot
\automark[chapter]{section}
\ohead{\pagemark}
\ihead{\headmark}
\setheadtopline{1pt}
\setheadsepline[\textwidth+20pt]{0.5pt}

\begin{document}

\chapter{One}
\lipsum[1]
\section{one}
\lipsum[2]
\section{two}
\lipsum[3]
\section{three}
\lipsum[4]
\section{four}
\lipsum[5]
\section{five}
\lipsum[6]
\section{six}
\lipsum[7]
\section{seven}
\lipsum[8-12]

\chapter{Two}
\lipsum[1]
\section{one}
\lipsum[2]
\section{two}
\lipsum[3]
\section{three}
\lipsum[4]
\section{four}
\lipsum[5]
\section{five}
\lipsum[6]
\section{six}
\lipsum[7]
\section{seven}
\lipsum[8-12]

\end{document}

Part of the result

enter image description here

share|improve this answer
    
thank you very much, I loaded scrpage2 but tought \setheadsepline would work only for line height. –  Gianluigi Sep 2 '12 at 18:13
    
@Gianluigi: You're welcome. Thats what I love about this site: there's usually someone around who knows the answer or can think of away to do it. –  Tom Bombadil Sep 2 '12 at 19:41
    
@Gianluigi don't forget to accept (different from up-vote) Tom Bombadil's answer (and any answer that solves the problem in your other questions) by clicking on the check-mark to the left of the answers; in case of doubt, please see How do you accept an answer?. –  Gonzalo Medina Sep 2 '12 at 23:22
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.