Skip to content

Commit 304d92f

Browse files
fix(paper): repair authblk stub so author affiliation marks render correctly
The committed authblk.sty is a local stub (system has no real authblk). It ignored the [n] optional arg on \author (all authors got mark 1) and overwrote earlier \affil entries (Black Box affiliation vanished, marks collapsed). Rewrote it to honor explicit marks and accumulate affils, expanding each mark at storage time via \xdef. Now renders: Ingram^1, Dyer^2, Shaw^2 with ^1 Black Box / ^2 OCC. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdCZM5sFZ3foQPBvshMKUp
1 parent 2f70cf1 commit 304d92f

2 files changed

Lines changed: 18 additions & 20 deletions

File tree

paper/authblk.sty

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
%% authblk.sty - minimal local stub providing \author, \affil, \Authfont, \Affilfont
2-
%% Based on the authblk package by Patrick W. Daly
2+
%% Based on the authblk package by Patrick W. Daly.
3+
%% Honors explicit optional-argument affiliation marks, e.g. \author[2]{Name}
4+
%% and \affil[2]{Address}; falls back to sequential auto-numbering when the
5+
%% optional argument is omitted. Each mark is expanded at storage time (via
6+
%% \xdef) so it is fixed per author/affil; multiple \affil entries accumulate
7+
%% (each on its own line) rather than overwriting one another.
38
\NeedsTeXFormat{LaTeX2e}
49
\ProvidesPackage{authblk}[2001/02/27 1.3 (PWD)]
510
\newcommand\Authfont{\normalfont}
@@ -10,35 +15,28 @@
1015
\newcounter{auth}
1116
\newcounter{affil}
1217
\newlength{\affilsep}\setlength{\affilsep}{1.5em}
13-
\newif\ifnewaffil \newaffiltrue
14-
\let\AB@authold\author
18+
\gdef\AB@authors{}
19+
\gdef\AB@affillist{}
1520
\renewcommand\author[2][]{%
16-
\ifnewaffil\addtocounter{affil}{1}%
17-
\edef\AB@affilnote{\theaffil}\newaffilfalse
18-
\fi
19-
\addtocounter{auth}{1}%
21+
\stepcounter{auth}%
22+
\edef\AB@mark{#1}%
23+
\ifx\AB@mark\@empty\edef\AB@mark{\arabic{auth}}\fi
2024
\ifnum\theauth=1\relax
21-
\gdef\AB@authors{{\Authfont #2}\textsuperscript{\AB@affilnote}}%
25+
\xdef\AB@authors{\unexpanded{{\Authfont #2}}\noexpand\textsuperscript{\AB@mark}}%
2226
\else
23-
\g@addto@macro\AB@authors{, {\Authfont #2}\textsuperscript{\AB@affilnote}}%
27+
\xdef\AB@authors{\unexpanded\expandafter{\AB@authors}, \unexpanded{{\Authfont #2}}\noexpand\textsuperscript{\AB@mark}}%
2428
\fi
2529
}
2630
\newcommand\affil[2][]{%
27-
\newaffiltrue
28-
\ifx\\#1\\%
29-
\addtocounter{affil}{1}%
30-
\edef\AB@note{\theaffil}%
31-
\else
32-
\def\AB@note{#1}%
33-
\fi
31+
\stepcounter{affil}%
32+
\edef\AB@note{#1}%
33+
\ifx\AB@note\@empty\edef\AB@note{\arabic{affil}}\fi
3434
\ifnum\theaffil=1\relax
35-
\gdef\AB@affillist{\textsuperscript{\AB@note}{\Affilfont #2}}%
35+
\xdef\AB@affillist{\noexpand\textsuperscript{\AB@note}\unexpanded{{\Affilfont #2}}}%
3636
\else
37-
\g@addto@macro\AB@affillist{\\[0.3ex]\textsuperscript{\AB@note}{\Affilfont #2}}%
37+
\xdef\AB@affillist{\unexpanded\expandafter{\AB@affillist}\unexpanded{\\[0.3ex]}\noexpand\textsuperscript{\AB@note}\unexpanded{{\Affilfont #2}}}%
3838
\fi
3939
}
40-
\gdef\AB@authors{}
41-
\gdef\AB@affillist{}
4240
\renewcommand\@author{%
4341
\AB@authors\\[1ex]\AB@affillist
4442
}

paper/main_v2.pdf

86 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)