使用 authblk 包自动计数 affil 命令

使用 authblk 包自动计数 affil 命令

我当前的编码是手动插入隶属链接号。

    \title{Hormonal crosstalk for root development: a combined experimental and modeling perspective}
\author[1]{Junli Liu}
\author[2]{James Rowe}
\author[3]{Keith Lindsey}
\affil[1]{address one}
\affil[2]{address two}
\affil[3]{address three}

但我希望像计数器概念一样自动输入关联链接号。建议解决方案

例如:

\title{Hormonal crosstalk for root development: a combined experimental and modeling perspective}
    \author[1]{Junli Liu}
    \author[2]{James Rowe}
    \author[3]{Keith Lindsey}
    \affil{address one}
    \affil{address two}
    \affil{address three}

在此处输入图片描述

答案1

我不确定您期待什么逻辑\affil

设施的使用形式有两种authblk

第一形态

\author{Name1}
\affil{Affiliation1}

\author{Name2a}
\author{Name2b}
\affil{Affiliation 2}

(命令前面可以有任意数量的作者\affil,该命令将引用该组作者)。这是您的情况:

\documentclass[twocolumn]{article}
\usepackage[noblocks]{authblk}

\begin{document}

\title{Hormonal crosstalk for root development: a combined experimental and modeling perspective}

\author{Junli Liu}
\affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences,
  The Bio physical Sciences Institute, Durham University, Durham, UK}

\author{James Rowe}
\author{Keith Lindsey}
\affil{Some other laboratory, Elsewhere}

\maketitle

\end{document}

生产

在此处输入图片描述

第二形态

如果隶属关系不遵循作者顺序,则必须采用第二种形式,其中可选参数是必要的:

\author[1]{Name1a}
\author[2]{Name2}
\author[1]{Name1b}

\affil[1]{Affiliation1}
\affil[2]{Affiliation2}

因此,如果 Lindsey 与 Liu 有相同的从属关系,则应输入

\documentclass[twocolumn]{article}
\usepackage[noblocks]{authblk}

\begin{document}

\title{Hormonal crosstalk for root development: a combined experimental and modeling perspective}

\author[1]{Junli Liu}
\author[2]{James Rowe}
\author[1]{Keith Lindsey}

\affil[1]{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences,
  The Bio physical Sciences Institute, Durham University, Durham, UK}
\affil[2]{Some other laboratory, Elsewhere}

\maketitle

你会得到

在此处输入图片描述

替代方法

如果您知道每个作者的所属关系并希望自动编号,则可以通过更改命令的工作方式来实现。

\documentclass[twocolumn]{article}
\usepackage[noblocks]{authblk}

\usepackage{letltxmacro,xpatch}
\newcounter{affiliations}
\LetLtxMacro{\authblkauthor}{\author}
\LetLtxMacro{\authblkaffil}{\affil}

\renewcommand{\author}[1]{%
  \authblkauthor[\theauthors]{#1}%
}
\renewcommand{\affil}[1]{%
  \stepcounter{affiliations}%
  \authblkaffil[\theaffiliations]{#1}%
}

\begin{document}

\title{Hormonal crosstalk for root development: a combined experimental and modeling perspective}

\author{Junli Liu}
\author{James Rowe}
\author{Keith Lindsey}

\affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences,
  The Bio physical Sciences Institute, Durham University, Durham, UK}
\affil{Some other laboratory, Elsewhere}
\affil{Another laboratory, Somewhere Else}

\maketitle
\end{document}

在此处输入图片描述

但是,使用第一种形式可以得到完全相同的结果,在我看来,这是更清晰的输入。

\documentclass[twocolumn]{article}
\usepackage[noblocks]{authblk}

\begin{document}

\title{Hormonal crosstalk for root development: a combined experimental and modeling perspective}

\author{Junli Liu}
\affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences,
  The Bio physical Sciences Institute, Durham University, Durham, UK}

\author{James Rowe}
\affil{Some other laboratory, Elsewhere}

\author{Keith Lindsey}
\affil{Another laboratory, Somewhere Else}

\maketitle
\end{document}

另一种可能性(这里需要 旁边的可选参数\author):

\documentclass[twocolumn]{article}
\usepackage[noblocks]{authblk}

\usepackage{letltxmacro,xpatch}
\newcounter{affiliations}
\LetLtxMacro{\authblkaffil}{\affil}

\renewcommand{\affil}[1]{%
  \stepcounter{affiliations}%
  \authblkaffil[\theaffiliations]{#1}%
}

\begin{document}

\title{Hormonal crosstalk for root development: a combined experimental and modeling perspective}

\author[1]{Junli Liu}
\author[2]{James Rowe}
\author[3]{Keith Lindsey}

\affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences,
  The Bio physical Sciences Institute, Durham University, Durham, UK}
\affil{Some other laboratory, Elsewhere}
\affil{Another laboratory, Somewhere Else}

\maketitle
\end{document}

答案2

如果您希望一个条目没有数字,您可以使用\affil[ ]{<stuff>}

在此处输入图片描述

\documentclass[twocolumn]{article}
\usepackage[noblocks]{authblk}
\begin{document}

\title{Hormonal crosstalk for root development: a combined experimental and modeling perspective}
\author[1]{Junli Liu}
\author[2]{James Rowe}
\author[2]{Keith Lindsey}
\affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK}
\affil[$\relax$]{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK}

\maketitle

\end{document}

如果您希望所有\affil内容都没有数字,您可以在序言中添加以下内容:

\usepackage[noblocks]{authblk}
\let\oldaffil\affil% Store a copy of \affil in \oldaffil
\renewcommand{\affil}{\oldaffil[ ]}% Update \affil to *always* use \affil[ ]

上述修改使\affil默认值变为,\affil[ ]因此您不再需要传递可选参数。

在此处输入图片描述

\documentclass[twocolumn]{article}
\usepackage[noblocks]{authblk}
\let\oldaffil\affil
\renewcommand{\affil}{\oldaffil[ ]}
\begin{document}

\title{Hormonal crosstalk for root development: a combined experimental and modeling perspective}
\author[1]{Junli Liu}
\author[2]{James Rowe}
\author[2]{Keith Lindsey}
\affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK}
\affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK}

\maketitle

\end{document}

相关内容