Skip to content

Commit a87ebcd

Browse files
committed
Fix the bibtex generation
1 parent 26be229 commit a87ebcd

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

10.5281_zenodo.3158244/article.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ language:
108108

109109
# For example, the URL of the GitHub issue where review actually occured
110110
review:
111-
- url:
111+
- url: https://github.com/ReScience/submissions/issues/5
112112

113113
contributors:
114114
- name: Nicolas Rougier

publish.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def git_branch(metadata_file, article_file, article_doi):
202202

203203
# Upload content
204204
print("Uploading content to Zenodo... ", end="")
205-
#upload_content(server, token, article_id, article_file)
205+
upload_content(server, token, article_id, article_file)
206206
print("done!")
207207

208208
# Update metadata

yaml-to-bibtex.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def generate_bibtex(filename, article):
1212
" month = {{{_.date_published.month}}},\n"
1313
" volume = {{{_.journal_volume}}},\n"
1414
" number = {{{_.journal_issue}}},\n"
15-
" pages = {{{_.article_number}}},\n"
15+
" pages = {{{{{#_.article_number}}}}},\n"
1616
" doi = {{{_.article_doi}}},\n"
1717
" url = {{{_.article_url}}},\n"
1818
" code_url = {{{_.code.url}}},\n"
@@ -47,6 +47,17 @@ def generate_bibtex(filename, article):
4747
with open(filename_in, "r") as file:
4848
article = Article(file.read())
4949

50+
51+
article.authors_full = ""
52+
n = len(article.authors)
53+
if n==1:
54+
article.authors_full = article.authors[0].fullname
55+
else:
56+
for i in range(n-1):
57+
article.authors_full += article.authors[i].fullname + " and "
58+
article.authors_full += article.authors[-1].fullname
59+
60+
5061
content = generate_bibtex(filename_in, article)
5162
if filename_out is not None:
5263
with open(filename_out, "w") as file:

0 commit comments

Comments
 (0)