Compare commits

...

163 Commits

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
59 changed files with 1826 additions and 402 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
with:
run: |
apk add make git zip
apk add make git zip grep
git config --global --add safe.directory '*'
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
git log -1 --pretty=%B | grep -v "Signed-off-by:" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
@ -35,13 +44,13 @@ jobs:
photobook.pdf
- name: Artifacts - build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build artifacts
path: photobook.pdf
- name: Artifacts - dist
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist artifacts
path: dist/photobook-*.zip
@ -69,6 +78,9 @@ jobs:
defining a set of parameters, meta-macros, macros and
environments with reasonable defaults to help typeset,
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: >
${{ env.COMMENT }}

View File

@ -43,10 +43,6 @@
#----------------------------------------------------------------------
# Config...
.EXPORT_ALL_VARIABLES:
#.ONESHELL:
# NOTE: this makes things run consistently on different systems including
# things like Android...
SHELL := bash
@ -60,8 +56,9 @@ MODULE := photobook
VERSION = $(strip $(shell \
cat $(MODULE).cls \
| grep 'VERSION{' \
| sed 's/.*{\(.*\)}.*/\1/' \
| sed 's/v//'))
| sed \
-e 's/.*{\(.*\)}.*/\1/' \
-e 's/v//'))
DATE = $(strip $(shell date "+%Y%m%d%H%M"))
COMMIT = $(strip $(shell git rev-parse HEAD))
@ -88,8 +85,7 @@ endif
# markdown dialect...
#
# XXX still needs some tweaking...
MD_FORMAT ?= markdown_github
MD_FORMAT ?= gfm
# debug output...
@ -125,6 +121,7 @@ DIST_NORMAL_FILES = \
README.md \
LICENSE \
Makefile \
DEPENDS.txt \
$(MODULE).cls \
$(MODULE).pdf
DIST_FILES = \
@ -175,26 +172,11 @@ LN := cp -l
# - |..| - verbatim does not work...
# - || - parts of doc omitted...
# - verbatim blocks get merged sometimes...
# - does not resolve \jobname in include...
# - ...
# ...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
cat $< \
| sed 's/documentclass{ltxdoc}/documentclass[markdownextra]{internet}/' \
> $<.tmp
mv $<{.tmp,}
$(TEX) $< $(STDERR)
pandoc -t $(MD_FORMAT) -s $< -o $@
# meta-section...
@ -225,6 +207,7 @@ LN := cp -l
# strip docs out...
#
# XXX can we unify these???
# ....not sure how...
%-stripped.tex: %.tex
$(DOC) --strip $< \
$(DOC) --prefix M --strip \
@ -241,6 +224,15 @@ LN := cp -l
> $@
# list of dependencies...
#
DEPENDS.txt: $(MODULE).cls
make depends \
| grep -v make \
| sed -e 's/^/hard /' \
> $@
#----------------------------------------------------------------------
# Info targets...
@ -250,10 +242,27 @@ 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...
.PHONY: dep
dep: DEPENDS.txt
.PHONY: pdf
pdf: $(MODULE).pdf
@ -295,6 +304,7 @@ tag:
@echo " v$(VERSION)"
@echo "Last 5 tags:"
@git tag -l 'v[0-9]*'\
| sort -V \
| tail -n 5 \
| sed 's/^/ /' \
| tac
@ -326,7 +336,7 @@ tag:
.PHONY: all
all: pdf
all: pdf dep
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -408,7 +418,7 @@ sweep:
.PHONY: clean
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.
## 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`, ..)
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
@ -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
- 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
long, a workaround is to place them in a `minipage` like this:
```latex
@ -72,3 +104,4 @@ Copyright (c) 2021-2023, Alex A. Naanou,
All rights reserved.
<!-- vim:set ts=4 sw=4 nowrap : -->

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

View File

@ -0,0 +1 @@
Some text

View File

@ -0,0 +1 @@
page text

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

View File

@ -0,0 +1 @@
Some 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 @@
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}
\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}

View File

@ -37,7 +37,7 @@
\end{inlinecell}%
\hspace{\textblockmargin}%
\begin{inlinecell}{0.75\cellwidth - \textblockmargin + \bleed}{\cellheight}%
\imagecell[fill]{}{DSC00403-2}%
\imagecell[fill]{}{landscape}%
\end{inlinecell}
\end{spreadtopages}
@ -45,7 +45,7 @@
\begin{spreadtopages}%
\hspace{-\bleed}%
\begin{inlinecell}{0.75\cellwidth - \textblockmargin + \bleed}{\cellheight}%
\imagecell[fill]{}{DSC00403-2}%
\imagecell[fill]{}{landscape}%
\end{inlinecell}%
\hspace{\textblockmargin}%
\begin{inlinecell}{0.25\cellwidth}{\cellheight}%

View File

@ -5,7 +5,8 @@
% page size...
blockwidth=240mm, blockheight=220mm,
bleed=4mm,
bindingoffset=5mm,
gutteroffset=5mm,
bindingoffset=0mm,
% image block configuration...
imageblockwidth=0.98, imageblockheight=0.98,
imageblockoffsettop=0,
@ -27,8 +28,8 @@
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\edef\TestImage{DSC00403-2}
\edef\TestImageV{DSC00403-2vert}
\edef\TestImage{landscape}
\edef\TestImageV{portrait}
\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}
\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
\end{document}
%----------------------------------------------------------------------
% vim:set ts=4 sw=4 :
\end{document} %-------------------------------------------------------
% 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

@ -24,18 +24,18 @@
\begin{page}
\begin{frontcover}
\begin{cliptocell}
\imagecell[fill]{}{DSC00403-2}
\begin{cliptocell}[0mm \bleed]
\imagecell[fill, clearance=-\bleed]{}{landscape}
\end{cliptocell}
\end{frontcover}
\begin{backcover}
\begin{cliptocell}
\imagecell[fill]{}{DSC00403-2}
\begin{cliptocell}[0mm \bleed]
\imagecell[fill, clearance=-\bleed]{}{landscape}
\end{cliptocell}
\end{backcover}
\begin{spine}
\begin{cliptocell}
\imagecell[fill]{}{DSC00403-2}
\begin{cliptocell}[0mm \bleed]
\imagecell[fill, clearance=-\bleed]{}{landscape}
\end{cliptocell}
\end{spine}
\begin{frontflap}

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

@ -15,7 +15,7 @@
MAKESPREADS := ../../scripts/make-spreads.sh
spreads.tex: spreads
spreads.tex: spreads $(wildcard spreads/*/*)
$(MAKESPREADS) $< $(SPREAD) > $@
dist:

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}
\edef\TestImage{DSC00403-2}
\edef\TestImageV{DSC00403-2vert}
\edef\TestImage{landscape}
\edef\TestImageV{portrait}
\writeimagelistfalse

View File

@ -19,8 +19,8 @@
\setlength\parindent{0pt}
\edef\TestImage{DSC00403-2}
\edef\TestImageV{DSC00403-2vert}
\edef\TestImage{landscape}
\edef\TestImageV{portrait}
\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}
\edef\TestImage{DSC00403-2}
\edef\TestImageV{DSC00403-2vert}
\edef\TestImage{landscape}
\edef\TestImageV{portrait}
\writeimagelistfalse

File diff suppressed because it is too large Load Diff

View File

@ -4,9 +4,9 @@ Support scripts
<!-- TOC depthfrom:2 -->
- [make-spreads.sh](#make-imagessh)
- [The process](#the-process)
- [Automatic template inferenceing](#automatic-template-inferenceing)
- [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)
@ -50,7 +50,7 @@ book/
│ ├── image-image.tex
│ ├── fullbleed.tex
│ └── ...
├── spreads/ . . . . . . . . . . . . . . Main block layout.
├── spreads/ . . . . . . . . . . . . . Main block layout.
│   ├── 00/ . . . . . . . . . . . . . . A basic spread.
│   │   ├── tweaks.tex The spread template is built
│   │   └── 0-DSC02432.jpg automatically with tweaks.tex
@ -77,23 +77,22 @@ book/
├── block.tex . . . . . . . . . . . . . Block skeletal layout.
│ This usually includes the titles,
│ technical pages and sources the
│ ./block-pages.tex.
├── block-pages.tex . . . . . . . . . . The generated block content.
│ ./block-spreads.tex.
├── block-spreads.tex . . . . . . . . . The generated block content.
├── cover.tex . . . . . . . . . . . . . Cover layout.
├── jacket.tex . . . . . . . . . . . . Dust jacket layout.
└── ...
```
<!-- XXX
For a live example see: ../examples/book -->
For a full example see: ../examples/book
Generate the block:
```shell
$ make-spreads.sh ./pages > block-pages.tex
$ make-spreads.sh ./spreads > block-spreads.tex
```
Note that `make-spreads.sh` does not force a specific layout outside of
the `pages` directory, all paths are configurable. The way the root
the `spreads` directory, all paths are configurable. The way the root
files are structured in this example is just one way to organize a
book's source code with minimal code duplication.
@ -104,7 +103,7 @@ $ make-spreads.sh --help
```
### The process
### Theory of operation
<!-- XXX spreads vs. pages -->
@ -121,24 +120,24 @@ work is starting to look like a book.
When starting work on a layout it is good to at least have a basic
understanding of the book's:
- structure and how it may change,
- core templates,
- 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 simple as possible -- it's all about providing the freedom to
make changes instead of growing work invested and thus making change
more and more expensive.
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
structured? How are we going to deal with the title? How are we going
placed? How are we going to deal with the title? How are we going
to present the images, full bleed, no bleeds, small, big, one per page
or multiple images, ...etc.? At this stage this is about the presentation
or multiples, ...etc.? At this stage this is about the presentation,
the flow of the work and not about the actual design. How many typical
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 tings, but note, there are
count 10+ then you might be overcomplicating things, but note, there are
no rules, a book where each spread is individually and manually layed out
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
@ -196,7 +195,18 @@ If only one image/text file is provided then `make-spreads.sh` will set it
on the right page of the spread using the appropriate page template and
leave the left page blank.
<!-- XXX do we need a `blankpage.tex` template??? -->
A black page uses `blankpage.tex` template if available, otherwise a
trivial blank page is used:
```latex
\null
\newpage
```
<!-- XXX
Template search order:
- spread directory
- template directory
-->
#### Manual template selection
@ -250,6 +260,8 @@ If `layout.tex` is present it will be included as the page layout/template.
Any paths in the `layout.tex` should be relative to the location the
built block .tex file will be located, usually to the project root.
Template field substitution is done as for all other templates.
### Templates
@ -298,7 +310,7 @@ environment variable.
Inline captions are also supported:
```bnf
pages/
spreads/
├── <spread>/
│   ├── ...
│   ├── 00-<image-name>.<ext>
@ -332,6 +344,8 @@ IMAGE_FORMATS=jpeg|jpg|png|pdf|svg|eps
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...
@ -358,6 +372,10 @@ IMAGE_SPREAD=(
[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:
@ -374,11 +392,19 @@ $ make-spreads.sh -c <path> ..
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
@ -396,8 +422,8 @@ This will:
- read the INPUT
- keep lines starting with \def\<module-name>@[A-Z]\+
- keep lines starting with '%%'
- %%%%% Text -> \subsection(Text)
- %%%% Text -> \section(Text)
- %%%%% Text -> \subsection{Text}
- %%%% Text -> \section{Text}
- %% >> code -> \begin{verbatim}code\end{verbatim}
- write the result to OUTPUT
@ -424,4 +450,4 @@ NOTE: the idea of keeping latex docs in a latex file is far simpler
in both the repo and in installed form, so .dtx is not used.
```
<!-- vim:set ts=4 sw=4 nowrap : -->

View File

@ -26,8 +26,8 @@ printhelp(){
echo " - read the INPUT"
echo " - keep lines starting with \\def\\<module-name>@[A-Z]\\+"
echo " - keep lines starting with '%%'"
echo " - %%%%% Text -> \\subsection(Text)"
echo " - %%%% Text -> \\section(Text)"
echo " - %%%%% Text -> \\subsection{Text}"
echo " - %%%% Text -> \\section{Text}"
echo " - %% >> code -> \\begin{verbatim}code\\end{verbatim}"
echo " - write the result to OUTPUT"
echo
@ -54,13 +54,6 @@ printhelp(){
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
printmsg(){
# print message...
@ -88,21 +81,23 @@ while true ; do
;;
-p|--prefix)
PREFIX=$2
shift
shift
shift 2
continue
;;
-s|--strip)
STRIP_DOC=1
shift
continue
;;
-n|--no-msg)
NO_MSG=1
shift
continue
;;
# handle unknown options...
-*|--*)
printerror "unknown option \"$1\""
echo "Error: unknown option: \"$1\"" >&2
exit
;;
@ -131,7 +126,7 @@ if [ -z $STRIP_DOC ] ; then
printmsg "Documentation" \
> "$OUTPUT"
cat "$INPUT" \
| egrep '(^%'$PREFIX'|^\\edef\\'$MODULE'@[A-Z][A-Z]+)' \
| grep -E '(^%'$PREFIX'|^\\edef\\'$MODULE'@[A-Z][A-Z]+)' \
| sed \
-e 's/^\(\\edef\\\)'$MODULE'@/%'$PREFIX'\1/' \
-e 's/%'$PREFIX'%%%% \(.*\)/%'$PREFIX'\\subsubsection{\1}\\label{subsubsec:\1}/' \
@ -146,8 +141,8 @@ else
printmsg "Stripped code" \
> "$OUTPUT"
cat "$INPUT" \
| egrep -v '%'$PREFIX'' \
| egrep -v '^(\s*%)?\s*$' \
| grep -Ev '%'$PREFIX'' \
| grep -Ev '^(\s*%)?\s*$' \
>> "$OUTPUT"
fi

297
scripts/make-spreads.sh Normal file → Executable file
View File

@ -1,76 +1,16 @@
#!/bin/bash
#!/usr/bin/env bash
shopt -s nullglob extglob
#----------------------------------------------------------------------
#
# TIP: It is better to think of a visual book as a set of spreads
# rather than a set of pages, hence the focus on spreads in the
# code below.
# The main unit of a "visual" book is a spread, it's the thing
# you see when you hold the book open, and the main workflow
# when building a book is creating spreads and ordering them so
# a single page is almost never treated as an independent unit.
# TIP: it is not recommended to use too many templates, the layout
# should be and feel structured and this structure should not be
# too complex for the average reader to get comfortable in.
#
#
# For docs see README.md
#
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Template structure:
# $TEMPLATE_DIR/
# spread.tex
# imagepage.tex
# textpage.tex
# ...
# $CAPTION_DIR/
# <image>.txt
# image caption.
# this is separated to decouple caption writing from the
# changes to the layout/sequencing and this drastically
# simplify the work with writers.
# For this reason this takes priority over local captions (XXX revise).
# ...
# $SPREADS_DIR/
#
# XXX DOC:
# $spread/
# tweaks.tex
# template tweaks.
# loaded before the templates are handled.
# layout.tex
# manual layout of spread.
# if given rest of directory contents are
# ignored.
# fields:
# ${IMAGE0}
# replaced with image path
# ${CAPTION0}
# replaced with content of caption file if found
# and empty otherwise.
# ${TEXT0}
# replaced with the content of a text file if
# found and empty otherwise.
# ...
# NOTE: if images are included, hi-res source
# substitution is not done here.
# NOTE: fields are ordered and matched according to their
# position and not their number, e.g. in the following
# sequence:
# IMAGE, IMAGE10, IMAGE20, ..,
# CAPTION2, CAPTION7, CAPTION12, ..
# IMAGE10 will be filled with the second found image
# and CAPTION7 will be filled with the second found
# caption.
# <spread-template-name>.tpl
# indicates the spread template to use.
# if given the rest of the .tex files in
# directory are ignored.
# resolves to:
# templates/<spread-template-name>.tex
# fields:
# ${IMAGE0}
# ${CAPTION0}
# ${TEXT0}
# ...
# ...
# imagepage.tex
# image page template.
# fields:
@ -87,46 +27,7 @@ shopt -s nullglob extglob
# <spread-template-name>-textpage.tpl
# indicates the image/text page template to use.
# ignored if explicit templates are given.
# fields:
# ${IMAGE}
# ${CAPTION}
# ${TEXT}
# ...
# 00-<image>.png
# image.
# if $IMAGE_HIRES_DIR is set then this will
# resolve to:
# $IMAGE_HIRES_DIR/<image>
# supported formats:
# .jpeg, .png, .pdf, .svg, .eps
# (see $IMAGE_FORMATS)
# 00-<image>.txt
# local image caption text.
# NOTE: this must be named the same as the image.
# 01-<text>.txt
# text.
# ...
# ...
#
#
# Env variables:
# ANOTATE_IMAGE_PATHS=
# TEXT_FORMATS=<ext>|..
# IMAGE_FORMATS=<ext>|..
# SPREADS_DIR=<path>
# IMAGE_HIRES_DIR=<path>
# sets the path to which the hi-res images are resolved.
# CAPTION_DIR=<path>
# TEMPLATE_DIR=<path>
# EMPTY_PAGE=<name>
# TEXT_PAGE=<name>
# IMAGE_PAGE=<name>
# IMAGE_SPREAD=<array>
#
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# XXX
#
#
#
@ -155,9 +56,11 @@ ANOTATE_IMAGE_PATHS=${ANOTATE_IMAGE_PATHS:=}
# supported formats/extensions...
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}
@ -190,7 +93,7 @@ IMAGE_PAGE=${IMAGE_PAGE:=imagepage}
# 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
if [ ${#CFG_IMAGE_SPREAD[@]} != 0 ] ; then
IMAGE_SPREAD=()
for i in ${!CFG_IMAGE_SPREAD[@]} ; do
IMAGE_SPREAD[$i]=${CFG_IMAGE_SPREAD[$i]}
@ -229,6 +132,9 @@ printhelp(){
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)"
@ -276,38 +182,50 @@ while true ; do
-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\""
echo "Error: unknown option \"$1\"" >&2
exit
;;
@ -378,24 +296,44 @@ readCaption(){
# getTemplate SPREAD TYPE
#
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_DIR/${TEMPLATE[0]%-${TYPE}.*}.tex"
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
if [ -z $TEMPLATE ] ; then
TEMPLATE="$TEMPLATE_DIR/${TYPE}.tex"
# local template...
template=($spread/*-$name.tex)
if [ ${#template[@]} != 0 ] ; then
template=${template[0]}
else
template=($spread/$name.tex)
fi
if ! [ -e $TEMPLATE ] ; then
return
# global template...
if [ -z $template ] \
|| ! [ -e "$template" ] ; then
template="$TEMPLATE_DIR/${name}.tex"
fi
echo $TEMPLATE
# check if the thing exists...
if ! [ -e $template ] ; then
return 1
fi
echo $template
}
@ -420,6 +358,12 @@ templateSlots(){
# 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"
@ -438,12 +382,22 @@ populateTemplate(){
local txt=()
local elem
for elem in "${items[@]}" ; do
if [[ "$elem" =~ $IMAGE_FORMATS ]] ; then
if [[ "${elem,,}" =~ $IMAGE_FORMATS ]] ; then
img+=("$elem")
elif [[ "$elem" =~ $TEXT_FORMATS ]] ; then
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
@ -459,7 +413,7 @@ populateTemplate(){
local i=0
for var in ${slots[@]} ; do
name=${var//[0-9]/}
if ! [ ${name} = "IMAGE" ] ; then
if [ ${name} != "IMAGE" ] ; then
continue
fi
@ -479,14 +433,17 @@ populateTemplate(){
i=$(( i + 1 ))
val=${val//\//\\/}
text=$(echo -e "${text}" | \
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
if [ ${name} != "CAPTION" ] ; then
continue
fi
@ -502,7 +459,7 @@ populateTemplate(){
val=$(readCaption "${val}")
fi
text=$(echo -e "${text}" | \
text=$(echo "${text}" | \
sed "s/\${${var}}/${val}/g")
done
@ -523,14 +480,17 @@ populateTemplate(){
done
val=${val//\//\\/}
text=$(echo -e "${text}" | \
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 -e "${text}"
return 0
echo "${text}"
return
}
@ -538,7 +498,7 @@ populateTemplate(){
# usage:
# handleSpread SPREAD
#
# closure: $IMAGE_HIRES_DIR, $IMAGE_SPREAD
# closure: $GRAPHICX_PATH, $IMAGE_HIRES_DIR, $IMAGE_SPREAD
handleSpread(){
local spread="$1"
# skip non-spreads...
@ -563,30 +523,41 @@ handleSpread(){
local txt=()
local items=()
for elem in "$spread"/* ; do
if [[ "$elem" =~ $IMAGE_FORMATS ]] ; then
if [[ "${elem,,}" =~ $IMAGE_FORMATS ]] ; then
img+=("$elem")
items+=("$elem")
elif [[ "$elem" =~ $TEXT_FORMATS ]] ; then
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...
if ! [ -z $IMAGE_HIRES_DIR ] ; then
elif ! [ -z $IMAGE_HIRES_DIR ] ; then
local C=0
for image in "${img[@]}" ; do
# skip non-images...
local new="$IMAGE_HIRES_DIR/`basename ${image/[0-9]-/}`"
local new=`basename ${image}`
new="$IMAGE_HIRES_DIR/${new#+([0-9])-}"
# ignore file ext for availability test...
# 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}\" -> \"${new}\"" \
echo "% WARNING: hi-res image not found for: \"${image}\" -> \"${target}\"" \
| tee >(cat >&2)
echo %
fi
@ -607,7 +578,7 @@ handleSpread(){
# 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 '.*-('${IMAGE_PAGE}'|'${TEXT_PAGE}')\.tpl'`)
| grep -E -v '.*-('${IMAGE_PAGE}'|'${TEXT_PAGE}')\.tpl'`)
fi
# no template explicitly defined -> match auto-template...
if [ -z $layout ] && [ -z $template ] ; then
@ -635,63 +606,61 @@ handleSpread(){
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")
# XXX need to use populateTemplate here...
# ...to do this need to somehow remove the used
# slots/files from list...
# image...
if [[ "$elem" =~ $IMAGE_FORMATS ]] ; then
if [[ "${elem,,}" =~ $IMAGE_FORMATS ]] ; then
echo %
echo "% $P page (image)..."
template=`getTemplate "$spread" "$IMAGE_PAGE"`
echo % template: $template
anotatePath "${elem}"
local caption=$(getCaption "$spread" "${elem}")
caption=$(readCaption "$caption")
cat "${template}" \
| sed -e "s%\${IMAGE0\?}%${elem%.*}%" \
-e "s%\${CAPTION0\?}%${caption}%"
populateTemplate "$spread" "$template"
# text...
else
echo %
echo "% $P page (text)..."
template=$(getTemplate "$spread" "$TEXT_PAGE")
echo % template: $template
cat "${template}" \
| sed "s%\${TEXT}%${elem}%"
populateTemplate "$spread" "$template"
fi
# reset for next page...
template=
# ignore the rest of the items when we are done
# creating two pages...
[ $C == 2 ] \
&& return 0
if [ $C == 2 ] ; then
populateTemplate_img=
populateTemplate_txt=
return
fi
done
fi
fi
# formatting done...
[ -z $template ] \
&& return 0
&& return
# format template path...
template=${template/$spread\//}
template=${template/[0-9]-/}
# get...
template="${template[0]%.*}.tex"
if ! [ -e "$template" ] ; then
template="$TEMPLATE_DIR/${template[0]%.*}.tex"
# 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 0
return $?
}

View File

@ -45,7 +45,7 @@
\usepackage{fontspec}
\setmainfont[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\sectiontitlefont[Mapping=tex-text]{Open Sans Light}

View File

@ -42,10 +42,13 @@
%\fontsize{30pt}{36pt}\selectfont
% fonts...
%\usepackage{ascii}
%\usepackage[default,oldstyle,scale=0.95]{opensans}
%\usepackage[T1]{fontenc}
\usepackage{fontspec}
\setmainfont[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\sectiontitlefont[Mapping=tex-text]{Open Sans Light}