使用 authblk 在 maketitle 中自定义换行符

使用 authblk 在 maketitle 中自定义换行符

我正在尝试修改用 authblk 定义的从属关系的输出,以便在连续的行上打印每个条目,并且当超出文本宽度时,在分隔不同从属关系的符号处断行。

我尝试采用这个解决方案特定字符自动换行不幸的是,它不能按照我想要的方式工作。

以下是问题的一个例子

\documentclass{article}
\usepackage{authblk}

\renewcommand\Authfont{\bfseries\normalsize}
\renewcommand\Affilfont{\normalfont\itshape}
\renewcommand\Authand{, }
\renewcommand\Authands{, }

% This did not work
\def\semicolon{;}
\let\semisep\semicolon
\renewcommand{\semicolon}{\discretionary{\semisep}{}{\semisep}}
\makeatletter
\renewcommand\AB@affilsepx{\protect{\semicolon } \protect\Affilfont}
\makeatother

\title{Fix line breaks}

\author[1]{Author A}
\author[1]{Author B}
\author[2]{Author C}
\author[3]{Author D}
\author[4]{Author E}
\author[1]{Author F}

\affil[1]{Really really Really Name of Institute 1, City, State}
\affil[2]{Name of Institute 2, City, State}
\affil[3]{Name of Institute 3, City, State}
\affil[4]{Name of Institute 4, City, State}

\date{}

\begin{document}

\maketitle

I want maketitle to have the authors and affiliations line break at separators like:\\
\begin{center}
\bfseries
Author A$^{1}$,
Author B$^{1}$,
Author C$^{2}$,
Author D$^{3}$,
Author E$^{4}$, \\ %have maketitle or authblk insert this linebreak
Author F$^{1}$    
\end{center}

\begin{center}
    \itshape
    $^{1}$Really really Really Name of Institute 1, City, State; \\ %have maketitle or authblk insert this linebreak
    $^{2}$Name of Institute 2, City, State;
    $^{3}$Name of Institute 3, City, State; \\ %have maketitle or authblk insert this linebreak
    $^{4}$Name of Institute 4, City, State;
\end{center}


\end{document}

工作示例输出

相关内容