diff --git a/examples/book/Makefile b/examples/book/Makefile new file mode 100644 index 0000000..0713ae5 --- /dev/null +++ b/examples/book/Makefile @@ -0,0 +1,126 @@ +#---------------------------------------------------------------------- +# +# +# +#---------------------------------------------------------------------- +# make config... + +.SECONDEXPANSION: + +.DEFAULT_GOAL := all + +ifeq ($(DEBUG),) + STDERR := > /dev/null +endif + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# config... + +DIST_DIR := dist/PRINT +SPREAD_DIR := spreads +TEMPLATE_DIR := templates + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# sources... + +SETUP := \ + setup.tex \ + macros.tex + +TEMPLATE_FILES := \ + $(wildcard $(TEMPLATE_DIR)/*) + +SPREADS := \ + spreads.tex + +COMPONENTS := \ + cover.pdf jacket.pdf endpaper.pdf \ + block.pdf + +# things that we need that does not need to be built my this Makefile, +# this could include custom graphics, manual layouts, ...etc. +EXTRAS := + + + +#---------------------------------------------------------------------- +# config/commands... + +MD = @mkdir -p + +# primary engine, everything works... +# NOTE: several hacks had to be made -- see setup.tex +CMD = lualatex +#ARGS = -output-driver="xdvipdfmx -q -E -V 3" + +MAKESPREADS := ../../scripts/make-spreads.sh + + + +#---------------------------------------------------------------------- +# components and rules... + +# generic latex -> pdf... +%.pdf: %.tex $(SETUP) + -$(CMD) $< $(STDERR) + + +spreads.tex: $(SPREAD_DIR) $(wildcard $(SPREAD_DIR)/*/*) $(TEMPLATE_FILES) + $(MAKESPREADS) $< $(SPREAD) > $@ + +# in case we need multiple chapters/sections, i.e. sets of spreads... +# XXX needs testing -- % in the wildcard function... +%-spreads.tex: $(SPREAD_DIR)/% $(wildcard $(SPREAD_DIR)/%/*/*) $(TEMPLATE_FILES) + $(MAKESPREADS) $< $(SPREAD) > $@ + + +block.pdf: $(SPREADS) + + + +#---------------------------------------------------------------------- +# production targets... + +.PHONY: all +all: $(COMPONENTS) $(EXTRAS) + + + +#---------------------------------------------------------------------- +# packageing... + +.PHONY: dist +dist: $(COMPONENTS) $(EXTRAS) + $(MD) $(DIST_DIR) + cp $? $(DIST_DIR) + + + +#---------------------------------------------------------------------- +# utility trgets... + +.PHONY: sweep +sweep: + -rm -f *.out *.aux *.log *.upa ; true + + +.PHONY: clean +clean: sweep + -rm -rf *.pdf PRINT *.image-list $(SPREADS) ; true + + +.PHONY: clean-dist +clean-dist: + -rm -rf dist ; true + + +.PHONY: clean-all +clean-all: clean clean-dist + + + + +#---------------------------------------------------------------------- +# diff --git a/examples/book/block.tex b/examples/book/block.tex new file mode 100644 index 0000000..7cf02ce --- /dev/null +++ b/examples/book/block.tex @@ -0,0 +1,28 @@ +%---------------------------------------------------------------------- + +\input{setup} + + +\begin{document} %----------------------------------------------------- + +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +% XXX half title... + +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +\BookInfoPage + +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +% XXX intro... + +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +% XXX title... + +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +\input{spreads} + +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +\BookSoftwareInfoPage + + +\end{document} %------------------------------------------------------- +% vim:set ts=4 sw=4 : diff --git a/examples/book/cover.tex b/examples/book/cover.tex new file mode 100644 index 0000000..e229c8b --- /dev/null +++ b/examples/book/cover.tex @@ -0,0 +1,17 @@ +%---------------------------------------------------------------------- + +\input{setup} + +\ChangeLayout{cover} + +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +\begin{document} + +\GenerateTemplate + +\end{document} + + +%---------------------------------------------------------------------- +% vim:set ts=4 sw=4 : diff --git a/examples/book/endpaper.tex b/examples/book/endpaper.tex new file mode 100644 index 0000000..6df8e91 --- /dev/null +++ b/examples/book/endpaper.tex @@ -0,0 +1,17 @@ +%---------------------------------------------------------------------- + +\input{setup} + +\ChangeLayout{endpaper} + +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +\begin{document} + +\GenerateTemplate + +\end{document} + + +%---------------------------------------------------------------------- +% vim:set ts=4 sw=4 : diff --git a/examples/book/jacket.tex b/examples/book/jacket.tex new file mode 100644 index 0000000..3b23e15 --- /dev/null +++ b/examples/book/jacket.tex @@ -0,0 +1,17 @@ +%---------------------------------------------------------------------- + +\input{setup} + +\ChangeLayout{jacket} + +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +\begin{document} + +\GenerateTemplate + +\end{document} + + +%---------------------------------------------------------------------- +% vim:set ts=4 sw=4 : diff --git a/examples/book/macros.tex b/examples/book/macros.tex new file mode 100644 index 0000000..e69de29 diff --git a/examples/book/setup.tex b/examples/book/setup.tex new file mode 100644 index 0000000..5686c83 --- /dev/null +++ b/examples/book/setup.tex @@ -0,0 +1,41 @@ + +%---------------------------------------------------------------------- + +\documentclass[ + layoutmode=block, + % page size... + blockwidth=240mm, blockheight=220mm, + bleed=4mm, + bindingoffset=5mm, + % cover... + coverboardgrow=3mm, + coverflap=17mm, + spinewidth=15mm, + spinefold=5mm, + spinefold=5mm, + % jacket... + jacketflap=50mm, + jacketwrap=1mm, + % image block configuration... + imageblockwidth=0.98, imageblockheight=0.98, + imageblockoffsettop=-0.1, + % misc... + 9pt,final,openany +]{photobook} + + +\def\BookTitle{Info page demo} +\def\BookVersion{1.0} +\def\BookAuthors{John J. Smith} +\def\ByNotice{% + Graphics: none + + Text: almost none} +\def\ThanksTo{% + Everyone} +\def\ISBN{000-0-0000000-0-0} +\def\Edition{I 500} + + +%---------------------------------------------------------------------- +% vim:set ts=4 sw=4 : diff --git a/examples/book/spreads/-03-disabled/01.txt b/examples/book/spreads/-03-disabled/01.txt new file mode 100644 index 0000000..f451a6a --- /dev/null +++ b/examples/book/spreads/-03-disabled/01.txt @@ -0,0 +1 @@ +Some text diff --git a/examples/book/spreads/-03-disabled/02.txt b/examples/book/spreads/-03-disabled/02.txt new file mode 100644 index 0000000..f451a6a --- /dev/null +++ b/examples/book/spreads/-03-disabled/02.txt @@ -0,0 +1 @@ +Some text diff --git a/examples/book/spreads/00-text-only/text.txt b/examples/book/spreads/00-text-only/text.txt new file mode 100644 index 0000000..53bc367 --- /dev/null +++ b/examples/book/spreads/00-text-only/text.txt @@ -0,0 +1 @@ +page text diff --git a/examples/book/spreads/01-image-text/01-img.png b/examples/book/spreads/01-image-text/01-img.png new file mode 100644 index 0000000..f5a0e4c Binary files /dev/null and b/examples/book/spreads/01-image-text/01-img.png differ diff --git a/examples/book/spreads/01-image-text/02-block.txt b/examples/book/spreads/01-image-text/02-block.txt new file mode 100644 index 0000000..f451a6a --- /dev/null +++ b/examples/book/spreads/01-image-text/02-block.txt @@ -0,0 +1 @@ +Some text diff --git a/examples/book/spreads/02-two-images-local-caption/01-image.png b/examples/book/spreads/02-two-images-local-caption/01-image.png new file mode 100644 index 0000000..f5a0e4c Binary files /dev/null and b/examples/book/spreads/02-two-images-local-caption/01-image.png differ diff --git a/examples/book/spreads/02-two-images-local-caption/02-pic.png b/examples/book/spreads/02-two-images-local-caption/02-pic.png new file mode 100644 index 0000000..f5a0e4c Binary files /dev/null and b/examples/book/spreads/02-two-images-local-caption/02-pic.png differ diff --git a/examples/book/spreads/02-two-images-local-caption/02-pic.txt b/examples/book/spreads/02-two-images-local-caption/02-pic.txt new file mode 100644 index 0000000..12d1742 --- /dev/null +++ b/examples/book/spreads/02-two-images-local-caption/02-pic.txt @@ -0,0 +1 @@ +caption text diff --git a/examples/book/spreads/04-manual-template/01.png b/examples/book/spreads/04-manual-template/01.png new file mode 100644 index 0000000..f5a0e4c Binary files /dev/null and b/examples/book/spreads/04-manual-template/01.png differ diff --git a/examples/book/spreads/04-manual-template/fullbleed.tpl b/examples/book/spreads/04-manual-template/fullbleed.tpl new file mode 100644 index 0000000..e69de29 diff --git a/examples/book/spreads/05-single-image/01-img.png b/examples/book/spreads/05-single-image/01-img.png new file mode 100644 index 0000000..f5a0e4c Binary files /dev/null and b/examples/book/spreads/05-single-image/01-img.png differ diff --git a/examples/book/templates/blank-image.tex b/examples/book/templates/blank-image.tex new file mode 100644 index 0000000..4985e41 --- /dev/null +++ b/examples/book/templates/blank-image.tex @@ -0,0 +1,2 @@ +\cleardoublepage +\ImagePage{${CAPTION0}}{${IMAGE0}} diff --git a/examples/book/templates/fullbleed.tex b/examples/book/templates/fullbleed.tex new file mode 100644 index 0000000..bffb5b0 --- /dev/null +++ b/examples/book/templates/fullbleed.tex @@ -0,0 +1 @@ +\ImageSpreadFill{${CAPTION}}{${IMAGE0}} diff --git a/examples/book/templates/image-blank.tex b/examples/book/templates/image-blank.tex new file mode 100644 index 0000000..6642e83 --- /dev/null +++ b/examples/book/templates/image-blank.tex @@ -0,0 +1,2 @@ +\ImagePage{${CAPTION0}}{${IMAGE0}} +\emptypage diff --git a/examples/book/templates/image-image.tex b/examples/book/templates/image-image.tex new file mode 100644 index 0000000..19519a4 --- /dev/null +++ b/examples/book/templates/image-image.tex @@ -0,0 +1,2 @@ +\ImagePage{${CAPTION0}}{${IMAGE0}} +\ImagePage{${CAPTION1}}{${IMAGE1}} diff --git a/examples/book/templates/imagepage.tex b/examples/book/templates/imagepage.tex new file mode 100644 index 0000000..0f5a5f0 --- /dev/null +++ b/examples/book/templates/imagepage.tex @@ -0,0 +1 @@ +\ImagePage{${CAPTION}}{${IMAGE}} diff --git a/examples/book/templates/textpage.tex b/examples/book/templates/textpage.tex new file mode 100644 index 0000000..04512bc --- /dev/null +++ b/examples/book/templates/textpage.tex @@ -0,0 +1,4 @@ +\parbox{\textwidth}{% + \setlength{\parskip}{1em} + \input{${TEXT}} } +\newpage diff --git a/scripts/README.md b/scripts/README.md index 9688b68..4083252 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -84,8 +84,7 @@ book/ └── ... ``` - +For a full example see: ../examples/book Generate the block: ```shell