mirror of
https://github.com/hendricius/the-sourdough-framework
synced 2025-12-05 09:04:26 -06:00
Create png for TikZ figures
- Add export_figures back
- Build a pdf from the the TikZ in standalone mode
- Change the cleanup to deal with those changes
- Remove trailing spaces..
This commit is contained in:
@@ -23,11 +23,21 @@ images += $(foreach directory, $(chapters), $(wildcard $(directory)/*.png))
|
|||||||
|
|
||||||
src_all := $(src_tex) $(src_figures) $(src_tables) tex4ebook.cfg book.mk4 $(images)
|
src_all := $(src_tex) $(src_figures) $(src_tables) tex4ebook.cfg book.mk4 $(images)
|
||||||
|
|
||||||
|
tgt_figures := $(patsubst %.tex, %.png,$(src_figures))
|
||||||
|
|
||||||
# Default rules for pdf and ebooks, getting overwritten when built in a
|
# Default rules for pdf and ebooks, getting overwritten when built in a
|
||||||
# sub-directory
|
# sub-directory
|
||||||
%.pdf: %.tex
|
%.pdf: %.tex
|
||||||
$(LATEX) $<
|
$(LATEX) $<
|
||||||
|
|
||||||
|
%.png: %.tex
|
||||||
|
@echo "\input{./vars}" > $@.in
|
||||||
|
# \b is backspace..
|
||||||
|
@echo "\\\begin{document}" >> $@.in
|
||||||
|
@cat $< >> $@.in
|
||||||
|
@echo "\end{document}" >> $@.in
|
||||||
|
$(LATEX) $@.in
|
||||||
|
|
||||||
book_serif/book.pdf: clean_ebook_build $(SRC_ALL)
|
book_serif/book.pdf: clean_ebook_build $(SRC_ALL)
|
||||||
$(LATEX) -output-directory=book_serif book.tex
|
$(LATEX) -output-directory=book_serif book.tex
|
||||||
|
|
||||||
@@ -96,9 +106,15 @@ build_serif_ebook: epub/book.epub epub/book.mobi epub/book.azw3 | make_release_d
|
|||||||
build_sans_serif_ebook: epub/book_sans_serif.epub epub/book_sans_serif.mobi \
|
build_sans_serif_ebook: epub/book_sans_serif.epub epub/book_sans_serif.mobi \
|
||||||
epub/book_sans_serif.azw3 | make_release_dir
|
epub/book_sans_serif.azw3 | make_release_dir
|
||||||
|
|
||||||
.PHONY: check
|
.PHONY: export_figures
|
||||||
|
# Requires that you have docker running on your computer.
|
||||||
|
export_figures: $(tgt_figures)
|
||||||
|
echo $(tgt_figures)
|
||||||
|
cd figures/ && bash export_figures.sh
|
||||||
|
|
||||||
# Goal is not really to have 0 warning reported but we should check we don't
|
# Goal is not really to have 0 warning reported but we should check we don't
|
||||||
# add many and if we do, we know they are false positive
|
# add many and if we do, we know they are false positive
|
||||||
|
PHONY: check
|
||||||
check: $(SRC_TEX)
|
check: $(SRC_TEX)
|
||||||
@echo "Running: " $(CHECK_1)
|
@echo "Running: " $(CHECK_1)
|
||||||
$(CHECK_1) book.tex
|
$(CHECK_1) book.tex
|
||||||
@@ -108,7 +124,9 @@ check: $(SRC_TEX)
|
|||||||
|
|
||||||
.PHONY: clean_figures
|
.PHONY: clean_figures
|
||||||
clean_figures:
|
clean_figures:
|
||||||
$(CLEAN) $(src_figures)
|
$(CLEAN) $(patsubst %.tex, %.png.in, $(src_figures))
|
||||||
|
- rm $(patsubst %.tex, %.png.pdf, $(src_figures))
|
||||||
|
- rm $(patsubst %.tex, %.png.in, $(src_figures))
|
||||||
|
|
||||||
.PHONY: clean_ebook_build
|
.PHONY: clean_ebook_build
|
||||||
clean_ebook_build:
|
clean_ebook_build:
|
||||||
@@ -149,7 +167,6 @@ mrproper: clean
|
|||||||
$(CLEAN) -C $(src_figures)
|
$(CLEAN) -C $(src_figures)
|
||||||
$(CLEAN) -C -output-directory=book_serif book.tex
|
$(CLEAN) -C -output-directory=book_serif book.tex
|
||||||
$(CLEAN) -C -output-directory=book_sans_serif book_sans_serif.tex
|
$(CLEAN) -C -output-directory=book_sans_serif book_sans_serif.tex
|
||||||
-rm figures/*.pdf
|
|
||||||
-rm figures/*.png
|
-rm figures/*.png
|
||||||
rm -rf epub/
|
rm -rf epub/
|
||||||
rm -rf release/
|
rm -rf release/
|
||||||
|
|||||||
Reference in New Issue
Block a user