Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
probml
GitHub Repository: probml/pyprobml
Path: blob/master/internal/left-latexified.py
1191 views
1
import os
2
from glob import glob
3
4
5
bookv2_path = "../../bookv2"
6
7
8
def to_latex_nb_name(notebook):
9
return notebook.replace("_", "\_").replace(".ipynb", "")
10
11
12
latexified_figs = glob("internal/figures/*/*_latexified.pdf")
13
# latexified_figs = set(map(lambda x: x.split("/")[-1], latexified_figs))
14
15
bookv2_figs = glob(os.path.join(bookv2_path, "figures/*_latexified.pdf"))
16
bookv2_figs = set(map(lambda x: x.split("/")[-1], bookv2_figs))
17
18
print(len(latexified_figs), len(bookv2_figs))
19
ignored_nb = [
20
"gp\_deep\_kernel\_learning",
21
"simulated\_annealing\_2d\_demo",
22
"gp\_kernel\_opt",
23
"linreg\_height\_weight",
24
]
25
for latexified_nb_path in latexified_figs:
26
latexified_fig = latexified_nb_path.split("/")[-1]
27
latexified_nb = to_latex_nb_name(latexified_nb_path.split("/")[-2])
28
if latexified_fig not in bookv2_figs and latexified_nb not in ignored_nb:
29
print(f"{latexified_nb} \t {latexified_fig}")
30
31