1

I have a document which doesn't have the first page as "front", but rather the content follows immediately after \maketitle.

It starts with:

\documentclass[twoside,a4paper,12pt]{article}
\usepackage{fancyhdr}
\pagestyle{fancy}

I try to set up the header and footer:

\fancyhf{}
\usepackage{titling}
\fancyhf[HC]{\thetitle}
\fancyhf[HL]{\theauthor}
\fancyhf[HR]{\today}
\fancyhf[FLO,FRE]{\thepage}

It works, but the number on the first page is centered, rather than aligned to right, as expected. Number on second page is aligned to right, and it should be on left. What's wrong?


Per request, here's the whole document (shortened)

\documentclass[twoside,a4paper,12pt]{article}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2.5cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage{fancyhdr}
\pagestyle{fancy}


\setlength{\parindent}{0pt}
\setlength{\parskip}{0.3em}

\fancyhf{}
\usepackage{titling}
\fancyhf[HC]{\thetitle}
\fancyhf[HL]{\theauthor}
\fancyhf[HR]{\today}
\fancyhf[FRO,FLE]{\thepage}

\title{Title}
\author{Jonny Gangsta}
\date{\today}

\begin{document}

    \maketitle

    Lorem ipsum blah blah... many paragraphs

\end{document}
  • the title page normaly does \thispagestyle{plain} so it has no header and centred number in the foot, you can redefine it to use a different style or redefine the plain style using fancyhdr. – David Carlisle Feb 20 '15 at 16:51
  • Yeah, but I don't want to have any title page, it'll be printed with duplex and stapled in top left corner. Should I just set it to FC and not bother with left/right? – MightyPork Feb 20 '15 at 16:53
  • Not much more to show, I tried it and yes, \maketitle is causing the problems. Do you know how to stop \maketitle from messing up the footer alignment / mage numbering? – MightyPork Feb 20 '15 at 17:01
  • By title page I meant the page with the title. you have not shown any usable example so we have to guess, but I am guessing you have used \maketitle – David Carlisle Feb 20 '15 at 17:01
  • I just used \maketitle and then follow the sections and paragraphs of text, on the same page. – MightyPork Feb 20 '15 at 17:02
2

\maketitle sets \thispagestyle{plain} as you do not normally want the running head above the title. However you can use use fancyhdr to redefine the plain page style, or just put

\thispagestyle{fancy}

after

\maketitle 

To use the defined page style on the first page as well.

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.