From 5af01c716e155a363393a5c6ba085bf9dd63ab2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Poisot?= Date: Sun, 26 Feb 2023 22:16:00 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20combine=20and=20publish=20supp=20ma?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/04_run.jl | 16 ++++++++++++++-- templates/index.html | 7 ++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/scripts/04_run.jl b/scripts/04_run.jl index e94bb24..549259c 100644 --- a/scripts/04_run.jl +++ b/scripts/04_run.jl @@ -30,15 +30,27 @@ run( `$(_pandoc) README.md -o dist/rawtext.txt $(_common_options) -M suppress-bibliography=true`, ) +function sm_name_from_path(p) + sm = replace(p, "appendix/" => "") + sm = replace(sm, ".md" => "") + return sm +end + possible_suppmat = readdir("appendix"; join = true) filter!(f -> endswith(f, ".md"), possible_suppmat) for sm in possible_suppmat - sm = replace(sm, "appendix/" => "") - sm = replace(sm, ".md" => "") + sm = sm_name_from_path(sm) @info "Build the supp. mat. $(sm)" run( `$(_pandoc) appendix/$(sm).md -s -o dist/appendix/$(metadata["filename"])_$(sm).pdf --pdf-engine ./tectonic $(_common_options) --template=.typesetter/templates/appendix.tex`, ) end + + +if ~isempty(possible_suppmat) + sm_paths = ["dist/appendix/$(metadata["filename"])_$(sm).pdf" for sm in sm_name_from_path.(possible_suppmat)] + run(`pdfunite $(sm_paths) dist/$(metadata["filename"])_appendix.pdf`) +end + end \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 6143eaa..8f47989 100644 --- a/templates/index.html +++ b/templates/index.html @@ -45,9 +45,10 @@
${ abstract:_render_abstract.html() }