refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-03-15 21:51:20 +03:00
parent 78eff5c68d
commit 8c78f72263
2 changed files with 17 additions and 1 deletions

View File

@ -198,7 +198,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

View File

@ -278,6 +278,7 @@ readCaption(){
# usage:
# getTemplate SPREAD TYPE
#
# XXX REVISE...
getTemplate(){
local SPREAD=$1
local TYPE=$2
@ -285,6 +286,10 @@ getTemplate(){
if [ -z $TEMPLATE ] ; then
TEMPLATE=($SPREAD/*-$TYPE.tpl)
if ! [ -z $TEMPLATE ] ; then
#TEMPLATE=${TEMPLATE_DIR}/$(echo "${TEMPLATE[0]}" \
# | sed -e "s/$SPREAD\///" \
# -e 's/^[0-9]\+-//' \
# -e "s/-${TYPE}.*$//")
TEMPLATE=${TEMPLATE/$SPREAD\//}
TEMPLATE=${TEMPLATE/[0-9]-/}
TEMPLATE="$TEMPLATE_DIR/${TEMPLATE[0]%-${TYPE}.*}.tex"