6

I am writing an article with memoir and the \pagestyle{ruled} is very nice but it keeps displaying CONTENTS every even (left) page (which I believe is a Chapter, but being my paper an article there are no chapters at all!).
What I would like to achieve is having the Section title (not in capitals) with its number on every page (with left/right alignment respectively), and the number centred at the bottom.
I know that the documentation is exhaustive, but the deadline is closer then ever and, unfortunately, I cannot dig into it right now. Moreover I couldn't find other questions with related purpose.

1 Answer 1

6

One possibility, with a slight variation on the ruled page style:

\documentclass[article]{memoir}
\usepackage{lipsum}

\makepagestyle{myruled}
\makeatletter
\makeheadposition{myruled}{flushright}{flushleft}{flushright}{flushleft}
\makeevenfoot{myruled}{}{\thepage}{}
\makeoddfoot{myruled}{}{\thepage}{}
\makeheadrule{myruled}{\textwidth}{\normalrulethickness}
\makepsmarks{myruled}{\@ruledmarks}
\makeevenhead{myruled}{\leftmark}{}{}
\makeoddhead{myruled}{}{}{\leftmark}
\makeatother
\pagestyle{myruled}

\begin{document}

\chapter{First section}
\lipsum[1-10]
\chapter{Second section}
\lipsum[1-9]

\end{document}
12
  • Almost! Instead of the Chapter I wanted to display the current Section (since I am writing an article there are not chapters but only sections in my paper).
    – Atcold
    Aug 10, 2013 at 21:07
  • 2
    @Atcold using memoir with the article option, \chapter acts as \section in the standard article class. Aug 10, 2013 at 21:13
  • Ok, in my situation I've been using \section anywhere (and 'fixed the numbering'), so how could I overcome this and point to my sections?
    – Atcold
    Aug 10, 2013 at 21:15
  • 1
    @Atcold but what you are doing produces inconsistencies; the ToC, LoF, LoT, references will have different headings (titles) than your sections, and there might be additional issues. In any case, change \leftmark to \rightmark in both places in my code above and see if it helps. I would suggest you, instead, to keep the intended structure for the sectional units. Aug 10, 2013 at 21:19
  • 1
    Yes, sorry; I meant an inconsistency in the entries in the ToC; if you use \section, entries will be typeset as section entries in a book, which is different from using \chapter. Aug 10, 2013 at 23:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .