-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
216 lines (185 loc) · 6.47 KB
/
Makefile
File metadata and controls
216 lines (185 loc) · 6.47 KB
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
205
206
207
208
209
210
211
212
213
214
215
PY=python
PANDOC=pandoc
# ppm:
# cd src/chapter_04 && \
# cp -R figs/ dist/ && \
# pandoc metadata.yaml \
# section_02_abstract.md section_03_introduction.md section_04_method.md section_05_results.md section_06_discussion.md alt/figure_of_merit.md \
# -o dist/manuscript.tex \
# --wrap=preserve \
# --default-image-extension=.pdf \
# --filter ../pandoc-crossref \
# --natbib \
# --bibliography=dist/references.bib \
# --template=template.tex \
# --lua-filter=parse-latex.lua \
# --lua-filter abstract-section.lua \
# --resource-path='.:chapter_04/figs:' && \
# sed -i 's/\\cite[t,p]{/\\cite{/g' dist/manuscript.tex && \
# sed -i 's/{natbib}/{cite}/' dist/manuscript.tex && \
# sed -i 's/,height=\\textheight//g' dist/manuscript.tex && \
# sed -i 's/subsection{/section{/g' dist/manuscript.tex && \
# sed -i 's/\\%/%/g' dist/manuscript.tex && \
# sed -i "s.\\\textasciitilde{}.~.g" dist/manuscript.tex && \
# sed -i "s.\\\textasciitilde .~.g" dist/manuscript.tex
ppm:
cd src/chapter_04 && \
cp -R figs/ dist/ && \
pandoc metadata.yaml \
section_02_abstract.md section_03_introduction.md section_04_method.md section_05_results.md section_06_discussion.md alt/figure_of_merit.md \
-o dist/manuscript.tex \
--wrap=preserve \
--default-image-extension=.pdf \
--filter pandoc-crossref \
--natbib \
--bibliography=dist/references.bib \
--template=template.tex \
--lua-filter=parse-latex.lua \
--lua-filter abstract-section.lua \
--resource-path='.:chapter_04/figs:' && \
sed -i '' 's/\\cite[t,p]{/\\cite{/g' dist/manuscript.tex && \
sed -i '' 's/{natbib}/{cite}/' dist/manuscript.tex && \
sed -i '' 's/,height=\\textheight//g' dist/manuscript.tex && \
sed -i '' 's/subsection{/section{/g' dist/manuscript.tex && \
sed -i '' 's/\\%/%/g' dist/manuscript.tex && \
sed -i '' "s.\\\textasciitilde{}.~.g" dist/manuscript.tex && \
sed -i '' "s.\\\textasciitilde .~.g" dist/manuscript.tex
# -r markdown-auto_identifiers # messes up abstract-section.lua
ppm-overleaf:
$(MAKE) ppm && \
cd src/chapter_04/dist && \
git add . && \
git commit -m "overleaf update" && \
git push overleaf master
ppm-overleaf-clean:
cd src/chapter_04/dist && \
rm manuscript.tex && \
git pull overleaf master && \
cd .. && cd .. && cd .. && \
$(MAKE) ppm-overleaf
ppm-pull:
cd src/chapter_04/dist && \
git pull overleaf master
ppm-produce-md:
cd src/chapter_04 && \
pandoc dist/manuscript.tex -o _manuscript.md --wrap=preserve --lua-filter=to_md.lua
ref-update:
cd src && \
uv run python clean_references.py
# tex:
# cd src && \
# python clean_references.py && \
# pandoc metadata.yaml \
# chapter*/*.md \
# ref_heading.md \
# -o thesis.tex \
# --wrap=preserve \
# --default-image-extension=.pdf \
# --template=styles/template.tex \
# --filter pandoc-crossref \
# --filter pandoc-latex-color \
# -M "crossrefYaml=ref_formatting.yaml" \
# --biblatex \
# --bibliography=references_cleaned.bib \
# --lua-filter=frontmatter/parse-latex.lua \
# --top-level-division chapter \
# --resource-path='.:chapter_01/figs:chapter_02/figs:chapter_03/figs:chapter_04/figs:chapter_05/figs:chapter_06/figs:chapter_07/figs:chapter_08/figs:chapter_09/figs:' \
# && sed -i "s.\\\textasciitilde{}.~.g" thesis.tex \
# && sed -i "s.\\\textasciitilde .~.g" thesis.tex \
# && sed -i 's/\\begin{equation}\\protect//g' thesis.tex \
# && sed -i 's/\\label{eq:[^ ]*}\\end{equation}//g' thesis.tex \
# && cd - \
# mac version
tex:
cd src && \
uv run python clean_references.py && \
pandoc metadata.yaml \
chapter*/*.md \
ref_heading.md \
-o thesis.tex \
--wrap=preserve \
--default-image-extension=.pdf \
--template=styles/template.tex \
--filter pandoc-crossref \
--filter pandoc-latex-color \
-M "crossrefYaml=ref_formatting.yaml" \
--biblatex \
--bibliography=references_cleaned.bib \
--lua-filter=frontmatter/parse-latex.lua \
--top-level-division chapter \
--resource-path='.:chapter_01/figs:chapter_02/figs:chapter_03/figs:chapter_04/figs:chapter_05/figs:chapter_06/figs:chapter_07/figs:chapter_08/figs:chapter_09/figs:' \
&& sed -i '' "s.\\\textasciitilde{}.~.g" thesis.tex \
&& sed -i '' "s.\\\textasciitilde .~.g" thesis.tex \
&& sed -i '' 's/\\begin{equation}\\protect//g' thesis.tex \
&& sed -i '' 's/\\label{eq:[^ ]*}\\end{equation}//g' thesis.tex \
&& cd - \
md_test:
cd src/ && \
uv run python clean_references.py && \
sh make_pandoc.sh
overleaf:
$(MAKE) tex \
&& git add . \
&& git commit -m "overleaf update" \
&& git push overleaf master
# overleaf_clean:
# cd src && \
# rm thesis.tex && \
# git pull overleaf master && \
# pandoc metadata.yaml \
# chapter*/*.md \
# ref_heading.md \
# -o thesis.tex \
# --default-image-extension=.pdf \
# --template=styles/template.tex \
# --filter pandoc-crossref \
# -M "crossrefYaml=ref_formatting.yaml" \
# --biblatex \
# --bibliography=references.bib \
# --lua-filter=frontmatter/parse-latex.lua \
# --top-level-division chapter \
# --resource-path='.:chapter_01/figs:chapter_02/figs:chapter_03/figs:chapter_04/figs:chapter_05/figs:chapter_06/figs:chapter_07/figs:chapter_08/figs:chapter_09/figs:' \
# && cd - \
# && git add . \
# && git commit -m "overleaf update" \
# && git push overleaf master
overleaf-clean:
cd src && \
rm thesis.tex && \
git pull overleaf master && \
cd .. && \
$(MAKE) tex \
&& git add . \
&& git commit -m "overleaf update" \
&& git push overleaf master
mkdocs:
cd src && \
uv run python clean_references.py && \
uv run python give_figures_path_info.py && \
cd .. && \
sh make_pandoc_site.sh
mkdocs_serve:
uv run mkdocs serve
serve: uv run mkdocs mkdocs_serve
# html:
# # JEKYLL_ENV=production bundle exec jekyll build --destination docs;\
# cd src && \
# cp -r chapter_01 ../mkdocs/docs/chapter_01
# cd .. \
# # sh copyfigs.sh ;\
# rm -r ./site/chapter_01/* \
# && rm -r ./site/chapter_02/* \
# && rm -r ./site/chapter_03/* \
# && rm -r ./site/chapter_04/* \
# && rm -r ./site/chapter_05/* \
# && cp -R ./src/chapter_01 ./site/ \
# && cp -R ./src/chapter_02 ./site/ \
# && cp -R ./src/chapter_03 ./site/ \
# && cp -R ./src/chapter_04 ./site/ \
# && cp -R ./src/chapter_05 ./site/ \
# && cp -R ./src/frontmatter ./site/ \
# && mv ./site/chapter_01/section_02_abstract.md ./site/chapter_01/index.md \
# && mv ./site/chapter_02/section_02_abstract.md ./site/chapter_02/index.md \
# && mv ./site/chapter_03/section_02_abstract.md ./site/chapter_03/index.md \
# && mv ./site/chapter_04/section_02_abstract.md ./site/chapter_04/index.md \
# && mv ./site/chapter_05/section_02_abstract.md ./site/chapter_05/index.md \