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.

How to remove headrule in chapter page without remove of footrule, eg, rule only in foot page in all pages, but without on chapter page, but headrule in others pages.

\documentclass[a4paper]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\copypagestyle{rgstyle}{headings}
\makeoddhead{rgstyle}{}{}{\slshape\rightmark}
\makeevenhead{rgstyle}{\slshape\leftmark}{}{}
\makeoddfoot{rgstyle}{R\'egis $\smiley$ \the\year}{}{\thepage}
\makeevenfoot{rgstyle}{\thepage}{}{R\'egis $\smiley$ \the\year}
% add line
\makeheadrule{headings}{\textwidth}{\normalrulethickness}
\makefootrule{headings}{\textwidth}{\normalrulethickness}{\footruleskip}
% fix plain
\copypagestyle{plain}{rgstyle} % overwrite plain with rgstyle
\makeoddhead{plain}{}{}{} % remove right header
\makeevenhead{plain}{}{}{} % remove left header
\pagestyle{rgstyle}

\begin{document}

\chapter{Memoir without headrule in chapter page}

\lipsum

\end{document}

enter image description here

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

memoir, just like book, typesets the first page of \chapter using the plain page style. You must therefore reset the plain page style header rule after copying rgstyle into plain:

\copypagestyle{plain}{rgstyle} % overwrite plain with rgstyle
\makeheadrule{plain}{0pt}{0pt} % remove plain header rule

enter image description here

The second parameter to \makeheadrule{plain}{<len>}{0pt} could just as well have been anything less than \textwidth.

share|improve this answer
2  
That is not entirely true. \chapter use the chapter pagestyle, which is an alias for plain. I suggest making two pagestyles. One to use for regular pages, and one (without the headrule) which the chapter style can be aliased to. Only edit the plain style if you really know what you are doing. –  daleif Dec 19 '11 at 12:56
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.