2

I'm using Lyx 2.0 to format my text with LaTex.

I'm using the predefined "book" template. On the first, non-title page I have the page number "1" centered on the bottom, while on the other pages the page number appears top-right.

I'd like the numbering to be always on the external (right on the pages on the right, left on the pages on the left), bottom corner.

How to get this? Thanks in advance.

5

You can use the titlesec package to easily define page styles:

\documentclass{book}
\usepackage[pagestyles]{titlesec}   
\usepackage{lipsum}

\newpagestyle{mystyle}{\setfoot[\thepage][][]{}{}{\thepage}}
\pagestyle{mystyle}

\begin{document}
\lipsum[1-8]
\end{document}

Another option would be to use the fancyhdr package:

\documentclass{book}
\usepackage{fancyhdr}   
\usepackage{lipsum}

\fancyhf{}
\renewcommand\headrulewidth{0pt}
\fancyfoot[RO, LE]{\thepage}
\pagestyle{fancy}

\begin{document}
\lipsum[1-8]
\end{document}
1

I don't know how to achieve this just with the plain book class. But if you can add the scrpage2 package, then something like to following should work (untested):

\usepackage{scrpage2}
\pagestyle{scrheadings}
\ofoot{\arabic{page}}
\ohead{}

Add this to your preamble

1

You could use the fancyhdr package. It offers quite a bit of flexibility on where things get placed int he header/footer.

\documentclass{book}

\usepackage{fancyhdr}   
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhead{}% clear headers
\fancyfoot{}% clear footers
\renewcommand{\headrulewidth}{0pt}% eliminate horizontal line
\fancyfoot[RO, LE]{Page \thepage}

\begin{document}
\lipsum[1-8]
\end{document}

There is a corresponding \fancyhead command to specify the header. The letters in within the [] options control where things get placed: The R and E refer to the right field and left field (there is also a C for center). The E means even pages, and the O reefers to odd pages.

  • But you forgot to issue \pagestyle{fancy} in order to apply the defined page style. You will also have to remove the existing headers/footers with \fancyhf{} (otherwise the page number will be duplicated) and suppress the line below the header. – Gonzalo Medina Jul 22 '11 at 16:54
  • @Gonzalo: Thanks. I had them in originally, and did not notice a problem when they were removed. Have update the MWE to now include those. – Peter Grill Jul 22 '11 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.