Skip to content

Commit

Permalink
✨ combine and publish supp mat
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoisot committed Feb 27, 2023
1 parent 408bc80 commit 5af01c7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
16 changes: 14 additions & 2 deletions scripts/04_run.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@
<section class="abstract">
${ abstract:_render_abstract.html() }
<div class="artifacts">
<a href="${ filename }_draft.pdf" title="Draft PDF" target="_blank">Draft</a>
<a href="${ filename }_preprint.pdf" title="Preprint PDF" target="_blank">Preprint</a>
<a href="${ filename }.odt" title="OpenDocument (Word)" target="_blank">Libre Office</a>
<a href="${ filename }_draft.pdf" title="Draft" target="_blank">Draft</a>
<a href="${ filename }_preprint.pdf" title="Preprint" target="_blank">Preprint</a>
<a href="${ filename }.odt" title="OpenDocument" target="_blank">Libre Office</a>
<a href="${ filename }_appendix.pdf" title="Supp. Mat." target="_blank">Supp. Mat.</a>
</div>
</section>

Expand Down

0 comments on commit 5af01c7

Please sign in to comment.