[Tex/LaTex] help redefining \maketitle and use of \thanks

titles

I needed to change the title page so that the title and authors were flushed left. For that I found some code in the answer here: Left align abstract, title and authors.

But I still have a few problems:
1. remove the space between the authors and the addresses.
2. my call to \thanks doesn't work any more.

Here is my code:

\documentclass[11pt]{article}
\usepackage{authblk} %affiliations
\usepackage[document]{ragged2e} %justify

\makeatletter
    \renewcommand{\maketitle}{\bgroup\setlength{\parindent}{0pt}
    \begin{flushleft}
      \textbf{\@title} \\[24pt]

      \@author
    \end{flushleft}\egroup
    }
\makeatother

\begin{document}

    \title{\huge {My Title}}

    \author[a]{Author1}\thanks{Corresponding author email:email@so.so}
    \author[b,c]{author2}

    \affil[a]{\small{\textit{address1}}}
    \affil[b]{\small{\textit{address2}}}

    \maketitle
    \justify

    \noindent
    \textbf{Abstract.} My abstract goes here. \\

    \noindent Keywords: a few words here.

    \section{Introduction} 
    Text.

\end{document}

Best Answer

Firstly, you should complete the coding by copying the way authblk modifies the \maketitle command: it saves a copy in \AB@maketitle and then redefines the tabular environment. In authblk the code is

\let\AB@maketitle=\maketitle
\def\maketitle
  {{\renewenvironment{tabular}[2][]{\begin{center}}
                                   {\end{center}}
  \AB@maketitle}}

You just want to change that center environment to a flushleft.

Secondly for the vertical spacing, authblk has the length \affilsep which by default is 1em. You can make it zero by writing

\setlength{\affilsep}{0pt}

Thirdly, \thanks can be replaced by \footnote without problem.

Now for some style comments. Setting of font sizes etc. should be done in your macro definitions etc. not added to the final text. So for the new \maketitle command write

{\huge\textbf{\@title}\par}

to get a huge bold title. (You can follow the \par by \vspace{...} to add some vertical space here.) Similarly styling of the affiliations and small italic should be set via authblk's mechanism of specifying the \Affilfont:

\renewcommand{\Affilfont}{\itshape\small}

Putting this together gives

Sample output

with a corresponding author note at the bottom of the page:

Sample foot

\documentclass[11pt]{article}

\usepackage{authblk}
\usepackage[document]{ragged2e}

\setlength{\affilsep}{0pt}

\renewcommand{\Affilfont}{\itshape\small}

\makeatletter
\renewcommand{\maketitle}{\bgroup\setlength{\parindent}{0pt}
\begin{flushleft}
  {\huge\textbf{\@title}\par}

  \@author
\end{flushleft}\egroup
}
\let\AB@maketitle=\maketitle
\def\maketitle{{\renewenvironment{tabular}[2][]{\begin{flushleft}}
  {\end{flushleft}}
  \AB@maketitle}}
\makeatother

\begin{document}

\title{My Title}

\author[a]{Author One\footnote{Corresponding author email email@so.so}}
\author[b,c]{Author Two}

\affil[a]{Address one\newline Town\newline Country}
\affil[b]{Address two\newline Town\newline Country}

\maketitle

\noindent
\textbf{Abstract.} My abstract goes here. 

\smallskip

\noindent Keywords: a few words here.

\section{Introduction} 
Text.

\end{document}