better navigation...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-03-10 13:30:19 +03:00
parent 52ef3c8cda
commit c5f5195670

View File

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