Skip to content

Commit d0fbd93

Browse files
authored
Merge pull request #47 from DarkEnergySurvey/aastex7
Update versioneer and aastex7
2 parents 918973f + 0bde35e commit d0fbd93

File tree

2 files changed

+1075
-498
lines changed

2 files changed

+1075
-498
lines changed

mkauthlist/mkauthlist.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def write_contributions(filename,data):
112112
('aastex','aastex6'), # This is for aastex v6.*
113113
('aastex5','aastex'), # This is for aastex v5.*
114114
('aastex61','aastex6'), # This is for aastex v6.1
115+
('aastex7','aastex7'), # This is for aastex v7.*
115116
('apj','aastex6'),
116117
('apjl','aastex6'),
117118
('aj','aastex6'),
@@ -199,6 +200,36 @@ def write_contributions(filename,data):
199200
\end{document}
200201
"""
201202

203+
### AASTEX 7.X ###
204+
aastex7_authlist = r"""
205+
\suppressAffiliations
206+
\correspondingauthor{%(corrauthor)s}
207+
208+
%(authors)s
209+
210+
%% Place \allauthors before \end{document} to list all authors.
211+
%% Number in first brackets below is how many author names to put on front page
212+
\collaboration{1}{(%(collaboration)s)}
213+
%% See https://journals.aas.org/aastexguide/#title_author for more details
214+
"""
215+
216+
aastex7_document = r"""
217+
\documentclass[twocolumn]{aastex7}
218+
219+
\begin{document}
220+
\title{%(title)s}
221+
222+
%(authlist)s
223+
224+
\begin{abstract}
225+
%(abstract)s
226+
\end{abstract}
227+
\maketitle
228+
\newpage
229+
\allauthors
230+
\end{document}
231+
"""
232+
202233
### EMULATEAPJ ###
203234
emulateapj_document = r"""
204235
\documentclass[iop]{emulateapj}
@@ -497,6 +528,49 @@ def write_contributions(filename,data):
497528
authors.append(author)
498529
params = dict(defaults,authors=''.join(authors))
499530

531+
# AASTEX 7 updates
532+
if cls in ['aastex7']:
533+
document = aastex7_document
534+
authlist = aastex7_authlist
535+
# Assume first author is the corresponding author
536+
corrauthor = None
537+
author_email = {}
538+
539+
for i,d in enumerate(data):
540+
if d['Affiliation'] == '':
541+
logging.warn("Blank affiliation for '%s'"%d['Authorname'])
542+
if d['Authorname'] == '':
543+
logging.warn("Blank authorname for '%s %s'"%(d['Firstname'],
544+
d['Lastname']))
545+
546+
if corrauthor is None:
547+
corrauthor = d['Authorname']
548+
authorkey = '{%s}'%(d['Authorname'])
549+
550+
if args.orcid and d['ORCID']:
551+
authorkey = "[%s, gname='%s', sname='%s']"%(d['ORCID'],d['Firstname'],d['Lastname']) + authorkey
552+
else:
553+
# Appears to be a bug in the AASTeX such that omitting one of them kills the compilation.
554+
authorkey = "[0000-0000-0000-0000,gname='%s', sname='%s']"%(d['Firstname'],d['Lastname']) + authorkey
555+
556+
if authorkey not in authdict.keys():
557+
authdict[authorkey] = [d['Affiliation']]
558+
else:
559+
authdict[authorkey].append(d['Affiliation'])
560+
561+
author_email[authorkey] = d['Email']
562+
563+
authors = []
564+
for key,val in authdict.items():
565+
#author = r'\author{%s}'%key+'\n'
566+
author = r'\author%s'%key+'\n'
567+
for v in val:
568+
author += r'\affiliation{%s}'%v+'\n'
569+
author += r'\email{%s}'%author_email[key] + '\n'
570+
author += '\n'
571+
authors.append(author)
572+
params = dict(defaults,authors=''.join(authors),corrauthor=corrauthor)
573+
500574
### Separate author and affiliation ###
501575
if cls in ['aastex','mnras','emulateapj', 'aanda']:
502576
if cls == 'aastex':

0 commit comments

Comments
 (0)