Compare commits

...

229 Commits
v0.1.8 ... main

Author SHA1 Message Date
53442622b9 now all images are correct + tiny tweak...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2025-09-12 00:03:31 +03:00
9bbd752c63 added public domain images...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2025-09-07 00:35:49 +03:00
ac0acee865 updated action...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2025-07-14 14:34:57 +03:00
3a3e4acc55 cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2025-07-14 11:41:36 +03:00
7bef61cb0f cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2025-07-14 11:15:10 +03:00
942197fdc9 added text-image spread example
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2025-07-14 11:12:36 +03:00
5e210b54eb minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2025-07-06 13:31:34 +03:00
615463cf72 Merge branch 'muzimuzhi-doc-typo' 2024-07-28 11:31:46 +03:00
Yukai Chou
90708b6ca7
Fix typos in doc 2024-07-28 06:53:12 +08:00
1508055cf3 Woraround an Arythmetic overflow in calc's \ratio{..}{..}, see Issues section in docs.
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-07-19 15:51:42 +03:00
9ad5a81054 Updated docs to better reflect the paperwidth/paperheigt within the page geometry...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2024-07-18 13:23:56 +03:00
d92251976b
typo fix... 2023-11-14 22:46:50 +03:00
949cd945b0 cleanup the markdown doc build, still not usable without manual tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-19 21:27:41 +03:00
be6bc7ba4d ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-18 22:54:50 +03:00
db9497cfb4 ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-18 01:08:04 +03:00
2983290550 added link to github releases for docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-18 01:07:01 +03:00
87e8169826 Merge branch 'main' of github.com:flynx/photobook 2023-09-17 17:27:40 +03:00
0e7524a778 leftside and rightside cells' star/non-star versions now follow the general convention of the star version not clipping it's content (POLS).
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-17 17:27:28 +03:00
60a4e8b6ef refactored the readme a bit...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-16 11:15:01 +03:00
ace4cc3e6f added a ref to the dummy book...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-16 11:02:43 +03:00
9579a4cc0b Merge branch 'main' of github.com:flynx/photobook 2023-09-16 10:06:01 +03:00
3d4ec82633 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-16 10:05:49 +03:00
7f2f8b1ff6 fixed typo...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-15 14:40:29 +03:00
deaa409acf Merge branch 'main' of github.com:flynx/photobook 2023-09-14 23:16:32 +03:00
73c3f721e3 minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-14 23:16:22 +03:00
53b4d58227 chmod +x ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-13 22:56:42 +03:00
3a1da05700 tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-13 17:37:43 +03:00
cc06475800 ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-12 18:10:06 +03:00
6ef54c6939 updated docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-11 22:48:44 +03:00
238597543e fixed several stray spaces.
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-11 21:16:25 +03:00
ea10fa1004 cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-11 19:41:48 +03:00
c3896ba7f9 updated docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-11 19:09:25 +03:00
5568a6d6b8 now page templates use paper cells making them more compatible with different layouts + some refactoring.
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-11 18:53:49 +03:00
ca2bb256ac added coloring docs to \GenerateTemplate...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-11 18:33:13 +03:00
74c2c5e4a7 make the cover template a bit more obvious...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-11 18:26:48 +03:00
4a19fc5a98 tests...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-10 11:04:16 +03:00
9ae85d2ea8 testing bleeds in cliptocell env...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-05 17:37:03 +03:00
0a3ef4c170 updated docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-04 21:02:02 +03:00
142ea9b4ce tweaked docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-04 20:57:45 +03:00
b21cc06599 refactored teplate generation + added option to generate paths that graphicx can handle...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-04 20:16:31 +03:00
14c62374ba added web version of book...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-08-30 22:25:49 +03:00
55244f04de typo fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-08-29 10:44:24 +03:00
f71b433366 updated docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-08-25 10:27:08 +03:00
164fdab6a5 added \BookType to make templates usable for non-book media too (fixed).
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-08-24 23:08:28 +03:00
a49fe8265a added \BookType to make templates usable for non-book media too.
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-08-24 23:06:17 +03:00
643a656553 bugfix in scripts...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-06-26 14:49:36 +03:00
36a9c8d380 bugfix: scripts/make-spreads.sh: added extension normalization...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-06-26 14:47:34 +03:00
035861ef77 added .editorconfig
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-06-12 12:35:41 +03:00
7bf8dc9cfd notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-20 11:07:03 +03:00
62434c5cf5 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-17 23:36:02 +03:00
832bc796e3 tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-05 18:41:27 +03:00
93105898cb testing / experimenting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-05 17:21:20 +03:00
8cdf25b17e clearence reworked, mostly, still need testing...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-05 15:27:39 +03:00
485bb4ba07 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-05 14:11:18 +03:00
7f37e7ff8c experimenting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-05 13:59:57 +03:00
0598725a54 experimenting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-05 13:59:24 +03:00
84178cf288 endpaper is behaving in an odd way...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-05 13:54:04 +03:00
e6a8b50a63 experimenting with cells...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-04 18:58:31 +03:00
0a65489501 Merge branch 'main' of github.com:flynx/photobook 2023-05-03 01:27:59 +03:00
2dbee1418f cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-02 23:27:23 +03:00
be9c1f40df notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-05-01 10:00:17 +03:00
83cc0db91f tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-30 02:08:00 +03:00
b44d563684 tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-29 16:32:43 +03:00
748d75a05b tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-29 16:31:32 +03:00
f1fbc82fca refactored the readme...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-29 16:26:35 +03:00
1ca673cf64 Merge branch 'main' of github.com:flynx/photobook 2023-04-28 02:50:35 +03:00
2e659072f3 tweaking Makefile...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-28 02:50:29 +03:00
6ce1032d33 bug in make + termux...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-27 21:01:21 +03:00
561273e27c cleanup + make ergonomics...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-27 01:46:04 +03:00
f094d073b5 Merge branch 'main' of github.com:flynx/photobook 2023-04-27 01:30:34 +03:00
7f0159fb35 added note about dependencies...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-27 01:30:17 +03:00
c670c4ccf8 cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-27 01:27:51 +03:00
79546e3407 added \cliptocellbleeds{..} to set default clipping bleeds for cliptocell env + updated how fold marks are set on jackets
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-27 01:24:24 +03:00
37b5ac92ff Merge branch 'main' of github.com:flynx/photobook 2023-04-27 00:37:44 +03:00
3a4a0b6fd5 cleanup + docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-27 00:37:37 +03:00
9a3e1bd0a1 Merge branch 'main' of github.com:flynx/photobook 2023-04-26 21:00:56 +03:00
0d14bb32e3 added notes about generated doc source...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-26 21:00:31 +03:00
c8645478f5 ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-26 16:53:34 +03:00
fab1a5f394 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-25 22:56:52 +03:00
2034e4fdfe minor refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-24 12:37:13 +03:00
c42d8a4208 now tested cliptocell envs do not affect each other (defaults).
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-23 03:14:01 +03:00
ca432d6546 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-22 22:37:42 +03:00
d57f81a745 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-21 18:05:26 +03:00
c3e4e8f81b notes..
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-20 14:47:27 +03:00
e36f67b085 cleaning up comments and notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-19 21:28:03 +03:00
1ea6c37cfa now clip to cell env supports clipping to bleeds.
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-19 21:20:50 +03:00
e85e579fca extended \cliptocell env to optionaly include bleeds...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-19 21:01:24 +03:00
d39f1d473a experimenting with more flexible \cliptocell{..}...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-19 16:38:03 +03:00
c9a2565297 started on bleed clipping...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-18 12:36:33 +03:00
2aa649c285 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-17 18:04:17 +03:00
02a98a4aa9 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-15 17:38:07 +03:00
4dbeae47c6 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-14 23:50:18 +03:00
32e28dae00 several fixes and some cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-13 11:37:45 +03:00
e2fb80991f notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-12 16:06:46 +03:00
ec4bf1c0a1 typo fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-12 15:57:28 +03:00
1d6652df17 renamed \clearfoldoutbinding to \clearfoldoutgutter
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-11 16:06:20 +03:00
787b33cac6 typo fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-11 15:58:00 +03:00
6fbe06bc49 notes and docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-11 15:39:19 +03:00
b52ba46a79 cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-11 15:21:06 +03:00
3ee4a6211b notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-10 11:53:01 +03:00
1102d91140 started updating examples...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-10 11:42:21 +03:00
e79da757f3 cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-09 18:28:57 +03:00
cb5cc02656 cleanup and notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-09 18:20:11 +03:00
a5a8515410 Reworked \bindingoffset to affect all cells now this has the same semantics as in \geometry{..}; added \gutteroffset to allow to offset non-bleed cells relative to the gutter.
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-09 18:12:54 +03:00
cebf722ac6 ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-08 22:46:45 +03:00
0a11677fab ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-07 23:00:47 +03:00
793f16802c ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-06 18:34:47 +03:00
ec8cd1b9a8 tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-05 17:22:36 +03:00
a72cee9c9c working on more uniform bindingoffset support + gutter offsets...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-05 17:06:18 +03:00
510c00192e ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-04 21:36:47 +03:00
dced601684 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-03 16:00:47 +03:00
55cea76fbd notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-03 15:58:54 +03:00
fb85de1272 Merge branch 'main' of github.com:flynx/photobook 2023-04-03 15:54:56 +03:00
957fb33de2 started work on macros for building screen versions of books...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-03 15:54:40 +03:00
0a87ae4087 experimenting with automatic web version generation...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-02 16:15:03 +03:00
9be9ed3062 docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-04-01 21:19:06 +03:00
2a29e29680 docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-31 20:11:26 +03:00
53b1dcc315 docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-31 19:49:13 +03:00
bde8e38d75 working on docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-31 02:55:09 +03:00
2badf07a0e added book example README (not done yet)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-30 17:19:18 +03:00
cf2b95a1d5 added a full book example...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-29 18:21:06 +03:00
aed58ffe70 cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-28 16:13:23 +03:00
84edb90f7c tweaking docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-27 23:02:30 +03:00
858dbf671c Merge branch 'main' of github.com:flynx/photobook 2023-03-26 14:12:18 +03:00
76c10a3141 ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-26 14:12:09 +03:00
662c674d0a ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-26 05:05:56 +03:00
5c16b2a999 typo fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-26 05:04:15 +03:00
8b151c433f docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-26 01:28:59 +03:00
85d1e5f013 docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-25 11:58:14 +03:00
0390f3adfd notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-24 23:19:22 +03:00
66cb965e98 Merge branch 'main' of github.com:flynx/photobook 2023-03-23 02:32:19 +03:00
fe16543735 notes..
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-23 02:32:13 +03:00
4f6490de4d added dependencies file to all target...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-22 18:57:52 +03:00
b368ffc69d explicitly removing null bytes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-22 01:10:17 +03:00
3f0636619d still tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-22 01:03:12 +03:00
cf9d533ada fixed a slightly broken formatting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-22 00:57:23 +03:00
888a54b176 explicitly cleaning up null bytes that seem to creep up when building on github actions...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-22 00:52:44 +03:00
aab7381159 reverted back scripts/cls2tex.sh -- a really odd bug someplace in the process...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-21 23:32:56 +03:00
2396df1a73 Merge branch 'main' of github.com:flynx/photobook 2023-03-21 21:32:34 +03:00
a9fd39df8d minor corrections...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-21 17:13:21 +03:00
cf619f4893 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-21 15:14:43 +03:00
a1a5b89b0d ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-20 12:50:02 +03:00
55c5844327 egrep -> grep -E ...though I do not understand the motivation behind this change...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-19 01:20:30 +03:00
264d80e4cd now a correct list of dependencies is generated for use with texlive and others (fixed)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-18 21:55:45 +03:00
7357f3a526 now a correct list of dependencies is generated for use with texlive and others
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-18 21:38:31 +03:00
8186a1ae10 tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-18 02:50:16 +03:00
c8f77a8acd added missing files...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-17 19:33:38 +03:00
5308600350 better error checking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-17 19:30:27 +03:00
91932d3137 refactored and cleaned up template search...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-17 18:38:25 +03:00
6845c059fe minor tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-16 22:40:27 +03:00
6ba981e3dd minor fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-16 00:28:15 +03:00
8c78f72263 refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-15 21:51:20 +03:00
78eff5c68d Merge branch 'main' of github.com:flynx/photobook 2023-03-14 03:19:55 +03:00
ab2c0e0a6a cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-14 03:19:43 +03:00
e950e4475f notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 23:11:59 +03:00
8b594fd4e2 minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 20:12:15 +03:00
e82f36717b cleanup and minor tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 16:35:18 +03:00
ba90796b22 one
last

