-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpandoc.sh
204 lines (192 loc) · 7.83 KB
/
pandoc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# Generate Dawn publication list
# 1) Feed the author queries below into the new ADS and save the
# output to BibTex files "cph-raw.bib" and "affil-raw.bib". That is,
# run the "cph" query with just the local authors and get the "affil"
# results by setting the intermediate flag OR to NOT.
#
# 2) Update cph.tex with the summary statistics, using these individual
# queries and the full author list fore the overall citation statistics
#
# 3) Run this file:
# # (pip install pandoc)
# # bash pandoc.sh
#
# Note, the bibliography style file taken and modified slightly from
# https://github.com/citation-style-language/styles
#
# 4) Still have to manually turn on as an ordered list and set the
# Affiliation publication counter to continue with the earlier list
#
# 5) Also, the left column of the summary stats needs to be manually set to
# right-justified.
# Impact factor
# https://jcr.clarivate.com/JCRJournalHomeAction.action?pg=JRNLHOME&categoryName=ASTRONOMY%20%26%20ASTROPHYSICS&categories=BU
# Open Access:
# Run ./get_doi.py | pbcopy and paste query into
# https://apps.webofknowledge.com/.
### Full author query for new ADS:
#
# # query="""
# ((author:"capak, peter" OR
# author:"oesch, p" OR
# author:"whitaker, k" OR
# author:"narayanan, d" OR
# author:"finlator, k" OR
# author:"lagos, c" OR
# author:"caputi, k" OR
# (author:"walter, f" AND aff:"Heidelberg") OR
# author:"colina, l"
# ) NOT
# (author:"brammer, g" OR
# author:"toft, s" OR
# author:"steinhardt, charles" OR
# author:"magdis, georgios" OR
# author:"greve, thomas" OR
# author:"fynbo, johan" OR
# author:"watson, darach" OR
# author:"jakobsen, peter" OR
# author:"nørgaard-nielsen" OR
# author:"hornstrup, allan" OR
# author:"valentino, f" OR
# author:"ceverino, d" OR
# (author:"nakajima, kimihiko" AND (aff:"European" OR aff:"Observatory of Japan")) OR
# author:"bonaventura, n" OR
# author:"milvang-jensen, b" OR
# author:"selsing, j" OR
# (author:"stockmann, m" AND aff:"Bohr") OR
# (author:"gomez-guijarro, c" AND aff:"Bohr") OR
# author:"cortzen, i" OR
# author:"kokorev, v" OR
# author:"killi, m" OR
# (author:"weaver, john" AND (aff:"Andrews" OR aff:"Bohr"))
# ))
# pubdate:[2018-12-31 TO 2019-12-31]
#
# # Recent arrivals
# ((
# author:"fujimoto, s"
# ) NOT
# (author:"brammer, g" OR
# author:"toft, s" OR
# author:"steinhardt, charles" OR
# author:"magdis, georgios" OR
# author:"greve, thomas" OR
# author:"fynbo, johan" OR
# author:"watson, darach" OR
# author:"jakobsen, peter" OR
# author:"nørgaard-nielsen" OR
# author:"hornstrup, allan" OR
# author:"valentino, f" OR
# author:"ceverino, d" OR
# (author:"nakajima, kimihiko" AND (aff:"European" OR aff:"Observatory of Japan")) OR
# author:"bonaventura, n" OR
# author:"milvang-jensen, b" OR
# author:"selsing, j" OR
# (author:"stockmann, m" AND aff:"Bohr") OR
# (author:"gomez-guijarro, c" AND aff:"Bohr") OR
# author:"cortzen, i" OR
# author:"kokorev, v" OR
# author:"killi, m" OR
# (author:"weaver, john" AND (aff:"Andrews" OR aff:"Bohr"))
# ))
# pubdate:[2019-10-31 TO 2019-12-31]
#
# # Recent arrivals
# ((
# author:"davidzon, i"
# ) NOT
# (author:"brammer, g" OR
# author:"toft, s" OR
# author:"steinhardt, charles" OR
# author:"magdis, georgios" OR
# author:"greve, thomas" OR
# author:"fynbo, johan" OR
# author:"watson, darach" OR
# author:"jakobsen, peter" OR
# author:"nørgaard-nielsen" OR
# author:"hornstrup, allan" OR
# author:"valentino, f" OR
# author:"ceverino, d" OR
# (author:"nakajima, kimihiko" AND (aff:"European" OR aff:"Observatory of Japan")) OR
# author:"bonaventura, n" OR
# author:"milvang-jensen, b" OR
# author:"selsing, j" OR
# (author:"stockmann, m" AND aff:"Bohr") OR
# (author:"gomez-guijarro, c" AND aff:"Bohr") OR
# author:"cortzen, i" OR
# author:"kokorev, v" OR
# author:"killi, m" OR
# (author:"weaver, john" AND (aff:"Andrews" OR aff:"Bohr"))
# ))
# pubdate:[2019-05-31 TO 2019-12-31]
#
# # Full query
# ((author:"capak, peter" OR
# author:"oesch, p" OR
# author:"whitaker, k" OR
# author:"narayanan, d" OR
# author:"finlator, k" OR
# author:"lagos, c" OR
# author:"caputi, k" OR
# (author:"walter, f" AND aff:"Heidelberg") OR
# author:"colina, l"
# ) OR
# (author:"brammer, g" OR
# author:"toft, s" OR
# author:"steinhardt, charles" OR
# author:"magdis, georgios" OR
# author:"greve, thomas" OR
# author:"fynbo, johan" OR
# author:"watson, darach" OR
# author:"jakobsen, peter" OR
# author:"nørgaard-nielsen" OR
# author:"hornstrup, allan" OR
# author:"valentino, f" OR
# author:"ceverino, d" OR
# author:"davidzon, i" OR
# author:"fujimoto, s" OR
# (author:"nakajima, kimihiko" AND (aff:"European" OR aff:"Observatory of Japan" OR aff:"Bohr")) OR
# author:"bonaventura, n" OR
# author:"milvang-jensen, b" OR
# author:"selsing, j" OR
# (author:"stockmann, m" AND aff:"Bohr") OR
# (author:"gomez-guijarro, c" AND aff:"Bohr") OR
# author:"cortzen, i" OR
# author:"kokorev, v" OR
# author:"killi, m" OR
# (author:"weaver, john" AND (aff:"Andrews" OR aff:"Bohr"))
# ))
# pubdate:[2018-12-31 TO 2019-12-31]
#
# """
# Make Dawn authors BOLD, replace journal keywords and some special characters
for root in cph affil; do
bibfile="${root}.bib"
cp "${root}-raw.bib" "${root}.bib"
perl -pi -e "s/\\\\apjl/ApJL/g" ${bibfile}
perl -pi -e "s/\\\\apj/ApJ/g" ${bibfile}
perl -pi -e "s/\\\\aj/AJ/g" ${bibfile}
perl -pi -e "s/\\\\mnras/MNRAS/g" ${bibfile}
perl -pi -e "s/\\\\aap/A\\\\&A/g" ${bibfile}
perl -pi -e "s/\\\\nat/Nature/g" ${bibfile}
perl -pi -e "s/Publications of the Astronomical Society of the Pacific/PASP/" ${bibfile}
perl -pi -e "s/Publications of the Astronomical Society of Japan/PASJ/" ${bibfile}
perl -pi -e "s/Publications of the Astronomical Society of Australia/PASA/" ${bibfile}
perl -pi -e "s/The Astrophysical Journal Supplement Series/ApJSS/" ${bibfile}
perl -pi -e "s/̃/\\$\\\sim\\$/g" ${bibfile}
perl -pi -e "s/─/--/g" ${bibfile}
perl -pi -e "s/≃/\\$\\\simeq\\$/g" ${bibfile}
perl -pi -e "s/\\\\</\\$<\\$/g" ${bibfile}
perl -pi -e "s/\\\\>/\\$>\\$/g" ${bibfile}
perl -pi -e "s/\\\\&/\\\&/g" ${bibfile}
perl -pi -e "s/Nargaard/N{\\\\o}rgaard/" ${bibfile}
for name in Brammer Toft Steinhardt Magdis Greve Fynbo Watson Jakobsen "N{\\\\o}rgaard-Nielsen" Hornstrup Valentino Ceverino Nakajima Bonaventura Milvang-Jensen Selsing Stockmann G{\'o}mez-Guijarro Cortzen Kokorev Killi Weaver Capak Oesch Whitaker Narayanan Finlator Lagos Caputi Walter Colina Davidzon Fujimoto; do
cp ${bibfile} tmp.bib
sed "s/{${name}}/{\\\bf ${name}}/g" tmp.bib > ${bibfile}
done
done
# Feed to pandoc
pandoc -o cph.docx --bibliography=cph.bib cph.tex --csl=./chicago-author-date-MOD.csl
pandoc -o affil.docx --bibliography=affil.bib affil.tex --csl=./chicago-author-date-MOD.csl
# Combine to single file
pandoc -s cph.docx affil.docx -o pubs.docx