0

I've been trying to learn some LaTeX formatting and I got stuck on something that should be quite simple but it seems that I only find quite complicated ways to solve it online. When I use the \fancyhdr package with the \maketitle while trying to change the page number to the bottom right corner I have a problem with the first page where I have the \maketitle. If I remove it's ok.

\documentclass[a4paper,12pt,twoside]{article}
\usepackage{multicol}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{lastpage}

\geometry{
 a4paper,
 total={170mm,257mm},
 left=30mm,
 right=20mm,
 top=20mm,
 bottom=20mm,
 }
\pagestyle{fancy}
\fancyhf{}
\rfoot{\thepage}


\title{Lorem Ipsum}
\author{XMen}
\date{\today}

\begin{document}
\begin{multicols}{2}
[
\maketitle
]

2 Answers2

0

Making your own custom title page is easier and sometimes more suitable than the inbuilt standard \maketitle

One example which can be customised to your requirements is below

Page number has been commented out and is optional

The vertical spacing can be adjusted as per user requirements

enter image description here

\documentclass[12pt,a4paper]{report}
\usepackage{graphicx}
\begin{document}
\begin{titlepage}
    \centering
    \includegraphics[width=0.15\textwidth]{example-image-1x1}\par\vspace{1cm}
    {\scshape\LARGE Columbidae University \par}
    \vspace{1cm}
    {\scshape\Large Final year project\par}
    \vspace{1.5cm}
    {\huge\bfseries Pigeons love doves\par}
    \vspace{2cm}
    {\Large\itshape John Birdwatch\par}
    \vfill
    supervised by\par
    Dr.~Mark \textsc{Brown}

    \vfill

% Bottom of the page
    {\large \today\par}
    % \thepage%optional
\end{titlepage}
\end{document}

Additional Resources for title pages

https://en.wikibooks.org/wiki/LaTeX/Title_Creation

Showcase of beautiful title page done in TeX

https://github.com/johannesbottcher/titlepageExamples/

If you feel the answer is as per your requirements please upvote the answer by clicking on the red triangle at the left and the tick mark below it

Please note that your MWE posting the code is incomplete and only an estimate of your requirement can be made as such.

js bibra
  • 21,280
0

The \maketitle command does \thispagestyle{plain}.

You have two choices: either redefine the plain pagestyle

\fancypagestyle{plain}{%
  \renewcommand{\headrulewidth}{0pt}%
  \fancyhf{}%
  \fancyfoot[R]{\thepage}% equivalent to \rfoot{\thepage}
}
\pagestyle{plain}

or issue \thispagestyle{fancy} after \maketitle and keep your code as is (well, I added \renewcommand{\headrulewidth}{0pt} to remove the nasty line).

\documentclass[a4paper,12pt,twoside]{article}
\usepackage{multicol}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{lastpage}

\usepackage{lipsum} % for filler text

\geometry{ a4paper, % total={170mm,257mm}, left=30mm, right=20mm, top=20mm, bottom=20mm, }

\pagestyle{fancy} \fancyhf{} \rfoot{\thepage} \renewcommand{\headrulewidth}{0pt}

\title{Lorem Ipsum} \author{XMen} \date{\today}

\begin{document}

\begin{multicols}{2}[\maketitle\thispagestyle{fancy}] \lipsum[1-10]

\end{multicols}

\end{document}

With the “redefine the plain style”:

\documentclass[a4paper,12pt,twoside]{article}
\usepackage{multicol}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{lastpage}

\usepackage{lipsum} % for filler text

\geometry{ a4paper, % total={170mm,257mm}, left=30mm, right=20mm, top=20mm, bottom=20mm, }

\fancypagestyle{plain}{% \renewcommand{\headrulewidth}{0pt}% \fancyhf{}% \fancyfoot[R]{\thepage}% } \pagestyle{plain}

\title{Lorem Ipsum} \author{XMen} \date{\today}

\begin{document}

\begin{multicols}{2}[\maketitle] \lipsum[1-10]

\end{multicols}

\end{document}

Note that I commented the total line: it doesn't make sense to specify the text width, the left margin and the right margin (and similarly for the vertical dimensions).

enter image description here

egreg
  • 1,121,712