I am writing a book with LyX Version (+TexLive 2021) I have choosen as Document Class in Lyx book standard but I do not like the default page numbering bottom-centered so I use the possibility to customize the LaTex preamble inside Lyx ( --> Document --> Settings --> LaTex Preamble) by using the fancyhdr package. So I have edit in the LaTex Preamble windows inside Lyx the following code


When I export the pdf, EVERY page number is printed ONLY (and ALWAYS) in the bottom Left If I change the last command in this way


EVERY page number is always written only and always in the bottom right

I show you below the complete preamble which is export from Lyx to Latex

%% LyX created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%Custom settings LatTex Preamble to define page numbering 
\fancyfoot{} % erase all the symbols from the foot page
\fancyfoot[RO,LE]{\thepage} %this should print right odd pages and left even pages 




....(here the document start)

Thanks in advance for helping!!

  • 3
    I think options RO and LE make only sense for twoside documents, while your document is set to oneside. I am surprised fancyhdr has not ignored them or does not warn you. If you set the document to twoside, does the code work? For oneside your settings should probably be simplified to \fancyfoot[R]{\thepage} etc.
    – Celdor
    Jan 10, 2022 at 1:27
  • 1
    Fancyhdr does give a warning. But many people don't even look at LaTeX warnings. I am thinking of adding an option to fancyhdr to make two-sided headers and footers available in a one-sided document, but I am not sure it is worth the effort, as you can as easily use the [twoside] document class option, and if you don't like the layout change it with geometry. Jan 10, 2022 at 8:44
  • @PietervanOostrum You are right. fancyhdr shows the warning. I never used TexLive which might not show logs but I doubt it. I checked with my IDE, which is Atom, latex, and language-latex and the warning from fancyhdr is right there.
    – Celdor
    Jan 10, 2022 at 10:11
  • Every TeX system generates a log file (<yourdocument>.log). It is always advised to look into it because it may have some warnings or errors in it. Sometimes it is full of annoying messages that may not be very interesting, and that can be a challenge to find the really useful information. Jan 10, 2022 at 10:28

1 Answer 1


I had exactly the same issue many times, see also the comments above.

Probably the problem is due to the initial line of your template:


Instead, write this:


I hope this may help you.

You must log in to answer this question.

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