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 am using winedt on windows.
My question is how to make a book page style like the following pic with variations of displaying either chapter or section headers, according to page number, beside a vertical margin.

An example of the required page style

Thanks for help in advance.


@Herbert: The following pic is what I get after copy>paste in a new file

Herbert syntax output

I really appreciate your help, however, what I need is a page style analogous to my first attached pic in my question.

share|improve this question
    
Good question! But the answer will have very little to do with your operating system or text editor (which is why I removed those tags). What document class are you using? –  Matthew Leingang Mar 15 '11 at 15:16
    
I am using "scrbook" class from "KOMA–Script". –  Diaa Abidou Mar 15 '11 at 16:12
add comment

1 Answer

That can be done with package fancyhdr which allows to write page numbers and running headers elsewhere.

\documentclass[a4paper,10pt,twoside]{book}
\usepackage[english]{babel}
\usepackage{xcolor,blindtext}

\usepackage{geometry}
\geometry{paperheight=239mm,paperwidth=169mm,tmargin=5mm,textwidth=124mm,textheight=195mm,
  rmargin=22mm,heightrounded,includeheadfoot,headheight=5mm,headsep=8mm,foot=18mm,
  marginparsep=2mm,marginparwidth=18mm}
\usepackage[color=red,cam,a4,center]{crop}

\usepackage{fancyhdr}
\colorlet{TitleBlue}{blue}
\DeclareRobustCommand\headingfont{\fontfamily\sfdefault\fontseries{b}\fontshape{n}\selectfont}
\fancyhf{}
\fancypagestyle{plain}{\fancyhf{}\def\headrulewidth{0pt}}

\fancyheadoffset[RO,LE]{30mm}
\fancyhead[LE]{\leavevmode\headingfont\smash{%
 \setlength\fboxsep{0pt}%
 \colorbox{black!80}{%
   \makebox[22mm]{\hfill
      \ifnum\value{chapter}>0
         \textcolor{white}{\fontsize{18}{19}\selectfont\thechapter}\ 
      \fi
      \rule[-2.85pt]{2mm}{12mm}%
  }%
 }}%
 \quad
  \color{TitleBlue}%<========================================
   \fontsize{9}{9}\selectfont\leftmark}%\MakeUppercase{\leftmark}}
\fancyhead[RO]{\leavevmode\fontsize{9}{9}\headingfont
               \rightmark
               \quad
               \makebox[22mm]{}}
\fancyfoot[LE]{\leavevmode% 
               \small\headingfont
               \llap{\thepage\ \rule[-13mm]{.6pt}{18mm}\hspace{1mm}}
           \hfill{\normalfont\today}% %<------ svn 
}
\fancyfoot[RO]{\leavevmode
               \small\headingfont
               {\normalfont\today}%<------ svn 
           ~\hfill \rlap{\hspace{1mm}\rule[-13mm]{.6pt}{18mm}\ \thepage}%
}

\pagestyle{fancy}

\begin{document}
\tableofcontents
\chapter{foo}\blindtext[3]\par\blindtext[3]
\chapter{bar}\blindtext[7]
\chapter{baz}\blindtext[8]

\end{document}
share|improve this answer
    
I am sorry, but would you show me an example of Latex syntax ?. –  Diaa Abidou Mar 15 '11 at 21:01
    
@Diaa; see example –  Herbert Mar 15 '11 at 21:39
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.