minor tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-03-09 16:46:18 +03:00
parent f0c0b79c45
commit 52ef3c8cda

View File

@ -1,146 +1,152 @@
`make-images.sh` `make-images.sh`
================ ================
Generate LaTeX block of pages from a directory tree. Generate LaTeX block of pages from a directory tree.
This is initially intended as a means to convert the exported directory 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 tree from an image viewer where image/text sequencing was done, but it
can also be used standalone. can also be used standalone.
A typical project tree: Goals:
``` - Decouple layout, images, processing and different texts to enable
book/ different people to work on them independently and in parallel,
├── templates/ . . . . . . . . . . . . Global templates. - Automate the build process.
│ ├── imagepage.tex . . . . . . . . . Single page image template,
│ ├── textpage.tex . . . . . . . . . Single page text template,
│   │ These are used to build spreads A typical project tree:
│   │ when no explicit template matches. ```
│ ├── blank-image.tex book/
│ ├── image-blank.tex ├── templates/ . . . . . . . . . . . . Global templates.
│ ├── image-image.tex │ ├── imagepage.tex . . . . . . . . . Single page image template,
│ ├── fullbleed.tex │ ├── textpage.tex . . . . . . . . . Single page text template,
│ └── ... │   │ These are used to build spreads
├── pages/ . . . . . . . . . . . . . . Main block layout. │   │ when no explicit template matches.
│   ├── 00/ . . . . . . . . . . . . . . A basic spread. │ ├── blank-image.tex
│   │   ├── tweaks.tex The spread template is built │ ├── image-blank.tex
│   │   └── 0-DSC02432.jpg automatically with tweaks.tex │ ├── image-image.tex
│   │   prepended. │ ├── fullbleed.tex
│   ├── 01/ │ └── ...
│   │   ├── 0-DSC02439.jpg ├── pages/ . . . . . . . . . . . . . . Main block layout.
│   │   └── 1-intro.txt │   ├── 00/ . . . . . . . . . . . . . . A basic spread.
│   ├── 02/ │   │   ├── tweaks.tex The spread template is built
│   │   ├── fullbleed.tpl . . . . . . . Explicitly use a global template. │   │   └── 0-DSC02432.jpg automatically with tweaks.tex
│   │   └── 1-DSC02511.jpg │   │   prepended.
│   ├── 03/ │   ├── 01/
│   │   ├── 0-DSC02509-0.jpg │   │   ├── 0-DSC02439.jpg
│   │   └── 1-DSC02506-0.jpg │   │   └── 1-intro.txt
│   └── ... │   ├── 02/
├── captions/ . . . . . . . . . . . . . Image captions. │   │   ├── fullbleed.tpl . . . . . . . Explicitly use a global template.
│   ├── DSC02432.txt │   │   └── 1-DSC02511.jpg
│   ├── DSC02439.txt │   ├── 03/
│   ├── DSC02511.txt │   │   ├── 0-DSC02509-0.jpg
│   └── ... │   │   └── 1-DSC02506-0.jpg
├── setup.tex . . . . . . . . . . . . . Book block setup. │   └── ...
│ This is included by all top level ├── captions/ . . . . . . . . . . . . . Image captions.
│ .tex files like block.tex, │   ├── DSC02432.txt
│ cover.tex, ...etc. │   ├── DSC02439.txt
├── block.tex . . . . . . . . . . . . . Block skeletal layout. │   ├── DSC02511.txt
│ This usually includes the titles, │   └── ...
│ technical pages and sources the ├── setup.tex . . . . . . . . . . . . . Book block setup.
│ ./block-pages.tex. │ This is included by all top level
├── block-pages.tex . . . . . . . . . . The generated block content. │ .tex files like block.tex,
├── cover.tex . . . . . . . . . . . . . Cover layout. │ cover.tex, ...etc.
├── jacket.tex . . . . . . . . . . . . Dust jacket layout. ├── block.tex . . . . . . . . . . . . . Block skeletal layout.
└── ... │ This usually includes the titles,
``` │ technical pages and sources the
│ ./block-pages.tex.
Generate the block: ├── block-pages.tex . . . . . . . . . . The generated block content.
```shell ├── cover.tex . . . . . . . . . . . . . Cover layout.
$ make-images.sh ./pages > block-pages.tex ├── jacket.tex . . . . . . . . . . . . Dust jacket layout.
``` └── ...
```
Note that `make-images.sh` does not force a specific layout outside of the `pages`
directory, all paths are configurable. The way the root files are structured is Generate the block:
just one way to organize a book's srouce code with minimal code duplication. ```shell
$ make-images.sh ./pages > block-pages.tex
```
For runtime help see:
```shell Note that `make-images.sh` does not force a specific layout outside of the `pages`
$ make-images.sh --help directory, all paths are configurable. The way the root files are structured is
``` just one way to organize a book's source code with minimal code duplication.
The process For runtime help see:
----------- ```shell
$ make-images.sh --help
```
Layout
------
The process
``` -----------
pages/
├── <spread>/
│   ├── tweaks.tex Layout
│   ├── layout.tex ------
│   ├── <template-name>.tpl
│   ├── 00-<image-name>.<ext> ```
│   ├── 01-<text>.txt pages/
│   └── ... ├── <spread>/
└── ... │   ├── tweaks.tex
``` │   ├── layout.tex
│   ├── <template-name>.tpl
│   ├── 00-<image-name>.<ext>
Image captions │   ├── 01-<text>.txt
-------------- │   └── ...
└── ...
In general image captions are decoupled from the main layout to enable ```
writers and editors to work on them externally.
```
captions/ Image captions
├── <image-name>.txt --------------
└── ...
``` In general image captions are decoupled from the main layout to enable
writers and editors to work on them externally.
The captions folder name/location is controlled by the `$CAPTION_DIR` ```
environment variable. captions/
├── <image-name>.txt
└── ...
Inline captions are also supported: ```
```
pages/ The captions folder name/location is controlled by the `$CAPTION_DIR`
├── <spread>/ environment variable.
│   ├── ...
│   ├── 00-<image-name>.<ext>
│   ├── 00-<image-name>.txt . . . . . . Local image caption Inline captions are also supported:
│   └── ... ```
└── ... pages/
``` ├── <spread>/
An inline caption must have the same filename as the corresponding image │   ├── ...
but with a .txt extension. │   ├── 00-<image-name>.<ext>
│   ├── 00-<image-name>.txt . . . . . . Local image caption
│   └── ...
Templates └── ...
--------- ```
An inline caption must have the same filename as the corresponding image
``` but with a .txt extension.
templates/
├── <template-name>.tex
└── ... Templates
``` ---------
```
Environment variables templates/
--------------------- ├── <template-name>.tex
└── ...
```
`cls2tex.sh` Environment variables
============ ---------------------
Extract the documentation from photobook.cls which is used to build the
photobook.pdf reference manual.
`cls2tex.sh`
============
Extract the documentation from photobook.cls which is used to build the
photobook.pdf reference manual.