默认会员编号放宽

默认会员编号放宽

我使用的是 authblk.sty 和 xkeyvalue.sty。默认情况下,作者编号应该放宽。但默认情况下,我当前输出的作者编号是 1。

我的代码如下:

\author{Maria Luisa Di Vona}
\author{Emanuela Sgreccia}
\author[aff={1,2},coraddress={Richard, Dipartimento di Scienze e
Tecnologie Chimiche, Universita di Roma Tor Vergata, Via della
Ricerca Scientifica 1, 00133 Roma,
Italia},email={[email protected]}]{Riccardo Narducci}

我当前的输出是:

Maria Luisa Di Vona 1 , Emanuela Sgreccia 1 , and Riccardo
Narducci 1,2

我所需的输出是:

Maria Luisa Di Vona, Emanuela Sgreccia, and Riccardo
Narducci 1,2

我没有aff={affilation number}为以下作者“Maria Luisa Di Vona, Emanuela Sgreccia”提供任何值。如果我没有提供值,则应该放宽隶属关系编号。但当前输出默认显示 1。如何默认放宽隶属关系编号?请提供建议。

梅威瑟:

\documentclass{article}

\usepackage{authblk}
\usepackage{xkeyval}
\usepackage{etoolbox}%
\usepackage{xparse}%


\usepackage{hyperref}
\makeatletter
\def\@maketitle{%
\vbox to \textheight{\vbox to \textheight{\vspace*{12pc}%\vfill%
\hbox to 10pc{\hfill%
\begin{minipage}[b]{10pc}
{\@correspondence\par}%
    \vskip 6pt%
{\@presentaddress}%
\end{minipage}}}
\hspace*{11pc}
\vbox to \textheight{\vspace*{-44pc}%
\hbox to 10pc{\hfill%
\begin{minipage}[b]{25pc}
  \let \footnote \thanks
    {\raggedright\fontsize{18pt}{20pt}\selectfont\@title \par}%
    \vskip 1.5em%
    {\large
      \begin{tabular}[t]{l}%
        \raggedright\@author
      \end{tabular}\par}%
   \end{minipage}}}}%
  \par
  \vskip 8.5em}


\def\@correspondence{}
\def\correspondence#1{%
  \gdef\@correspondence{\textbf{\textit{*Correspondence:}}\newline%
    \raggedright  #1\FrontKVMacroEmail%
    }}

