Compare commits
163 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 53442622b9 | |||
| 9bbd752c63 | |||
| ac0acee865 | |||
| 3a3e4acc55 | |||
| 7bef61cb0f | |||
| 942197fdc9 | |||
| 5e210b54eb | |||
| 615463cf72 | |||
|
|
90708b6ca7 | ||
| 1508055cf3 | |||
| 9ad5a81054 | |||
| d92251976b | |||
| 949cd945b0 | |||
| be6bc7ba4d | |||
| db9497cfb4 | |||
| 2983290550 | |||
| 87e8169826 | |||
| 0e7524a778 | |||
| 60a4e8b6ef | |||
| ace4cc3e6f | |||
| 9579a4cc0b | |||
| 3d4ec82633 | |||
| 7f2f8b1ff6 | |||
| deaa409acf | |||
| 73c3f721e3 | |||
| 53b4d58227 | |||
| 3a1da05700 | |||
| cc06475800 | |||
| 6ef54c6939 | |||
| 238597543e | |||
| ea10fa1004 | |||
| c3896ba7f9 | |||
| 5568a6d6b8 | |||
| ca2bb256ac | |||
| 74c2c5e4a7 | |||
| 4a19fc5a98 | |||
| 9ae85d2ea8 | |||
| 0a3ef4c170 | |||
| 142ea9b4ce | |||
| b21cc06599 | |||
| 14c62374ba | |||
| 55244f04de | |||
| f71b433366 | |||
| 164fdab6a5 | |||
| a49fe8265a | |||
| 643a656553 | |||
| 36a9c8d380 | |||
| 035861ef77 | |||
| 7bf8dc9cfd | |||
| 62434c5cf5 | |||
| 832bc796e3 | |||
| 93105898cb | |||
| 8cdf25b17e | |||
| 485bb4ba07 | |||
| 7f37e7ff8c | |||
| 0598725a54 | |||
| 84178cf288 | |||
| e6a8b50a63 | |||
| 0a65489501 | |||
| 2dbee1418f | |||
| be9c1f40df | |||
| 83cc0db91f | |||
| b44d563684 | |||
| 748d75a05b | |||
| f1fbc82fca | |||
| 1ca673cf64 | |||
| 2e659072f3 | |||
| 6ce1032d33 | |||
| 561273e27c | |||
| f094d073b5 | |||
| 7f0159fb35 | |||
| c670c4ccf8 | |||
| 79546e3407 | |||
| 37b5ac92ff | |||
| 3a4a0b6fd5 | |||
| 9a3e1bd0a1 | |||
| 0d14bb32e3 | |||
| c8645478f5 | |||
| fab1a5f394 | |||
| 2034e4fdfe | |||
| c42d8a4208 | |||
| ca432d6546 | |||
| d57f81a745 | |||
| c3e4e8f81b | |||
| e36f67b085 | |||
| 1ea6c37cfa | |||
| e85e579fca | |||
| d39f1d473a | |||
| c9a2565297 | |||
| 2aa649c285 | |||
| 02a98a4aa9 | |||
| 4dbeae47c6 | |||
| 32e28dae00 | |||
| e2fb80991f | |||
| ec4bf1c0a1 | |||
| 1d6652df17 | |||
| 787b33cac6 | |||
| 6fbe06bc49 | |||
| b52ba46a79 | |||
| 3ee4a6211b | |||
| 1102d91140 | |||
| e79da757f3 | |||
| cb5cc02656 | |||
| a5a8515410 | |||
| cebf722ac6 | |||
| 0a11677fab | |||
| 793f16802c | |||
| ec8cd1b9a8 | |||
| a72cee9c9c | |||
| 510c00192e | |||
| dced601684 | |||
| 55cea76fbd | |||
| fb85de1272 | |||
| 957fb33de2 | |||
| 0a87ae4087 | |||
| 9be9ed3062 | |||
| 2a29e29680 | |||
| 53b1dcc315 | |||
| bde8e38d75 | |||
| 2badf07a0e | |||
| cf2b95a1d5 | |||
| aed58ffe70 | |||
| 84edb90f7c | |||
| 858dbf671c | |||
| 76c10a3141 | |||
| 662c674d0a | |||
| 5c16b2a999 | |||
| 8b151c433f | |||
| 85d1e5f013 | |||
| 0390f3adfd | |||
| 66cb965e98 | |||
| fe16543735 | |||
| 4f6490de4d | |||
| b368ffc69d | |||
| 3f0636619d | |||
| cf9d533ada | |||
| 888a54b176 | |||
| aab7381159 | |||
| 2396df1a73 | |||
| a9fd39df8d | |||
| cf619f4893 | |||
| a1a5b89b0d | |||
| 55c5844327 | |||
| 264d80e4cd | |||
| 7357f3a526 | |||
| 8186a1ae10 | |||
| c8f77a8acd | |||
| 5308600350 | |||
| 91932d3137 | |||
| 6845c059fe | |||
| 6ba981e3dd | |||
| 8c78f72263 | |||
| 78eff5c68d | |||
| ab2c0e0a6a | |||
| e950e4475f | |||
| 8b594fd4e2 | |||
| e82f36717b | |||
| ba90796b22 | |||
| ea11ad94e3 | |||
| 488e893b5e | |||
| 3e8e15448c | |||
| 4503271af3 | |||
| 98e2fe7c13 |
7
.editorconfig
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[**]
|
||||||
|
indent_style = tab
|
||||||
|
tab_width = 4
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
18
.github/workflows/make-dist.yml
vendored
@ -18,9 +18,18 @@ jobs:
|
|||||||
uses: xu-cheng/texlive-action/full@v1
|
uses: xu-cheng/texlive-action/full@v1
|
||||||
with:
|
with:
|
||||||
run: |
|
run: |
|
||||||
apk add make git zip
|
apk add make git zip grep
|
||||||
git config --global --add safe.directory '*'
|
git config --global --add safe.directory '*'
|
||||||
echo "VERSION=$(make version)" >> $GITHUB_ENV
|
echo "VERSION=$(make version)" >> $GITHUB_ENV
|
||||||
|
# XXX not sure about this...
|
||||||
|
#COMMENT="$(git log -1 --pretty=%B | grep -v "Signed-off-by:")"
|
||||||
|
#COMMENT="${COMMENT//'%'/'%25'}"
|
||||||
|
#COMMENT="${COMMENT//$'\n'/'%0A'}"
|
||||||
|
#COMMENT="${COMMENT//$'\n'/'%0D'}"
|
||||||
|
#echo 'COMMENT<<EOF' >> $GITHUB_ENV
|
||||||
|
#echo "${COMMENT}" >> $GITHUB_ENV
|
||||||
|
#echo 'EOF' >> $GITHUB_ENV
|
||||||
|
# XXX if comment is multi-line it breaks the CTAN announcement...
|
||||||
echo 'COMMENT<<EOF' >> $GITHUB_ENV
|
echo 'COMMENT<<EOF' >> $GITHUB_ENV
|
||||||
git log -1 --pretty=%B | grep -v "Signed-off-by:" >> $GITHUB_ENV
|
git log -1 --pretty=%B | grep -v "Signed-off-by:" >> $GITHUB_ENV
|
||||||
echo 'EOF' >> $GITHUB_ENV
|
echo 'EOF' >> $GITHUB_ENV
|
||||||
@ -35,13 +44,13 @@ jobs:
|
|||||||
photobook.pdf
|
photobook.pdf
|
||||||
|
|
||||||
- name: Artifacts - build
|
- name: Artifacts - build
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build artifacts
|
name: build artifacts
|
||||||
path: photobook.pdf
|
path: photobook.pdf
|
||||||
|
|
||||||
- name: Artifacts - dist
|
- name: Artifacts - dist
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: dist artifacts
|
name: dist artifacts
|
||||||
path: dist/photobook-*.zip
|
path: dist/photobook-*.zip
|
||||||
@ -69,6 +78,9 @@ jobs:
|
|||||||
defining a set of parameters, meta-macros, macros and
|
defining a set of parameters, meta-macros, macros and
|
||||||
environments with reasonable defaults to help typeset,
|
environments with reasonable defaults to help typeset,
|
||||||
build and print books mainly based on visual/image content.
|
build and print books mainly based on visual/image content.
|
||||||
|
# XXX multi-line comments will break things...
|
||||||
|
# ...another potential cause is an empty line in a commit,
|
||||||
|
# need more testing...
|
||||||
announcement: >
|
announcement: >
|
||||||
${{ env.COMMENT }}
|
${{ env.COMMENT }}
|
||||||
|
|
||||||
|
|||||||
64
Makefile
@ -43,10 +43,6 @@
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Config...
|
# Config...
|
||||||
|
|
||||||
.EXPORT_ALL_VARIABLES:
|
|
||||||
|
|
||||||
#.ONESHELL:
|
|
||||||
|
|
||||||
# NOTE: this makes things run consistently on different systems including
|
# NOTE: this makes things run consistently on different systems including
|
||||||
# things like Android...
|
# things like Android...
|
||||||
SHELL := bash
|
SHELL := bash
|
||||||
@ -60,8 +56,9 @@ MODULE := photobook
|
|||||||
VERSION = $(strip $(shell \
|
VERSION = $(strip $(shell \
|
||||||
cat $(MODULE).cls \
|
cat $(MODULE).cls \
|
||||||
| grep 'VERSION{' \
|
| grep 'VERSION{' \
|
||||||
| sed 's/.*{\(.*\)}.*/\1/' \
|
| sed \
|
||||||
| sed 's/v//'))
|
-e 's/.*{\(.*\)}.*/\1/' \
|
||||||
|
-e 's/v//'))
|
||||||
DATE = $(strip $(shell date "+%Y%m%d%H%M"))
|
DATE = $(strip $(shell date "+%Y%m%d%H%M"))
|
||||||
COMMIT = $(strip $(shell git rev-parse HEAD))
|
COMMIT = $(strip $(shell git rev-parse HEAD))
|
||||||
|
|
||||||
@ -88,8 +85,7 @@ endif
|
|||||||
|
|
||||||
# markdown dialect...
|
# markdown dialect...
|
||||||
#
|
#
|
||||||
# XXX still needs some tweaking...
|
MD_FORMAT ?= gfm
|
||||||
MD_FORMAT ?= markdown_github
|
|
||||||
|
|
||||||
|
|
||||||
# debug output...
|
# debug output...
|
||||||
@ -125,6 +121,7 @@ DIST_NORMAL_FILES = \
|
|||||||
README.md \
|
README.md \
|
||||||
LICENSE \
|
LICENSE \
|
||||||
Makefile \
|
Makefile \
|
||||||
|
DEPENDS.txt \
|
||||||
$(MODULE).cls \
|
$(MODULE).cls \
|
||||||
$(MODULE).pdf
|
$(MODULE).pdf
|
||||||
DIST_FILES = \
|
DIST_FILES = \
|
||||||
@ -175,26 +172,11 @@ LN := cp -l
|
|||||||
# - |..| - verbatim does not work...
|
# - |..| - verbatim does not work...
|
||||||
# - || - parts of doc omitted...
|
# - || - parts of doc omitted...
|
||||||
# - verbatim blocks get merged sometimes...
|
# - verbatim blocks get merged sometimes...
|
||||||
|
# - does not resolve \jobname in include...
|
||||||
# - ...
|
# - ...
|
||||||
# ...not sure if this can be tweaked...
|
# ...not sure if this can be tweaked...
|
||||||
#%.md: %.tex
|
|
||||||
# pandoc -t $(MD_FORMAT) -s $< -o $@
|
|
||||||
|
|
||||||
# XXX EXPERIMENTAL...
|
|
||||||
# XXX revise:
|
|
||||||
# ...for this to work we need to replace:
|
|
||||||
# \documentclass{ltxdoc}
|
|
||||||
# to:
|
|
||||||
# \documentclass[markdownextra]{internet}
|
|
||||||
# XXX install the internet class...
|
|
||||||
# https://github.com/loopspace/latex-to-internet
|
|
||||||
# ...needs testing...
|
|
||||||
%.md: %.tex
|
%.md: %.tex
|
||||||
cat $< \
|
pandoc -t $(MD_FORMAT) -s $< -o $@
|
||||||
| sed 's/documentclass{ltxdoc}/documentclass[markdownextra]{internet}/' \
|
|
||||||
> $<.tmp
|
|
||||||
mv $<{.tmp,}
|
|
||||||
$(TEX) $< $(STDERR)
|
|
||||||
|
|
||||||
|
|
||||||
# meta-section...
|
# meta-section...
|
||||||
@ -225,6 +207,7 @@ LN := cp -l
|
|||||||
# strip docs out...
|
# strip docs out...
|
||||||
#
|
#
|
||||||
# XXX can we unify these???
|
# XXX can we unify these???
|
||||||
|
# ....not sure how...
|
||||||
%-stripped.tex: %.tex
|
%-stripped.tex: %.tex
|
||||||
$(DOC) --strip $< \
|
$(DOC) --strip $< \
|
||||||
$(DOC) --prefix M --strip \
|
$(DOC) --prefix M --strip \
|
||||||
@ -241,6 +224,15 @@ LN := cp -l
|
|||||||
> $@
|
> $@
|
||||||
|
|
||||||
|
|
||||||
|
# list of dependencies...
|
||||||
|
#
|
||||||
|
DEPENDS.txt: $(MODULE).cls
|
||||||
|
make depends \
|
||||||
|
| grep -v make \
|
||||||
|
| sed -e 's/^/hard /' \
|
||||||
|
> $@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Info targets...
|
# Info targets...
|
||||||
@ -250,10 +242,27 @@ version:
|
|||||||
@echo $(VERSION)
|
@echo $(VERSION)
|
||||||
|
|
||||||
|
|
||||||
|
# NOTE: grep's -z flag generates a bunch if nulls that we need to clean
|
||||||
|
# out via tr.
|
||||||
|
# XXX this is a bit ugly -- adding/removing "hard" and then adding it
|
||||||
|
# again for DEPENDS.txt...
|
||||||
|
.PHONY: depends
|
||||||
|
depends: $(MODULE).cls
|
||||||
|
@cat $< \
|
||||||
|
| grep -Ezo '\s*\\RequirePackage(\[[^]]*\])?\{[^}]*\}' \
|
||||||
|
| sed -e 's/.*{\(.*\)}/hard \1\n/' \
|
||||||
|
| grep -a hard \
|
||||||
|
| tr -d '\000' \
|
||||||
|
| cut -d " " -f 2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Main targets...
|
# Main targets...
|
||||||
|
|
||||||
|
.PHONY: dep
|
||||||
|
dep: DEPENDS.txt
|
||||||
|
|
||||||
.PHONY: pdf
|
.PHONY: pdf
|
||||||
pdf: $(MODULE).pdf
|
pdf: $(MODULE).pdf
|
||||||
|
|
||||||
@ -295,6 +304,7 @@ tag:
|
|||||||
@echo " v$(VERSION)"
|
@echo " v$(VERSION)"
|
||||||
@echo "Last 5 tags:"
|
@echo "Last 5 tags:"
|
||||||
@git tag -l 'v[0-9]*'\
|
@git tag -l 'v[0-9]*'\
|
||||||
|
| sort -V \
|
||||||
| tail -n 5 \
|
| tail -n 5 \
|
||||||
| sed 's/^/ /' \
|
| sed 's/^/ /' \
|
||||||
| tac
|
| tac
|
||||||
@ -326,7 +336,7 @@ tag:
|
|||||||
|
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: pdf
|
all: pdf dep
|
||||||
|
|
||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
@ -408,7 +418,7 @@ sweep:
|
|||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean: sweep
|
clean: sweep
|
||||||
rm -rf $(DIST_DIR) $(BUILD_DIR) $(MODULE).md *.pdf
|
rm -rf $(DIST_DIR) $(BUILD_DIR) $(MODULE).md DEPENDS.txt *.pdf
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
85
README.md
@ -4,8 +4,59 @@ photobook
|
|||||||
[LaTeX](https://www.latex-project.org/) document class for making photo books.
|
[LaTeX](https://www.latex-project.org/) document class for making photo books.
|
||||||
|
|
||||||
|
|
||||||
## Build requirements for docs
|
Available on:
|
||||||
|
- CTAN: https://ctan.org/pkg/photobook
|
||||||
|
- GitHub: https://github.com/flynx/photobook
|
||||||
|
|
||||||
|
|
||||||
|
## Install / Build
|
||||||
|
|
||||||
|
The simplest way to install is to use either
|
||||||
|
[TeX Live](https://www.tug.org/texlive/)'s or [MiKTeX](https://miktex.org/)'s
|
||||||
|
standard way to install modules.
|
||||||
|
|
||||||
|
|
||||||
|
Installing from source:
|
||||||
|
```shell
|
||||||
|
# get the source...
|
||||||
|
$ git clone https://github.com/flynx/photobook.git
|
||||||
|
|
||||||
|
# if desired, install in the user context...
|
||||||
|
$ cd ./photobook
|
||||||
|
$ make install
|
||||||
|
```
|
||||||
|
|
||||||
|
The `photobook` document class requires a set of modules to be installed
|
||||||
|
for it to function, the full list is included in the docs and can be
|
||||||
|
generated and printed by calling:
|
||||||
|
```shell
|
||||||
|
$ make depends
|
||||||
|
```
|
||||||
|
|
||||||
|
For more info on `make` targets see the: [./Makefile](./Makefile)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
|
||||||
|
Pre-built documentation can be found in the
|
||||||
|
[Github releases](https://github.com/flynx/photobook/releases/latest) or on
|
||||||
|
[CTAN](http://mirrors.ctan.org/macros/latex/contrib/photobook/photobook.pdf).
|
||||||
|
|
||||||
|
|
||||||
|
A full book (dummy) example is included in [./examples/book/](./examples/book/)
|
||||||
|
and can be used as a reference / starting point.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Building documentation
|
||||||
|
|
||||||
|
Building the reference from source is done by:
|
||||||
|
```shell
|
||||||
|
$ make pdf
|
||||||
|
```
|
||||||
|
|
||||||
|
Build requirements for docs:
|
||||||
- LaTeX tool chain (including: `lualatex`, `latexmk`, ..)
|
- LaTeX tool chain (including: `lualatex`, `latexmk`, ..)
|
||||||
The simplest way to get started is [TeX Live](https://www.tug.org/texlive/),
|
The simplest way to get started is [TeX Live](https://www.tug.org/texlive/),
|
||||||
either a full install or for specific modules see the _Packages_ section
|
either a full install or for specific modules see the _Packages_ section
|
||||||
@ -17,33 +68,14 @@ photobook
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Build / Install
|
|
||||||
|
|
||||||
The package is available on:
|
|
||||||
- CTAN: https://ctan.org/pkg/photobook
|
|
||||||
- GitHub: https://github.com/flynx/photobook
|
|
||||||
|
|
||||||
|
|
||||||
To install from source:
|
|
||||||
```shell
|
|
||||||
# get the source...
|
|
||||||
$ git clone https://github.com/flynx/photobook.git
|
|
||||||
|
|
||||||
# if desired, install in the user context...
|
|
||||||
$ cd ./photobook
|
|
||||||
$ make install
|
|
||||||
```
|
|
||||||
|
|
||||||
If only building the docs is required without installing:
|
|
||||||
```shell
|
|
||||||
$ make pdf
|
|
||||||
```
|
|
||||||
|
|
||||||
For more info on `make` targets see the: [./Makefile](./Makefile)
|
|
||||||
|
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
|
- The main reference is maintained inline with the source [photobook.cls](./photobook.cls)
|
||||||
|
thus it is both human-readable next to the code it documents and is
|
||||||
|
used to build the `photobook.pdf`.
|
||||||
|
Extracting the documentation source (`photobook*.tex`) is done
|
||||||
|
by [make](./Makefile) via [cls2tex.sh](scripts/README.md#cls2texsh) when
|
||||||
|
building the docs, see them for more info.
|
||||||
- There is a bug in default captions not being typeset correctly if too
|
- There is a bug in default captions not being typeset correctly if too
|
||||||
long, a workaround is to place them in a `minipage` like this:
|
long, a workaround is to place them in a `minipage` like this:
|
||||||
```latex
|
```latex
|
||||||
@ -72,3 +104,4 @@ Copyright (c) 2021-2023, Alex A. Naanou,
|
|||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
|
||||||
|
<!-- vim:set ts=4 sw=4 nowrap : -->
|
||||||
|
|||||||
151
examples/book/Makefile
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
#----------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
# make config...
|
||||||
|
|
||||||
|
.SECONDEXPANSION:
|
||||||
|
|
||||||
|
.DEFAULT_GOAL := all
|
||||||
|
|
||||||
|
#SHELL := bash
|
||||||
|
|
||||||
|
ifeq ($(DEBUG),)
|
||||||
|
STDERR := > /dev/null
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# config...
|
||||||
|
|
||||||
|
DIST_DIR := dist/PRINT
|
||||||
|
SPREAD_DIR := spreads
|
||||||
|
TEMPLATE_DIR := templates
|
||||||
|
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# sources...
|
||||||
|
|
||||||
|
SETUP := \
|
||||||
|
setup.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)
|
||||||
|
|
||||||
|
|
||||||
|
# XXX need to also include covers and endpapers (optionally?)
|
||||||
|
# XXX this is broken...
|
||||||
|
##web.tex: setup.tex
|
||||||
|
## { \
|
||||||
|
## echo "% This file is generated via make web.tex" \
|
||||||
|
## echo "% see the Makefile for info" \
|
||||||
|
## echo "% do not edit directly" \
|
||||||
|
## echo \
|
||||||
|
## echo "\input{setup}" \
|
||||||
|
## echo \
|
||||||
|
## echo "\setlength\bleed{0mm}" \
|
||||||
|
## echo "\setlength\bindingoffset{0mm}" \
|
||||||
|
## echo \
|
||||||
|
## echo "\ChangeLayout{endpaper}" \
|
||||||
|
## echo \
|
||||||
|
## echo "\pagecolor{black}" \
|
||||||
|
## echo \
|
||||||
|
## echo "\begin{document}" \
|
||||||
|
## echo "\includepdf[pages={{},1-}, nup=2x1, delta=0.3mm 0.3mm]{block}" \
|
||||||
|
## echo "\end{document}" \
|
||||||
|
## echo \
|
||||||
|
## } > $@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
# 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
#
|
||||||
81
examples/book/README.md
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
Full book example
|
||||||
|
=================
|
||||||
|
|
||||||
|
This directory contains a full book example.
|
||||||
|
|
||||||
|
```
|
||||||
|
book/
|
||||||
|
├── templates/ . . . . . . . . . . . . Templates used to buld spreads
|
||||||
|
│ └── ... (used by: make-spreads.sh)
|
||||||
|
├── spreads/ . . . . . . . . . . . . . Spread layout
|
||||||
|
│ └── ... (used by: make-spreads.sh)
|
||||||
|
├── captions/ . . . . . . . . . . . . . Image captions
|
||||||
|
│ └── ... (used by: make-spreads.sh)
|
||||||
|
├── hi-res/ . . . . . . . . . . . . . . High resolution graphics
|
||||||
|
│ └── ... (used by: make-spreads.sh)
|
||||||
|
├── Makefile
|
||||||
|
├── setup.tex . . . . . . . . . . . . . Book setup and configuration
|
||||||
|
│ This file contains all the book
|
||||||
|
│ geometry, colors and other
|
||||||
|
│ settings common to all comoponents
|
||||||
|
│ of the book.
|
||||||
|
├── block.tex . . . . . . . . . . . . . General page block layout.
|
||||||
|
├── spreads.tex . . . . . . . . . . . . Book spereads
|
||||||
|
│ (generated by: make-spreads.sh)
|
||||||
|
├── cover.tex
|
||||||
|
├── endpaper.tex
|
||||||
|
├── jacket.tex
|
||||||
|
└── ...
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that this is by no means the only or most optomal project
|
||||||
|
structure, but it is a good enough starting point that evolved through
|
||||||
|
several, big and small project to start the next one from (at least
|
||||||
|
for me, subjectively).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Building
|
||||||
|
--------
|
||||||
|
|
||||||
|
To build all components:
|
||||||
|
```shell
|
||||||
|
$ make all
|
||||||
|
```
|
||||||
|
|
||||||
|
To build a specific component:
|
||||||
|
```shell
|
||||||
|
$ make block.pdf
|
||||||
|
```
|
||||||
|
|
||||||
|
`block.pdf` in this case.
|
||||||
|
|
||||||
|
<!-- XXX add basic introspection to Makefike??? -->
|
||||||
|
|
||||||
|
|
||||||
|
Structure
|
||||||
|
---------
|
||||||
|
|
||||||
|
### `setup.tex`
|
||||||
|
|
||||||
|
### `spreads.tex`
|
||||||
|
|
||||||
|
### `cover.tex` / `jacket.tex` / `endpaper.tex` / ..
|
||||||
|
|
||||||
|
### `web.tex`
|
||||||
|
|
||||||
|
<!-- XXX this is quite generic, can we generate it? -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Workflow
|
||||||
|
--------
|
||||||
|
|
||||||
|
XXX
|
||||||
|
|
||||||
|
|
||||||
|
For information about building spreads see:
|
||||||
|
[make-spreads.sh](../../scripts/README.md)
|
||||||
|
|
||||||
|
|
||||||
|
<!-- vim:set ts=4 sw=4 nowrap : -->
|
||||||
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
@ -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
@ -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
@ -0,0 +1,17 @@
|
|||||||
|
%----------------------------------------------------------------------
|
||||||
|
|
||||||
|
\input{setup}
|
||||||
|
|
||||||
|
\ChangeLayout{jacket}
|
||||||
|
|
||||||
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\GenerateTemplate
|
||||||
|
|
||||||
|
\end{document}
|
||||||
|
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------
|
||||||
|
% vim:set ts=4 sw=4 :
|
||||||
42
examples/book/setup.tex
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
|
||||||
|
%----------------------------------------------------------------------
|
||||||
|
|
||||||
|
\documentclass[
|
||||||
|
layoutmode=block,
|
||||||
|
% page size...
|
||||||
|
blockwidth=240mm, blockheight=220mm,
|
||||||
|
bleed=4mm,
|
||||||
|
gutteroffset=5mm,
|
||||||
|
bindingoffset=1mm,
|
||||||
|
% 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
@ -0,0 +1 @@
|
|||||||
|
Some text
|
||||||
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
@ -0,0 +1 @@
|
|||||||
|
page text
|
||||||
BIN
examples/book/spreads/01-image-text/01-img.png
Normal file
|
After Width: | Height: | Size: 4.3 MiB |
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
|
After Width: | Height: | Size: 4.3 MiB |
BIN
examples/book/spreads/02-two-images-local-caption/02-pic.png
Normal file
|
After Width: | Height: | Size: 4.3 MiB |
@ -0,0 +1 @@
|
|||||||
|
caption text
|
||||||
BIN
examples/book/spreads/04-manual-template/01.png
Normal file
|
After Width: | Height: | Size: 4.3 MiB |
BIN
examples/book/spreads/05-single-image/01-img.png
Normal file
|
After Width: | Height: | Size: 4.3 MiB |
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
@ -0,0 +1 @@
|
|||||||
|
\ImageSpreadFill{${CAPTION}}{${IMAGE0}}
|
||||||
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
@ -0,0 +1,2 @@
|
|||||||
|
\ImagePage{${CAPTION0}}{${IMAGE0}}
|
||||||
|
\ImagePage{${CAPTION1}}{${IMAGE1}}
|
||||||
1
examples/book/templates/imagepage.tex
Normal file
@ -0,0 +1 @@
|
|||||||
|
\ImagePage{${CAPTION}}{${IMAGE}}
|
||||||
4
examples/book/templates/textpage.tex
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
\parbox{\textwidth}{%
|
||||||
|
\setlength{\parskip}{1em}
|
||||||
|
\input{${TEXT}} }
|
||||||
|
\newpage
|
||||||
28
examples/book/web.tex
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
%----------------------------------------------------------------------
|
||||||
|
%
|
||||||
|
%
|
||||||
|
%
|
||||||
|
%
|
||||||
|
%----------------------------------------------------------------------
|
||||||
|
|
||||||
|
\input{setup}
|
||||||
|
|
||||||
|
\setlength\bleed{0mm}
|
||||||
|
\ChangeLayout{spread}
|
||||||
|
\pagestyle{empty}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\begin{document} %-----------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
\includepdfmerge{jacket.pdf}
|
||||||
|
|
||||||
|
\includepdfmerge{cover.pdf}
|
||||||
|
|
||||||
|
\pdfspreadstopages{block}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\end{document} %-------------------------------------------------------
|
||||||
|
% vim:set ts=4 sw=4 :
|
||||||
93
examples/cliptocell-test.tex
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
%----------------------------------------------------------------------
|
||||||
|
|
||||||
|
\documentclass[
|
||||||
|
layoutmode=block,
|
||||||
|
% page size...
|
||||||
|
blockwidth=240mm, blockheight=220mm,
|
||||||
|
bleed=4mm,
|
||||||
|
gutteroffset=5mm,
|
||||||
|
bindingoffset=0mm,
|
||||||
|
% image block configuration...
|
||||||
|
imageblockwidth=0.98, imageblockheight=0.98,
|
||||||
|
imageblockoffsettop=0,
|
||||||
|
% misc...
|
||||||
|
9pt,final,openany
|
||||||
|
]{photobook}
|
||||||
|
|
||||||
|
\usepackage{lipsum}
|
||||||
|
\usepackage{ragged2e}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
% XXX for some reason this is not in the top/left corner...
|
||||||
|
% XXX bug in photobook???
|
||||||
|
\newcommand\CaptionBox[1][Caption]{%
|
||||||
|
\setlength\fboxsep{0pt}%
|
||||||
|
\fbox{%
|
||||||
|
\setlength\fboxsep{1pt}%
|
||||||
|
\colorbox{white}{\tiny #1}}}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{document} %-----------------------------------------------------
|
||||||
|
|
||||||
|
\setlength\parindent{0em}
|
||||||
|
\newlength\cellsize
|
||||||
|
\setlength\cellsize{25mm}
|
||||||
|
\renewcommand\fbox{\fcolorbox{red}{white}}
|
||||||
|
|
||||||
|
\begin{page}%
|
||||||
|
|cliptocell| bleeds
|
||||||
|
\par%
|
||||||
|
\vspace{6mm}%
|
||||||
|
\setlength\fboxsep{0pt}%
|
||||||
|
\fbox{%
|
||||||
|
\begin{inlinecell*}{\cellsize}{\cellsize}%
|
||||||
|
\imagecell[fill, clearance=-6mm]{\CaptionBox[no clip]}{landscape}%
|
||||||
|
\end{inlinecell*}}%
|
||||||
|
\hspace{1cm}%
|
||||||
|
\fbox{%
|
||||||
|
\begin{inlinecell*}{\cellsize}{\cellsize}%
|
||||||
|
\begin{cliptocell}%
|
||||||
|
\imagecell[fill, clearance=-6mm]{\CaptionBox[default=0pt]}{landscape}%
|
||||||
|
\end{cliptocell}%
|
||||||
|
\end{inlinecell*}}%
|
||||||
|
\hspace{1cm}%
|
||||||
|
\fbox{%
|
||||||
|
\begin{inlinecell*}{\cellsize}{\cellsize}%
|
||||||
|
\begin{cliptocell}[5mm]%
|
||||||
|
\imagecell[fill, clearance=-6mm]{\CaptionBox[5mm]}{landscape}%
|
||||||
|
\end{cliptocell}%
|
||||||
|
\end{inlinecell*}}%
|
||||||
|
\hspace{1cm}%
|
||||||
|
\fbox{%
|
||||||
|
\begin{inlinecell*}{\cellsize}{\cellsize}%
|
||||||
|
\begin{cliptocell}[1mm 5mm]%
|
||||||
|
\imagecell[fill, clearance=-6mm]{\CaptionBox[1mm 5mm]}{landscape}%
|
||||||
|
\end{cliptocell}%
|
||||||
|
\end{inlinecell*}}%
|
||||||
|
\hspace{1cm}%
|
||||||
|
\fbox{%
|
||||||
|
\begin{inlinecell*}{\cellsize}{\cellsize}%
|
||||||
|
\begin{cliptocell}[1mm 2mm 3mm 4mm]%
|
||||||
|
\imagecell[fill, clearance=-6mm]{\CaptionBox[1mm 2mm 3mm 4mm]}{landscape}%
|
||||||
|
\end{cliptocell}%
|
||||||
|
\end{inlinecell*}}%
|
||||||
|
\end{page}%
|
||||||
|
|
||||||
|
\begin{page}%
|
||||||
|
% XXX this is padded by 1mm for some reason -- not sure if it's the
|
||||||
|
% image or the enclosing cell...
|
||||||
|
\fbox{%
|
||||||
|
\begin{inlinecell*}{\cellsize}{\cellsize}%
|
||||||
|
\imagecell[fit]{}{landscape}%
|
||||||
|
\end{inlinecell*}}%
|
||||||
|
\hspace{1cm}%
|
||||||
|
\fbox{%
|
||||||
|
\begin{inlinecell*}{\cellsize}{\cellsize}%
|
||||||
|
\imagecell[fit, clearance=-1mm -2mm -3mm -4mm]{}{landscape}%
|
||||||
|
\end{inlinecell*}}%
|
||||||
|
\end{page}%
|
||||||
|
|
||||||
|
|
||||||
|
\end{document} %-------------------------------------------------------
|
||||||
|
% vim:set ts=4 sw=4 :
|
||||||
30
examples/cover-template.tex
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
%----------------------------------------------------------------------
|
||||||
|
|
||||||
|
\documentclass[
|
||||||
|
layoutmode=cover,
|
||||||
|
spinewidth=20mm,
|
||||||
|
spinefold=7mm,
|
||||||
|
coverboardgrow=3mm,
|
||||||
|
coverflap=17mm,
|
||||||
|
% page size...
|
||||||
|
blockwidth=240mm, blockheight=220mm,
|
||||||
|
bleed=4mm,
|
||||||
|
bindingoffset=5mm,
|
||||||
|
% image block configuration...
|
||||||
|
imageblockwidth=0.98, imageblockheight=0.98,
|
||||||
|
imageblockoffsettop=-0.1,
|
||||||
|
% misc...
|
||||||
|
9pt,final,openany
|
||||||
|
]{photobook}
|
||||||
|
|
||||||
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\GenerateTemplate
|
||||||
|
|
||||||
|
\end{document}
|
||||||
|
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------
|
||||||
|
% vim:set ts=4 sw=4 :
|
||||||
@ -21,7 +21,40 @@
|
|||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
\GenerateTemplate
|
\begin{page}
|
||||||
|
\begin{frontcover}
|
||||||
|
% NOTE: in the real world there is no need to extend the bleeds
|
||||||
|
% all the way to the end of the flaps, they need to go
|
||||||
|
% only 2-4 millimeters under the endpaper to account for
|
||||||
|
% cut and alignment errors...
|
||||||
|
\begin{cliptocell}[0mm {\coverflap} {\coverflap} {\coverflap}]
|
||||||
|
\imagecell[fill, clearance=-\coverflap]{}{landscape}
|
||||||
|
% title...
|
||||||
|
\begin{zinlinecell}
|
||||||
|
\begin{center}
|
||||||
|
\vfill
|
||||||
|
\color{white}
|
||||||
|
\Huge TITLE TEXT
|
||||||
|
\vfill
|
||||||
|
\end{center}
|
||||||
|
\end{zinlinecell}
|
||||||
|
\end{cliptocell}
|
||||||
|
\end{frontcover}
|
||||||
|
\begin{spine}
|
||||||
|
\begin{cliptocell}[0mm \coverflap]
|
||||||
|
\imagecell[fill, clearance=-\coverflap]{}{landscape}
|
||||||
|
\end{cliptocell}
|
||||||
|
\end{spine}
|
||||||
|
\begin{backcover}
|
||||||
|
\begin{cliptocell}[{\coverflap} {\coverflap} 0mm {\coverflap}]
|
||||||
|
\imagecell[fill, clearance=-\coverflap]{}{landscape}
|
||||||
|
\end{cliptocell}
|
||||||
|
\end{backcover}
|
||||||
|
|
||||||
|
\textblockrulecolour{white}
|
||||||
|
\textcolor{white}
|
||||||
|
\GenerateTemplate
|
||||||
|
\end{page}
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
\end{inlinecell}%
|
\end{inlinecell}%
|
||||||
\hspace{\textblockmargin}%
|
\hspace{\textblockmargin}%
|
||||||
\begin{inlinecell}{0.75\cellwidth - \textblockmargin + \bleed}{\cellheight}%
|
\begin{inlinecell}{0.75\cellwidth - \textblockmargin + \bleed}{\cellheight}%
|
||||||
\imagecell[fill]{}{DSC00403-2}%
|
\imagecell[fill]{}{landscape}%
|
||||||
\end{inlinecell}
|
\end{inlinecell}
|
||||||
\end{spreadtopages}
|
\end{spreadtopages}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@
|
|||||||
\begin{spreadtopages}%
|
\begin{spreadtopages}%
|
||||||
\hspace{-\bleed}%
|
\hspace{-\bleed}%
|
||||||
\begin{inlinecell}{0.75\cellwidth - \textblockmargin + \bleed}{\cellheight}%
|
\begin{inlinecell}{0.75\cellwidth - \textblockmargin + \bleed}{\cellheight}%
|
||||||
\imagecell[fill]{}{DSC00403-2}%
|
\imagecell[fill]{}{landscape}%
|
||||||
\end{inlinecell}%
|
\end{inlinecell}%
|
||||||
\hspace{\textblockmargin}%
|
\hspace{\textblockmargin}%
|
||||||
\begin{inlinecell}{0.25\cellwidth}{\cellheight}%
|
\begin{inlinecell}{0.25\cellwidth}{\cellheight}%
|
||||||
|
|||||||
@ -5,7 +5,8 @@
|
|||||||
% page size...
|
% page size...
|
||||||
blockwidth=240mm, blockheight=220mm,
|
blockwidth=240mm, blockheight=220mm,
|
||||||
bleed=4mm,
|
bleed=4mm,
|
||||||
bindingoffset=5mm,
|
gutteroffset=5mm,
|
||||||
|
bindingoffset=0mm,
|
||||||
% image block configuration...
|
% image block configuration...
|
||||||
imageblockwidth=0.98, imageblockheight=0.98,
|
imageblockwidth=0.98, imageblockheight=0.98,
|
||||||
imageblockoffsettop=0,
|
imageblockoffsettop=0,
|
||||||
@ -27,8 +28,8 @@
|
|||||||
|
|
||||||
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
\edef\TestImage{DSC00403-2}
|
\edef\TestImage{landscape}
|
||||||
\edef\TestImageV{DSC00403-2vert}
|
\edef\TestImageV{portrait}
|
||||||
|
|
||||||
|
|
||||||
\newcommand\Chapter[1]{
|
\newcommand\Chapter[1]{
|
||||||
|
|||||||
27
examples/endpaper-template.tex
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
%----------------------------------------------------------------------
|
||||||
|
|
||||||
|
\documentclass[
|
||||||
|
layoutmode=endpaper,
|
||||||
|
% page size...
|
||||||
|
blockwidth=240mm, blockheight=220mm,
|
||||||
|
bleed=4mm,
|
||||||
|
bindingoffset=5mm,
|
||||||
|
% image block configuration...
|
||||||
|
imageblockwidth=0.98, imageblockheight=0.98,
|
||||||
|
imageblockoffsettop=-0.1,
|
||||||
|
% misc...
|
||||||
|
9pt,final,openany
|
||||||
|
]{photobook}
|
||||||
|
|
||||||
|
|
||||||
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\GenerateTemplate
|
||||||
|
|
||||||
|
\end{document}
|
||||||
|
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------
|
||||||
|
% vim:set ts=4 sw=4 :
|
||||||
@ -14,14 +14,52 @@
|
|||||||
]{photobook}
|
]{photobook}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{document} % - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
% the simplest way to fill...
|
||||||
|
\ImagePageFill{}{landscape}
|
||||||
|
|
||||||
|
|
||||||
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
\begin{document}
|
% manual...
|
||||||
|
% NOTE: to fill the page the image cell needs to be placed relative to
|
||||||
|
% the page (papercell / pagecell) and not the text (page env)
|
||||||
|
\begin{page}
|
||||||
|
\begin{papercell}
|
||||||
|
\imagecell[fill, clearance=-\bleed]{}{landscape}
|
||||||
|
\end{papercell}
|
||||||
|
\end{page}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
% control #1 -- works fine...
|
||||||
|
\begin{page}
|
||||||
|
\begin{leftside}
|
||||||
|
\imagecell[fit]{}{landscape}
|
||||||
|
\end{leftside}
|
||||||
|
\begin{rightside}
|
||||||
|
\imagecell[fit]{}{landscape}
|
||||||
|
\end{rightside}
|
||||||
|
\end{page}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{page}
|
||||||
|
\begin{leftside}
|
||||||
|
\imagecell[fill, right, clearance=\cliptocellclearances]{}{landscape}
|
||||||
|
\end{leftside}
|
||||||
|
\begin{rightside}
|
||||||
|
\imagecell[fill, left, clearance=\cliptocellclearances]{}{landscape}
|
||||||
|
\end{rightside}
|
||||||
|
\end{page}
|
||||||
|
|
||||||
|
|
||||||
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
\GenerateTemplate
|
\GenerateTemplate
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
|
||||||
|
\end{document} %-------------------------------------------------------
|
||||||
%----------------------------------------------------------------------
|
% vim:set ts=4 sw=4 :
|
||||||
% vim:set ts=4 sw=4 :
|
|
||||||
|
|||||||
|
After Width: | Height: | Size: 1.3 MiB |
@ -0,0 +1,130 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="svg1"
|
||||||
|
width="3840"
|
||||||
|
height="5495"
|
||||||
|
viewBox="0 0 3840 5495"
|
||||||
|
sodipodi:docname="Johannes Vermeer - The Girl With The Pearl Earring (1665).svg"
|
||||||
|
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
||||||
|
inkscape:export-filename="Johannes Vermeer - The Girl With The Pearl Earring (1665).png"
|
||||||
|
inkscape:export-xdpi="50"
|
||||||
|
inkscape:export-ydpi="50"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<defs
|
||||||
|
id="defs1">
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath2">
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#ffffff;stroke-width:15.1181;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
d="M 1920,0 0,2747.5 1920,5495 3840,2747.5 Z"
|
||||||
|
id="path3" />
|
||||||
|
</clipPath>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath6">
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:#ffffff;stroke-width:60.4724;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
id="rect7"
|
||||||
|
width="500"
|
||||||
|
height="500"
|
||||||
|
x="318.06506"
|
||||||
|
y="257.89059" />
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#000000"
|
||||||
|
borderopacity="0.25"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
showguides="true"
|
||||||
|
inkscape:zoom="0.11632839"
|
||||||
|
inkscape:cx="1916.9868"
|
||||||
|
inkscape:cy="2750.8331"
|
||||||
|
inkscape:window-width="2048"
|
||||||
|
inkscape:window-height="1115"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="g1" />
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
inkscape:label="Image"
|
||||||
|
id="g1">
|
||||||
|
<image
|
||||||
|
width="3840"
|
||||||
|
height="5495"
|
||||||
|
preserveAspectRatio="none"
|
||||||
|
xlink:href="Johannes%20Vermeer%20-%20The%20Girl%20With%20The%20Pearl%20Earring%20(1665).jpg"
|
||||||
|
id="image1"
|
||||||
|
sodipodi:insensitive="true"
|
||||||
|
style="display:inline" />
|
||||||
|
<g
|
||||||
|
id="g5"
|
||||||
|
inkscape:label="large diamond">
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:60.47244094;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke;stroke-linejoin:miter;stroke-miterlimit:10;stroke-linecap:square"
|
||||||
|
d="M 1920,0 0,2747.5 1920,5495 3840,2747.5 Z"
|
||||||
|
id="path1"
|
||||||
|
clip-path="none"
|
||||||
|
inkscape:label="black diamond" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#ffffff;stroke-width:30.23622047;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke;stroke-linejoin:miter;stroke-miterlimit:10;stroke-linecap:square"
|
||||||
|
d="M 1920,0 0,2747.5 1920,5495 3840,2747.5 Z"
|
||||||
|
id="path4"
|
||||||
|
clip-path="url(#clipPath2)"
|
||||||
|
inkscape:label="white diamond" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g9"
|
||||||
|
inkscape:label="small diamond">
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:60.4724;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
id="rect8"
|
||||||
|
width="500"
|
||||||
|
height="500"
|
||||||
|
x="250"
|
||||||
|
y="-250"
|
||||||
|
clip-path="none"
|
||||||
|
transform="rotate(45)" />
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:#ffffff;stroke-width:60.4724;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
id="rect5"
|
||||||
|
width="500"
|
||||||
|
height="500"
|
||||||
|
x="318.06506"
|
||||||
|
y="257.89059"
|
||||||
|
clip-path="url(#clipPath6)"
|
||||||
|
transform="rotate(45,647.11071,171.7835)" />
|
||||||
|
</g>
|
||||||
|
<use
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
xlink:href="#g9"
|
||||||
|
id="use9"
|
||||||
|
transform="translate(3132.8932)" />
|
||||||
|
<use
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
xlink:href="#g9"
|
||||||
|
id="use10"
|
||||||
|
transform="translate(3132.8932,4787.8932)" />
|
||||||
|
<use
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
xlink:href="#g9"
|
||||||
|
id="use11"
|
||||||
|
transform="translate(2.0565886e-5,4789.4527)" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 720 KiB |
@ -0,0 +1,174 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="svg1"
|
||||||
|
width="2000"
|
||||||
|
height="1350"
|
||||||
|
viewBox="0 0 2000 1350"
|
||||||
|
sodipodi:docname="Katsushika Hokusai - The Great Wave off Kanagawa.svg"
|
||||||
|
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
||||||
|
inkscape:export-filename="Katsushika Hokusai - The Great Wave off Kanagawa.png"
|
||||||
|
inkscape:export-xdpi="96"
|
||||||
|
inkscape:export-ydpi="96"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<defs
|
||||||
|
id="defs1">
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath6">
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:#ffffff;stroke-width:60.4724;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
id="rect7"
|
||||||
|
width="500"
|
||||||
|
height="500"
|
||||||
|
x="318.06506"
|
||||||
|
y="257.89059" />
|
||||||
|
</clipPath>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath1">
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:#ffffff;stroke-width:60.4724;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
id="rect1"
|
||||||
|
width="500"
|
||||||
|
height="500"
|
||||||
|
x="318.06506"
|
||||||
|
y="257.89059" />
|
||||||
|
</clipPath>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath3">
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:#ffffff;stroke-width:60.4724;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
id="rect3"
|
||||||
|
width="500"
|
||||||
|
height="500"
|
||||||
|
x="318.06506"
|
||||||
|
y="257.89059" />
|
||||||
|
</clipPath>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath4">
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#ffffff;stroke-width:15.1181;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
d="M 1920,0 0,2747.5 1920,5495 3840,2747.5 Z"
|
||||||
|
id="path3" />
|
||||||
|
</clipPath>
|
||||||
|
<clipPath
|
||||||
|
clipPathUnits="userSpaceOnUse"
|
||||||
|
id="clipPath5">
|
||||||
|
<use
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
xlink:href="#g2"
|
||||||
|
id="use5" />
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#000000"
|
||||||
|
borderopacity="0.25"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:zoom="0.66962963"
|
||||||
|
inkscape:cx="1000.5531"
|
||||||
|
inkscape:cy="675"
|
||||||
|
inkscape:window-width="2048"
|
||||||
|
inkscape:window-height="1115"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="g1" />
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
inkscape:label="Image"
|
||||||
|
id="g1">
|
||||||
|
<image
|
||||||
|
width="2000"
|
||||||
|
height="1350"
|
||||||
|
preserveAspectRatio="none"
|
||||||
|
xlink:href="Katsushika%20Hokusai%20-%20The%20Great%20Wave%20off%20Kanagawa.jpg"
|
||||||
|
id="image1"
|
||||||
|
style="display:inline" />
|
||||||
|
<g
|
||||||
|
id="g5"
|
||||||
|
inkscape:label="large diamond"
|
||||||
|
transform="matrix(0.52086102,0,0,0.24566116,-0.05316214,0.04597332)"
|
||||||
|
style="display:inline">
|
||||||
|
<path
|
||||||
|
style="display:inline;fill:none;stroke:#000000;stroke-width:60.4724;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
d="M 1920,0 0,2747.5 1920,5495 3840,2747.5 Z"
|
||||||
|
id="path1"
|
||||||
|
clip-path="none"
|
||||||
|
inkscape:label="black" />
|
||||||
|
<g
|
||||||
|
id="g3"
|
||||||
|
clip-path="url(#clipPath5)"
|
||||||
|
inkscape:label="white"
|
||||||
|
style="display:inline">
|
||||||
|
<g
|
||||||
|
inkscape:label="Clip"
|
||||||
|
id="g2">
|
||||||
|
<path
|
||||||
|
style="display:inline;fill:none;stroke:#ffffff;stroke-width:30.2362;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
d="M 1920,0 0,2747.5 1920,5495 3840,2747.5 Z"
|
||||||
|
id="path4"
|
||||||
|
clip-path="none"
|
||||||
|
inkscape:label="white diamond" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g9"
|
||||||
|
inkscape:label="small diamond"
|
||||||
|
transform="matrix(0.31062245,0,0,0.31062245,3.6225648,2.1883219)"
|
||||||
|
style="display:inline">
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:60.4724;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
id="rect8"
|
||||||
|
width="500"
|
||||||
|
height="500"
|
||||||
|
x="250"
|
||||||
|
y="-250"
|
||||||
|
clip-path="none"
|
||||||
|
transform="rotate(45)" />
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:#ffffff;stroke-width:60.4724;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
|
||||||
|
id="rect5"
|
||||||
|
width="500"
|
||||||
|
height="500"
|
||||||
|
x="318.06506"
|
||||||
|
y="257.89059"
|
||||||
|
clip-path="url(#clipPath6)"
|
||||||
|
transform="rotate(45,647.11071,171.7835)" />
|
||||||
|
</g>
|
||||||
|
<use
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
xlink:href="#g9"
|
||||||
|
id="use9"
|
||||||
|
transform="translate(1776.7342,-2.1240179)" />
|
||||||
|
<use
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
xlink:href="#g9"
|
||||||
|
id="use10"
|
||||||
|
transform="translate(1776.7342,1128.1684)" />
|
||||||
|
<use
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
xlink:href="#g9"
|
||||||
|
id="use11"
|
||||||
|
transform="translate(-3.6225648,1128.1684)"
|
||||||
|
style="display:inline" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 5.8 KiB |
@ -24,18 +24,18 @@
|
|||||||
|
|
||||||
\begin{page}
|
\begin{page}
|
||||||
\begin{frontcover}
|
\begin{frontcover}
|
||||||
\begin{cliptocell}
|
\begin{cliptocell}[0mm \bleed]
|
||||||
\imagecell[fill]{}{DSC00403-2}
|
\imagecell[fill, clearance=-\bleed]{}{landscape}
|
||||||
\end{cliptocell}
|
\end{cliptocell}
|
||||||
\end{frontcover}
|
\end{frontcover}
|
||||||
\begin{backcover}
|
\begin{backcover}
|
||||||
\begin{cliptocell}
|
\begin{cliptocell}[0mm \bleed]
|
||||||
\imagecell[fill]{}{DSC00403-2}
|
\imagecell[fill, clearance=-\bleed]{}{landscape}
|
||||||
\end{cliptocell}
|
\end{cliptocell}
|
||||||
\end{backcover}
|
\end{backcover}
|
||||||
\begin{spine}
|
\begin{spine}
|
||||||
\begin{cliptocell}
|
\begin{cliptocell}[0mm \bleed]
|
||||||
\imagecell[fill]{}{DSC00403-2}
|
\imagecell[fill, clearance=-\bleed]{}{landscape}
|
||||||
\end{cliptocell}
|
\end{cliptocell}
|
||||||
\end{spine}
|
\end{spine}
|
||||||
\begin{frontflap}
|
\begin{frontflap}
|
||||||
|
|||||||
BIN
examples/landscape.png
Normal file
|
After Width: | Height: | Size: 4.3 MiB |
BIN
examples/portrait.png
Normal file
|
After Width: | Height: | Size: 4.8 MiB |
@ -15,7 +15,7 @@
|
|||||||
MAKESPREADS := ../../scripts/make-spreads.sh
|
MAKESPREADS := ../../scripts/make-spreads.sh
|
||||||
|
|
||||||
|
|
||||||
spreads.tex: spreads
|
spreads.tex: spreads $(wildcard spreads/*/*)
|
||||||
$(MAKESPREADS) $< $(SPREAD) > $@
|
$(MAKESPREADS) $< $(SPREAD) > $@
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
|
|||||||
BIN
examples/spread generation/spreads/05-single-image/01-img.png
Normal file
|
After Width: | Height: | Size: 384 KiB |
BIN
examples/spread generation/spreads/06-maual-layout/01-img.png
Normal file
|
After Width: | Height: | Size: 384 KiB |
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
Manual template
|
||||||
|
|
||||||
|
\newpage
|
||||||
|
|
||||||
|
\ImagePage{${CAPTION}}{${IMAGE}}
|
||||||
1
examples/spread generation/templates/fullbleed.tex
Normal file
@ -0,0 +1 @@
|
|||||||
|
\ImageSpreadFill{${CAPTION}}{${IMAGE0}}
|
||||||
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
\setlength\parindent{0pt}
|
\setlength\parindent{0pt}
|
||||||
|
|
||||||
\edef\TestImage{DSC00403-2}
|
\edef\TestImage{landscape}
|
||||||
\edef\TestImageV{DSC00403-2vert}
|
\edef\TestImageV{portrait}
|
||||||
|
|
||||||
\writeimagelistfalse
|
\writeimagelistfalse
|
||||||
|
|
||||||
|
|||||||
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
\setlength\parindent{0pt}
|
\setlength\parindent{0pt}
|
||||||
|
|
||||||
\edef\TestImage{DSC00403-2}
|
\edef\TestImage{landscape}
|
||||||
\edef\TestImageV{DSC00403-2vert}
|
\edef\TestImageV{portrait}
|
||||||
|
|
||||||
\writeimagelistfalse
|
\writeimagelistfalse
|
||||||
|
|
||||||
|
|||||||
44
examples/text-image-spread.tex
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
%----------------------------------------------------------------------
|
||||||
|
|
||||||
|
\documentclass[
|
||||||
|
layoutmode=block,
|
||||||
|
% page size...
|
||||||
|
blockwidth=240mm, blockheight=220mm,
|
||||||
|
bleed=4mm,
|
||||||
|
gutteroffset=5mm,
|
||||||
|
bindingoffset=0mm,
|
||||||
|
% image block configuration...
|
||||||
|
imageblockwidth=0.98, imageblockheight=0.98,
|
||||||
|
imageblockoffsettop=0,
|
||||||
|
% misc...
|
||||||
|
9pt,final,openany
|
||||||
|
]{photobook}
|
||||||
|
|
||||||
|
\usepackage{lipsum}
|
||||||
|
\usepackage{ragged2e}
|
||||||
|
|
||||||
|
|
||||||
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
\edef\TestImage{landscape}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
% force what's next to left page of spread...
|
||||||
|
\cleartoleftpage
|
||||||
|
|
||||||
|
% text...
|
||||||
|
\begin{page}
|
||||||
|
\lipsum[1-3]
|
||||||
|
\end{page}
|
||||||
|
|
||||||
|
% image...
|
||||||
|
\ImagePage{}{\TestImage}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------
|
||||||
|
\end{document} % vim:set ts=4 sw=4 :
|
||||||
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
\setlength\parindent{0pt}
|
\setlength\parindent{0pt}
|
||||||
|
|
||||||
\edef\TestImage{DSC00403-2}
|
\edef\TestImage{landscape}
|
||||||
\edef\TestImageV{DSC00403-2vert}
|
\edef\TestImageV{portrait}
|
||||||
|
|
||||||
\writeimagelistfalse
|
\writeimagelistfalse
|
||||||
|
|
||||||
|
|||||||
630
photobook.cls
@ -4,9 +4,9 @@ Support scripts
|
|||||||
|
|
||||||
<!-- TOC depthfrom:2 -->
|
<!-- TOC depthfrom:2 -->
|
||||||
|
|
||||||
- [make-spreads.sh](#make-imagessh)
|
- [make-spreads.sh](#make-spreadssh)
|
||||||
- [The process](#the-process)
|
- [Theory of operation](#theory-of-operation)
|
||||||
- [Automatic template inferenceing](#automatic-template-inferenceing)
|
- [Automatic template inferencing](#automatic-template-inferencing)
|
||||||
- [Manual template selection](#manual-template-selection)
|
- [Manual template selection](#manual-template-selection)
|
||||||
- [Template tweaking](#template-tweaking)
|
- [Template tweaking](#template-tweaking)
|
||||||
- [Manual spread layouts](#manual-spread-layouts)
|
- [Manual spread layouts](#manual-spread-layouts)
|
||||||
@ -50,7 +50,7 @@ book/
|
|||||||
│ ├── image-image.tex
|
│ ├── image-image.tex
|
||||||
│ ├── fullbleed.tex
|
│ ├── fullbleed.tex
|
||||||
│ └── ...
|
│ └── ...
|
||||||
├── spreads/ . . . . . . . . . . . . . . Main block layout.
|
├── spreads/ . . . . . . . . . . . . . Main block layout.
|
||||||
│ ├── 00/ . . . . . . . . . . . . . . A basic spread.
|
│ ├── 00/ . . . . . . . . . . . . . . A basic spread.
|
||||||
│ │ ├── tweaks.tex The spread template is built
|
│ │ ├── tweaks.tex The spread template is built
|
||||||
│ │ └── 0-DSC02432.jpg automatically with tweaks.tex
|
│ │ └── 0-DSC02432.jpg automatically with tweaks.tex
|
||||||
@ -77,23 +77,22 @@ book/
|
|||||||
├── block.tex . . . . . . . . . . . . . Block skeletal layout.
|
├── block.tex . . . . . . . . . . . . . Block skeletal layout.
|
||||||
│ This usually includes the titles,
|
│ This usually includes the titles,
|
||||||
│ technical pages and sources the
|
│ technical pages and sources the
|
||||||
│ ./block-pages.tex.
|
│ ./block-spreads.tex.
|
||||||
├── block-pages.tex . . . . . . . . . . The generated block content.
|
├── block-spreads.tex . . . . . . . . . The generated block content.
|
||||||
├── cover.tex . . . . . . . . . . . . . Cover layout.
|
├── cover.tex . . . . . . . . . . . . . Cover layout.
|
||||||
├── jacket.tex . . . . . . . . . . . . Dust jacket layout.
|
├── jacket.tex . . . . . . . . . . . . Dust jacket layout.
|
||||||
└── ...
|
└── ...
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- XXX
|
For a full example see: ../examples/book
|
||||||
For a live example see: ../examples/book -->
|
|
||||||
|
|
||||||
Generate the block:
|
Generate the block:
|
||||||
```shell
|
```shell
|
||||||
$ make-spreads.sh ./pages > block-pages.tex
|
$ make-spreads.sh ./spreads > block-spreads.tex
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that `make-spreads.sh` does not force a specific layout outside of
|
Note that `make-spreads.sh` does not force a specific layout outside of
|
||||||
the `pages` directory, all paths are configurable. The way the root
|
the `spreads` directory, all paths are configurable. The way the root
|
||||||
files are structured in this example is just one way to organize a
|
files are structured in this example is just one way to organize a
|
||||||
book's source code with minimal code duplication.
|
book's source code with minimal code duplication.
|
||||||
|
|
||||||
@ -104,7 +103,7 @@ $ make-spreads.sh --help
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### The process
|
### Theory of operation
|
||||||
|
|
||||||
<!-- XXX spreads vs. pages -->
|
<!-- XXX spreads vs. pages -->
|
||||||
|
|
||||||
@ -121,24 +120,24 @@ work is starting to look like a book.
|
|||||||
When starting work on a layout it is good to at least have a basic
|
When starting work on a layout it is good to at least have a basic
|
||||||
understanding of the book's:
|
understanding of the book's:
|
||||||
- structure and how it may change,
|
- structure and how it may change,
|
||||||
- core templates,
|
- general look (i.e. core templates),
|
||||||
- exceptions from the above.
|
- exceptions from the above.
|
||||||
|
|
||||||
In most cases all of the above will change in one way or another during
|
In most cases all of the above will change in one way or another during
|
||||||
the project's lifespan, and the main goal of this stage is to make this
|
the project's lifespan, and the main goal of this stage is to make this
|
||||||
change as simple as possible -- it's all about providing the freedom to
|
change as efgortless as possible -- it's all about providing the freedom
|
||||||
make changes instead of growing work invested and thus making change
|
to make changes instead of growing the work invested and thus making
|
||||||
more and more expensive.
|
change more and more expensive.
|
||||||
|
|
||||||
The first question is what is the _structure_ of the book we are making?
|
The first question is what is the _structure_ of the book we are making?
|
||||||
Will it have chapters? How many? Text? how much, how should it be
|
Will it have chapters? How many? Text? how much, how should it be
|
||||||
structured? How are we going to deal with the title? How are we going
|
placed? How are we going to deal with the title? How are we going
|
||||||
to present the images, full bleed, no bleeds, small, big, one per page
|
to present the images, full bleed, no bleeds, small, big, one per page
|
||||||
or multiple images, ...etc.? At this stage this is about the presentation
|
or multiples, ...etc.? At this stage this is about the presentation,
|
||||||
the flow of the work and not about the actual design. How many typical
|
the flow of the work and not about the actual design. How many typical
|
||||||
spreads (i.e. spread templates) should it have? A good number should be
|
spreads (i.e. spread templates) should it have? A good number should be
|
||||||
small-ish, for example 3-4 spread templates is a good number, if you
|
small-ish, for example 3-4 spread templates is a good number, if you
|
||||||
count 10+ then you might be overcomplicating tings, but note, there are
|
count 10+ then you might be overcomplicating things, but note, there are
|
||||||
no rules, a book where each spread is individually and manually layed out
|
no rules, a book where each spread is individually and manually layed out
|
||||||
may work as well as a book with just a single template spread, but in
|
may work as well as a book with just a single template spread, but in
|
||||||
general for a photo book the focus is on the project and the layout
|
general for a photo book the focus is on the project and the layout
|
||||||
@ -196,7 +195,18 @@ If only one image/text file is provided then `make-spreads.sh` will set it
|
|||||||
on the right page of the spread using the appropriate page template and
|
on the right page of the spread using the appropriate page template and
|
||||||
leave the left page blank.
|
leave the left page blank.
|
||||||
|
|
||||||
<!-- XXX do we need a `blankpage.tex` template??? -->
|
A black page uses `blankpage.tex` template if available, otherwise a
|
||||||
|
trivial blank page is used:
|
||||||
|
```latex
|
||||||
|
\null
|
||||||
|
\newpage
|
||||||
|
```
|
||||||
|
|
||||||
|
<!-- XXX
|
||||||
|
Template search order:
|
||||||
|
- spread directory
|
||||||
|
- template directory
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
#### Manual template selection
|
#### Manual template selection
|
||||||
@ -250,6 +260,8 @@ If `layout.tex` is present it will be included as the page layout/template.
|
|||||||
Any paths in the `layout.tex` should be relative to the location the
|
Any paths in the `layout.tex` should be relative to the location the
|
||||||
built block .tex file will be located, usually to the project root.
|
built block .tex file will be located, usually to the project root.
|
||||||
|
|
||||||
|
Template field substitution is done as for all other templates.
|
||||||
|
|
||||||
|
|
||||||
### Templates
|
### Templates
|
||||||
|
|
||||||
@ -298,7 +310,7 @@ environment variable.
|
|||||||
|
|
||||||
Inline captions are also supported:
|
Inline captions are also supported:
|
||||||
```bnf
|
```bnf
|
||||||
pages/
|
spreads/
|
||||||
├── <spread>/
|
├── <spread>/
|
||||||
│ ├── ...
|
│ ├── ...
|
||||||
│ ├── 00-<image-name>.<ext>
|
│ ├── 00-<image-name>.<ext>
|
||||||
@ -332,6 +344,8 @@ IMAGE_FORMATS=jpeg|jpg|png|pdf|svg|eps
|
|||||||
SPREADS_DIR=spreads/
|
SPREADS_DIR=spreads/
|
||||||
|
|
||||||
# if non-empty link link images to matching ones from this directory...
|
# if non-empty link link images to matching ones from this directory...
|
||||||
|
# NOTE: this is ignored if --graphicx-path is passed or GRAPHICX_PATH
|
||||||
|
# is set.
|
||||||
IMAGE_HIRES_DIR=
|
IMAGE_HIRES_DIR=
|
||||||
|
|
||||||
# directory where external captions are stored...
|
# directory where external captions are stored...
|
||||||
@ -358,6 +372,10 @@ IMAGE_SPREAD=(
|
|||||||
[0]=text-spread
|
[0]=text-spread
|
||||||
[2]=image-image
|
[2]=image-image
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# if set (or --graphicx-path is passed) the images are identified by their
|
||||||
|
# basename so as to let graphicx package resolve the paths internally.
|
||||||
|
GRAPHICX_PATH=1
|
||||||
```
|
```
|
||||||
|
|
||||||
An explicit configuration file can be manually specified:
|
An explicit configuration file can be manually specified:
|
||||||
@ -374,11 +392,19 @@ $ make-spreads.sh -c <path> ..
|
|||||||
Extract the documentation from photobook.cls which is used to build the
|
Extract the documentation from photobook.cls which is used to build the
|
||||||
photobook.pdf reference manual.
|
photobook.pdf reference manual.
|
||||||
|
|
||||||
|
This makes it possible to keep the documentation and code it describes
|
||||||
|
in the same place/file.
|
||||||
|
|
||||||
|
The format is in part inspired by LaTeX's [.dtx](http://tug.ctan.org/info/dtxtut/dtxtut.pdf)
|
||||||
|
format but is far simpler and retains human readability with less effort.
|
||||||
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ cls2tex.sh --help
|
$ cls2tex.sh --help
|
||||||
```
|
```
|
||||||
|
|
||||||
The `--help` says it all:
|
The `--help` says it all:
|
||||||
|
<!-- :r !cl2tex.sh --help -->
|
||||||
```
|
```
|
||||||
Generate docs from latex package/class
|
Generate docs from latex package/class
|
||||||
|
|
||||||
@ -396,8 +422,8 @@ This will:
|
|||||||
- read the INPUT
|
- read the INPUT
|
||||||
- keep lines starting with \def\<module-name>@[A-Z]\+
|
- keep lines starting with \def\<module-name>@[A-Z]\+
|
||||||
- keep lines starting with '%%'
|
- keep lines starting with '%%'
|
||||||
- %%%%% Text -> \subsection(Text)
|
- %%%%% Text -> \subsection{Text}
|
||||||
- %%%% Text -> \section(Text)
|
- %%%% Text -> \section{Text}
|
||||||
- %% >> code -> \begin{verbatim}code\end{verbatim}
|
- %% >> code -> \begin{verbatim}code\end{verbatim}
|
||||||
- write the result to OUTPUT
|
- write the result to OUTPUT
|
||||||
|
|
||||||
@ -424,4 +450,4 @@ NOTE: the idea of keeping latex docs in a latex file is far simpler
|
|||||||
in both the repo and in installed form, so .dtx is not used.
|
in both the repo and in installed form, so .dtx is not used.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<!-- vim:set ts=4 sw=4 nowrap : -->
|
||||||
|
|||||||
@ -26,8 +26,8 @@ printhelp(){
|
|||||||
echo " - read the INPUT"
|
echo " - read the INPUT"
|
||||||
echo " - keep lines starting with \\def\\<module-name>@[A-Z]\\+"
|
echo " - keep lines starting with \\def\\<module-name>@[A-Z]\\+"
|
||||||
echo " - keep lines starting with '%%'"
|
echo " - keep lines starting with '%%'"
|
||||||
echo " - %%%%% Text -> \\subsection(Text)"
|
echo " - %%%%% Text -> \\subsection{Text}"
|
||||||
echo " - %%%% Text -> \\section(Text)"
|
echo " - %%%% Text -> \\section{Text}"
|
||||||
echo " - %% >> code -> \\begin{verbatim}code\\end{verbatim}"
|
echo " - %% >> code -> \\begin{verbatim}code\\end{verbatim}"
|
||||||
echo " - write the result to OUTPUT"
|
echo " - write the result to OUTPUT"
|
||||||
echo
|
echo
|
||||||
@ -54,13 +54,6 @@ printhelp(){
|
|||||||
echo " in both the repo and in installed form, so .dtx is not used."
|
echo " in both the repo and in installed form, so .dtx is not used."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Usage: printerror MESSAGE...
|
|
||||||
printerror(){
|
|
||||||
echo Error: $@
|
|
||||||
echo
|
|
||||||
printusage
|
|
||||||
}
|
|
||||||
|
|
||||||
# Usage: printmsg TEXT
|
# Usage: printmsg TEXT
|
||||||
printmsg(){
|
printmsg(){
|
||||||
# print message...
|
# print message...
|
||||||
@ -88,21 +81,23 @@ while true ; do
|
|||||||
;;
|
;;
|
||||||
-p|--prefix)
|
-p|--prefix)
|
||||||
PREFIX=$2
|
PREFIX=$2
|
||||||
shift
|
shift 2
|
||||||
shift
|
continue
|
||||||
;;
|
;;
|
||||||
-s|--strip)
|
-s|--strip)
|
||||||
STRIP_DOC=1
|
STRIP_DOC=1
|
||||||
shift
|
shift
|
||||||
|
continue
|
||||||
;;
|
;;
|
||||||
-n|--no-msg)
|
-n|--no-msg)
|
||||||
NO_MSG=1
|
NO_MSG=1
|
||||||
shift
|
shift
|
||||||
|
continue
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# handle unknown options...
|
# handle unknown options...
|
||||||
-*|--*)
|
-*|--*)
|
||||||
printerror "unknown option \"$1\""
|
echo "Error: unknown option: \"$1\"" >&2
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -131,7 +126,7 @@ if [ -z $STRIP_DOC ] ; then
|
|||||||
printmsg "Documentation" \
|
printmsg "Documentation" \
|
||||||
> "$OUTPUT"
|
> "$OUTPUT"
|
||||||
cat "$INPUT" \
|
cat "$INPUT" \
|
||||||
| egrep '(^%'$PREFIX'|^\\edef\\'$MODULE'@[A-Z][A-Z]+)' \
|
| grep -E '(^%'$PREFIX'|^\\edef\\'$MODULE'@[A-Z][A-Z]+)' \
|
||||||
| sed \
|
| sed \
|
||||||
-e 's/^\(\\edef\\\)'$MODULE'@/%'$PREFIX'\1/' \
|
-e 's/^\(\\edef\\\)'$MODULE'@/%'$PREFIX'\1/' \
|
||||||
-e 's/%'$PREFIX'%%%% \(.*\)/%'$PREFIX'\\subsubsection{\1}\\label{subsubsec:\1}/' \
|
-e 's/%'$PREFIX'%%%% \(.*\)/%'$PREFIX'\\subsubsection{\1}\\label{subsubsec:\1}/' \
|
||||||
@ -146,8 +141,8 @@ else
|
|||||||
printmsg "Stripped code" \
|
printmsg "Stripped code" \
|
||||||
> "$OUTPUT"
|
> "$OUTPUT"
|
||||||
cat "$INPUT" \
|
cat "$INPUT" \
|
||||||
| egrep -v '%'$PREFIX'' \
|
| grep -Ev '%'$PREFIX'' \
|
||||||
| egrep -v '^(\s*%)?\s*$' \
|
| grep -Ev '^(\s*%)?\s*$' \
|
||||||
>> "$OUTPUT"
|
>> "$OUTPUT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
297
scripts/make-spreads.sh
Normal file → Executable file
@ -1,76 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
shopt -s nullglob extglob
|
shopt -s nullglob extglob
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# TIP: It is better to think of a visual book as a set of spreads
|
# For docs see README.md
|
||||||
# rather than a set of pages, hence the focus on spreads in the
|
#
|
||||||
# code below.
|
|
||||||
# The main unit of a "visual" book is a spread, it's the thing
|
|
||||||
# you see when you hold the book open, and the main workflow
|
|
||||||
# when building a book is creating spreads and ordering them so
|
|
||||||
# a single page is almost never treated as an independent unit.
|
|
||||||
# TIP: it is not recommended to use too many templates, the layout
|
|
||||||
# should be and feel structured and this structure should not be
|
|
||||||
# too complex for the average reader to get comfortable in.
|
|
||||||
#
|
|
||||||
#
|
#
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
#
|
#
|
||||||
# Template structure:
|
# XXX DOC:
|
||||||
# $TEMPLATE_DIR/
|
|
||||||
# spread.tex
|
|
||||||
# imagepage.tex
|
|
||||||
# textpage.tex
|
|
||||||
# ...
|
|
||||||
# $CAPTION_DIR/
|
|
||||||
# <image>.txt
|
|
||||||
# image caption.
|
|
||||||
# this is separated to decouple caption writing from the
|
|
||||||
# changes to the layout/sequencing and this drastically
|
|
||||||
# simplify the work with writers.
|
|
||||||
# For this reason this takes priority over local captions (XXX revise).
|
|
||||||
# ...
|
|
||||||
# $SPREADS_DIR/
|
|
||||||
# $spread/
|
# $spread/
|
||||||
# tweaks.tex
|
# ...
|
||||||
# template tweaks.
|
|
||||||
# loaded before the templates are handled.
|
|
||||||
# layout.tex
|
|
||||||
# manual layout of spread.
|
|
||||||
# if given rest of directory contents are
|
|
||||||
# ignored.
|
|
||||||
# fields:
|
|
||||||
# ${IMAGE0}
|
|
||||||
# replaced with image path
|
|
||||||
# ${CAPTION0}
|
|
||||||
# replaced with content of caption file if found
|
|
||||||
# and empty otherwise.
|
|
||||||
# ${TEXT0}
|
|
||||||
# replaced with the content of a text file if
|
|
||||||
# found and empty otherwise.
|
|
||||||
# ...
|
|
||||||
# NOTE: if images are included, hi-res source
|
|
||||||
# substitution is not done here.
|
|
||||||
# NOTE: fields are ordered and matched according to their
|
|
||||||
# position and not their number, e.g. in the following
|
|
||||||
# sequence:
|
|
||||||
# IMAGE, IMAGE10, IMAGE20, ..,
|
|
||||||
# CAPTION2, CAPTION7, CAPTION12, ..
|
|
||||||
# IMAGE10 will be filled with the second found image
|
|
||||||
# and CAPTION7 will be filled with the second found
|
|
||||||
# caption.
|
|
||||||
# <spread-template-name>.tpl
|
|
||||||
# indicates the spread template to use.
|
|
||||||
# if given the rest of the .tex files in
|
|
||||||
# directory are ignored.
|
|
||||||
# resolves to:
|
|
||||||
# templates/<spread-template-name>.tex
|
|
||||||
# fields:
|
|
||||||
# ${IMAGE0}
|
|
||||||
# ${CAPTION0}
|
|
||||||
# ${TEXT0}
|
|
||||||
# ...
|
|
||||||
# imagepage.tex
|
# imagepage.tex
|
||||||
# image page template.
|
# image page template.
|
||||||
# fields:
|
# fields:
|
||||||
@ -87,46 +27,7 @@ shopt -s nullglob extglob
|
|||||||
# <spread-template-name>-textpage.tpl
|
# <spread-template-name>-textpage.tpl
|
||||||
# indicates the image/text page template to use.
|
# indicates the image/text page template to use.
|
||||||
# ignored if explicit templates are given.
|
# ignored if explicit templates are given.
|
||||||
# fields:
|
|
||||||
# ${IMAGE}
|
|
||||||
# ${CAPTION}
|
|
||||||
# ${TEXT}
|
|
||||||
# ...
|
|
||||||
# 00-<image>.png
|
|
||||||
# image.
|
|
||||||
# if $IMAGE_HIRES_DIR is set then this will
|
|
||||||
# resolve to:
|
|
||||||
# $IMAGE_HIRES_DIR/<image>
|
|
||||||
# supported formats:
|
|
||||||
# .jpeg, .png, .pdf, .svg, .eps
|
|
||||||
# (see $IMAGE_FORMATS)
|
|
||||||
# 00-<image>.txt
|
|
||||||
# local image caption text.
|
|
||||||
# NOTE: this must be named the same as the image.
|
|
||||||
# 01-<text>.txt
|
|
||||||
# text.
|
|
||||||
# ...
|
# ...
|
||||||
# ...
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Env variables:
|
|
||||||
# ANOTATE_IMAGE_PATHS=
|
|
||||||
# TEXT_FORMATS=<ext>|..
|
|
||||||
# IMAGE_FORMATS=<ext>|..
|
|
||||||
# SPREADS_DIR=<path>
|
|
||||||
# IMAGE_HIRES_DIR=<path>
|
|
||||||
# sets the path to which the hi-res images are resolved.
|
|
||||||
# CAPTION_DIR=<path>
|
|
||||||
# TEMPLATE_DIR=<path>
|
|
||||||
# EMPTY_PAGE=<name>
|
|
||||||
# TEXT_PAGE=<name>
|
|
||||||
# IMAGE_PAGE=<name>
|
|
||||||
# IMAGE_SPREAD=<array>
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
#
|
|
||||||
# XXX
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@ -155,9 +56,11 @@ ANOTATE_IMAGE_PATHS=${ANOTATE_IMAGE_PATHS:=}
|
|||||||
# supported formats/extensions...
|
# supported formats/extensions...
|
||||||
TEXT_FORMATS=${TEXT_FORMATS:=$CFG_TEXT_FORMATS}
|
TEXT_FORMATS=${TEXT_FORMATS:=$CFG_TEXT_FORMATS}
|
||||||
TEXT_FORMATS=${TEXT_FORMATS:=txt}
|
TEXT_FORMATS=${TEXT_FORMATS:=txt}
|
||||||
|
TEXT_FORMATS=${TEXT_FORMATS,,}
|
||||||
|
|
||||||
IMAGE_FORMATS=${IMAGE_FORMATS:=$CFG_IMAGE_FORMATS}
|
IMAGE_FORMATS=${IMAGE_FORMATS:=$CFG_IMAGE_FORMATS}
|
||||||
IMAGE_FORMATS=${IMAGE_FORMATS:=jpeg|jpg|png|pdf|svg|eps}
|
IMAGE_FORMATS=${IMAGE_FORMATS:=jpeg|jpg|png|pdf|svg|eps}
|
||||||
|
IMAGE_FORMATS=${IMAGE_FORMATS,,}
|
||||||
|
|
||||||
|
|
||||||
SPREADS_DIR=${SPREADS_DIR:=$CFG_SPREADS_DIR}
|
SPREADS_DIR=${SPREADS_DIR:=$CFG_SPREADS_DIR}
|
||||||
@ -190,7 +93,7 @@ IMAGE_PAGE=${IMAGE_PAGE:=imagepage}
|
|||||||
# NOTE: the index here corresponds to the number of images found in a
|
# NOTE: the index here corresponds to the number of images found in a
|
||||||
# spread directory...
|
# spread directory...
|
||||||
if [ ${#IMAGE_SPREAD[@]} = 0 ] ; then
|
if [ ${#IMAGE_SPREAD[@]} = 0 ] ; then
|
||||||
if ! [ ${#CFG_IMAGE_SPREAD[@]} = 0 ] ; then
|
if [ ${#CFG_IMAGE_SPREAD[@]} != 0 ] ; then
|
||||||
IMAGE_SPREAD=()
|
IMAGE_SPREAD=()
|
||||||
for i in ${!CFG_IMAGE_SPREAD[@]} ; do
|
for i in ${!CFG_IMAGE_SPREAD[@]} ; do
|
||||||
IMAGE_SPREAD[$i]=${CFG_IMAGE_SPREAD[$i]}
|
IMAGE_SPREAD[$i]=${CFG_IMAGE_SPREAD[$i]}
|
||||||
@ -229,6 +132,9 @@ printhelp(){
|
|||||||
echo " - text spread default template (default: ${IMAGE_SPREAD[0]})."
|
echo " - text spread default template (default: ${IMAGE_SPREAD[0]})."
|
||||||
echo " --captions PATH"
|
echo " --captions PATH"
|
||||||
echo " - path to search for captions (default: $CAPTION_DIR)."
|
echo " - path to search for captions (default: $CAPTION_DIR)."
|
||||||
|
echo " --graphicx-path"
|
||||||
|
echo " - reference images by their basenames and let graphicx manage"
|
||||||
|
echo " searching."
|
||||||
echo
|
echo
|
||||||
echo "Parameters:"
|
echo "Parameters:"
|
||||||
echo " PATH - path to root pages directory (default: $SPREADS_DIR)"
|
echo " PATH - path to root pages directory (default: $SPREADS_DIR)"
|
||||||
@ -276,38 +182,50 @@ while true ; do
|
|||||||
-a|--annotate)
|
-a|--annotate)
|
||||||
ANOTATE_IMAGE_PATHS=1
|
ANOTATE_IMAGE_PATHS=1
|
||||||
shift
|
shift
|
||||||
|
continue
|
||||||
;;
|
;;
|
||||||
-c)
|
-c)
|
||||||
$CONFIG="$2"
|
$CONFIG="$2"
|
||||||
[ -e "$CONFIG" ] \
|
[ -e "$CONFIG" ] \
|
||||||
&& source "$CONFIG"
|
&& source "$CONFIG"
|
||||||
shift 2
|
shift 2
|
||||||
|
continue
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--templates)
|
--templates)
|
||||||
TEMPLATE_DIR=$2
|
TEMPLATE_DIR=$2
|
||||||
shift 2
|
shift 2
|
||||||
|
continue
|
||||||
;;
|
;;
|
||||||
--single-image-tpl)
|
--single-image-tpl)
|
||||||
IMAGE_SPREAD[1]=$2
|
IMAGE_SPREAD[1]=$2
|
||||||
shift 2
|
shift 2
|
||||||
|
continue
|
||||||
;;
|
;;
|
||||||
--double-image-tpl)
|
--double-image-tpl)
|
||||||
IMAGE_SPREAD[2]=$2
|
IMAGE_SPREAD[2]=$2
|
||||||
shift 2
|
shift 2
|
||||||
|
continue
|
||||||
;;
|
;;
|
||||||
--text-spread-tpl)
|
--text-spread-tpl)
|
||||||
IMAGE_SPREAD[0]=$2
|
IMAGE_SPREAD[0]=$2
|
||||||
shift 2
|
shift 2
|
||||||
|
continue
|
||||||
;;
|
;;
|
||||||
--captions)
|
--captions)
|
||||||
CAPTION_DIR=$2
|
CAPTION_DIR=$2
|
||||||
shift 2
|
shift 2
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
--graphicx-path)
|
||||||
|
GRAPHICX_PATH=1
|
||||||
|
shift
|
||||||
|
continue
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# handle unknown options...
|
# handle unknown options...
|
||||||
-*|--*)
|
-*|--*)
|
||||||
echo "Error: unknown option \"$1\""
|
echo "Error: unknown option \"$1\"" >&2
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -378,24 +296,44 @@ readCaption(){
|
|||||||
# getTemplate SPREAD TYPE
|
# getTemplate SPREAD TYPE
|
||||||
#
|
#
|
||||||
getTemplate(){
|
getTemplate(){
|
||||||
local SPREAD=$1
|
local spread=$1
|
||||||
local TYPE=$2
|
local name=$2
|
||||||
local TEMPLATE=($SPREAD/*-$TYPE.tex)
|
local template
|
||||||
if [ -z $TEMPLATE ] ; then
|
|
||||||
TEMPLATE=($SPREAD/*-$TYPE.tpl)
|
if [[ $name =~ .*\.tex ]] ; then
|
||||||
if ! [ -z $TEMPLATE ] ; then
|
# already an existing template...
|
||||||
TEMPLATE=${TEMPLATE/$SPREAD\//}
|
if [ -e "$name" ] ; then
|
||||||
TEMPLATE=${TEMPLATE/[0-9]-/}
|
echo $name
|
||||||
TEMPLATE="$TEMPLATE_DIR/${TEMPLATE[0]%-${TYPE}.*}.tex"
|
return
|
||||||
fi
|
fi
|
||||||
|
# normalize...
|
||||||
|
name=${name%.tex}
|
||||||
|
# normalize template name...
|
||||||
|
elif [[ $name =~ .*\.tpl ]] ; then
|
||||||
|
name=$( echo $name \
|
||||||
|
| sed \
|
||||||
|
-e 's/.tpl$//' \
|
||||||
|
-e "s%$spread/%%" \
|
||||||
|
-e 's/^[0-9]\+-//' )
|
||||||
fi
|
fi
|
||||||
if [ -z $TEMPLATE ] ; then
|
|
||||||
TEMPLATE="$TEMPLATE_DIR/${TYPE}.tex"
|
# local template...
|
||||||
|
template=($spread/*-$name.tex)
|
||||||
|
if [ ${#template[@]} != 0 ] ; then
|
||||||
|
template=${template[0]}
|
||||||
|
else
|
||||||
|
template=($spread/$name.tex)
|
||||||
fi
|
fi
|
||||||
if ! [ -e $TEMPLATE ] ; then
|
# global template...
|
||||||
return
|
if [ -z $template ] \
|
||||||
|
|| ! [ -e "$template" ] ; then
|
||||||
|
template="$TEMPLATE_DIR/${name}.tex"
|
||||||
fi
|
fi
|
||||||
echo $TEMPLATE
|
# check if the thing exists...
|
||||||
|
if ! [ -e $template ] ; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
echo $template
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -420,6 +358,12 @@ templateSlots(){
|
|||||||
# usage:
|
# usage:
|
||||||
# populateTemplate SPREAD TEMPLATE ITEMS...
|
# populateTemplate SPREAD TEMPLATE ITEMS...
|
||||||
#
|
#
|
||||||
|
# closure: $populateTemplate_img, $populateTemplate_txt
|
||||||
|
#
|
||||||
|
# NOTE: this is the least hacky/ugly but could not figure out a better
|
||||||
|
# way to update a list from within a function...
|
||||||
|
populateTemplate_img=
|
||||||
|
populateTemplate_txt=
|
||||||
populateTemplate(){
|
populateTemplate(){
|
||||||
local spread="$1"
|
local spread="$1"
|
||||||
local tpl="$2"
|
local tpl="$2"
|
||||||
@ -438,12 +382,22 @@ populateTemplate(){
|
|||||||
local txt=()
|
local txt=()
|
||||||
local elem
|
local elem
|
||||||
for elem in "${items[@]}" ; do
|
for elem in "${items[@]}" ; do
|
||||||
if [[ "$elem" =~ $IMAGE_FORMATS ]] ; then
|
if [[ "${elem,,}" =~ $IMAGE_FORMATS ]] ; then
|
||||||
img+=("$elem")
|
img+=("$elem")
|
||||||
elif [[ "$elem" =~ $TEXT_FORMATS ]] ; then
|
elif [[ "${elem,,}" =~ $TEXT_FORMATS ]] ; then
|
||||||
txt+=("$elem")
|
txt+=("$elem")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
local global_img=
|
||||||
|
if ! [ -z $populateTemplate_img ] ; then
|
||||||
|
global_img=1
|
||||||
|
img=(${populateTemplate_img[@]})
|
||||||
|
fi
|
||||||
|
local global_txt=
|
||||||
|
if ! [ -z $populateTemplate_txt ] ; then
|
||||||
|
global_txt=1
|
||||||
|
txt=(${populateTemplate_txt[@]})
|
||||||
|
fi
|
||||||
|
|
||||||
local var
|
local var
|
||||||
local val
|
local val
|
||||||
@ -459,7 +413,7 @@ populateTemplate(){
|
|||||||
local i=0
|
local i=0
|
||||||
for var in ${slots[@]} ; do
|
for var in ${slots[@]} ; do
|
||||||
name=${var//[0-9]/}
|
name=${var//[0-9]/}
|
||||||
if ! [ ${name} = "IMAGE" ] ; then
|
if [ ${name} != "IMAGE" ] ; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -479,14 +433,17 @@ populateTemplate(){
|
|||||||
i=$(( i + 1 ))
|
i=$(( i + 1 ))
|
||||||
|
|
||||||
val=${val//\//\\/}
|
val=${val//\//\\/}
|
||||||
text=$(echo -e "${text}" | \
|
text=$(echo "${text}" | \
|
||||||
sed "s/\${${var}}/${val%.*}/g")
|
sed "s/\${${var}}/${val%.*}/g")
|
||||||
done
|
done
|
||||||
|
if ! [ -z $global_img ] ; then
|
||||||
|
populateTemplate_img=("${populateTemplate_img[@]:$i}")
|
||||||
|
fi
|
||||||
|
|
||||||
# pass 2: captions...
|
# pass 2: captions...
|
||||||
for var in ${slots[@]} ; do
|
for var in ${slots[@]} ; do
|
||||||
name=${var//[0-9]/}
|
name=${var//[0-9]/}
|
||||||
if ! [ ${name} = "CAPTION" ] ; then
|
if [ ${name} != "CAPTION" ] ; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -502,7 +459,7 @@ populateTemplate(){
|
|||||||
val=$(readCaption "${val}")
|
val=$(readCaption "${val}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
text=$(echo -e "${text}" | \
|
text=$(echo "${text}" | \
|
||||||
sed "s/\${${var}}/${val}/g")
|
sed "s/\${${var}}/${val}/g")
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -523,14 +480,17 @@ populateTemplate(){
|
|||||||
done
|
done
|
||||||
|
|
||||||
val=${val//\//\\/}
|
val=${val//\//\\/}
|
||||||
text=$(echo -e "${text}" | \
|
text=$(echo "${text}" | \
|
||||||
sed "s/\${${var}}/${val}/g")
|
sed "s/\${${var}}/${val}/g")
|
||||||
done
|
done
|
||||||
|
if ! [ -z $global_txt ] ; then
|
||||||
|
populateTemplate_txt=("${txt[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
# print out the filled template...
|
# print out the filled template...
|
||||||
echo % template: $tpl
|
echo % template: $tpl
|
||||||
echo -e "${text}"
|
echo "${text}"
|
||||||
return 0
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -538,7 +498,7 @@ populateTemplate(){
|
|||||||
# usage:
|
# usage:
|
||||||
# handleSpread SPREAD
|
# handleSpread SPREAD
|
||||||
#
|
#
|
||||||
# closure: $IMAGE_HIRES_DIR, $IMAGE_SPREAD
|
# closure: $GRAPHICX_PATH, $IMAGE_HIRES_DIR, $IMAGE_SPREAD
|
||||||
handleSpread(){
|
handleSpread(){
|
||||||
local spread="$1"
|
local spread="$1"
|
||||||
# skip non-spreads...
|
# skip non-spreads...
|
||||||
@ -563,30 +523,41 @@ handleSpread(){
|
|||||||
local txt=()
|
local txt=()
|
||||||
local items=()
|
local items=()
|
||||||
for elem in "$spread"/* ; do
|
for elem in "$spread"/* ; do
|
||||||
if [[ "$elem" =~ $IMAGE_FORMATS ]] ; then
|
if [[ "${elem,,}" =~ $IMAGE_FORMATS ]] ; then
|
||||||
img+=("$elem")
|
img+=("$elem")
|
||||||
items+=("$elem")
|
items+=("$elem")
|
||||||
elif [[ "$elem" =~ $TEXT_FORMATS ]] ; then
|
elif [[ "${elem,,}" =~ $TEXT_FORMATS ]] ; then
|
||||||
txt+=("$elem")
|
txt+=("$elem")
|
||||||
items+=("$elem")
|
items+=("$elem")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# graphicx paths...
|
||||||
|
if ! [ -z $GRAPHICX_PATH ] ; then
|
||||||
|
local C=0
|
||||||
|
for image in "${img[@]}" ; do
|
||||||
|
local new=`basename ${image}`
|
||||||
|
new="${new#+([0-9])-}"
|
||||||
|
img[$C]=$new
|
||||||
|
C=$(( C + 1 ))
|
||||||
|
done
|
||||||
# get hi-res image paths...
|
# get hi-res image paths...
|
||||||
if ! [ -z $IMAGE_HIRES_DIR ] ; then
|
elif ! [ -z $IMAGE_HIRES_DIR ] ; then
|
||||||
local C=0
|
local C=0
|
||||||
for image in "${img[@]}" ; do
|
for image in "${img[@]}" ; do
|
||||||
# skip non-images...
|
# skip non-images...
|
||||||
local new="$IMAGE_HIRES_DIR/`basename ${image/[0-9]-/}`"
|
local new=`basename ${image}`
|
||||||
|
new="$IMAGE_HIRES_DIR/${new#+([0-9])-}"
|
||||||
# ignore file ext for availability test...
|
# ignore file ext for availability test...
|
||||||
# NOTE: the first match may be an unsupported format...
|
# NOTE: the first match may be an unsupported format...
|
||||||
new="${new%.*}"
|
new="${new%.*}"
|
||||||
|
local target=$new
|
||||||
new=($new.*)
|
new=($new.*)
|
||||||
if [ -e "${new[0]}" ] ; then
|
if [ -e "${new[0]}" ] ; then
|
||||||
img[$C]=${new[0]}
|
img[$C]=${new[0]}
|
||||||
else
|
else
|
||||||
echo %
|
echo %
|
||||||
echo "% WARNING: hi-res image not found for: \"${image}\" -> \"${new}\"" \
|
echo "% WARNING: hi-res image not found for: \"${image}\" -> \"${target}\"" \
|
||||||
| tee >(cat >&2)
|
| tee >(cat >&2)
|
||||||
echo %
|
echo %
|
||||||
fi
|
fi
|
||||||
@ -607,7 +578,7 @@ handleSpread(){
|
|||||||
# XXX this will also eat 0-imagepage.tpl / 20-textpage.tpl -- do a better pattern...
|
# XXX this will also eat 0-imagepage.tpl / 20-textpage.tpl -- do a better pattern...
|
||||||
if ! [ -z $template ] ; then
|
if ! [ -z $template ] ; then
|
||||||
template=(`ls "$spread/"*.tpl \
|
template=(`ls "$spread/"*.tpl \
|
||||||
| egrep -v '.*-('${IMAGE_PAGE}'|'${TEXT_PAGE}')\.tpl'`)
|
| grep -E -v '.*-('${IMAGE_PAGE}'|'${TEXT_PAGE}')\.tpl'`)
|
||||||
fi
|
fi
|
||||||
# no template explicitly defined -> match auto-template...
|
# no template explicitly defined -> match auto-template...
|
||||||
if [ -z $layout ] && [ -z $template ] ; then
|
if [ -z $layout ] && [ -z $template ] ; then
|
||||||
@ -635,63 +606,61 @@ handleSpread(){
|
|||||||
cat "${template}"
|
cat "${template}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
populateTemplate_img=("${img[@]}")
|
||||||
|
populateTemplate_txt=("${txt[@]}")
|
||||||
|
|
||||||
for elem in "${items[@]}" ; do
|
for elem in "${items[@]}" ; do
|
||||||
C=$(( C + 1 ))
|
C=$(( C + 1 ))
|
||||||
P=$([ $C == 1 ] \
|
P=$([ $C == 1 ] \
|
||||||
&& echo "left" \
|
&& echo "left" \
|
||||||
|| echo "right")
|
|| echo "right")
|
||||||
|
|
||||||
# XXX need to use populateTemplate here...
|
|
||||||
# ...to do this need to somehow remove the used
|
|
||||||
# slots/files from list...
|
|
||||||
|
|
||||||
# image...
|
# image...
|
||||||
if [[ "$elem" =~ $IMAGE_FORMATS ]] ; then
|
if [[ "${elem,,}" =~ $IMAGE_FORMATS ]] ; then
|
||||||
echo %
|
echo %
|
||||||
echo "% $P page (image)..."
|
echo "% $P page (image)..."
|
||||||
template=`getTemplate "$spread" "$IMAGE_PAGE"`
|
template=`getTemplate "$spread" "$IMAGE_PAGE"`
|
||||||
echo % template: $template
|
populateTemplate "$spread" "$template"
|
||||||
anotatePath "${elem}"
|
|
||||||
local caption=$(getCaption "$spread" "${elem}")
|
|
||||||
caption=$(readCaption "$caption")
|
|
||||||
cat "${template}" \
|
|
||||||
| sed -e "s%\${IMAGE0\?}%${elem%.*}%" \
|
|
||||||
-e "s%\${CAPTION0\?}%${caption}%"
|
|
||||||
# text...
|
# text...
|
||||||
else
|
else
|
||||||
echo %
|
echo %
|
||||||
echo "% $P page (text)..."
|
echo "% $P page (text)..."
|
||||||
template=$(getTemplate "$spread" "$TEXT_PAGE")
|
template=$(getTemplate "$spread" "$TEXT_PAGE")
|
||||||
echo % template: $template
|
populateTemplate "$spread" "$template"
|
||||||
cat "${template}" \
|
|
||||||
| sed "s%\${TEXT}%${elem}%"
|
|
||||||
fi
|
fi
|
||||||
# reset for next page...
|
# reset for next page...
|
||||||
template=
|
template=
|
||||||
# ignore the rest of the items when we are done
|
# ignore the rest of the items when we are done
|
||||||
# creating two pages...
|
# creating two pages...
|
||||||
[ $C == 2 ] \
|
if [ $C == 2 ] ; then
|
||||||
&& return 0
|
populateTemplate_img=
|
||||||
|
populateTemplate_txt=
|
||||||
|
return
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# formatting done...
|
# formatting done...
|
||||||
[ -z $template ] \
|
[ -z $template ] \
|
||||||
&& return 0
|
&& return
|
||||||
|
|
||||||
# format template path...
|
# resolve the template path...
|
||||||
template=${template/$spread\//}
|
local p=$template
|
||||||
template=${template/[0-9]-/}
|
template=$(getTemplate "$spread" "$template")
|
||||||
# get...
|
|
||||||
template="${template[0]%.*}.tex"
|
# not found...
|
||||||
if ! [ -e "$template" ] ; then
|
if [ -z $template ] ; then
|
||||||
template="$TEMPLATE_DIR/${template[0]%.*}.tex"
|
echo "%"
|
||||||
|
echo "% ERROR: could not resolve template: $p" | tee >(cat >&2)
|
||||||
|
echo "%"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
populateTemplate_img=
|
||||||
|
populateTemplate_txt=
|
||||||
populateTemplate "$spread" "$template" "${img[@]}" "${txt[@]}"
|
populateTemplate "$spread" "$template" "${img[@]}" "${txt[@]}"
|
||||||
|
|
||||||
return 0
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
\usepackage{fontspec}
|
\usepackage{fontspec}
|
||||||
\setmainfont[Mapping=tex-text]{Open Sans}
|
\setmainfont[Mapping=tex-text]{Open Sans}
|
||||||
\setsansfont[Mapping=tex-text]{Open Sans}
|
\setsansfont[Mapping=tex-text]{Open Sans}
|
||||||
\setmonofont[Mapping=tex-text, Scale=0.8]{Courier New}
|
%\setmonofont[Mapping=tex-text, Scale=0.8]{Courier New}
|
||||||
\newfontfamily\titlefont[Mapping=tex-text]{Open Sans Light}
|
\newfontfamily\titlefont[Mapping=tex-text]{Open Sans Light}
|
||||||
\newfontfamily\sectiontitlefont[Mapping=tex-text]{Open Sans Light}
|
\newfontfamily\sectiontitlefont[Mapping=tex-text]{Open Sans Light}
|
||||||
|
|
||||||
|
|||||||
@ -42,10 +42,13 @@
|
|||||||
%\fontsize{30pt}{36pt}\selectfont
|
%\fontsize{30pt}{36pt}\selectfont
|
||||||
|
|
||||||
% fonts...
|
% fonts...
|
||||||
|
%\usepackage{ascii}
|
||||||
|
%\usepackage[default,oldstyle,scale=0.95]{opensans}
|
||||||
|
%\usepackage[T1]{fontenc}
|
||||||
\usepackage{fontspec}
|
\usepackage{fontspec}
|
||||||
\setmainfont[Mapping=tex-text]{Open Sans}
|
\setmainfont[Mapping=tex-text]{Open Sans}
|
||||||
\setsansfont[Mapping=tex-text]{Open Sans}
|
\setsansfont[Mapping=tex-text]{Open Sans}
|
||||||
\setmonofont[Mapping=tex-text, Scale=0.8]{Courier New}
|
%\setmonofont[Mapping=tex-text, Scale=0.8]{Courier New}
|
||||||
\newfontfamily\titlefont[Mapping=tex-text]{Open Sans Light}
|
\newfontfamily\titlefont[Mapping=tex-text]{Open Sans Light}
|
||||||
\newfontfamily\sectiontitlefont[Mapping=tex-text]{Open Sans Light}
|
\newfontfamily\sectiontitlefont[Mapping=tex-text]{Open Sans Light}
|
||||||
|
|
||||||
|
|||||||