如何重置作者列表?

如何重置作者列表?

我正在使用titling包并authblk在单个文件中管理多篇文章。以下是示例代码

\documentclass[11pt,openany]{article}
\usepackage{amsmath,amsfonts,amsthm,dsfont,amssymb,csquotes}
\usepackage{titling}

\usepackage[blocks]{authblk}


\usepackage{geometry}
\geometry{
    headheight=4ex,
    includehead,
    includefoot
}

\geometry{
    %   paper=a4paper, % Change to letterpaper for US letter
    paperheight=25cm,paperwidth=18cm,
    inner=1cm, % Inner margin
    outer=2cm, % Outer margin
    bindingoffset=1cm, % Binding offset
    top=1cm, % Top margin
    bottom=1cm, % Bottom margin
    %   showframe,% show how the type block is set on the page
}


\makeatletter
\newcommand\receivedon[1]{\renewcommand\@receivedon{#1}}
\newcommand\@receivedon{}
\newcommand\acceptedon[1]{\renewcommand\@acceptedon{\underline{\hspace{1.7cm}}#1}}
\newcommand\@acceptedon{}
\newcommand\uniqueid[1]{\renewcommand\@uniqueid{\text{#1}}}
\newcommand\@uniqueid{}
\newcommand\category[1]{\renewcommand\@category{\text{#1}}}
\newcommand\@category{}
\setlength{\droptitle}{-5cm}

\def\@maketitle{%
    \begin{minipage}{.5\textwidth}
        %       \raggedright
        $\begin{array}{lcl}
        \text{Unique Id} & :& \@uniqueid  \\
        \text{Category} & : & \@category  \\
        \end{array} $
    \end{minipage}
    \begin{minipage}{.5\textwidth}
        \raggedleft
        Received on : \@receivedon \\
        Accepted on : \@acceptedon
    \end{minipage}
    \vskip 1.5em%
    \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}
\makeatother


\begin{document}

%%%%%%%---------First Article-------------

\title{First Article}


\author[]{Author A}

\affil[]{Affiliation of Author A}

\uniqueid {17ICLAA034} \category{Invited Speaker }
\receivedon{26.09.2017}  \acceptedon{}


\maketitle


\begin{abstract}
    Abstract goes here...
 \end{abstract}


%%%%%%%---------Second Article-------------

\title{Second Article}

\author[]{\underline{Author B}}

\affil[]{Affiliation of author B. }

\uniqueid {17ICLAA087} \category{Invited Speaker }
\receivedon{03.10.2017}  \acceptedon{}

\maketitle

\begin{abstract}
    Abstract goes here...
\end{abstract}




\end{document}

我想要的是?

  • 需要重新设置每篇文章的作者列表。
  • 必须删除分页符。
  • 需要在目录中添加标题和作者。
  • 需要在标题中添加作者。

电流输出:

在此处输入图片描述

PS: 给出的解决方案这个问题对我来说不起作用。

提前致谢。

答案1

我专注于重置包的作者列表authblk

作者列表存储在\AB@authors其中,可以在每次使用文章的新标题之前将其定义为空,从而手动重置。

另一种方法是抓住\author定义,使用\RenewDocumentCommand 并检查作者数量是否为0,然后重新定义\AB@authors,然后在里面使用原始内容\author

\@maketitle在其末尾将authoraffil计数器值设置为。0

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{dsfont}
\usepackage{amssymb}
\usepackage{csquotes}
\usepackage{titling}
\usepackage{letltxmacro}
\usepackage{xparse}
\usepackage[blocks]{authblk}



\usepackage{geometry}
\geometry{
    headheight=4ex,
    includehead,
    includefoot
}

\geometry{
    %   paper=a4paper, % Change to letterpaper for US letter
    paperheight=25cm,paperwidth=18cm,
    inner=1cm, % Inner margin
    outer=2cm, % Outer margin
    bindingoffset=1cm, % Binding offset
    top=1cm, % Top margin
    bottom=1cm, % Bottom margin
    %   showframe,% show how the type block is set on the page
}


\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}%
  }%
}

\newcommand\receivedon[1]{\renewcommand\@receivedon{#1}}
\newcommand\@receivedon{}
\newcommand\acceptedon[1]{\renewcommand\@acceptedon{\underline{\hspace{1.7cm}}#1}}
\newcommand\@acceptedon{}
\newcommand\uniqueid[1]{\renewcommand\@uniqueid{\text{#1}}}
\newcommand\@uniqueid{}
\newcommand\category[1]{\renewcommand\@category{\text{#1}}}
\newcommand\@category{}
\setlength{\droptitle}{-5cm}



\def\@maketitle{%
  \begin{minipage}{.5\textwidth}
    % \raggedright
    $\begin{array}{lcl}
      \text{Unique Id} & :& \@uniqueid  \\
      \text{Category} & : & \@category  \\
    \end{array} $
  \end{minipage}
  \begin{minipage}{.5\textwidth}
        \raggedleft
        Received on : \@receivedon \\
        Accepted on : \@acceptedon
      \end{minipage}
    \vskip 1.5em%
    \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}


\author[]{Author A}

\affil[]{Affiliation of Author A}

\uniqueid {17ICLAA034} \category{Invited Speaker }
\receivedon{26.09.2017}  \acceptedon{}


\maketitle


\begin{abstract}
  Abstract goes here...
\end{abstract}


%%%%%%%---------Second Article-------------




\title{Second Article}

\author[]{\underline{Author B}}

\affil[]{Affiliation of author B. }

\uniqueid {17ICLAA087} \category{Invited Speaker }
\receivedon{03.10.2017}  \acceptedon{}

\makeatletter
\makeatother
\maketitle

\begin{abstract}
    Abstract goes here...
\end{abstract}




\end{document}

相关内容