\def\@presentaddress{}
\def\presentaddress#1{%
     \gdef\@presentaddress{\textbf{\textit{$\dagger$presentaddress:}}\newline%
       \raggedright  #1}}



\define@key{authorinfo}{aff}{%
\def\FrontKVMacroAff{#1}%
}%


\define@key{authorinfo}{coraddress}{%
\def\FrontKVMacroCorAddress{#1}%
}%

\define@key{authorinfo}{email}{%
\def\FrontKVMacroEmail{#1}%
}%

\define@key{authorinfo}{presentaddress}{%
\def\FrontKVMacroPresentAddress{#1}%
}%

\define@key{authorinfo}{link}{%
\def\FrontKVMacroLink{#1}%
}%


\let\OriginalAuthor\author

\RenewDocumentCommand{\author}{+O{}+m}{%
\setkeys{authorinfo}{#1}%
\ifdef{\FrontKVMacroAff}{%
  \ifdef{\FrontKVMacroLink}{%
    \OriginalAuthor[\FrontKVMacroAff]{\href{\FrontKVMacroLink}{#2}}%
  }{%
    \OriginalAuthor[\FrontKVMacroAff]{#2}%
  }%
}{%
  \ifdef{\FrontKVMacroLink}{%
    \OriginalAuthor{\href{\FrontKVMacroLink}{#2}}%
  }{%
    \OriginalAuthor{#2}%
  }%
}%
\ifdef{\FrontKVMacroCorAddress}{%
  \correspondence{\FrontKVMacroCorAddress}%
}{%
}
\ifdef{\FrontKVMacroPresentAddress}{%
  \presentaddress{\FrontKVMacroPresentAddress}%
}{%
}%
\undef\FrontKVMacroAff%
}% End of RenewDocumentCommand.


\makeatother

\begin{document}

\title{Hormonal crosstalk for root development}
\author{Maria Luisa Di Vona}
\author{Emanuela Sgreccia}
\author[aff={1,2},coraddress={Richard, Dipartimento di Scienze e
Tecnologie Chimiche, Universita di Roma Tor Vergata, Via della
Ricerca Scientifica 1, 00133 Roma,
Italia},email={[email protected]}]{Riccardo Narducci}
\affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK}

\maketitle
\end{document} 

答案1

改变你的\author定义

\RenewDocumentCommand{\author}{+O{}+m}{%
\setkeys{authorinfo}{#1}%
\ifdef{\FrontKVMacroAff}{%
  \ifdef{\FrontKVMacroLink}{%
    \OriginalAuthor[\FrontKVMacroAff]{\href{\FrontKVMacroLink}{#2}}%
  }{%
    \OriginalAuthor[\FrontKVMacroAff]{#2}%
  }%
}{%
  \ifdef{\FrontKVMacroLink}{%
    \OriginalAuthor[$\relax$]{\href{\FrontKVMacroLink}{#2}}%
  }{%
    \OriginalAuthor[$\relax$]{#2}%
  }%
}%
\ifdef{\FrontKVMacroCorAddress}{%
  \correspondence{\FrontKVMacroCorAddress}%
}{%
}
\ifdef{\FrontKVMacroPresentAddress}{%
  \presentaddress{\FrontKVMacroPresentAddress}%
}{%
}%
\undef\FrontKVMacroAff%
}% End of RenewDocumentCommand.

请注意,我添加了可选参数,当\OriginalAuthor未定义$\relax$\FrontKVMacroAff

附注:我在\correspondence之前的定义中添加了一个空格\FrontKVMacroEmail,否则电子邮件将被打印并附加到前面的文本中:

\def\correspondence#1{%
  \gdef\@correspondence{\textbf{\textit{*Correspondence:}}\newline%
    \raggedright  #1 \FrontKVMacroEmail%
    }}

梅威瑟:

\documentclass{article}

\usepackage{authblk}
\usepackage{xkeyval}
\usepackage{etoolbox}%
\usepackage{xparse}%


\usepackage{hyperref}
\makeatletter
\def\@maketitle{%
\vbox to \textheight{\vbox to \textheight{\vspace*{12pc}%\vfill%
\hbox to 10pc{\hfill%
\begin{minipage}[b]{10pc}
{\@correspondence\par}%
    \vskip 6pt%
{\@presentaddress}%
\end{minipage}}}
\hspace*{11pc}
\vbox to \textheight{\vspace*{-44pc}%
\hbox to 10pc{\hfill%
\begin{minipage}[b]{25pc}
  \let \footnote \thanks
    {\raggedright\fontsize{18pt}{20pt}\selectfont\@title \par}%
    \vskip 1.5em%
    {\large
      \begin{tabular}[t]{l}%
        \raggedright\@author
      \end{tabular}\par}%
   \end{minipage}}}}%
  \par
  \vskip 8.5em}


\def\@correspondence{}
\def\correspondence#1{%
  \gdef\@correspondence{\textbf{\textit{*Correspondence:}}\newline%
    \raggedright  #1 \FrontKVMacroEmail%
    }}

\def\@presentaddress{}
\def\presentaddress#1{%
     \gdef\@presentaddress{\textbf{\textit{$\dagger$presentaddress:}}\newline%
       \raggedright  #1}}



\define@key{authorinfo}{aff}{%
\def\FrontKVMacroAff{#1}%
}%


\define@key{authorinfo}{coraddress}{%
\def\FrontKVMacroCorAddress{#1}%
}%

\define@key{authorinfo}{email}{%
\def\FrontKVMacroEmail{#1}%
}%

\define@key{authorinfo}{presentaddress}{%
\def\FrontKVMacroPresentAddress{#1}%
}%

\define@key{authorinfo}{link}{%
\def\FrontKVMacroLink{#1}%
}%


\let\OriginalAuthor\author

\RenewDocumentCommand{\author}{+O{}+m}{%
\setkeys{authorinfo}{#1}%
\ifdef{\FrontKVMacroAff}{%
  \ifdef{\FrontKVMacroLink}{%
    \OriginalAuthor[\FrontKVMacroAff]{\href{\FrontKVMacroLink}{#2}}%
  }{%
    \OriginalAuthor[\FrontKVMacroAff]{#2}%
  }%
}{%
  \ifdef{\FrontKVMacroLink}{%
    \OriginalAuthor[$\relax$]{\href{\FrontKVMacroLink}{#2}}%
  }{%
    \OriginalAuthor[$\relax$]{#2}%
  }%
}%
\ifdef{\FrontKVMacroCorAddress}{%
  \correspondence{\FrontKVMacroCorAddress}%
}{%
}
\ifdef{\FrontKVMacroPresentAddress}{%
  \presentaddress{\FrontKVMacroPresentAddress}%
}{%
}%
\undef\FrontKVMacroAff%
}% End of RenewDocumentCommand.


\makeatother

\begin{document}

\title{Hormonal crosstalk for root development}
\author{Maria Luisa Di Vona}
\author{Emanuela Sgreccia}
\author[aff={1,2},coraddress={Richard, Dipartimento di Scienze e
Tecnologie Chimiche, Universita di Roma Tor Vergata, Via della
Ricerca Scientifica 1, 00133 Roma,
Italia},email={[email protected]}]{Riccardo Narducci}
\affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK}

\maketitle
\end{document} 

输出:

在此处输入图片描述

相关内容