-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmp.py
More file actions
30 lines (27 loc) · 784 Bytes
/
tmp.py
File metadata and controls
30 lines (27 loc) · 784 Bytes
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
import json
data = json.loads(open('reco.json').read())
print("")
def printbook(e):
print("\\subsubsection{"+e["title"]+"}")
print("\\textit{By "+e["author"]+"}\\\\\\\\")
print("First published in "+e["year"]+"\\\\\\\\")
if ("trad" in e):
for key,value in e["trad"].items():
sortie = "(Also in "+key+" : "+value["title"]
if "year" in value:
sortie += " ("+value["year"]+") "
sortie += ")\\\\\\\\"
print(sortie)
print("")
print("\\documentclass{article}")
print("")
print("\\begin{document}")
print(" \\section{Books}")
print("")
for key,value in data["books"].items():
print("\\subsection{"+key+"}")
for e in value:
printbook(e)
print("")
print("\\end{document}")
print("")