Page LayoutHow to change the direction of the \makepmark header?

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Faergen
Posts: 7
Joined: Wed Mar 27, 2013 8:21 am

How to change the direction of the \makepmark header?

Post by Faergen »

I am having some trouble getting the command \makepmarks behave as I want it to behave. I would like to have the section titles in the header behave as follows: No section titles should be displayed until the second page of a section. When one section stops in the middle of the page, I want the title in the header to be from that section, and not the section beginning on the page.

If you compile my minimal example and look on page 3, there should not be a section title in the header. On page 5 the section title should remain section one until the next page, because section one ends on that page.

I have tried to fiddle around with the both, left and right commands and changed the \leftmark and \rightmark commands around, but I haven't found a solution, so I hope you can help.

Code: Select all

\documentclass[12pt,a4paper,onecolumn,oneside,final]{memoir}
\usepackage{multicol}
\usepackage[english]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[textwidth=10cm,textheight=22cm]{geometry}
\usepackage{calc}
\usepackage{lipsum}


\makepagestyle{HDR}
\makepsmarks{HDR}{\nouppercaseheads 
\createmark{chapter}{left}{nonumber}{}{\space}
\createmark{section}{right}{nonumber}{}{\space} 
\makeheadrule{HDR}{10cm}{\normalrulethickness}
}
\makeoddhead{HDR}{\small\normalfont\mdseries\textsc{\leftmark}\hskip.3cm\vrule\hskip.3cm\bfseries\rightmark}{}{}
\makeoddfoot{HDR}{}{\thepage}{}

\begin{document}
\pagestyle{HDR}
\chapter{Chapter One}
\lipsum
\section{Section One}
\lipsum
\section{Section Two}
\lipsum
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to change the direction of the \makepmark header?

Post by Johannes_B »

This question has also been asked on TeX.SX and got an answer there.
Please always mark crossposts by linking one against the other.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply