Is there something like \emptyauthor and \emptyaffil similair to \emptythanks in TeX?

Viewed 11

I try to implement 2 titles in TeX document using package \titling. Something similar was considered in https://tex.stackexchange.com/questions/401081/how-to-reset-the-author-list , but this solution works only for 1 author and 1 affiliation for each title. Contrary, I have 2 authors and 2 affilations for each title. As a result of code, I get 4 authors and 4 affiliations for the 2nd title which is not appropriate!

As you can see in WE there is a feature \emptythanks in package \titling which is fine for me and it'll be great to find something like \emptyauthor and \emptyaffil. But mb there is an another way to solve this problem...

Could someone help me, please?!

\documentclass[12pt]{article}
    \usepackage[cp1251]{inputenc}
    \usepackage[english]{babel}
    
    \usepackage{amsmath}
    \usepackage{amsfonts}
    \usepackage{amsthm}
    \usepackage{dsfont}
    \usepackage{amssymb}
    \usepackage{csquotes}
    \usepackage{titling}
    \usepackage{letltxmacro}
    \usepackage{xparse}
    \usepackage[blocks]{authblk}
    
    %\newcommand{\emptyauthor}{\global\let\@author\@empty}
    %\newcommand{\emptyaffil}{\global\let\@affil\@empty}
    
    
    \makeatletter \LetLtxMacro\@uthorfrom@uthblk\author
    
    \RenewDocumentCommand{\author}{+o+m}{%
      \ifnum0=\value{authors}%
      \def\AB@authors{}%
      \fi
      \IfValueTF{#1}{%
        \@uthorfrom@uthblk[#1]{#2}%
      }{%
        \@uthorfrom@uthblk{#2}%
      }%
    }
    
    \def\@maketitle{%
        \begin{center}%
          \let \footnote \thanks
          {\LARGE \@title \par}%
          \vskip 1.5em%
          {\large
            \lineskip .5em%
            \begin{tabular}[t]{c}%
              \@author%
            \end{tabular}\par}%
            \vskip 1em%
            % {\large \@date}%
          \end{center}%
          \par
          \vskip 1.5em%
          % reset counters for possible next \author macro
          \setcounter{authors}{0}%
          \setcounter{affil}{0}%
        }
    \makeatother
    
    
    \begin{document}
    
    %%%%%%%---------First Article-------------
    
    \title{First Article\thanks{thanks to everyone.}}
    
    
    \author[1]{Author A1}
    \author[2]{Author A2}
    
    \affil[1]{Affiliation of Author A1}
    \affil[2]{Affiliation of Author
    A2}
    
    \maketitle
    
    
    \begin{abstract}
      Abstract goes here...
    \end{abstract}
    
    
    %%%%%%%---------Second Article-------------
    
    
    \emptythanks
    %\emptyauthor
    %\emptyaffil
    
    \title{Second Article\thanks{thanks to your mom.}}
    
    \author[1]{\underline{Author B1}}
    \author[2]{\underline{Author B2}}
    
    \affil[1]{Affiliation of Author B1}
    \affil[2]{Affiliation of Author
    B2}
    
    \makeatletter
    \makeatother
    \maketitle
    
    \begin{abstract}
        Abstract goes here...
    \end{abstract}
    
    
    
    
    \end{document}

enter image description here

0 Answers
Related