1. Even page numbers do not show up using fancyhdr package.
  2. Page number are centered, but should be right on odd and left on even.

Minimal Working Example (MWE):



\newenvironment{abstract1} { 
    \chapter{Abstract 1}

\newenvironment{abstract2} { 
    \chapter{Abstract 2}




% Abstract -----------------------------------------------------

\begin{abstract1} % creates the abstract header in 1

\begin{abstract2} % creates the abstract header in 2



Centered roman numbers on odd page numbers, but empty on even page numbers.

Desired output:

Right roman numbers on odd page numbers, left roman numbers on even page numbers.


Page numbers are visible on both odd/even pages in the center and in roman. But for some reason, there is a line in the head that I cannot I tried with \renewcommand{\headrulewidth}{0pt} but does not seem to work. How is the horizontal line removed?

  • 1
    Shouldn't you use \pagestyle{roman} instead of \pagestyle{empty}? Another 'error' is that chapter start pages use plain style instead of the desired other one. The usage of \newenvironment is wrong as well
    – user31729
    Commented Apr 12, 2018 at 7:21
  • @ChristianHupfer Thanks for the feedback, it's quite helpful. I have removed \pagestyle{empty} from both environments and the page number is visible now on both pages (but even page number are shown top-right now?). However, when I switched to \pagestyle{roman} in the \newcommand I got an error saying Undefined control sequence.
    – kexxcream
    Commented Apr 12, 2018 at 9:35
  • But your pagestyle asks for centered page numbers! \fancyfoot[C]{\thepage} And you haven't defined a pagestyle called roman. Commented Apr 12, 2018 at 10:27

1 Answer 1


If you want right numerals on odd pages and left on even ones, tell fancydr: what you are asking for is centered numerals on all pages:


And what you want is


Since you have defined the pagestyle as fancy (not roman) that's what you have to use: if you ask for the roman pagestyle you will get an error, because it's not defined. (Note that it is the \frontmatter instruction that is making the numerals roman, not anything in your fancyhdr instruction.)

If you want the first page of the abstract to have the numbers set left, you will need to add \thispagestyle{fancy} to override the plain that would otherwise be selected.

You can't define new environments with two arguments. A new environment needs three arguments:


Edited to add: Your headrule problem is because you are calling your fancyheader instruction set inside an environment, and it's not making a global change to the command. Put the \renewcommands outside the environment.

  • Excellent and thank you for the educational instructions!
    – kexxcream
    Commented Apr 12, 2018 at 11:00
  • 1
    @kexxcream Edited because I'd forgotten to point out that if you want the first page of a chapter fancy you will need to specify that separately, because otherwise it will be set to plain. Commented Apr 12, 2018 at 11:18

You must log in to answer this question.

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