@@ -112,6 +112,8 @@ 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+ ('aastex61' ,'aastex6' ), # This is for aastex v6.1
116+ ('aastex7' ,'aastex7' ), # This is for aastex v7.*
115117 ('apj' ,'aastex6' ),
116118 ('apjl' ,'aastex6' ),
117119 ('aj' ,'aastex6' ),
@@ -199,6 +201,34 @@ def write_contributions(filename,data):
199201\end{document}
200202"""
201203
204+ ### AASTEX 7.X ###
205+ aastex7_authlist = r"""
206+ \suppressAffiliations
207+ \correspondingauthor{%(corrauthor)s}
208+
209+ %(authors)s
210+
211+ %% Number in brackets is how many author names to put on front page
212+ \collaboration{1}{(%(collaboration)s)}
213+ """
214+
215+ aastex7_document = r"""
216+ \documentclass[twocolumn]{aastex7}
217+
218+ \begin{document}
219+ \title{%(title)s}
220+
221+ %(authlist)s
222+
223+ \begin{abstract}
224+ %(abstract)s
225+ \end{abstract}
226+ \maketitle
227+ \newpage
228+ \allauthors
229+ \end{document}
230+ """
231+
202232### EMULATEAPJ ###
203233emulateapj_document = r"""
204234\documentclass[iop]{emulateapj}
@@ -497,6 +527,53 @@ def write_contributions(filename,data):
497527 authors .append (author )
498528 params = dict (defaults ,authors = '' .join (authors ))
499529
530+ # AASTEX 7 updates
531+ if cls in ['aastex7' ]:
532+ document = aastex7_document
533+ authlist = aastex7_authlist
534+ # Assume first author is the corresponding author
535+ corrauthor = None
536+ author_email = {}
537+
538+ for i ,d in enumerate (data ):
539+ if d ['Affiliation' ] == '' :
540+ logging .warn ("Blank affiliation for '%s'" % d ['Authorname' ])
541+ if d ['Authorname' ] == '' :
542+ logging .warn ("Blank authorname for '%s %s'" % (d ['Firstname' ],
543+ d ['Lastname' ]))
544+
545+ if corrauthor is None :
546+ corrauthor = d ['Authorname' ]
547+ authorkey = '{%s}' % (d ['Authorname' ])
548+
549+ if args .orcid and d ['ORCID' ]:
550+ authorkey = "[%s, gname='%s', sname='%s']" % (d ['ORCID' ],d ['Firstname' ],d ['Lastname' ]) + authorkey
551+ else :
552+ # Appears to be a bug in the AASTeX such that omitting one of them kills the compilation.
553+ authorkey = "[0000-0000-0000-0000,gname='%s', sname='%s']" % (d ['Firstname' ],d ['Lastname' ]) + authorkey
554+
555+ if authorkey not in authdict .keys ():
556+ authdict [authorkey ] = [d ['Affiliation' ]]
557+ else :
558+ authdict [authorkey ].append (d ['Affiliation' ])
559+
560+ author_email [authorkey ] = d ['Email' ]
561+ #if d['Authorname'] not in authdict.keys():
562+ # authdict[d['Authorname']] = [d['Affiliation']]
563+ #else:
564+ # authdict[d['Authorname']].append(d['Affiliation'])
565+
566+ authors = []
567+ for key ,val in authdict .items ():
568+ #author = r'\author{%s}'%key+'\n'
569+ author = r'\author%s' % key + '\n '
570+ for v in val :
571+ author += r'\affiliation{%s}' % v + '\n '
572+ author += r'\email{%s}' % author_email [key ] + '\n '
573+ author += '\n '
574+ authors .append (author )
575+ params = dict (defaults ,authors = '' .join (authors ),corrauthor = corrauthor )
576+
500577 ### Separate author and affiliation ###
501578 if cls in ['aastex' ,'mnras' ,'emulateapj' , 'aanda' ]:
502579 if cls == 'aastex' :
0 commit comments