mirror of
https://github.com/hendricius/the-sourdough-framework
synced 2025-11-26 12:54:00 -06:00
Export figures feature (#70)
This adds a `make export_figures` command which exports all the flow charts into nicely looking pngs. The command requires that you have docker running locally.
This commit is contained in:
committed by
GitHub
parent
36b9c4c7a9
commit
e0d5422041
@@ -78,7 +78,7 @@ that it will reach more people all over the world without
|
||||
budget constraints.
|
||||
|
||||
If you would like to contribute with a small donation you can do so
|
||||
via my [ko-fi page.](https://breadco.de/book). This will help me
|
||||
via my [ko-fi page.](https://breadco.de/book) This will help me
|
||||
to cover costs related to running the-bread-code and allow me
|
||||
to work more updates for this book.
|
||||
|
||||
|
||||
8
book/figures/export_figures.sh
Executable file
8
book/figures/export_figures.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
for i in *.pdf
|
||||
do
|
||||
docker run -v $(pwd):/imgs dpokidov/imagemagick -density 900 -trim /imgs/$i -quality 100 /imgs/$i.png
|
||||
rename 's/pdf.png/png/' *.png
|
||||
rename 's/fig-/figure-/' *.png
|
||||
done
|
||||
|
||||
@@ -4,16 +4,31 @@ build_pdf: clean figures tables
|
||||
biber book
|
||||
pdflatex book.tex
|
||||
|
||||
.PHONY: clean_figures
|
||||
clean_figures:
|
||||
cd figures
|
||||
rm -rf figures/*.aux
|
||||
rm -rf figures/*.fdb_latexmk
|
||||
rm -rf figures/*.fls
|
||||
rm -rf figures/*.log
|
||||
rm -rf figures/*.pdf
|
||||
rm -rf figures/*.png
|
||||
|
||||
.PHONY: export_figures
|
||||
# Requires that you have docker running on your computer.
|
||||
export_figures:
|
||||
cd figures/ && bash export_figures.sh
|
||||
|
||||
.PHONY: figures
|
||||
figures:
|
||||
cd figures && find . -name "fig-*.tex" -exec pdflatex '{}' \; && cd ../
|
||||
figures: clean_figures
|
||||
cd figures && find . -name "fig-*.tex" -exec pdflatex '{}' \;
|
||||
|
||||
.PHONY: tables
|
||||
tables:
|
||||
cd tables && find . -name "table-*.tex" -exec pdflatex '{}' \; && cd ../
|
||||
cd tables && find . -name "table-*.tex" -exec pdflatex '{}' \;
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
clean: clean_figures
|
||||
rm -f book.blg
|
||||
rm -f book.bbl
|
||||
rm -f book.aux
|
||||
@@ -47,12 +62,6 @@ clean:
|
||||
rm -f *.pdf
|
||||
rm -f output.log
|
||||
rm -f content.opf
|
||||
rm -rf figures/*.aux
|
||||
rm -rf figures/*.fdb_latexmk
|
||||
rm -rf figures/*.fls
|
||||
rm -rf figures/*.log
|
||||
rm -rf figures/*.pdf
|
||||
rm -rf figures/*.png
|
||||
find . -name "*.xbb" | xargs rm -f
|
||||
rm -rf release/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user