0

I want to add multiple authors in my document. However, the \maketitle needs a redefinition to fit my document style. Therefore, I have used \def to redefined it as shown here below:

\documentclass[a4paper,11pt]{article}

%%% PACKAGES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[swedish]{babel}
\usepackage{geometry}
\usepackage[dvipsnames]{xcolor}

%%% DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength{\parindent}{0pt}
\setlength{\parskip}{5pt}

\geometry{margin=2cm}

\definecolor{oscars-darkblue}{HTML}{134590}

%%% TITLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\makeatletter
\def\@maketitle{%
  \huge\centering\textbf{\textcolor{oscars-darkblue}{\fontfamily{qag}\selectfont\@title}}
  \vskip 4mm
  \normalsize\centering\@author
}
\makeatother

\title{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor}
\author{FirstName1 LastName1\\example1gmail.com\\affiliation1\\
   \and FirstName2 LastName2\\example2gmail.com\\affiliation2\\
   \and FirstName3 LastName3\\example3gmail.com\\affiliation3\\
   \and FirstName4 LastName4\\example4gmail.com\\affiliation4\\
   \and FirstName5 LastName5\\example5gmail.com\\affiliation5\\
}
\date{}

%%% DOCUMENT STARTS HERE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\maketitle

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

\end{document}

This creates a problem with the \author command. It will no longer align the authors with the \and command. Using Google Docs, I can approximate what I want:

My questions is: can you change my existing code to make it work and how in that case? Or do I need to use the renewcommand command to define \author and \title separately?

1
  • If you found the answer satisfactory, please accept it. Commented Jan 25, 2022 at 21:07

1 Answer 1

1

Only to redefine \title. Try this code.

UPDATE With the requested header on the first page, after a follow-up request.

b

Fill the content of the four corners using \upperright, \lowerright, etc. (text or graphics).

The oscars.png figure used in the example was taken from the link provided in the comments.

\documentclass[a4paper,11pt]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[swedish]{babel}
\usepackage{geometry}
\usepackage[dvipsnames]{xcolor}

\usepackage{lipsum}% just dummy text

\setlength{\parindent}{0pt}
\setlength{\parskip}{5pt}
\geometry{margin=2cm}
\definecolor{oscars-darkblue}{HTML}{134590}

%********************************************* added <<<<<<<<<<<<<<<<
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{makecell}
\usepackage{tabularx}

\makeatletter
\DeclareRobustCommand\title[1]{\gdef\@title{%
\vspace*{-4.5ex}{\small\makeheader}\sffamily\bfseries\huge\centering\textcolor{oscars-darkblue}{#1}\vspace*{4mm}}} 
\makeatother

\newcommand{\makeheader}{%
    \begin{tabularx}{\textwidth}{@{}X X@{}}
        \makecell[l]{\upperleft} &  \makecell[r]{\upperright} \\[5ex]
        \makecell[bl]{\lowerleft}& \makecell[br]{\lowerright} \\[1ex]
    \end{tabularx}\\ \color{gray!70}    \rule{\textwidth}{1pt}\\
}
%********************************************* 

% ***************************** fill the four corners with text or graphics <<<<<<<<<<<<<<<<<<<
\newcommand{\upperright}{Some text above to the right \\    Some more text above to the right}
\newcommand{\upperleft}{Some text above to the left \\  Some more text above to the left}
\newcommand{\lowerleft}{\includegraphics[scale=0.8]{oscars.png}}
\newcommand{\lowerright}{Some text align with the logo \\ Some more text align with the logo}
% *****************************

\title{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor}
\author{FirstName1 LastName1\\example1gmail.com\\affiliation1\\ \and FirstName2 LastName2\\example2gmail.com\\affiliation2\\ \and FirstName3 LastName3\\example3gmail.com\\affiliation3\\ \and FirstName4 LastName4\\example4gmail.com\\affiliation4\\ \and FirstName5 LastName5\\example5gmail.com\\affiliation5\\ }
\date{}
%%%%% dont mind the things below this
\begin{document}

\maketitle
\begin{abstract}
    \lipsum[1]
\end{abstract}  

\begin{multicols}{2}
    \lipsum[2-4]
\end{multicols}
\end{document}
5
  • Thanks for the answer. A small problem though. I thought I would simplify the problem to make it easier to solve. But when I took it and implemented it into my "real" problem, it broke. The thing is, I have a logo and some text (in a separate file) that I want to redefine all at once. Can you make it to look like this or do I have to find a better alternative? You can find my current code in the document. Commented Jan 23, 2022 at 14:23
  • @JokingGold0 Logo and text only in the first page? Commented Jan 23, 2022 at 15:37
  • No. If you click my previous link, you can interact within a document how I want it. Or you can click this link to see how I want it. In other words, I want the title, abstract, authors, and etc. on the same first page. Do you understand? Commented Jan 23, 2022 at 15:49
  • @JokingGold0 I do. I asked because sometimes you want the logo on later pages as well. Commented Jan 23, 2022 at 16:06
  • Sorry for replying late, but thank you so much. It works like a charm. thumbs up Commented Jan 25, 2022 at 9:28

You must log in to answer this question.

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