Wie kann ich diesen Code ändern, um die Zugehörigkeit der Autoren anzugeben?

Wie kann ich diesen Code ändern, um die Zugehörigkeit der Autoren anzugeben?

Ich habe erfolgreich ein Dokument mit Abstracts für eine bevorstehende Konferenz auf der Grundlage dieses Codes erstellt, der verfügbar istHieraber kann mir jemand sagen, was ich ändern muss, um eine Autorenzugehörigkeit herzustellen? Vielen Dank.

\documentclass[11pt,a4paper]{article}

\usepackage[ngerman]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{blindtext}

\setlength{\parindent}{0cm} % Default is 15pt.

\usepackage[titles]{tocloft}

\newcommand{\listabstractname}{List of Abstracts}
\newlistof[section]{abstracts}{abs}{\listabstractname}

\newenvironment{abstracts}[1]{%
\refstepcounter{abstracts}%
\small%
\begin{center}%
  \textbf{#1}%
\end{center}%
\quotation%
\addcontentsline{abs}{abstracts}{#1}%
}{%
\endquotation%
\clearpage%
}

\newcommand\abstractauthor[1]{\authortoabs{#1}\printabstractauthor{#1}}

\newcommand{\printabstractauthor}[1]{%
{\noindent\centering\scshape#1\par\nobreak\vspace*{35pt}}%
}
\newcommand{\authortoabs}[1]{%
  \addtocontents{abs}{\vskip-10pt}%
  \addtocontents{abs}{%
    \protect\contentsline{section}{\hskip1.3em\mdseries\scshape\protect\scriptsize#1}{}{}}%
  \addtocontents{abs}{\vskip5pt}%
}

\begin{document}

\listofabstracts
\clearpage

\begin{abstracts}{This is a test title of an abstract}
\abstractauthor{First Author, Second Author}
\blindtext[3]
\end{abstracts}

\begin{abstracts}{This is a second abstract}
\abstractauthor{First Author}
\blindtext[3]
\end{abstracts}

\end{document} 

Antwort1

Versuchen Sie diesen einfachen Ansatz.

A

% !TeX TS-program = pdflatex

\documentclass[11pt,a4paper]{article}

\usepackage[ngerman]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{blindtext}

\setlength{\parindent}{0cm} % Default is 15pt.

\usepackage[titles]{tocloft}

\newcommand{\listabstractname}{List of Abstracts}
\newlistof[section]{abstracts}{abs}{\listabstractname}

%%************************************ added <<<<<<<<<<<<
\newcounter{authornum}
\newcommand{\TA}{\stepcounter{authornum}\textsuperscript{\theauthornum}}

\newcounter{affilnum}
\newcommand{\TF}{\stepcounter{affilnum}\textsuperscript{\theaffilnum}}

\newcommand{\afillauthor}[1]{\par\medskip\noindent\hfill\TF#1\hfill}

\newcommand{\printabstract}[1]{\par\vspace*{2em}#1}
%%************************************

\newenvironment{abstracts}[1]{%
    \refstepcounter{abstracts}%
    \setcounter{authornum}{0}\setcounter{affilnum}{0}% added <<<<<<<<<<<<   
    \small%
    \begin{center}%
        \textbf{#1}%
    \end{center}%
    \quotation% 
    \addtocontents{abs}{\vskip2ex}% added <<<<<<<<<<<<  
    \addcontentsline{abs}{abstracts}{#1}%
}{%
    \endquotation%
    \clearpage%
}

\newcommand{\printabstractauthor}[1]{% changed <<<<<<<<<<<<
    {\noindent\hfill\scshape#1\TA\hfill}
}%

\newcommand{\addauthortoToC}[1]{% added <<<<<<<<<<<<
    \par\addtocontents{abs}{%
        \protect\contentsline{section}{\vskip-1.7\baselineskip\hskip1.3em\mdseries\scshape\protect\scriptsize#1}{}{}}%
}


\begin{document}
    
    \listofabstracts
    \clearpage

    \begin{abstracts}{This is a test title of an abstract}
        \printabstractauthor{First Author}
        \printabstractauthor{Second Author}
        \addauthortoToC{First Author, Second Author}
        \afillauthor{University One}
        \afillauthor{University Two}
        \printabstract{\blindtext[3]}
    \end{abstracts}
    
    \begin{abstracts}{This is a second abstract}
        \printabstractauthor{First Author}
        \addauthortoToC{First Author}
        \afillauthor{University Three}
        \printabstract{\blindtext[3]}
    \end{abstracts}
    
    \begin{abstracts}{This is a third abstract}
        \printabstractauthor{First Author}
        \printabstractauthor{Second Author}
        \printabstractauthor{Third Author}
        \addauthortoToC{First Author, Second Author, Third Author}
        \afillauthor{University One}
        \afillauthor{University Two}
        \afillauthor{University Three}
        \printabstract{\blindtext[3]}
    \end{abstracts}
    
\end{document}

verwandte Informationen