1

I am trying to modify the output of the affiliations defined with authblk to print each entry on consecutive lines, and when the text width is exceeded break the line at the symbol separating the different affiliations.

I tried adapting this solution from Automatic linebreak on specific character unfortunately it does not work the way I want.

Here is an example of the problem

\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}

working example output

  • Welcome to TeX.SE. I'm sure it would be possible (and meaningful) to force authblk to do it, but in the end I think it is much easier to just write \author[1]{Author~A} and so on... – campa Aug 10 '23 at 15:05
  • Is there a way I can define a command to find replace a space with a tilde when processing. Perhaps some combination of xpatch and \StrSubstitute? – Brendan Kochunas Aug 10 '23 at 15:16
  • Again: possible? Yes. However (forgive the bluntness) I don't think it's worth it. Why write complicated TeX code when a sensible input does the same, only better? – campa Aug 10 '23 at 20:23

0 Answers0