使用 authblk 自定义作者和所属机构

使用 authblk 自定义作者和所属机构

我在使用自定义作者和所属机构时遇到了一些问题authblk

xxx

上图显示了我的 MWE 生成的作者和所属格式。

我想要:

  1. 将作者姓名排版为粗体。我使用命令\renewcommand*{\Authfont}{\bfseries}。但是,它会将作者姓名和所属机构都变成粗体。我不知道问题出在哪里。
  2. 我想将隶属关系 1 中的 XXXXX 与 200021 放在新行中。我该怎么做?谢谢。

以下是我的 MWE:

\documentclass{article}
\usepackage[left=3.00cm, right=3.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\usepackage{authblk}

\renewcommand*{\Authsep}{, }
\renewcommand*{\Authand}{, }
\renewcommand*{\Authands}{, }
\renewcommand*{\Affilfont}{\normalsize}
%\renewcommand*{\Authfont}{\bfseries}    % make author names boldface    
\setlength{\affilsep}{2em}   % set the space between author and affiliation

\title{Aa Article Title}
\author[1]{Aaaaaa Aa}
\author[1*]{Bbbbb Bb}
\author[2]{Ccccccc Ccc}
\affil[1]{Department of Chemical Engineering, University of AAAAA BBBBBB, CCCCC road, XXXXX 200021, Y Country} 
\affil[2]{AAAAAA Laboratory, University of AAAAA BBBBBB, XXXXX 303939, Z Country}
\date{}    

\begin{document}
\maketitle

This is an article.
\end{document}

答案1

在此处输入图片描述

  1. 您需要\normalfont为作者的隶属关系中和粗体字体:

    \renewcommand*{\Affilfont}{\normalsize\normalfont}
    \renewcommand*{\Authfont}{\bfseries}
    
  2. 您可以\parbox在内部使用适当宽度\affil来进行手动换行。

代码:

\documentclass{article}
\usepackage[left=3.00cm, right=3.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\usepackage{authblk}

\renewcommand*{\Authsep}{, }
\renewcommand*{\Authand}{, }
\renewcommand*{\Authands}{, }
\renewcommand*{\Affilfont}{\normalsize\normalfont}
\renewcommand*{\Authfont}{\bfseries}    % make author names boldface    
\setlength{\affilsep}{2em}   % set the space between author and affiliation

\newsavebox\affbox

\title{Aa Article Title}
\author[1]{Aaaaaa Aa}
\author[1*]{Bbbbb Bb}
\author[2]{Ccccccc Ccc}
\affil[1]{%
  \savebox\affbox{\Affilfont Department of Chemical Engineering, University of AAAAA BBBBBB, CCCCC road,}%
  \parbox[t]{\wd\affbox}{\protect\centering Department of Chemical Engineering, University of AAAAA BBBBBB, CCCCC road, \par XXXXX 200021, Y Country}} 
\affil[2]{AAAAAA Laboratory, University of AAAAA BBBBBB, XXXXX 303939, Z Country}
\date{}    

\begin{document}

\maketitle

This is an article.

\end{document}

对于 2.,\parbox您可以使用varwidth环境,这样您就不必计算长度:

\documentclass{article}
\usepackage[left=3.00cm, right=3.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\usepackage{authblk}
\usepackage{varwidth}

\renewcommand*{\Authsep}{, }
\renewcommand*{\Authand}{, }
\renewcommand*{\Authands}{, }
\renewcommand*{\Affilfont}{\normalsize\normalfont}
\renewcommand*{\Authfont}{\bfseries}    % make author names boldface    
\setlength{\affilsep}{2em}   % set the space between author and affiliation

\title{Aa Article Title}
\author[1]{Aaaaaa Aa}
\author[1*]{Bbbbb Bb}
\author[2]{Ccccccc Ccc}
\affil[1]{\protect\begin{varwidth}[t]{\linewidth}\protect\centering Department of Chemical Engineering, University of AAAAA BBBBBB, CCCCC road, \par XXXXX 200021, Y Country\protect\end{varwidth}} 
\affil[2]{AAAAAA Laboratory, University of AAAAA BBBBBB, XXXXX 303939, Z Country}
\date{}    

\begin{document}
\maketitle

This is an article.
\end{document}

答案2

作为对定制的补充(我认为更优雅),可以在序言中使用宏来设置 \affil 的定制,例如:

\usepackage{authblk}
\renewcommand*{\Authand}{\authorcr}
\renewcommand*{\Authands}{\newline} %%new line after each author
\renewcommand*{\Affilfont}{\normalsize}
\renewcommand*{\Authfont}{\bfseries}    % make author names boldface    
\setlength{\affilsep}{2em}   % set the space between author and affiliation
\newcommand{\filliation}[5]{\affil[#1]{\textbf{#2}\vskip 0pt \textbf{#3}\vskip 0pt #4\vskip 0pt #5\vspace{10pt}}} %% 5 number of affil 1

在主文件中:

\filliation{1}{University}{Dept.}{Adress}{email@email}

相关内容