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.

3 Answers 3

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.

2
  • 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. Commented Jul 22, 2011 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. Commented Jul 22, 2011 at 17:02

You must log in to answer this question.

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