2

my current code is as below:

\documentclass[fleqn,11pt]{wlscirep}
\usepackage{authblk}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{fourier} 
\usepackage{array}
\usepackage{makecell}
\usepackage{lipsum}


\title{\centering cccccc}
\author{xxxx}
\affil{vvvvv}
\affil{vvvvv}

and it is appearing as below

enter image description here

How do i make the author name and the affiliation details to appear in the middle below the title instead? thank you.

  • (1) welcome, (2) please make this into a full minimal example, not just a sniplet (makes it a lot easier for others to test), (3) were is that class available, it does not seem to be a class distributed with LaTeX. – daleif Feb 1 '18 at 11:08
1

This is fixed in the class definition file. However, you can change the format. The command that produces the titles is \@maketitle. It contains the command \raggedright two times, once for the title and once for the author information. Replacing each instance by \centering produces the required result. This can be achieve by patching the command as follows

\usepackage{etoolbox}

\makeatletter
\patchcmd{\@maketitle}{\raggedright}{\centering}{}{}
\patchcmd{\@maketitle}{\raggedright}{\centering}{}{}
\makeatother

Sample output

\documentclass[fleqn,11pt]{wlscirep}
\usepackage{authblk}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{fourier}
\usepackage{array}
\usepackage{makecell}
\usepackage{lipsum}
\usepackage{etoolbox}

\makeatletter
\patchcmd{\@maketitle}{\raggedright}{\centering}{}{}
\patchcmd{\@maketitle}{\raggedright}{\centering}{}{}
\makeatother

\begin{document}
\title{cccccc}
\author{xxxx}
\affil{vvvvv}
\affil{vvvvv}
\begin{abstract}
  x
\end{abstract}
\maketitle
\end{document}

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.