experiemnt...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 15:09:05 +03:00
ea11ad94e3 nother
multiline

test...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 15:00:32 +03:00
488e893b5e testing multiline
comment messages

in actions...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 14:59:16 +03:00
3e8e15448c notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 14:43:21 +03:00
4503271af3 minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 14:40:33 +03:00
98e2fe7c13 several fixes to the build system, now correct versions are both selected and uploaded.
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 14:35:07 +03:00
246d7b2f48 Updated/fixed the build system, not worrect versions are publshed.
This update also contains all the chaniges from v0.1.11.

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 14:20:25 +03:00
c72756c693 added test for uncommited cnages...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 13:31:11 +03:00
3efd35c8fe notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 13:23:18 +03:00
59196d54e6 added \ChangeLayout{<layoutmode>} macro/shorthand.
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-13 02:09:11 +03:00
60f6fe4a72 added config example...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-12 00:52:30 +03:00
566e81fff7 adde -c PATH option to make-spreads.sh...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-12 00:45:46 +03:00
a008cdccf1 Merge branch 'main' of github.com:flynx/photobook 2023-03-12 00:38:16 +03:00
b0cc99b5e2 bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-12 00:38:04 +03:00
a11a580d5f minor tweak...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-11 17:00:36 +03:00
d6b026cd90 fixed env/config overriding...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-11 11:51:25 +03:00
a40e2707c0 now all book parameters can be defined once and the layout changed without the need to redefine things...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-11 04:15:05 +03:00
a370287f88 now make-images.sh is a more logical make-spreads.sh, finally...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-11 02:24:31 +03:00
2093b15021 typo fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-11 01:06:38 +03:00
e7c7bd2b8d added cls2tex --help to docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-11 01:02:38 +03:00
5159d04af3 typo...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-11 00:56:42 +03:00
60eeeb4d00 batter goals...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-11 00:52:11 +03:00
4bcb541df9 found an issue, not sure if it's a bug or a feature yet =)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-11 00:46:58 +03:00
2ccbc7f7d3 minor tweak...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-11 00:43:00 +03:00
98d7e54ca4 make-images.sh readme mostly done...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-11 00:41:00 +03:00
55929b9437 template process and theory...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-10 16:46:34 +03:00
67b4df7cda tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-10 14:19:58 +03:00
8c2bc40ba3 ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-10 14:10:43 +03:00
570aec81b5 tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-10 14:03:10 +03:00
24935c85f8 Merge branch 'main' of github.com:flynx/photobook 2023-03-10 13:30:34 +03:00
c5f5195670 better navigation...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-10 13:30:19 +03:00
bccb619969 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-10 02:13:27 +03:00
52ef3c8cda minor tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-09 16:46:18 +03:00
f0c0b79c45 ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-09 15:26:22 +03:00
a53ab29edf ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-09 15:24:47 +03:00
c464f20ec6 started docs for the included scripts...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-09 15:24:05 +03:00
1dd87ecead minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-09 02:29:00 +03:00
2f90ff9266 better file naming in examples...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-09 02:13:43 +03:00
d601eaa272 bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 20:08:57 +03:00
66318f10eb typo fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 12:07:15 +03:00
362ce6d782 updated docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 05:40:04 +03:00
909074e18e cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 05:35:33 +03:00
da89fffb4e minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 05:27:17 +03:00
2b3456edb5 minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 05:22:52 +03:00
b99a5a8631 tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 05:20:25 +03:00
c86312d422 bugfix + tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 05:12:58 +03:00
ef12c0118d now the env takes priority over the config + notes + docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 04:30:17 +03:00
4834ccbf03 cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 04:06:27 +03:00
e4ded36d47 added disabled spread example...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 04:00:49 +03:00
fd34ebd9b2 better defaults and more stable sorting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 04:00:02 +03:00
2855a9126d now the config is quite a bit more flexible...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 03:30:51 +03:00
99f3b45d8b added "natural" sort order for files. + docs..
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 02:50:04 +03:00
010b3ad4e9 updating docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-08 01:56:38 +03:00
9ccabceb2e make-images.sh mostly done...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-07 23:29:23 +03:00
0b26af3abf fixing bugs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-07 23:00:16 +03:00
feb1395bd0 refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-06 20:40:41 +03:00
ecbfd5e0d1 notes and tips...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-06 13:37:19 +03:00
f5c1c8c968 mostly done with new dynamic teplate generation...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-06 02:08:47 +03:00
c21fb0bbf8 ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-05 22:29:54 +03:00
5d0a593026 better template indexing...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-05 01:50:13 +03:00
7ae71693ec experimenting with dynamic fields in templates...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-04 23:52:52 +03:00
3eac98bb5d notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-03 18:53:19 +03:00
7b9d8c3063 notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-03 18:48:10 +03:00
659cba9d67 docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-03 18:41:49 +03:00
a528bb254e fixed typo...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-03 04:15:12 +03:00
216fbc48ac bugfixes and cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-03 00:53:15 +03:00
09ed8b60b6 tweaks
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-02 19:31:22 +03:00
3bb6e6f61c minor tweak...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-02 17:47:54 +03:00
9b51e88fe5 custom spread example now works...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-02 17:46:11 +03:00
b0f8b06753 added a custom spread example (has a bug)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-02 03:06:37 +03:00
363a44261c added custom jacket example...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-02 02:33:02 +03:00
fbf4a951d8 added an English version of the slides...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-01 23:26:09 +03:00
82 changed files with 3814 additions and 721 deletions

7
.editorconfig Normal file
View File

@ -0,0 +1,7 @@
root = true
[**]
indent_style = tab
tab_width = 4
charset = utf-8
end_of_line = lf

View File

@ -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 }}

View File

@ -43,8 +43,6 @@
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# Config... # Config...
.EXPORT_ALL_VARIABLES:
# 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
@ -58,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))
@ -86,8 +85,7 @@ endif
# markdown dialect... # markdown dialect...
# #
# XXX still needs some tweaking... MD_FORMAT ?= gfm
MD_FORMAT ?= markdown_github
# debug output... # debug output...
@ -123,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 = \
@ -173,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...
@ -223,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 \
@ -239,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...
@ -248,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
@ -287,18 +298,35 @@ ctan-dist: dist
cp -f $(DIST_DIR)/$(DIST_NAME).zip $(DIST_DIR)/$(MODULE).zip cp -f $(DIST_DIR)/$(DIST_NAME).zip $(DIST_DIR)/$(MODULE).zip
.PHONY: tag .PHONY: tag
tag: tag:
@echo "Will create and publish git tag:" @echo "Will create and publish git 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
@echo "Note that this must be done after a commit." # # check if we need to bug the user about committing and/or pushing stuff...
@read -p "(press any key to continue or ctrl-c to cancel)" @\
UNCOMITTED=$$(git status --porcelain=v1 2> /dev/null | grep -v '??' | wc -l) ;\
UNPUSHED=$$(git log origin..HEAD | wc -l) ;\
if ! [ $$UNCOMITTED = 0 ] ; then \
echo ;\
echo "WARNING: Uncommited changes found!" ;\
fi ;\
if ! [ $$UNPUSHED = 0 ] ; then \
[ $$UNCOMITTED = 0 ] \
&& echo ;\
echo "WARNING: Unpushed commits found!" ;\
fi ;\
if ! [ $$UNCOMITTED = 0 ] || ! [ $$UNPUSHED = 0 ] ; then \
echo ;\
echo "Note that this must be done after a commit and a push." ;\
echo "(press any key to continue or ctrl-c to cancel)" ;\
read ;\
fi ;\
git tag "v$(VERSION)" git tag "v$(VERSION)"
git push origin "v$(VERSION)" git push origin "v$(VERSION)"
@ -308,7 +336,7 @@ tag:
.PHONY: all .PHONY: all
all: pdf all: pdf dep
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -390,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

View File

@ -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 : -->

View File

@ -6,6 +6,11 @@
blockwidth=240mm, blockheight=220mm, blockwidth=240mm, blockheight=220mm,
bleed=4mm, bleed=4mm,
bindingoffset=5mm, bindingoffset=5mm,
spinewidth=15mm,
coverboardgrow=3mm,
spinefold=5mm,
spinefold=5mm,
coverflap=17mm,
% image block configuration... % image block configuration...
imageblockwidth=0.98, imageblockheight=0.98, imageblockwidth=0.98, imageblockheight=0.98,
imageblockoffsettop=-0.1, imageblockoffsettop=-0.1,
@ -18,15 +23,7 @@
% %
% This can be usefull when having a single setup file for multiple book % This can be usefull when having a single setup file for multiple book
% elemnts like page blocks, covers, endpapers and dust jackets... % elemnts like page blocks, covers, endpapers and dust jackets...
\def\layoutmode{cover} \ChangeLayout{cover}
\setlength\spinewidth{15mm}
\setlength\coverboardgrow{3mm}
\setlength\spinefold{5mm}
\setlength\spinefold{5mm}
\setlength\coverflap{17mm}
\ReInitPages
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

151
examples/book/Makefile Normal file
View 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
View 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
View 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
View File

@ -0,0 +1,17 @@
%----------------------------------------------------------------------
\input{setup}
\ChangeLayout{cover}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\begin{document}
\GenerateTemplate
\end{document}
%----------------------------------------------------------------------
% vim:set ts=4 sw=4 :

View 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
View 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
View 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 :

View File

@ -0,0 +1 @@
page text

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

View File

@ -0,0 +1 @@
caption text

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

View File

