[Tex/LaTex] Center align title, authors and affiliation on first page

affiliationalignauthorhorizontal alignmenttitles

So I have a Latex document in which I want to center align title, authors, and affiliation on first page.

Right now, it is left aligned by default.

\begin{document}
\mainmatter              % start of the contribution
\title*{My Title}
\titlerunning{My Title}
\author{AuthorA \and AuthorB}
\tocauthor{AuthorA, AuthorB}
\institute{Department of ABC,\\XYZ Institute, City, Country\\
Email: \{a, b\}@pqr.ijk.mn.st}
\maketitle              % typeset the title of the contribution
\renewcommand{\abstractname}{Abstract.}
\input{abstract}
\input{intro}
\input{design}
\input{evaluation}
\input{related_work}
\input{conclusion}
\input{acknowledgments}

My class file is at https://pastebin.com/wLzFsSc8.

Please let me know.

UPDATE: I have got the title, author, and affiliation center aligned. However, I am now facing an issue. The page numbers have been shifted to the bottom center of each page. Earlier, they were on top left in even pages and top right in odd pages. I want it to remain the same. I am using fancyhdr package.

How do I solve this ?

\usepackage{afterpage}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancypagestyle{plain}
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[LE]{Author1 and Author2}
\fancyhead[RO]{Title}
\renewcommand\headrulewidth{0pt}

\begin{document}

\afterpage{\cfoot{\thepage}}

\thispagestyle{plain}
\begin{center}
    \Large
    \textbf{Title} \\
    \vspace{0.4cm}
    \small{Author 1 and Author 2} \\
    \vspace{0.4cm}
    Department of ABC,\\XYZ Institute, City, Country\\
    Email: \{a, b\}@pqr.ijk.mn.st}
    \input{abstract}
\end{center}

Best Answer

Minimal approach, change it to your liking. The page break was introduced by the titlepage environment. If you don't want this break, you can use a center-environment instead and drop the \centering.

\documentclass[]{article}

\usepackage{blindtext}% for the abstract

\begin{document}
\begin{center}
  \mbox{}\vfill
  {\huge My Title}
  \vfill
  {\Large AuthorA and AuthorB}
  \vfill
  Department of ABC,\\
  XYZ Institute, City, Country\\
  Email: \{a, b\}@pqr.ijk.mn.st
  \vfill
\end{center}
\blindtext% abstract
\end{document}
Related Question