Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions mkauthlist/mkauthlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def write_contributions(filename,data):
('aastex','aastex6'), # This is for aastex v6.*
('aastex5','aastex'), # This is for aastex v5.*
('aastex61','aastex6'), # This is for aastex v6.1
('aastex7','aastex7'), # This is for aastex v7.*
('apj','aastex6'),
('apjl','aastex6'),
('aj','aastex6'),
Expand Down Expand Up @@ -199,6 +200,36 @@ def write_contributions(filename,data):
\end{document}
"""

### AASTEX 7.X ###
aastex7_authlist = r"""
\suppressAffiliations
\correspondingauthor{%(corrauthor)s}

%(authors)s

%% Place \allauthors before \end{document} to list all authors.
%% Number in first brackets below is how many author names to put on front page
\collaboration{1}{(%(collaboration)s)}
%% See https://journals.aas.org/aastexguide/#title_author for more details
"""

aastex7_document = r"""
\documentclass[twocolumn]{aastex7}

\begin{document}
\title{%(title)s}

%(authlist)s

\begin{abstract}
%(abstract)s
\end{abstract}
\maketitle
\newpage
\allauthors
\end{document}
"""

### EMULATEAPJ ###
emulateapj_document = r"""
\documentclass[iop]{emulateapj}
Expand Down Expand Up @@ -497,6 +528,49 @@ def write_contributions(filename,data):
authors.append(author)
params = dict(defaults,authors=''.join(authors))

# AASTEX 7 updates
if cls in ['aastex7']:
document = aastex7_document
authlist = aastex7_authlist
# Assume first author is the corresponding author
corrauthor = None
author_email = {}

for i,d in enumerate(data):
if d['Affiliation'] == '':
logging.warn("Blank affiliation for '%s'"%d['Authorname'])
if d['Authorname'] == '':
logging.warn("Blank authorname for '%s %s'"%(d['Firstname'],
d['Lastname']))

if corrauthor is None:
corrauthor = d['Authorname']
authorkey = '{%s}'%(d['Authorname'])

if args.orcid and d['ORCID']:
authorkey = "[%s, gname='%s', sname='%s']"%(d['ORCID'],d['Firstname'],d['Lastname']) + authorkey
else:
# Appears to be a bug in the AASTeX such that omitting one of them kills the compilation.
authorkey = "[0000-0000-0000-0000,gname='%s', sname='%s']"%(d['Firstname'],d['Lastname']) + authorkey

if authorkey not in authdict.keys():
authdict[authorkey] = [d['Affiliation']]
else:
authdict[authorkey].append(d['Affiliation'])

author_email[authorkey] = d['Email']

authors = []
for key,val in authdict.items():
#author = r'\author{%s}'%key+'\n'
author = r'\author%s'%key+'\n'
for v in val:
author += r'\affiliation{%s}'%v+'\n'
author += r'\email{%s}'%author_email[key] + '\n'
author += '\n'
authors.append(author)
params = dict(defaults,authors=''.join(authors),corrauthor=corrauthor)

### Separate author and affiliation ###
if cls in ['aastex','mnras','emulateapj', 'aanda']:
if cls == 'aastex':
Expand Down
Loading