@ -0,0 +1,2 @@
\cleardoublepage
\ImagePage{${CAPTION0}}{${IMAGE0}}

View File

@ -0,0 +1 @@
\ImageSpreadFill{${CAPTION}}{${IMAGE0}}

View File

@ -0,0 +1,2 @@
\ImagePage{${CAPTION0}}{${IMAGE0}}
\emptypage

View File

@ -0,0 +1,2 @@
\ImagePage{${CAPTION0}}{${IMAGE0}}
\ImagePage{${CAPTION1}}{${IMAGE1}}

View File

@ -0,0 +1 @@
\ImagePage{${CAPTION}}{${IMAGE}}

View File

@ -0,0 +1,4 @@
\parbox{\textwidth}{%
\setlength{\parskip}{1em}
\input{${TEXT}} }
\newpage

28
examples/book/web.tex Normal file
View 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 :

View 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 :

View 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 :

View File

@ -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}

View File

@ -0,0 +1,58 @@
%----------------------------------------------------------------------
\documentclass[
layoutmode=block,
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}
\usepackage{lipsum}
\begin{document} %-----------------------------------------------------
\cleartoleftpage
% NOTE: this is just a trivial example, we are not formatting the text
% block here in any way nor are we pedantic about lengths...
\newlength\textblockmargin
\setlength\textblockmargin{2mm}
% text at left...
\begin{spreadtopages}%
\begin{inlinecell}{0.25\cellwidth}{\cellheight}%
\lipsum
\end{inlinecell}%
\hspace{\textblockmargin}%
\begin{inlinecell}{0.75\cellwidth - \textblockmargin + \bleed}{\cellheight}%
\imagecell[fill]{}{landscape}%
\end{inlinecell}
\end{spreadtopages}
% text at right...
\begin{spreadtopages}%
\hspace{-\bleed}%
\begin{inlinecell}{0.75\cellwidth - \textblockmargin + \bleed}{\cellheight}%
\imagecell[fill]{}{landscape}%
\end{inlinecell}%
\hspace{\textblockmargin}%
\begin{inlinecell}{0.25\cellwidth}{\cellheight}%
\lipsum
\end{inlinecell}
\end{spreadtopages}
\end{document} %-------------------------------------------------------
% vim:set ts=4 sw=4 :

View File

