目前我正在为我们的会议制作一个模板文件,我们需要在标题中写上作者姓名。
如果作者人数为两位,则列出这些作者;如果作者人数多于两位,则应显示“第一作者等”。
如何实现这个目标?
梅威瑟:
\documentclass[a4paper,10pt]{article}
\usepackage{amsmath,amsfonts,amsthm,dsfont,amssymb,lipsum}
\usepackage[blocks]{authblk}
\newenvironment{keywords}{\noindent\textbf{Keywords:}}{}
\newenvironment{classification}{\noindent\textbf{AMS subject classifications.}}{}
\newcommand{\email}[1]{\texttt{\small #1}}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{%
\ifodd\value{page}
\small\nouppercase\authors
\else
\small\nouppercase\shorttitle
\fi
}
\begin{document}
% % % % %--------------------------------------------------------------------
% % % % % Title of the Paper and Acknowledgement
% % % % %--------------------------------------------------------------------
\title{Your Title of the Paper
\thanks{Acknowledgement: The authors thanks the support of so and so project/funding \dots}
}
% % % % %--------------------------------------------------------------------
% % % % % Authors,, Affiliations and email ids
% % % % %--------------------------------------------------------------------
\author[1]{Author A\footnote{Presenting Author.}}
\author[2]{Author B}
\author[3]{Author C} % Author having same Affiliation that of Author A
\author[4]{Author D}
\affil[1]{Affiliation of Author A. \email{[email protected]}}
\affil[2] {Affiliation of Author B. \email{[email protected]}}
\affil[3] {Affiliation of Author C. \email{[email protected]}}
\affil[4]{Department of Statistics, Manipal University, Manipal, India. \email{[email protected]}}
% % % % %--------------------------------------------------------------------
\date{(Received on , Accepted on )}
\newcommand\shorttitle{The Running title of the article(give a short title)}
\newcommand\authors{Authors on the Author A et.al.,}
\maketitle
\begin{abstract}
Your abstract goes here\dots The citation can be done using \verb|\cite{key}| and this will result the respective number in the reference list, Eg.\cite{einstein}.
\end{abstract}
\begin{keywords}
ginverse, drazin inverse, diffrential equation
\end{keywords}
\begin{classification}
13C10; 15A09; 15A24; 15B57
\end{classification}
\section{Introduction}
Use \verb|\section{}| command to type your sections. Here, goes your introduction or preliminaries...
\section{Your section title\dots}
\lipsum[1-20]
\begin{thebibliography}{100}
\bibitem{einstein}
Albert Einstein.
{\em Zur Elektrodynamik bewegter K{\"o}rper}.
Journal of Mathematics, 322(10):89--921, 1905.
\bibitem{impj} The Japan Reader {\em Imperial Japan 1800-1945} 1973:
Random House, N.Y.
\bibitem{norman} E. H. Norman {\em Japan's emergence as a modern
state} 1940: International Secretariat, Institute of Pacific
Relations.
\bibitem{fo} Bob Tadashi Wakabayashi {\em Anti-Foreignism and Western
Learning in Early-Modern Japan} 1986: Harvard University Press.
\end{thebibliography}
\end{document}
答案1
authblk
将作者存储在两个宏\AB@authlist
和中\AB@authors
。第一个具有以下结构:
\protect\@nameuse{@sep1} \protect\Authfont AUTHORNAME\protect\footnote {AFFILL}\protect\textsuperscript {,}
\protect\@nameuse{@sep2} \protect\Authfont AUTHORNAME\protect\footnote {AFFILL}\protect\textsuperscript {,}
…
第二个就复杂多了。这个包用 counter 来统计作者的数量authors
。
如果计数器authors
小于 3,我们可以简单地使用它\AB@authlist
来显示页眉中的作者。但是如果它大于或等于 3,我们必须拆分第一作者。这可以通过一个简单的分隔参数来完成:
\documentclass[a4paper,10pt]{article}
\usepackage{amsmath,amsfonts,amsthm,dsfont,amssymb,lipsum}
\usepackage[blocks]{authblk}
\newenvironment{keywords}{\noindent\textbf{Keywords:}}{}
\newenvironment{classification}{\noindent\textbf{AMS subject classifications.}}{}
\newcommand{\email}[1]{\texttt{\small #1}}
\makeatletter
\newcommand*{\authors}{%
\begingroup
\let\footnote\@gobble% ignore \footnote
\let\textsuperscript\@gobble% ignore protected \textsuperscript
\expandafter\let\csname textsuperscript \endcsname\@gobble
\let\Authfont\relax% do not use a special font
\def\Authand{, }% separate list of authors by ,
\ifnum\value{authors}<3 % one ore two authors
\AB@authlist% show them all
\else% 3 or more authors
% show only the first one followed by "et.~al"
\expandafter\@firstof@authlist\AB@authlist\@nil\ et.~al%
\fi
\endgroup
}
\def\@firstof@authlist#1\footnote#2\@nil{#1}% skip all from the first footnote
\makeatother
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{%
\ifodd\value{page}
\small\nouppercase\authors
\else
\small\nouppercase\shorttitle
\fi
}
\begin{document}
% % % % %--------------------------------------------------------------------
% % % % % Title of the Paper and Acknowledgement
% % % % %--------------------------------------------------------------------
\title{Your Title of the Paper
\thanks{Acknowledgement: The authors thanks the support of so and so project/funding \dots}
}
% % % % %--------------------------------------------------------------------
% % % % % Authors,, Affiliations and email ids
% % % % %--------------------------------------------------------------------
\author[1]{Author A\footnote{Presenting Author.}}
\author[2]{Author B}
\author[3]{Author C} % Author having same Affiliation that of Author A
\author[4]{Author D}
\affil[1]{Affiliation of Author A. \email{[email protected]}}
\affil[2] {Affiliation of Author B. \email{[email protected]}}
\affil[3] {Affiliation of Author C. \email{[email protected]}}
\affil[4]{Department of Statistics, Manipal University, Manipal, India. \email{[email protected]}}
% % % % %--------------------------------------------------------------------
\date{(Received on , Accepted on )}
\newcommand\shorttitle{The Running title of the article(give a short title)}
\maketitle
\begin{abstract}
Your abstract goes here\dots The citation can be done using \verb|\cite{key}| and this will result the respective number in the reference list, Eg.\cite{einstein}.
\end{abstract}
\begin{keywords}
ginverse, drazin inverse, diffrential equation
\end{keywords}
\begin{classification}
13C10; 15A09; 15A24; 15B57
\end{classification}
\section{Introduction}
Use \verb|\section{}| command to type your sections. Here, goes your introduction or preliminaries...
\section{Your section title\dots}
\lipsum[1-20]
\begin{thebibliography}{100}
\bibitem{einstein}
Albert Einstein.
{\em Zur Elektrodynamik bewegter K{\"o}rper}.
Journal of Mathematics, 322(10):89--921, 1905.
\bibitem{impj} The Japan Reader {\em Imperial Japan 1800-1945} 1973:
Random House, N.Y.
\bibitem{norman} E. H. Norman {\em Japan's emergence as a modern
state} 1940: International Secretariat, Institute of Pacific
Relations.
\bibitem{fo} Bob Tadashi Wakabayashi {\em Anti-Foreignism and Western
Learning in Early-Modern Japan} 1986: Harvard University Press.
\end{thebibliography}
\end{document}
结果是:
或者如果你删除
\author[3]{Author C} % Author having same Affiliation that of Author A
\author[4]{Author D}
在