# Customize author and affiliation using authblk

I have some problems when customizing author and affiliation using authblk.

The above picture shows the author and affiliation format generated by my MWE.

I want to:

1. typeset the author names bold face. I use the command \renewcommand*{\Authfont}{\bfseries}. However, it will turn both author names and affiliation boldface. I do not know what the problem is.
2. I want to put XXXXX in affiliation 1 together with 200021 in a new line. How can I achieve this? Thanks.

The following is my MWE:

\documentclass{article}
\usepackage[left=3.00cm, right=3.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\usepackage{authblk}

\renewcommand*{\Authsep}{, }
\renewcommand*{\Authand}{, }
\renewcommand*{\Authands}{, }
\renewcommand*{\Affilfont}{\normalsize}
%\renewcommand*{\Authfont}{\bfseries}    % make author names boldface
\setlength{\affilsep}{2em}   % set the space between author and affiliation

\title{Aa Article Title}
\author[1]{Aaaaaa Aa}
\author[1*]{Bbbbb Bb}
\author[2]{Ccccccc Ccc}
\affil[1]{Department of Chemical Engineering, University of AAAAA BBBBBB, CCCCC road, XXXXX 200021, Y Country}
\affil[2]{AAAAAA Laboratory, University of AAAAA BBBBBB, XXXXX 303939, Z Country}
\date{}

\begin{document}
\maketitle

This is an article.
\end{document}


1. You need \normalfont for the affiliations to neutralize the boldfaced fonts for the authors:

\renewcommand*{\Affilfont}{\normalsize\normalfont}
\renewcommand*{\Authfont}{\bfseries}

2. You can use a \parbox of the appropriate width inside \affil to have manual line breaks.

The code:

\documentclass{article}
\usepackage[left=3.00cm, right=3.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\usepackage{authblk}

\renewcommand*{\Authsep}{, }
\renewcommand*{\Authand}{, }
\renewcommand*{\Authands}{, }
\renewcommand*{\Affilfont}{\normalsize\normalfont}
\renewcommand*{\Authfont}{\bfseries}    % make author names boldface
\setlength{\affilsep}{2em}   % set the space between author and affiliation

\newsavebox\affbox

\title{Aa Article Title}
\author[1]{Aaaaaa Aa}
\author[1*]{Bbbbb Bb}
\author[2]{Ccccccc Ccc}
\affil[1]{%
\savebox\affbox{\Affilfont Department of Chemical Engineering, University of AAAAA BBBBBB, CCCCC road,}%
\parbox[t]{\wd\affbox}{\protect\centering Department of Chemical Engineering, University of AAAAA BBBBBB, CCCCC road, \par XXXXX 200021, Y Country}}
\affil[2]{AAAAAA Laboratory, University of AAAAA BBBBBB, XXXXX 303939, Z Country}
\date{}

\begin{document}

\maketitle

This is an article.

\end{document}


For 2., instead of \parbox you can use a varwidth environment so you don't have to calculate lengths:

\documentclass{article}
\usepackage[left=3.00cm, right=3.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\usepackage{authblk}
\usepackage{varwidth}

\renewcommand*{\Authsep}{, }
\renewcommand*{\Authand}{, }
\renewcommand*{\Authands}{, }
\renewcommand*{\Affilfont}{\normalsize\normalfont}
\renewcommand*{\Authfont}{\bfseries}    % make author names boldface
\setlength{\affilsep}{2em}   % set the space between author and affiliation

\title{Aa Article Title}
\author[1]{Aaaaaa Aa}
\author[1*]{Bbbbb Bb}
\author[2]{Ccccccc Ccc}
\affil[1]{\protect\begin{varwidth}[t]{\linewidth}\protect\centering Department of Chemical Engineering, University of AAAAA BBBBBB, CCCCC road, \par XXXXX 200021, Y Country\protect\end{varwidth}}
\affil[2]{AAAAAA Laboratory, University of AAAAA BBBBBB, XXXXX 303939, Z Country}
\date{}

\begin{document}
\maketitle

This is an article.
\end{document}

• To Gonzalo: Thanks. By the way, how could I know the width of the first line of Affiliation 1 is 0.85 \linewidth? If I change 0.85 to other value, say 0.9, then there is some spaces between the prefix 1 and Affiliation 1.
– Nick
Aug 10, 2015 at 2:12
• @Nick One could first box the content and then determine the box width, but the simller approach is to use varwidth (second example in my answer). If you're interested in the boxing method, let me know. Aug 10, 2015 at 3:28
• To Gonzalo: Yes, I want to more learn more about box method, especially how to determine box width. Thanks.
– Nick
Aug 10, 2015 at 5:44
• @Nick I've updated the answer showing the boxing/meassuring process. Aug 10, 2015 at 15:02

In complement to customise (more elegant in my opinion) could be using macro in your preamble for setting the customization of \affil, by example:

\usepackage{authblk}
\renewcommand*{\Authand}{\authorcr}
\renewcommand*{\Authands}{\newline} %%new line after each author
\renewcommand*{\Affilfont}{\normalsize}
\renewcommand*{\Authfont}{\bfseries}    % make author names boldface
\setlength{\affilsep}{2em}   % set the space between author and affiliation
\newcommand{\filliation}[5]{\affil[#1]{\textbf{#2}\vskip 0pt \textbf{#3}\vskip 0pt #4\vskip 0pt #5\vspace{10pt}}} %% 5 number of affil 1


In main file:

\filliation{1}{University}{Dept.}{Adress}{email@email}