@ -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]{

View 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 :

View File

@ -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 :

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 KiB

View File

@ -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

View File

@ -0,0 +1,31 @@
%----------------------------------------------------------------------
\documentclass[
layoutmode=jacket,
spinewidth=20mm,
spinefold=7mm,
coverboardgrow=3mm,
jacketflap=50mm,
jacketwrap=1mm,
% 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 :

View File

@ -22,7 +22,29 @@
\begin{document} \begin{document}
\GenerateTemplate \begin{page}
\begin{frontcover}
\begin{cliptocell}[0mm \bleed]
\imagecell[fill, clearance=-\bleed]{}{landscape}
\end{cliptocell}
\end{frontcover}
\begin{backcover}
\begin{cliptocell}[0mm \bleed]
\imagecell[fill, clearance=-\bleed]{}{landscape}
\end{cliptocell}
\end{backcover}
\begin{spine}
\begin{cliptocell}[0mm \bleed]
\imagecell[fill, clearance=-\bleed]{}{landscape}
\end{cliptocell}
\end{spine}
\begin{frontflap}
Some text
\end{frontflap}
\begin{backflap}
Some text
\end{backflap}
\end{page}
\end{document} \end{document}

BIN
examples/landscape.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

BIN
examples/portrait.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 MiB

View File

@ -8,14 +8,14 @@
# $ SPREAD=1 make # $ SPREAD=1 make
# #
# For more info use: # For more info use:
# make-images.sh --help # make-spreads.sh --help
# #
# #
MAKESPREADS := ../../scripts/make-images.sh MAKESPREADS := ../../scripts/make-spreads.sh
spreads.tex: spreads spreads.tex: spreads $(wildcard spreads/*/*)
$(MAKESPREADS) $< $(SPREAD) > $@ $(MAKESPREADS) $< $(SPREAD) > $@
dist: dist:

View File

@ -0,0 +1 @@
Some text

View File

@ -0,0 +1 @@
Some text

View File

@ -0,0 +1 @@
page text

View File

Before

Width:  |  Height:  |  Size: 384 KiB

After

Width:  |  Height:  |  Size: 384 KiB

View File

@ -0,0 +1 @@
Some text

View File

Before

Width:  |  Height:  |  Size: 384 KiB

After

Width:  |  Height:  |  Size: 384 KiB

View File

Before

Width:  |  Height:  |  Size: 384 KiB

After

Width:  |  Height:  |  Size: 384 KiB

View File

@ -0,0 +1 @@
caption text

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

View File

@ -0,0 +1,6 @@
Manual template
\newpage
\ImagePage{${CAPTION}}{${IMAGE}}

View File

@ -0,0 +1 @@
\ImageSpreadFill{${CAPTION}}{${IMAGE0}}

View File

@ -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

View File

@ -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

View 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 :

View File

@ -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

File diff suppressed because it is too large Load Diff

453
scripts/README.md Normal file
View File

@ -0,0 +1,453 @@
Support scripts
===============
<!-- TOC depthfrom:2 -->
- [make-spreads.sh](#make-spreadssh)
- [Theory of operation](#theory-of-operation)
- [Automatic template inferencing](#automatic-template-inferencing)
- [Manual template selection](#manual-template-selection)
- [Template tweaking](#template-tweaking)
- [Manual spread layouts](#manual-spread-layouts)
- [Templates](#templates)
- [Image captions](#image-captions)
- [Environment variables and configuration](#environment-variables-and-configuration)
- [cls2tex.sh](#cls2texsh)
<!-- /TOC -->
---
`make-spreads.sh`
----------------
Generate LaTeX block of pages/spreads from a directory tree.
This was initially intended as a means to convert the exported directory
tree from an image viewer where image/text sequencing was done, but it
can also be used standalone.
Goals:
- Decouple layout, sequencing, images, processing and different texts
to enable different people to work on them independently and in
parallel,
- Simplify editing the page/spread sequence,
- Automate the build process.
A typical project tree:
```
book/
├── templates/ . . . . . . . . . . . . Global templates.
│ ├── imagepage.tex . . . . . . . . . Single page image template,
│ ├── textpage.tex . . . . . . . . . Single page text template,
│   │ These are used to build spreads
│   │ when no explicit template matches.
│ ├── blank-image.tex
│ ├── image-blank.tex
│ ├── image-image.tex
│ ├── fullbleed.tex
│ └── ...
├── spreads/ . . . . . . . . . . . . . Main block layout.
│   ├── 00/ . . . . . . . . . . . . . . A basic spread.
│   │   ├── tweaks.tex The spread template is built
│   │   └── 0-DSC02432.jpg automatically with tweaks.tex
│   │   prepended.
│   ├── 01/
│   │   ├── 0-DSC02439.jpg
│   │   └── 1-intro.txt
│   ├── 02/
│   │   ├── fullbleed.tpl . . . . . . . Explicitly use a global template.
│   │   └── 1-DSC02511.jpg
│   ├── 03/
│   │   ├── 0-DSC02509-0.jpg
│   │   └── 1-DSC02506-0.jpg
│   └── ...
├── captions/ . . . . . . . . . . . . . Image captions.
│   ├── DSC02432.txt
│   ├── DSC02439.txt
│   ├── DSC02511.txt
│   └── ...
├── setup.tex . . . . . . . . . . . . . Book block setup.
│ This is included by all top level
│ .tex files like block.tex,
│ cover.tex, ...etc.
├── block.tex . . . . . . . . . . . . . Block skeletal layout.
│ This usually includes the titles,
│ technical pages and sources the
│ ./block-spreads.tex.
├── block-spreads.tex . . . . . . . . . The generated block content.
├── cover.tex . . . . . . . . . . . . . Cover layout.
├── jacket.tex . . . . . . . . . . . . Dust jacket layout.
└── ...
```
For a full example see: ../examples/book
Generate the block:
```shell
$ make-spreads.sh ./spreads > block-spreads.tex
```
Note that `make-spreads.sh` does not force a specific layout outside of
the `spreads` directory, all paths are configurable. The way the root
files are structured in this example is just one way to organize a
book's source code with minimal code duplication.
For runtime help see:
```shell
$ make-spreads.sh --help
```
### Theory of operation
<!-- XXX spreads vs. pages -->
The system is designed to minimize the effort in laying out pages, so
when designing a book the focus should be on global templates and on
helping `make-spreads.sh` build them rather than trying to layout each
spread individually.
There are several ways to arrive at a book layout starting from the
concept, through the edit, sequencing, structuring and the graphic
design, we here will focus on the stage of the process where a body of
work is starting to look like a book.
When starting work on a layout it is good to at least have a basic
understanding of the book's:
- structure and how it may change,
- general look (i.e. core templates),
- exceptions from the above.
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
change as efgortless as possible -- it's all about providing the freedom
to make changes instead of growing the work invested and thus making
change more and more expensive.
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
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
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
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
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
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
should work with it without overwhelming it.
Have answers, good, now it's time to build those mock layouts and make
them into basic templates.
It would be simplest to start work with the basic templates provided by
`photobook` (see: ../examples/spread templates/templates/) and rework
them when or if needed.
The templates are split into two levels:
- Page templates
These are typical pages that makeup a spread, usually an
image page (`imagepage.tex`), a text page (`textpage.tex`), and an
optional empty page (`emptypage.tex`), `make-spreads.sh` can combine
them to build spreads automatically.
- Spread templates
These typeset a spread and can be either automatically inferred from
the structure or manually selected.
#### Automatic template inferencing
If no explicit template is defined (see next section) `make-spreads.sh`
will try and infer a template based on the number of images in the
spread directory, if that is not possible the it will build a spread
from page templates based on the sequence of first two image/text files.
For example with the default settings and the templates defined above:
```
├── 01/
│   ├── 0-DSC02439.jpg
│   └── 1-intro.txt
```
Will use `imagepage.tex` and `textpage.tex` templates to build the spread,
while the following:
```
├── 03/
│   ├── 0-DSC02509-0.jpg
│   └── 1-DSC02506-0.jpg
```
Will use `image-image.tex`.
Note that if a spread template is not found `make-spreads.sh` fallback to
page templates, e.g. if we delete `image-image.tex` then `imagepage.tex`
will be used for both pages of the spread instead.
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
leave the left page blank.
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
A template can be selected manually by providing a file in the form:
```bnf
<template-name>.tpl
```
The content of this file is ignored and `templates/<template-name>.tex`
will be used for that spread.
Example:
```
├── 02/
│   ├── fullbleed.tpl
│   └── 1-DSC02511.jpg
```
Here `templates/fullbleed.tex` will be used.
#### Template tweaking
If the file `tweaks.tex` is present in the spread directory its contents
are included in the built block at the start of that spread.
This can be useful to _tweak_ the spread, for example to set page/font
color, tweak image positioning in some of the `photobook`'s template
spread macros (see: tweaking section in photobook.pdf).
Example:
```
├── 00/
│   ├── tweaks.tex
│   └── 0-DSC02432.jpg
```
Note that this can both apply to a single spread as well as a set of
spreads, of example page or text colors are not reset automatically
and will affect all subsequent spreads until manually reset (in a
different spread's `tweaks.tex` file), while `photobook`'s tweaks apply
only to a single page.
#### Manual spread layouts
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
built block .tex file will be located, usually to the project root.
Template field substitution is done as for all other templates.
### Templates
A template is a LaTeX file with zero or more special fields defined.
Field types:
- `${IMAGE}` / `${IMAGE<number>}`
Filled with image path.
- `${CAPTION}` / `${CAPTION<number>}`
Filled with caption file content
- `${TEXT}` / `${TEXT<number>}`
Filled with text file content
Each field can be used more than once, the field value will be copied to
each instance.
Multiple fields of the same type can be provided and each will be filled
with corresponding data in order, e.g. the third image filed will get
the third image path. Note that we are talking of field order and not
field number, this removes the need to constantly keep the field/file
numbers matched when adding and removing files/fields, all one needs to
do is keep the order the same.
If a field is not filled it will be empty in the resulting `.tex`.
Example template `templates/fullbleed.tex`:
```
\ImageSpreadFill{${CAPTION}}{${IMAGE0}}
```
### Image captions
In general image captions are decoupled from the main layout to enable
writers and editors to work on them externally.
```bnf
captions/
├── <image-name>.txt
└── ...
```
The captions folder name/location is controlled by the `$CAPTION_DIR`
environment variable.
Inline captions are also supported:
```bnf
spreads/
├── <spread>/
│   ├── ...
│   ├── 00-<image-name>.<ext>
│   ├── 00-<image-name>.txt . . . . . . Local image caption
│   └── ...
└── ...
```
An inline caption must have the same filename as the corresponding image
but with a .txt extension.
### Environment variables and configuration
All the configuration options can be given in a configuration file as
well as environment variables.
Environment variables take precedence over the configuration file.
The default `make-images.cfg` would look something like:
```shell
# if non-empty make-spreads.sh will add image paths to pdf notes...
ANOTATE_IMAGE_PATHS=
# file extensions to treat as text (separated with "|")
TEXT_FORMATS=txt
# file extensions to treat as images (separated with "|")
IMAGE_FORMATS=jpeg|jpg|png|pdf|svg|eps
# default directory spread definitions are located in...
SPREADS_DIR=spreads/
# 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=
# directory where external captions are stored...
CAPTION_DIR=captions/
# root template directory...
TEMPLATE_DIR=templates/
# empty page template...
EMPTY_PAGE=emptypage
# text page template...
TEXT_PAGE=textpage
# image page template...
IMAGE_PAGE=imagepage
# spread templates...
IMAGE_SPREAD=(
#
# +------- number of found images
# / +-- template name
# / /
[0]=text-spread
[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:
```shell
$ make-spreads.sh -c <path> ..
```
---
`cls2tex.sh`
------------
Extract the documentation from photobook.cls which is used to build the
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
$ cls2tex.sh --help
```
The `--help` says it all:
<!-- :r !cl2tex.sh --help -->
```
Generate docs from latex package/class
Usage:
cls2tex.sh [OPTIONS] [[INPUT] OUTPUT]
Options:
-h | --help Show this message and exit
-p | --prefix PREFIX
Set the doc comment PREFIX (default: "%")
-s | --strip Strip docs out
-n | --no-msg Don't add the "generated with" message to output
This will:
- read the INPUT
- keep lines starting with \def\<module-name>@[A-Z]\+
- keep lines starting with '%%'
- %%%%% Text -> \subsection{Text}
- %%%% Text -> \section{Text}
- %% >> code -> \begin{verbatim}code\end{verbatim}
- write the result to OUTPUT
If no OUTPUT is given cls2tex.sh will write to stdout. If no INPUT
is given cls2tex.sh will read stdin.
PREFIX can replace the second "%" in the above patterns to make it
possible to integrate multiple layers of documentation in one file
and to integrate them in various ways, for example, in the photobook
document class documentation "M" prefix is used to indicate
meta-command docs, this enables us to document them in the relevant
location (i.e. at the implementation) in source but move the docs to
a unified location in docs, effectively decoupling the source and doc
structure when needed.
Strip mode is the reverse of of the default, it will strip out docs
and empty lines, keeping only the actual code and code comments.
NOTE: stripping will not remove non-doc comments.
NOTE: the idea of keeping latex docs in a latex file is far simpler
than all the stuff crammed into .dtx, at least for my needs:
- keep the code readable
- keep the docs readable
in both the repo and in installed form, so .dtx is not used.
```
<!-- vim:set ts=4 sw=4 nowrap : -->

View File

@ -26,12 +26,12 @@ 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
echo "If no OUTPUT is given $SCRIPT_NAME will read stdout. If no INPUT" echo "If no OUTPUT is given $SCRIPT_NAME will write to stdout. If no INPUT"
echo "is given $SCRIPT_NAME will read stdin." echo "is given $SCRIPT_NAME will read stdin."
echo echo
echo "PREFIX can replace the second \"%\" in the above patterns to make it" echo "PREFIX can replace the second \"%\" in the above patterns to make it"
@ -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,12 +126,13 @@ 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 's/^\(\\edef\\\)'$MODULE'@/%'$PREFIX'\1/' \ | sed \
| sed 's/%'$PREFIX'%%%% \(.*\)/%'$PREFIX'\\subsubsection{\1}\\label{subsubsec:\1}/' \ -e 's/^\(\\edef\\\)'$MODULE'@/%'$PREFIX'\1/' \
| sed 's/%'$PREFIX'%%% \(.*\)/%'$PREFIX'\\subsection{\1}\\label{subsec:\1}/' \ -e 's/%'$PREFIX'%%%% \(.*\)/%'$PREFIX'\\subsubsection{\1}\\label{subsubsec:\1}/' \
| sed 's/%'$PREFIX'%% \(.*\)/%'$PREFIX'\\section{\1}\\label{sec:\1}/' \ -e 's/%'$PREFIX'%%% \(.*\)/%'$PREFIX'\\subsection{\1}\\label{subsec:\1}/' \
| sed 's/%'$PREFIX'\s\+>>\s\+\(.*\)/%'$PREFIX'\\begin{verbatim} \1 \\end{verbatim}/' \ -e 's/%'$PREFIX'%% \(.*\)/%'$PREFIX'\\section{\1}\\label{sec:\1}/' \
-e 's/%'$PREFIX'\s\+>>\s\+\(.*\)/%'$PREFIX'\\begin{verbatim} \1 \\end{verbatim}/' \
| cut -c 3- - \ | cut -c 3- - \
>> "$OUTPUT" >> "$OUTPUT"
@ -145,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

View File

@ -1,449 +0,0 @@
#!/bin/bash
shopt -s nullglob extglob
#----------------------------------------------------------------------
#
# Template structure:
# templates/
# imagepage.tex
# textpage.tex
# ...
# $IMAGE_DIR/
# $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}
# ${CAPTION0}
# ${IMAGE1}
# ${CAPTION1}
# NOTE: if images are included, hi-res source
# substitution is not done here.
# <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}
# ${IMAGE1}
# ${CAPTION1}
# imagepage.tex
# image page template.
# fields:
# ${IMAGE}
# ${CAPTION}
# textpage.tex
# text page template.
# fields:
# ${TEXT}
# <spread-template-name>-imagepage.tpl
# <spread-template-name>-textpage.tpl
# indicates the image/text page template to use.
# ignored if explicit templates are given.
# image fields:
# ${IMAGE}
# ${CAPTION}
# text fields:
# ${TEXT}
# 00-<image>.png
# image.
# if $IMAGE_HIRES_DIR is set then this will
# resolve to:
# $IMAGE_HIRES_DIR/<image>
# XXX hi-res substitution currently disabled.
# 01-<text>.txt
# text.
# ...
# ...
#
#
#
# Env variables:
# IMAGE_HIRES_DIR=<path>
# sets the path to which the hi-res images are resolved.
#
#
#
#
# XXX TODO:
# - revise printed comments...
# - add real arg handling...
# - add abbility to apply template to a specific page in spread...
# ...something like:
# <template-name>-left.tpl
# <template-name>-right.tpl
#
#
#
#----------------------------------------------------------------------
# defaults...
CFG_FILE=`basename $0`.cfg
TEMPLATE_PATH=templates/
IMAGE_DIR=pages/
#IMAGE_HIRES_DIR=
# Default timplates
#SINGLE_IMAGE=blank-image
SINGLE_IMAGE=imagebleedleft
DOUBLE_IMAGE=image-image
# load config...
[ -e $CFG_FILE ] && source $CFG_FILE
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
printhelp(){
echo "Usage: `basename $0` [ARGUMENTS] [PATH]"
echo " `basename $0` [ARGUMENTS] PATH FROM [COUNT]"
echo
echo "Generate LaTeX layout from directory structure."
echo
echo "Arguments:"
echo " -h --help - print this help and exit."
echo " --templates=PATH"
echo " - path to search for templates (default: $TEMPLATE_PATH)."
echo " --single-image-tpl=NAME"
echo " - single image default template (default: $SINGLE_IMAGE)."
echo " --double-image-tpl=NAME"
echo " - double image default template (default: $DOUBLE_IMAGE)."
echo
echo "Parameters:"
echo " PATH - path to root pages directory (default: $IMAGE_DIR)"
echo " FROM - spread to start from (default: 0)"
echo " COUNT - number of spreads to generate (default: 1)"
echo
echo "Environment:"
echo " \$IMAGE_HIRES_DIR "
echo " - source directory for replacement hi-res images."
echo " \$ANOTATE_IMAGE_PATHS "
echo " - if true add image paths in anotations."
echo
echo "Configuration defaults can be stored in a config file: $CFG_FILE"
echo
echo "NOTE: COUNT is relevant iff FROM is given, otherwise all available "
echo " spreads are generated."
echo
echo "Examples:"
echo " $ `basename $0` ./pages > pages.tex"
echo " - generate a layout fron the contents of ./pages"
echo
echo " $ IMAGE_HIRES_DIR=images/hi-res `basename $0` ./pages"
echo " - generate a layout fron the contents of ./pages and "
echo " replaceing local images with images in ./images/hi-res"
echo
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# handle arguments...
while true ; do
case $1 in
-h|--help)
printhelp
exit
;;
--templates)
TEMPLATE_PATH=$2
shift
shift
;;
--single-image-tpl)
SINGLE_IMAGE=$2
shift
shift
;;
--double-image-tpl)
DOUBLE_IMAGE=$2
shift
shift
;;
# handle unknown options...
-*|--*)
echo "Error: unknown option \"$1\""
exit
;;
*)
break
;;
esac
done
if [ -z $1 ] ; then
IMAGE_DIR=pages/
else
IMAGE_DIR=$1/
fi
# calculate spread index range...
# XXX add support for negative indexing...
FROM=$2
COUNT=$( [ -z $3 ] && echo 1 || echo $3 )
STOP=$(( FROM + COUNT ))
#----------------------------------------------------------------------
# XXX should we report images w/o captions???
getCaption(){
local C=`basename "${1%.*}"`
#C="${C/[0-9]-}"
C="captions/${C}.txt"
if [ -e "${C}" ] ; then
C=`cat "${C}" | sed 's/\\\/\\\\\\\/g'`
else
C=""
fi
echo ${C[*]}
}
getTemplate(){
local SPREAD=$1
local TYPE=$2
local TEMPLATE=($SPREAD/*-$TYPE.tex)
if [ -z $TEMPLATE ] ; then
TEMPLATE=($SPREAD/*-$TYPE.tpl)
if ! [ -z $TEMPLATE ] ; then
TEMPLATE=${TEMPLATE/$SPREAD\//}
TEMPLATE=${TEMPLATE/[0-9]-/}
TEMPLATE="$TEMPLATE_PATH/${TEMPLATE[0]%-${TYPE}.*}.tex"
fi
fi
if [ -z $TEMPLATE ] ; then
TEMPLATE="$TEMPLATE_PATH/${TYPE}.tex"
fi
echo $TEMPLATE
}
anotatePath(){
if [ -z "$1" ] || [ -z "$ANOTATE_IMAGE_PATHS" ] ; then
return
fi
path=$(basename ${1%.*})
# NOTE: did not figure out how to make a verbatim comment in latex
# so here we are, doing it in shell...
path=${path//_/\\_}
#echo "\\pdfmargincomment{Image: $path}%"
echo "\\pdfcommentcell{Image: $path}%"
}
#----------------------------------------------------------------------
echo %----------------------------------------------------------------------
echo %
echo % WARNING: This file is auto-generated by make-images.sh and will be
echo "% overwritten on next run..."
echo %
echo "% Image source (preview): \"$IMAGE_DIR\""
echo "% Image source (hi-res): \"$IMAGE_HIRES_DIR\""
echo %
echo %----------------------------------------------------------------------
echo %
#echo % set image source directory...
#echo "\\graphicspath{{${IMAGE_DIR}}}"
#echo %
#echo %----------------------------------------------------------------------
#echo %
#
#cd ${IMAGE_DIR}
l=$(ls "$IMAGE_DIR/" | wc -l)
c=0
for spread in "${IMAGE_DIR}"/* ; do
# skip non-spreads...
if ! [ -d "$spread" ] ; then
continue
fi
c=$(( c + 1 ))
# if $FROM is given print only stuff in range...
[ -z $FROM ] \
|| if (( $(( c - 1 )) < $FROM )) || (( $c > $STOP )) ; then
continue
fi
# if we are building only a specific spread...
##if ! [ -z $SPREAD ] && [[ "$spread" != "$IMAGE_DIR/$SPREAD" ]]; then
## continue
##fi
if ! [ -z $SKIP_FIRST ] ; then
echo %
echo %
echo % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fi
SKIP_FIRST=1
# skip temporarily disabled...
if [ -z ${spread/-*/} ] ; then
echo "% spread: ${spread/-/}: skipped..." | tee >(cat >&2)
echo %
continue
else
printf "Spread ($c/$l): ${spread/-/} \r" >&2
echo "% spread: ${spread/-/}"
fi
# auto layout / templates...
# NOTE: to use a specific template just `touch <template-name>.tpl`
# in the spread directory...
# layout tweaks...
tweaks=($spread/*tweak.tex)
if ! [ -z ${tweaks} ] ; then
echo "% tweaks: ${tweaks[0]}"
cat ${tweaks[0]}
fi
# NOTE: we also get *.txt files here...
items=($spread/*.!(tex|tpl|bak))
# get hi-res image paths...
if ! [ -z $IMAGE_HIRES_DIR ] ; then
C=0
for img in "${items[@]}" ; do
# skip non-images...
if [[ "$img" == "${img/.txt/}" ]] ; then
#new="../$IMAGE_HIRES_DIR/`basename ${img/[0-9]-/}`"
new="$IMAGE_HIRES_DIR/`basename ${img/[0-9]-/}`"
# ignore file ext for availability test...
# NOTE: the first match may be an unsupported format...
new="${new%.*}"
new=($new.*)
if [ -e "${new[0]}" ] ; then
items[$C]=${new[0]}
else
echo %
echo "% WARNING: hi-res image not found for: \"${img}\" -> \"${new}\"" | tee >(cat >&2)
echo %
fi
fi
C=$(( C + 1 ))
done
fi
# manual layout...
layout=($spread/*layout.tex)
if ! [ -z $layout ] ; then
TEMPLATE=${layout[0]}
# templates and partial templates...
else
# spread template...
TEMPLATE=($spread/*.tpl)
# skip page template refs: *-imagepage.tpl / *-textpage.tpl
# XXX this will also eat 0-imagepage.tpl / 20-textpage.tpl -- do a better pattern...
if ! [ -z $TEMPLATE ] ; then
TEMPLATE=(`ls "$spread/"*.tpl | egrep -v '.*-(imagepage|textpage)\.tpl'`)
fi
# no template explicitly defined -> match auto-template...
AUTO=
if [ -z $layout ] && [ -z $TEMPLATE ] ; then
AUTO=" (auto)"
if [ ${#items[@]} == 1 ] ; then
TEMPLATE=$SINGLE_IMAGE
# multiple items...
else
C=0
for img in "${items[@]}" ; do
C=$(( C + 1 ))
P=`[ $C == 1 ] && echo "left" || echo "right"`
# image...
if [ "${img/.txt/}" == "${img}" ] ; then
echo %
echo "% $P page (image)..."
TEMPLATE=`getTemplate "$spread" "imagepage"`
echo % page template: $TEMPLATE
anotatePath "${img}"
CAPTION=`getCaption "${img}"`
cat "${TEMPLATE}" \
| sed "s%\${IMAGE0\?}%${img%.*}%" \
| sed "s%\${CAPTION0\?}%${CAPTION}%"
# text...
else
echo %
echo "% $P page (text)..."
TEMPLATE=`getTemplate "$spread" "textpage"`
echo % page template: $TEMPLATE
cat "${TEMPLATE}" \
| sed "s%\${TEXT}%${img}%"
fi
# reset for next page...
TEMPLATE=
# only two pages at a time...
[ $C == 2 ] && break
done
fi
fi
# formatting done...
[ -z $TEMPLATE ] && continue
# format...
TEMPLATE=${TEMPLATE/$spread\//}
TEMPLATE=${TEMPLATE/[0-9]-/}
# get...
TEMPLATE="$TEMPLATE_PATH/${TEMPLATE[0]%.*}.tex"
fi
# captions...
CAPTION0=`getCaption "${items[0]}"`
CAPTION1=`getCaption "${items[1]}"`
echo "% template: (template${AUTO}: $TEMPLATE)"
anotatePath "${items[0]}"
# fill the template...
cat "${TEMPLATE}" \
| sed "s%\${IMAGE0\?}%${items[0]%.*}%" \
| sed "s%\${CAPTION0\?}%${CAPTION0}%" \
| sed "s%\${IMAGE1}%${items[1]%.*}%" \
| sed "s%\${CAPTION1}%${CAPTION1}%"
done
echo %
echo %
echo %
echo %----------------------------------------------------------------------
echo
echo "Spread created: $c of $l " >&2
#----------------------------------------------------------------------
# vim:set ts=4 sw=4 :

View File

@ -0,0 +1,39 @@
# if non-empty make-spreads.sh will add image paths to pdf notes...
ANOTATE_IMAGE_PATHS=
# file extensions to treat as text (separated with "|")
TEXT_FORMATS=txt
# file extensions to treat as images (separated with "|")
IMAGE_FORMATS=jpeg|jpg|png|pdf|svg|eps
# default directory spread definitions are located in...
SPREADS_DIR=spreads/
# if non-empty link link images to matching ones from this directory...
IMAGE_HIRES_DIR=
# directory where external captions are stored...
CAPTION_DIR=captions/
# root template directory...
TEMPLATE_DIR=templates/
# empty page template...
EMPTY_PAGE=emptypage
# text page template...
TEXT_PAGE=textpage
# image page template...
IMAGE_PAGE=imagepage
# spread templates...
IMAGE_SPREAD=(
#
# +------- number of found images
# / +-- template name
# / /
[0]=text-spread
[2]=image-image
)

755
scripts/make-spreads.sh Executable file
View File

@ -0,0 +1,755 @@
#!/usr/bin/env bash
shopt -s nullglob extglob
#----------------------------------------------------------------------
#
# For docs see README.md
#
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# XXX DOC:
# $spread/
# ...
# imagepage.tex
# image page template.
# fields:
# ${IMAGE}
# ${CAPTION}
# ${TEXT0}
# ...
# textpage.tex
# text page template.
# fields:
# ${TEXT}
# ...
# <spread-template-name>-imagepage.tpl
# <spread-template-name>-textpage.tpl
# indicates the image/text page template to use.
# ignored if explicit templates are given.
# ...
#
#
#
#----------------------------------------------------------------------
# load config...
CONFIG=${CONFIG:=$(basename ${0%.*}).cfg}
# prepend CFG_ to settings in config...
# NOTE: this is done to prevent them overriding the environment...
[ -e $CONFIG ] \
&& eval $(cat "$CONFIG" \
| sed -e 's/^\(\s*\)\([A-Z_]\+=\)/\1CFG_\2/')
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# defaults...
#
# NOTE: all of these options can be either set in the $CONFIG file or
# set in the script env.
# NOTE: env takes priority over $CONFIG
# if set add pdf annotations of paths to each image...
ANOTATE_IMAGE_PATHS=${ANOTATE_IMAGE_PATHS:=$CFG_ANOTATE_IMAGE_PATHS}
ANOTATE_IMAGE_PATHS=${ANOTATE_IMAGE_PATHS:=}
# supported formats/extensions...
TEXT_FORMATS=${TEXT_FORMATS:=$CFG_TEXT_FORMATS}
TEXT_FORMATS=${TEXT_FORMATS:=txt}
TEXT_FORMATS=${TEXT_FORMATS,,}
IMAGE_FORMATS=${IMAGE_FORMATS:=$CFG_IMAGE_FORMATS}
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:=spreads/}
IMAGE_HIRES_DIR=${IMAGE_HIRES_DIR:=$CFG_IMAGE_HIRES_DIR}
IMAGE_HIRES_DIR=${IMAGE_HIRES_DIR:=}
CAPTION_DIR=${CAPTION_DIR:=$CFG_CAPTION_DIR}
CAPTION_DIR=${CAPTION_DIR:=captions/}
TEMPLATE_DIR=${TEMPLATE_DIR:=$CFG_TEMPLATE_DIR}
TEMPLATE_DIR=${TEMPLATE_DIR:=templates/}
# Default templates
# NOTE: if a template is not found we will try and build a spread from
# page components...
# page templates...
EMPTY_PAGE=${EMPTY_PAGE:=$CFG_EMPTY_PAGE}
EMPTY_PAGE=${EMPTY_PAGE:=emptypage}
TEXT_PAGE=${TEXT_PAGE:=$CFG_TEXT_PAGE}
TEXT_PAGE=${TEXT_PAGE:=textpage}
IMAGE_PAGE=${IMAGE_PAGE:=$CFG_IMAGE_PAGE}
IMAGE_PAGE=${IMAGE_PAGE:=imagepage}
# dynamic spread templates...
# NOTE: the index here corresponds to the number of images found in a
# spread directory...
if [ ${#IMAGE_SPREAD[@]} = 0 ] ; then
if [ ${#CFG_IMAGE_SPREAD[@]} != 0 ] ; then
IMAGE_SPREAD=()
for i in ${!CFG_IMAGE_SPREAD[@]} ; do
IMAGE_SPREAD[$i]=${CFG_IMAGE_SPREAD[$i]}
done
else
IMAGE_SPREAD=(
[0]=text-spread
[2]=image-image
)
fi
fi
#----------------------------------------------------------------------
printhelp(){
echo "Usage: `basename $0` [ARGUMENTS] [PATH]"
echo " `basename $0` [ARGUMENTS] PATH INDEX"
echo " `basename $0` [ARGUMENTS] PATH FROM COUNT"
echo
echo "Generate LaTeX layout from directory structure."
echo
echo "Arguments:"
echo " -h --help - print this help and exit."
echo " -c PATH - load configuration from PATH."
echo " -a --annotate"
echo " - add annotations with image paths to pages."
echo " --templates PATH"
echo " - path to search for templates (default: $TEMPLATE_DIR)."
echo " --single-image-tpl NAME"
echo " - single image default template (default: ${IMAGE_SPREAD[1]})."
echo " --double-image-tpl NAME"
echo " - double image default template (default: ${IMAGE_SPREAD[2]})."
echo " --text-spread-tpl NAME"
echo " - text spread default template (default: ${IMAGE_SPREAD[0]})."
echo " --captions PATH"
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 "Parameters:"
echo " PATH - path to root pages directory (default: $SPREADS_DIR)"
echo " INDEX - index of spread to generate"
echo " FROM - spread to start from"
echo " COUNT - number of spreads to generate"
echo
echo "Environment:"
echo " \$IMAGE_HIRES_DIR "
echo " - source directory for replacement hi-res images."
echo " \$ANOTATE_IMAGE_PATHS "
echo " - if true add image paths in anotations."
echo " \$CONFIG - sets the config file name (default: $CONFIG)"
echo " \$TEXT_FORMATS "
echo " - list of file extensions treated as text (default: $TEXT_FORMATS)."
echo " \$IMAGE_FORMATS "
echo " - list of file extensions treated as images"
echo " (default: $IMAGE_FORMATS)."
echo
echo "Configuration defaults can be stored in a config file: $CONFIG"
echo
echo "NOTE: COUNT is relevant iff FROM is given, otherwise all available "
echo " spreads are generated."
echo
echo "Examples:"
echo " $ `basename $0` ./pages > pages.tex"
echo " - generate a layout fron the contents of ./pages"
echo
echo " $ IMAGE_HIRES_DIR=images/hi-res `basename $0` ./pages"
echo " - generate a layout fron the contents of ./pages and "
echo " replaceing local images with images in ./images/hi-res"
echo
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# handle arguments...
while true ; do
case $1 in
-h|--help)
printhelp
exit
;;
-a|--annotate)
ANOTATE_IMAGE_PATHS=1
shift
continue
;;
-c)
$CONFIG="$2"
[ -e "$CONFIG" ] \
&& source "$CONFIG"
shift 2
continue
;;
--templates)
TEMPLATE_DIR=$2
shift 2
continue
;;
--single-image-tpl)
IMAGE_SPREAD[1]=$2
shift 2
continue
;;
--double-image-tpl)
IMAGE_SPREAD[2]=$2
shift 2
continue
;;
--text-spread-tpl)
IMAGE_SPREAD[0]=$2
shift 2
continue
;;
--captions)
CAPTION_DIR=$2
shift 2
continue
;;
--graphicx-path)
GRAPHICX_PATH=1
shift
continue
;;
# handle unknown options...
-*|--*)
echo "Error: unknown option \"$1\"" >&2
exit
;;
*)
break
;;
esac
done
if [ -z $1 ] ; then
SPREADS_DIR=spreads/
else
SPREADS_DIR=$1/
fi
# calculate spread index range...
# XXX add support for negative indexing...
FROM=$2
COUNT=$( [ -z $3 ] && echo 1 || echo $3 )
STOP=$(( FROM + COUNT ))
# prep format regexps...
TEXT_FORMATS='.*\.('$TEXT_FORMATS')$'
IMAGE_FORMATS='.*\.('$IMAGE_FORMATS')$'
#----------------------------------------------------------------------
# Get image caption...
# usage:
# getCaption SPREAD IMAGE
getCaption(){
local spread=$1
local name=`basename "${2%.*}"`
local captions=(
"$CAPTION_DIR/${name}.txt"
"${spread}/${name}.txt"
)
local caption
for caption in "${captions[@]}" ; do
if [ -e "${caption}" ] ; then
echo ${caption}
return
fi
done
}
# Read/print caption text...
# usage:
# readCaption PATH
readCaption(){
[ -z "$1" ] \
&& return 1
cat "$1" \
| sed -e 's/\\/\\\\\\/g'
}
# Get template...
# usage:
# getTemplate SPREAD TYPE
#
getTemplate(){
local spread=$1
local name=$2
local template
if [[ $name =~ .*\.tex ]] ; then
# already an existing template...
if [ -e "$name" ] ; then
echo $name
return
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
# local template...
template=($spread/*-$name.tex)
if [ ${#template[@]} != 0 ] ; then
template=${template[0]}
else
template=($spread/$name.tex)
fi
# global template...
if [ -z $template ] \
|| ! [ -e "$template" ] ; then
template="$TEMPLATE_DIR/${name}.tex"
fi
# check if the thing exists...
if ! [ -e $template ] ; then
return 1
fi
echo $template
}
# Get template slots (cached)...
# usage:
# templateSlots TEMPLATE
declare -A TEMPLATE_INDEX
templateSlots(){
# cache the vars...
#if [ ${TEMPLATE_INDEX[$1]+_} ] ; then
if [ -z ${TEMPLATE_INDEX[$1]} ] ; then
TEMPLATE_INDEX[$1]=$(cat "$1" \
| grep -o '\${[A-Z0-9_]\+}' \
| sed 's/\${\(.*\)}/\1/g' \
| sort -V)
fi
echo ${TEMPLATE_INDEX[$1]}
}
# Populate template image/text slots
# usage:
# 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(){
local spread="$1"
local tpl="$2"
[ -e "$tpl" ] \
|| return 1
local slots=( $(templateSlots "${tpl}") )
local text=$(cat "${tpl}")
# items/img/txt...
shift 2
local items=("$@")
if [ ${#items[@]} = 0 ] ; then
items=( $spread/* )
fi
local img=()
local txt=()
local elem
for elem in "${items[@]}" ; do
if [[ "${elem,,}" =~ $IMAGE_FORMATS ]] ; then
img+=("$elem")
elif [[ "${elem,,}" =~ $TEXT_FORMATS ]] ; then
txt+=("$elem")
fi
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 val
local index=()
local captions=()
local name
# pass 1: images...
# NOTE: we are doing this in three passes as caption and image slots
# can be included in the template in any order but the captions
# need all the images to be fully populated/indexed (passes 1
# and 2), and text is done as a separate pass to prevent it
# from competing with captions.
local i=0
for var in ${slots[@]} ; do
name=${var//[0-9]/}
if [ ${name} != "IMAGE" ] ; then
continue
fi
val=${img[$i]}
# index images for caption retrieval...
index[${var/$name/}]="$val"
# warn if no image found for slot...
if [ -z ${val} ] ; then
echo %
{
echo "% WARNING: image #${i} requested but not found"
echo "% in: ${tpl}"
echo "% by: ${spread}"
} | tee >(cat >&2)
echo %
fi
i=$(( i + 1 ))
val=${val//\//\\/}
text=$(echo "${text}" | \
sed "s/\${${var}}/${val%.*}/g")
done
if ! [ -z $global_img ] ; then
populateTemplate_img=("${populateTemplate_img[@]:$i}")
fi
# pass 2: captions...
for var in ${slots[@]} ; do
name=${var//[0-9]/}
if [ ${name} != "CAPTION" ] ; then
continue
fi
# get global caption...
val=$(getCaption "$spread" "${index[${var/$name/}]}" "${txt[@]}")
if [ -n "${val}" ] ; then
# clear the used texts... (XXX test)
for i in "${!txt[@]}" ; do
[ "$val" = "${txt[$i]}" ] \
&& unset "txt[$i]"
done
val=$(readCaption "${val}")
fi
text=$(echo "${text}" | \
sed "s/\${${var}}/${val}/g")
done
# pass 3: texts...
for var in ${slots[@]} ; do
name=${var//[0-9]/}
if [ ${name} = "CAPTION" ] || [ ${name} = "IMAGE" ] ; then
continue
fi
val=
for i in ${!txt[@]} ; do
# NOTE: we do not care as much if not text is found...
val=${txt[$i]}
unset "txt[$i]"
# we only need the first text...
break
done
val=${val//\//\\/}
text=$(echo "${text}" | \
sed "s/\${${var}}/${val}/g")
done
if ! [ -z $global_txt ] ; then
populateTemplate_txt=("${txt[@]}")
fi
# print out the filled template...
echo % template: $tpl
echo "${text}"
return
}
# Handle/print spread...
# usage:
# handleSpread SPREAD
#
# closure: $GRAPHICX_PATH, $IMAGE_HIRES_DIR, $IMAGE_SPREAD
handleSpread(){
local spread="$1"
# skip non-spreads...
[ -d "$spread" ] \
|| return 1
# auto layout / templates...
# NOTE: to use a specific template just `touch <template-name>.tpl`
# in the spread directory...
# layout tweaks...
local tweaks=($spread/*tweak.tex)
if ! [ -z ${tweaks} ] ; then
echo "% tweaks: ${tweaks[0]}"
cat ${tweaks[0]}
fi
# collect images and text...
# NOTE: we are filling these manually to support configurable
# image/text patterns...
local img=()
local txt=()
local items=()
for elem in "$spread"/* ; do
if [[ "${elem,,}" =~ $IMAGE_FORMATS ]] ; then
img+=("$elem")
items+=("$elem")
elif [[ "${elem,,}" =~ $TEXT_FORMATS ]] ; then
txt+=("$elem")
items+=("$elem")
fi
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...
elif ! [ -z $IMAGE_HIRES_DIR ] ; then
local C=0
for image in "${img[@]}" ; do
# skip non-images...
local new=`basename ${image}`
new="$IMAGE_HIRES_DIR/${new#+([0-9])-}"
# ignore file ext for availability test...
# NOTE: the first match may be an unsupported format...
new="${new%.*}"
local target=$new
new=($new.*)
if [ -e "${new[0]}" ] ; then
img[$C]=${new[0]}
else
echo %
echo "% WARNING: hi-res image not found for: \"${image}\" -> \"${target}\"" \
| tee >(cat >&2)
echo %
fi
C=$(( C + 1 ))
done
fi
# manual layout...
local template
local layout=( $spread/*layout.tex )
if ! [ -z $layout ] ; then
template=${layout[0]}
# templates and partial templates...
else
local template=( $spread/*.tpl )
# skip page template refs: *-imagepage.tpl / *-textpage.tpl
# XXX this will also eat 0-imagepage.tpl / 20-textpage.tpl -- do a better pattern...
if ! [ -z $template ] ; then
template=(`ls "$spread/"*.tpl \
| grep -E -v '.*-('${IMAGE_PAGE}'|'${TEXT_PAGE}')\.tpl'`)
fi
# no template explicitly defined -> match auto-template...
if [ -z $layout ] && [ -z $template ] ; then
# N images...
if [ -z $template ] && [ -n "${IMAGE_SPREAD[${#img[@]}]}" ] ; then
template=$(getTemplate "$spread" "${IMAGE_SPREAD[${#img[@]}]}")
fi
# build spread from pages...
if [ -z $template ] ; then
local C=0
local P
local elem
# only one page in spread...
# NOTE since the right page is more important we prioritize
# it over the left page, placing the blank left...
if [ ${#items[@]} = 1 ] ; then
C=1
echo "%"
echo "% empty page..."
template=$(getTemplate "$spread" "$EMPTY_PAGE")
if [ -z "$teplate" ] ; then
echo "\\null"
echo "\\newpage"
else
cat "${template}"
fi
fi
populateTemplate_img=("${img[@]}")
populateTemplate_txt=("${txt[@]}")
for elem in "${items[@]}" ; do
C=$(( C + 1 ))
P=$([ $C == 1 ] \
&& echo "left" \
|| echo "right")
# image...
if [[ "${elem,,}" =~ $IMAGE_FORMATS ]] ; then
echo %
echo "% $P page (image)..."
template=`getTemplate "$spread" "$IMAGE_PAGE"`
populateTemplate "$spread" "$template"
# text...
else
echo %
echo "% $P page (text)..."
template=$(getTemplate "$spread" "$TEXT_PAGE")
populateTemplate "$spread" "$template"
fi
# reset for next page...
template=
# ignore the rest of the items when we are done
# creating two pages...
if [ $C == 2 ] ; then
populateTemplate_img=
populateTemplate_txt=
return
fi
done
fi
fi
# formatting done...
[ -z $template ] \
&& return
# resolve the template path...
local p=$template
template=$(getTemplate "$spread" "$template")
# not found...
if [ -z $template ] ; then
echo "%"
echo "% ERROR: could not resolve template: $p" | tee >(cat >&2)
echo "%"
fi
fi
populateTemplate_img=
populateTemplate_txt=
populateTemplate "$spread" "$template" "${img[@]}" "${txt[@]}"
return $?
}
# Add pdf notes with image path used in template
# usage:
# anotatePath PATH
#
anotatePath(){
if [ -z "$1" ] || [ -z "$ANOTATE_IMAGE_PATHS" ] ; then
return
fi
path=$(basename ${1%.*})
# NOTE: did not figure out how to make a verbatim comment in latex
# so here we are, doing it in shell...
path=${path//_/\\_}
#echo "\\pdfmargincomment{Image: $path}%"
echo "\\pdfcommentcell{Image: $path}%"
}
#----------------------------------------------------------------------
# generate the template...
echo %----------------------------------------------------------------------
echo %
echo % WARNING: This file is auto-generated by make-spreads.sh and will be
echo "% overwritten on next run..."
echo %
echo "% Image source (preview): \"$SPREADS_DIR\""
echo "% Image source (hi-res): \"$IMAGE_HIRES_DIR\""
echo %
echo %----------------------------------------------------------------------
echo %
l=$(ls "$SPREADS_DIR/" | wc -l)
c=0
d=0
SPREADS=("$(ls "${SPREADS_DIR}" | sort -n)")
for spread in ${SPREADS[@]} ; do
spread="${SPREADS_DIR}/${spread}"
# skip non-spreads...
if ! [ -d "$spread" ] ; then
l=$(( l - 1 ))
continue
# skip temporarily disabled...
elif [[ "${spread}" =~ [\\\/]-.*$ ]] ; then
SKIP_FIRST=1
echo "% spread: ${spread}: skipped..." | tee >(cat >&2)
continue
fi
c=$(( c + 1 ))
# if $FROM is given print only stuff in range...
[ -z $FROM ] \
|| if (( $(( c - 1 )) < $FROM )) || (( $c > $STOP )) ; then
continue
fi
# if we are building only a specific spread...
##if ! [ -z $SPREAD ] && [[ "$spread" != "$SPREADS_DIR/$SPREAD" ]]; then
## continue
##fi
if ! [ -z $SKIP_FIRST ] ; then
echo %
echo %
echo % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fi
SKIP_FIRST=1
printf "Spread ($c/$l): ${spread} \r" >&2
echo "% spread: ${spread}"
handleSpread "$spread"
d=$(( d + 1 ))
done
echo %
echo %
echo %
echo %----------------------------------------------------------------------
echo
echo "Spread created: $d of $l " >&2
#----------------------------------------------------------------------
# vim:set ts=4 sw=4 nowrap :

View File

@ -57,10 +57,14 @@ endif
%.pdf: %.tex $(SETUP) %.pdf: %.tex $(SETUP)
-$(CMD) $< $(STDERR) -$(CMD) $< $(STDERR)
# XXX need to figure this out with patterns...
photobook-slides-en.pdf: $(COMPONENTS)
photobook-slides.pdf: $(COMPONENTS) photobook-slides-ru.pdf: $(COMPONENTS)
photobook-slides-web.pdf: photobook-slides.pdf photobook-web-en.pdf: photobook-slides-en.pdf
photobook-web-ru.pdf: photobook-slides-ru.pdf
#---------------------------------------------------------------------- #----------------------------------------------------------------------
@ -72,10 +76,10 @@ photobook-slides-web.pdf: photobook-slides.pdf
all: web all: web
.PHONY: slides .PHONY: slides
slides: photobook-slides.pdf $(IMAGES) slides: photobook-slides-en.pdf photobook-slides-ru.pdf $(IMAGES)
.PHONY: web .PHONY: web
web: photobook-slides-web.pdf slides web: photobook-web-en.pdf photobook-web-ru.pdf slides
.PHONY: components .PHONY: components
components: $(COMPONENTS) components: $(COMPONENTS)

View File

@ -15,11 +15,11 @@ $ make all sweep
``` ```
Generated pdf's: Generated pdf's:
- `photobook-slides.pdf` - `photobook-slides-en.pdf` / `photobook-slides-ru.pdf`
The actual slides used for the talk. These require a pdf viewer that The actual slides used for the talk. These require a pdf viewer that
supports "book mode" and the "two-page view", and preferably good enough supports "book mode" and the "two-page view", and preferably good enough
maners not to ignore the settings set in the file. maners not to ignore the settings set in the file.
- `photobook-slides-web.pdf` - `photobook-web-en.pdf` / `photobook-web-ru.pdf`
Compatibility version that sets one spread per page. This should work Compatibility version that sets one spread per page. This should work
on any pdf viewer. on any pdf viewer.

View File

@ -1,5 +1,5 @@
\documentclass[a5paper]{book} \documentclass[a5paper]{book}
% Что-бы было видно страницу на сером фоне % make the page visible on a gray backdrop...
\usepackage{xcolor} \usepackage{xcolor}
\usepackage{pagecolor} \usepackage{pagecolor}
\pagecolor{white} \pagecolor{white}

View File

@ -0,0 +1,656 @@
%----------------------------------------------------------------------
\documentclass[
layoutmode=block,
% make the spread 16x9...
blockwidth=96mm, blockheight=108mm,
bleed=0mm,
bindingoffset=0mm,
% image block configuration...
imageblockwidth=0.98, imageblockheight=0.98,
imageblockoffsettop=0mm,
% misc...
12pt,final,openany
]{photobook}
%\usepackage{xcolor}
%\usepackage{pagecolor}
\usepackage{anyfontsize}
\usepackage{ragged2e}
\usepackage{hyperref}
\usepackage{cprotect}
%\usepackage{listings}
\usepackage{fancyvrb}
\usepackage{ccicons}
\usepackage{lipsum}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\setlength\parindent{0pt}
\writeimagelistfalse
\pagestyle{empty}
\pagecolor{white}
%\fontsize{30pt}{36pt}\selectfont
% fonts...
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Open Sans}
\setsansfont[Mapping=tex-text]{Open Sans}
%\setmonofont[Mapping=tex-text, Scale=0.8]{Courier New}
\newfontfamily\titlefont[Mapping=tex-text]{Open Sans Light}
\newfontfamily\sectiontitlefont[Mapping=tex-text]{Open Sans Light}
\def\captionsize{%
\fontsize{4pt}{5pt}\selectfont}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% Macros/templates...
\def\TEX{%
{\fontfamily{lmr}\selectfont \TeX}}
\def\LATEX{%
{\fontfamily{lmr}\selectfont \LaTeX}}
\newcommand\PageFushRight[1]{
\begin{page}
\begin{cell}{2mm,2mm}{\paperwidth - 4mm}{\paperheight - 4mm}
\begin{flushright}
#1
\end{flushright}
\end{cell}
\end{page}}
\newcommand\PageFushLeft[1]{
\begin{page}
\begin{cell}{2mm,2mm}{\paperwidth - 4mm}{\paperheight - 4mm}
\begin{flushleft}
#1
\end{flushleft}
\end{cell}
\end{page}}
\newcommand\PageFushRightC[1]{
\begin{page}
\begin{cell}{2mm,2mm}{\paperwidth - 4mm}{\paperheight - 4mm}
\null
\vfill
\begin{flushright}
#1
\end{flushright}
\vfill
\null
\end{cell}
\end{page}}
\newcommand\PageFushLeftC[1]{
\begin{page}
\begin{cell}{2mm,2mm}{\paperwidth - 4mm}{\paperheight - 4mm}
\null
\vfill
\begin{flushleft}
#1
\end{flushleft}
\vfill
\null
\end{cell}
\end{page}}
\begin{document} %-----------------------------------------------------
% cover...
\ImagePageClear[clearance=28mm]{%
\begin{minipage}{\cellwidth}
\vspace{-1mm}
\begin{center}
\color{lightgray}
\hspace{-1.7mm}This is not a presentation, it's a well camoflaged book
\end{center}
\end{minipage}}{images/DSC00182}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% title...
\ImageSpread[clearance=40mm]{}{images/latex}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% history...
\PageFushRight{
\null
\vfill
\vspace{-12mm}
\section*{1978: TeX}%
\vspace{-4mm}
Donald Knuth
\section*{1984: LaTeX}%
\vspace{-4mm}
Leslie Lamport
\vfill
\fontsize{4pt}{5pt}\selectfont
\textbf{2021: photobook}
\fontsize{3.5pt}{4.5pt}\selectfont
Alex A. Naanou}
\PageFushLeft{
\null
\vfill
\vspace{12mm}
\section*{1982: PostScript}%
\vspace{-4mm}
%John Warnock, Chuck Geschke, Doug Brotz, Ed Taft, Bill Paxton
Adobe Systems
\section*{1993: PDF}%
\vspace{-4mm}
Adobe Inc.
\vfill
\null}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% hello world...
\begin{page}%
\scriptsize%
\vfill%
\begin{center}%
\BVerbatimInput{hello-world.tex}
\end{center}%
\vfill%
\end{page}
%
\pagecolor{lightgray}
\ImagePageClear{}{hello-world}
\pagecolor{white}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% text layout...
\begin{spreadtopages}
\vfill
\begin{center}
\section*{Text $+$ Boxes $\longrightarrow$ Pages}
\end{center}
\vfill
\end{spreadtopages}
\newpage
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% layout example...
% left page...
\begin{page}
\fontsize{5pt}{5.5pt}\selectfont
\vfill
\begin{center}
\begin{BVerbatim}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer
id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque
habitant morbi tristique senectus et netus et malesuada fames ac
turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et
lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet
tortor gravida placerat. Integer sapien est, iaculis in, pretium quis,
viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean
faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac,
nulla. Curabitur auctor semper nulla. Donec varius orci eget risus.
Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis
eget orci sit amet orci dignissim rutrum.
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel,
wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis
vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum,
erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et
nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque
a nulla. Cum sociis natoque penatibus et magnis dis parturient montes,
nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper
vestibulum turpis. Pellentesque cursus luctus mauris.
\newpage
\end{BVerbatim}
\end{center}
\vfill
\null
\end{page}
% right page...
{\tiny%
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer
id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque
habitant morbi tristique senectus et netus et malesuada fames ac
turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et
lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet
tortor gravida placerat. Integer sapien est, iaculis in, pretium quis,
viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean
faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac,
nulla. Curabitur auctor semper nulla. Donec varius orci eget risus.
Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis
eget orci sit amet orci dignissim rutrum.
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel,
wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis
vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum,
erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et
nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque
a nulla. Cum sociis natoque penatibus et magnis dis parturient montes,
nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper
vestibulum turpis. Pellentesque cursus luctus mauris.
\newpage}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% build...
\begin{spreadtopages}
\vfill
\begin{center}
\section*{.tex $\longrightarrow$ .pdf}
\vspace{1.5em}
\hspace{1mm}
\includegraphics[keepaspectratio, height=0.5\cellheight]{images/commandline}
\hspace{4mm}
\includegraphics[keepaspectratio, height=0.5\cellheight]{images/TeXWorks}
\end{center}
\vfill
\end{spreadtopages}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% Advantages / disadvanages
\newcommand\seppoints{%
\par
\vspace{0.1em}}
\PageFushRightC{
\section*{Advantages}
Simple templating
\seppoints
Handling large projects
\seppoints
Full support for everything needed
\seppoints
Documentation
\seppoints
Free and open source
}
\PageFushLeftC{
\vspace{-0.5em}
\section*{Disadvantages}
Not WYSIWYG
\seppoints
Harder to create graphics
\seppoints
Not as efficient for smaller tasks
}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% Alternatives...
\PageFushRightC{
\section*{Alternatives}
\vspace{1em}
\subsection*{Adobe:}
\vspace{-.7em}
InDesign / Illustrator / Photoshop / DPS }
\PageFushLeftC{
\vspace{-0.5em}
\subsection*{OpenSource:}
\vspace{-.7em}
Scribus / Inkscape / Krita / Blender }
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% photobook...
\begin{spreadtopages}
\vfill
\begin{center}
\fontsize{42pt}{45pt}\selectfont
photobook
\end{center}
\vfill
\end{spreadtopages}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% differences to native LaTeX...
\PageFushRightC{
\section*{in photobook}
\vspace{-7mm}
we can do:}
\PageFushLeftC{
Bleeds
Pages
Spreads
Foldouts
Endpapers
Covers
Jackets
}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\begin{page}
\vfill
\begin{center}
\begin{BVerbatim}
\documentclass{photobook}
\end{BVerbatim}
\end{center}
\vfill
\null
\end{page}
\begin{page}%
\begin{Verbatim}[tabsize=4]
\documentclass[
layoutmode=block,
blockwidth=96mm,
blockheight=108mm,
bleed=0mm,
bindingoffset=0mm,
imageblockwidth=0.98,
imageblockheight=0.98,
]{photobook}
\end{Verbatim}
\end{page}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\begin{page}%
\vfill%
\begin{center}%
\scriptsize%
\begin{BVerbatim}
\ImagePageClear{Park}{images/DSC03759}
\end{BVerbatim}
\end{center}%
\vfill%
\null%
\end{page}
\ImagePageClear{Park}{images/DSC03759}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\begin{page}%
\vfill%
\begin{center}%
\scriptsize%
\begin{BVerbatim}
\ImagePageFit{}{images/DSC02091}
\end{BVerbatim}
\end{center}%
\vfill%
\null%
\end{page}
\ImagePageFit{}{images/DSC02091}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\cprotEnv\begin{spreadtopages}%
\normalsize
\vfill%
\begin{center}%
\begin{BVerbatim}
\ImageSpread{"Копейка под домом"}{images/DSC05647}
\end{BVerbatim}
\end{center}%
\vfill%
\null%
\end{spreadtopages}
\ImageSpread{"Копейка под домом"}{images/DSC05647}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\cprotEnv\begin{spreadtopages}%
\normalsize
\vfill%
\begin{center}%
\begin{BVerbatim}
\ImageSpreadFitL{New year}{images/DSC03603a}
\end{BVerbatim}
\end{center}%
\vfill%
\null%
\end{spreadtopages}
\ImageSpreadFitL{New year}{images/DSC03603a}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\cprotEnv\begin{spreadtopages}%
\normalsize
\vfill%
\begin{center}%
\begin{BVerbatim}
\tweakimageoffsettop{5mm}
\ImageSpreadFill{%
\color{lightgray}%
Pechatniki}{images/DSC06650}
\end{BVerbatim}
\end{center}%
\vfill%
\null%
\end{spreadtopages}
\tweakimageoffsettop{5mm}
\ImageSpreadFill{%
\color{lightgray}%
Pechatniki}{images/DSC06650}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% templates...
\begin{spreadtopages}
\vfill
\begin{center}
\section*{Template Templates}
\end{center}
\vfill
\end{spreadtopages}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% cover...
\begin{page}%
\scriptsize%
\vfill%
\begin{center}%
\begin{BVerbatim}
\documentclass[
layoutmode=cover,
spinewidth=5mm,
spinefold=2mm,
coverflap=17mm,
coverboardgrow=0.5mm,
...
]{photobook}
\begin{document}
\GenerateTemplate
\end{document}
\end{BVerbatim}
\end{center}%
\vfill%
\null%
\end{page}
\pagecolor{lightgray}
\ImagePageClear{}{photobook-cover}
\pagecolor{white}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% jacket...
\begin{page}%
\scriptsize%
\vfill%
\begin{center}%
\begin{BVerbatim}
\documentclass[
layoutmode=jacket,
...
jacketflap=50mm,
jacketwrap=0.5mm,
...
]{photobook}
\begin{document}
\GenerateTemplate
\end{document}
\end{BVerbatim}
\end{center}%
\vfill%
\null%
\end{page}
\pagecolor{lightgray}
\ImagePageClear{}{photobook-jacket}
\pagecolor{white}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% endpaper...
\begin{page}%
\scriptsize%
\vfill%
\begin{center}%
\begin{BVerbatim}
\documentclass[
layoutmode=endpaper,
...
]{photobook}
\begin{document}
\GenerateTemplate
\end{document}
\end{BVerbatim}
\end{center}%
\vfill%
\null%
\end{page}
\pagecolor{lightgray}
\ImagePageClear{}{photobook-endpaper}
\pagecolor{white}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% the future...
\PageFushRightC{
Template for book boxes
More examples
Text book
Fixing bugs
Polishing and cleanup }
\PageFushLeftC{
\section*{:The future} }
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% links...
\newcommand\link[2]{
#1
\url{#2}
\vspace{1em}
\par}
\PageFushRightC{
\link{\TEX Live}{https://www.tug.org/texlive/}
\link{\LATEX}{https://www.latex-project.org/} }
\PageFushLeftC{
\link{photobook}{https://ctan.org/pkg/photobook}
\link{\TEX\space Wikipedia}{https://ru.wikipedia.org/wiki/TeX}
\link{\LATEX\space Wikipedia}{https://ru.wikipedia.org/wiki/LaTeX} }
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% back cover / copyright...
\cleartoleftpage
\begin{pagecell}
\begin{center}
\null
\vfill
\par
\begin{minipage}{0.8\cellwidth}
\fontsize{3.3pt}{4pt}\selectfont
\ccbyncnd\space
All {\it photographs} are by Alex A. Naanou, and licenced under
the Creative Commons, Attribution-NonCommercial-NoDerivatives 4.0 \\
(CC BY-NC-ND 4.0) \\
\url{https://creativecommons.org/licenses/by-nc-nd/4.0/} \\
\par
\ccCopy\space
The {\it source code} of this book is licensed under the New BSD License
(BSD-3-clause) \\
\url{https://opensource.org/license/bsd-3-clause/} \\
\par
\ccPublicDomain\space
The {\it code listed} in this book can be treated as {\it Public Domain}. \\
\url{https://en.wikipedia.org/wiki/Public_domain} \\
\par
This book was designed and laid out using open source fonts and software
including:
\href{https://fonts.google.com/specimen/Open+Sans}{Open Sans},
\href{https://ctan.org/pkg/photobook}{photobook} and
\href{https://www.latex-project.org/}{\LATEX.} \\
\end{minipage}
\vspace{2em}
\end{center}
\end{pagecell}
%----------------------------------------------------------------------
\end{document} % vim:set ts=4 sw=4 :

View File

@ -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}

View File

@ -14,7 +14,7 @@
\begin{document} % - - - - - - - - - - - - - - - - - - - - - - - - - - \begin{document} % - - - - - - - - - - - - - - - - - - - - - - - - - -
\includepdf[pages={{},1-}, nup=2x1, delta=0.3mm 0.3mm]{photobook-slides} \includepdf[pages={{},1-}, nup=2x1, delta=0.3mm 0.3mm]{photobook-slides-en}
%---------------------------------------------------------------------- %----------------------------------------------------------------------

View File

@ -0,0 +1,21 @@
%----------------------------------------------------------------------
\documentclass[
layoutmode=endpaper,
% make the spread 16x9...
blockwidth=96mm, blockheight=108mm,
bleed=0mm,
bindingoffset=0mm,
% misc...
12pt,final,openany
]{photobook}
\pagecolor{black}
\begin{document} % - - - - - - - - - - - - - - - - - - - - - - - - - -
\includepdf[pages={{},1-}, nup=2x1, delta=0.3mm 0.3mm]{photobook-slides-ru}
%----------------------------------------------------------------------
\end{document} % vim:set ts=4 sw=4 :