[Tex/LaTex] How to print the corresponding author

authblktitles

I am using the authblk style file. I want to print the corresponding author and address to the left of the complete list of authors (and in addition to this list – so the list should also contain the corresponding author). Moreover, the corresponding author should be marked by an asterisk in the complete list of authors.

Currently, I am using this code:

\documentclass[twocolumn]{article}

\usepackage[noblocks]{authblk}
\makeatletter
\def\@correspondence{}
\def\correspondence#1{%
     \gdef\@correspondence{\textbf{\textit{*Correspondence:}}\newline%
       \raggedright  #1}}

\def\@maketitle{%
  \newpage
  \null
  \vskip 50pc%
\vbox{\hbox to 0pt{\vbox to 0pt{\vskip -40pc%
\begin{minipage}[!b]{10pc}
{\@correspondence\par}%
\end{minipage}
\hspace*{12pt}
\begin{minipage}[!b]{31pc}  
  \let \footnote \thanks
    {\@title \par}%
    \vskip 1.5em%
    {\large
%      \lineskip .5em%
      \begin{tabular}[t]{l}%
        \raggedright\@author
      \end{tabular}\par}%
   \end{minipage}}}}%
  \par
  }
\makeatother
\begin{document}

\title{Journal Title}
\author[1*]{Junli Liu}
\affil{address one}
\correspondence{Junli Liu\newline correspondence author address to be printed here}

\maketitle

\end{document}

What I would like to have instead is something like:

\documentclass[twocolumn]{article}

\usepackage[noblocks]{authblk}


\begin{document}

\title{Journal Title}
\author[1,corauthor,coraddress={corresponding address here}]{Junli Liu}
\affil{address one}


\maketitle

\end{document}

The output of my current code and my requirements are illustrated here:

enter image description here

How can I modify \author to work as required?

Best Answer

Starting from the code you already have, you could achieve your desired output as follows:

\documentclass[twocolumn]{article}

\usepackage[noblocks]{authblk}

\makeatletter
\def\@correspondence{}
\def\correspondence#1{%
     \gdef\@correspondence{\textbf{\textit{*Correspondence:}}\newline%
       \raggedright  #1}}

\def\@maketitle{%
  \newpage
  \null
  \vskip 50pc%
\vbox{\hbox to 0pt{\vbox to 0pt{\vskip -40pc%
\begin{minipage}[!b]{10pc}
{\@correspondence\par}%
\end{minipage}
\hspace*{12pt}
\begin{minipage}[!b]{31pc}  
  \let \footnote \thanks
    {\@title \par}%
    \vskip 1.5em%
    {\large
%      \lineskip .5em%
      \begin{tabular}[t]{l}%
        \raggedright\@author
      \end{tabular}\par}%
   \end{minipage}}}}%
  \par
  }
\makeatother

\newcommand{\corauthor}[4]{\author[#4]{#1$^*$}\affil[#4]{#3}\correspondence{#1\newline #2}}

\begin{document}

\title{Journal Title}
\author[1]{First author}
\affil[1]{address one}
\corauthor{Junli Liu}{corresponding address}{address two}{2}
\author[3]{Third author}
\author[2]{Fourth author with same affil as corresponding one}
\affil[3]{address three}

\maketitle

\end{document}

So instead of writing \author[1,corauthor,coraddress={corresponding address here}]{Junli Liu}, you would have to write \corauthor{Junli Liu}{corresponding address}{address two}{2} with this solution. The arguments of the command \corauthor are first the author's name, second the author's corresponding address, third the author's normal address, and fourth the index of the author's affiliation. As you can see in the example code, you can then use this index to refer to the same (normal) affiliation for other authors as well (e.g., for the fourth author in the code above).