mirror of
https://github.com/flynx/photobook.git
synced 2025-10-28 09:50:09 +00:00
added a full book example...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
aed58ffe70
commit
cf2b95a1d5
126
examples/book/Makefile
Normal file
126
examples/book/Makefile
Normal file
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
#
|
||||
28
examples/book/block.tex
Normal file
28
examples/book/block.tex
Normal file
@ -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 :
|
||||
17
examples/book/cover.tex
Normal file
17
examples/book/cover.tex
Normal file
@ -0,0 +1,17 @@
|
||||
%----------------------------------------------------------------------
|
||||
|
||||
\input{setup}
|
||||
|
||||
\ChangeLayout{cover}
|
||||
|
||||
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
\begin{document}
|
||||
|
||||
\GenerateTemplate
|
||||
|
||||
\end{document}
|
||||
|
||||
|
||||
%----------------------------------------------------------------------
|
||||
% vim:set ts=4 sw=4 :
|
||||
17
examples/book/endpaper.tex
Normal file
17
examples/book/endpaper.tex
Normal file
@ -0,0 +1,17 @@
|
||||
%----------------------------------------------------------------------
|
||||
|
||||
\input{setup}
|
||||
|
||||
\ChangeLayout{endpaper}
|
||||
|
||||
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
\begin{document}
|
||||
|
||||
\GenerateTemplate
|
||||
|
||||
\end{document}
|
||||
|
||||
|
||||
%----------------------------------------------------------------------
|
||||
% vim:set ts=4 sw=4 :
|
||||
17
examples/book/jacket.tex
Normal file
17
examples/book/jacket.tex
Normal file
@ -0,0 +1,17 @@
|
||||
%----------------------------------------------------------------------
|
||||
|
||||
\input{setup}
|
||||
|
||||
\ChangeLayout{jacket}
|
||||
|
||||
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
\begin{document}
|
||||
|
||||
\GenerateTemplate
|
||||
|
||||
\end{document}
|
||||
|
||||
|
||||
%----------------------------------------------------------------------
|
||||
% vim:set ts=4 sw=4 :
|
||||
0
examples/book/macros.tex
Normal file
0
examples/book/macros.tex
Normal file
41
examples/book/setup.tex
Normal file
41
examples/book/setup.tex
Normal file
@ -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 :
|
||||
1
examples/book/spreads/-03-disabled/01.txt
Normal file
1
examples/book/spreads/-03-disabled/01.txt
Normal file
@ -0,0 +1 @@
|
||||
Some text
|
||||
1
examples/book/spreads/-03-disabled/02.txt
Normal file
1
examples/book/spreads/-03-disabled/02.txt
Normal file
@ -0,0 +1 @@
|
||||
Some text
|
||||
1
examples/book/spreads/00-text-only/text.txt
Normal file
1
examples/book/spreads/00-text-only/text.txt
Normal file
@ -0,0 +1 @@
|
||||
page text
|
||||
BIN
examples/book/spreads/01-image-text/01-img.png
Normal file
BIN
examples/book/spreads/01-image-text/01-img.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 384 KiB |
1
examples/book/spreads/01-image-text/02-block.txt
Normal file
1
examples/book/spreads/01-image-text/02-block.txt
Normal file
@ -0,0 +1 @@
|
||||
Some text
|
||||
BIN
examples/book/spreads/02-two-images-local-caption/01-image.png
Normal file
BIN
examples/book/spreads/02-two-images-local-caption/01-image.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 384 KiB |
BIN
examples/book/spreads/02-two-images-local-caption/02-pic.png
Normal file
BIN
examples/book/spreads/02-two-images-local-caption/02-pic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 384 KiB |
@ -0,0 +1 @@
|
||||
caption text
|
||||
BIN
examples/book/spreads/04-manual-template/01.png
Normal file
BIN
examples/book/spreads/04-manual-template/01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 384 KiB |
BIN
examples/book/spreads/05-single-image/01-img.png
Normal file
BIN
examples/book/spreads/05-single-image/01-img.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 384 KiB |
2
examples/book/templates/blank-image.tex
Normal file
2
examples/book/templates/blank-image.tex
Normal file
@ -0,0 +1,2 @@
|
||||
\cleardoublepage
|
||||
\ImagePage{${CAPTION0}}{${IMAGE0}}
|
||||
1
examples/book/templates/fullbleed.tex
Normal file
1
examples/book/templates/fullbleed.tex
Normal file
@ -0,0 +1 @@
|
||||
\ImageSpreadFill{${CAPTION}}{${IMAGE0}}
|
||||
2
examples/book/templates/image-blank.tex
Normal file
2
examples/book/templates/image-blank.tex
Normal file
@ -0,0 +1,2 @@
|
||||
\ImagePage{${CAPTION0}}{${IMAGE0}}
|
||||
\emptypage
|
||||
2
examples/book/templates/image-image.tex
Normal file
2
examples/book/templates/image-image.tex
Normal file
@ -0,0 +1,2 @@
|
||||
\ImagePage{${CAPTION0}}{${IMAGE0}}
|
||||
\ImagePage{${CAPTION1}}{${IMAGE1}}
|
||||
1
examples/book/templates/imagepage.tex
Normal file
1
examples/book/templates/imagepage.tex
Normal file
@ -0,0 +1 @@
|
||||
\ImagePage{${CAPTION}}{${IMAGE}}
|
||||
4
examples/book/templates/textpage.tex
Normal file
4
examples/book/templates/textpage.tex
Normal file
@ -0,0 +1,4 @@
|
||||
\parbox{\textwidth}{%
|
||||
\setlength{\parskip}{1em}
|
||||
\input{${TEXT}} }
|
||||
\newpage
|
||||
@ -84,8 +84,7 @@ book/
|
||||
└── ...
|
||||
```
|
||||
|
||||
<!-- XXX
|
||||
For a live example see: ../examples/book -->
|
||||
For a full example see: ../examples/book
|
||||
|
||||
Generate the block:
|
||||
```shell
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user