photobook/scripts/cls2tex.sh
Alex A. Naanou a1a5b89b0d ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-03-20 12:50:02 +03:00

1589 lines
69 KiB
Bash
Executable File

%----------------------------------------------------------------------
% Stripped code file generated by:
% ./scripts/cls2tex.sh --strip photobook.tex ./scripts/cls2tex.sh --prefix M --strip
% NOTE: multiple messages indicate multiple runs.
%----------------------------------------------------------------------
%----------------------------------------------------------------------
% Documentation file generated by:
% ./scripts/cls2tex.sh photobook.cls
% NOTE: multiple messages indicate multiple runs.
%----------------------------------------------------------------------
% NOTE: \def\<module-name>@[A-Z]+ macros will be visible to both the
% code and the generated docs...
\edef\FILEVERSION{v0.1.15}
\edef\FILEDATE{2023-03-18}
\documentclass{ltxdoc}
% \usepackage{iftex}
% \ifluatex
% \edef\pdfcompresslevel{\pdfvariable compresslevel}
% \edef\pdfobjcompresslevel{\pdfvariable objcompresslevel}
% \fi
% \pdfcompresslevel 0
% \pdfobjcompresslevel 0
\usepackage[a4paper,margin=25mm,left=55mm,nohead]{geometry}
% NOTE: this needs to load before hyperref or bookmarks will break...
% NOTE: loading hyperref here will break it loading later in one of
% the packages...
\usepackage{titlesec}
\usepackage[numbered]{hypdoc}
\usepackage{doctools}
\usepackage{needspace}
\usepackage[toc]{multitoc}
\renewcommand*{\multicolumntoc}{2}
\setlength{\columnseprule}{0.5pt}
\usepackage{imakeidx}
\makeindex[
columns=1,
title=Alphabetical Index,
intoc,
options= -s photobook.ist ]
% \newcommand\DescribeGlobal[1]{%
% \DescribeMacro{#1}}
\newcommand\LEGACY[1][]{\fbox{LEGACY #1}}
\newcommand\EXPERIMENTAL[1][]{\fbox{EXPERIMENTAL #1}}
% sections to new pages...
\newcommand\sectionbreak{\Needspace{5\baselineskip}}
% remove section numbering...
\setcounter{secnumdepth}{0}
% paragraph configuration...
\setlength\parindent{0pt}
\setlength\parskip{0.5em}
\newcommand\blankfootnote[1]{%
\begingroup
\renewcommand\thefootnote{}%
\footnote{#1}%
\addtocounter{footnote}{-1}%
\endgroup}
\begin{document}
\title{\textsf{photobook} --- Document class for building photo-books
\thanks{This file describes version \FILEVERSION,
last revised \FILEDATE.}}
\author{Alex A. Naanou\thanks{E-mail: alex.nanou@gmail.com}}
\date{Released \FILEDATE}
\maketitle
\begin{abstract}
The |photobook| \LaTeX\space document class extends the |book| class
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.
\end{abstract}
\tableofcontents
\section{Introduction}\label{sec:Introduction}
\LaTeX\ is great with textual and text-primary content with figures
peppered in, as long as pictures/figures flow within, with or as part
of text, vanilla \LaTeX\ is fantastic.
One can relatively easily stretch the flow concept to more complex
layouts introducing {\it even} and {\it odd} pages (the |book| class is
one example) and flow rules based on them, but the next step, {\it bleeds},
combining page pairs into {\it spreads} as is often needed when designing
image-oriented books is lacking. Full-bleed images/pages can be implemented
manually, some more effort is needed to split something horizontally
into a page spread, but doing so for whole book's worth of content is
not practical -- automating and experimenting with this process is
how |photobook| began.
|photobook| extends the |book| class adding page layout types, bleeds
and other global geometry configuration, introduces the {\it page} and
{\it spread} as first-class elements into the document flow. These concepts
are generalized as |cell|s. A |cell| is similar to a figure, it can
be placed within the document flow, but unlike a figure a |cell| can
be aligned relative to a page, it can fill a page, a cell can even be
horizontally split to fill several pages (how spreads are implemented).
On top of the |cell|, {\it page}, and {\it spread} concepts, |photobook|
also builds a set of configurable high level macros and templates for
common use cases like full bleed image spreads, foldouts, ... etc.
\section{Usage}\label{sec:Usage}
\begin{verbatim} \documentclass[<options>]{photobook} \end{verbatim}
\section{Options}\label{sec:Options}
\subsection{Page geometry}\label{subsec:Page geometry}
\DescribeMacro{blockwidth=<len>}
\DescribeMacro{blockheight=<len>}
\DescribeMacro{bindingoffset=<len>}
\DescribeMacro{bleed=<len>}
This is similar to what |geometry| does, but adds bleed support.
\begin{minipage}{\textwidth}
\begin{verbatim}
<---> bleed <---> bleed
+ - - - - - - - - - - - - - - - - - - - - - + - + ^
. . . | bleed
. +---------------------------------------+----- v . . ---
. | ^ . = .
. | . . . . . . | . . = . ^
. |<-- blockwidth ----------------------->= . |
. | . | . . = . |
. | | . = . textheight
. | . Page | . . = . |
. | blockheight . = . |
. | . | . . = . |
. | | <---> bindingoffset |
. | . . . . . . | . . = . v
. | v . = .
. +---------------------------------------+----- ^ . . ---
. . . . | bleed
+ - - - - - - - - - - - - - - - - - - - - - + - + v
. .
| <-- textwidth --------------> . |
^ gutter
\end{verbatim}
\end{minipage}
\DescribeMacro{flatfold=<len>}
Sets the clearance set aside for a flat fold, used for foldouts
(see: \nameref{subsec:Foldout page cells} section).
\DescribeMacro{pagefold=<fold>}
Sets the default fold type.
Can be |in| or |out|.
\DescribeMacro{foldout=<fold-spec>}
Sets the default fold specification (i.e. sets |\defaultfoldout|).
For more information see: \nameref{subsec:Foldout page cells} section.
\subsection{layout}\label{subsec:layout}
\DescribeMacro{layoutmode=<layout>}
\DescribeMacro{block}
\DescribeMacro{endpaper}
\DescribeMacro{cover}
\DescribeMacro{jacket}
Sat page layout mode.
\begin{verbatim} layoutmode=<option> \end{verbatim}
|block| (default)
Basic page layout.
\begin{minipage}{\textwidth}
\begin{verbatim}
blockwidth
<--------------->
+---------------+
| |
| |
| page |
| |
| |
+---------------+
\end{verbatim}
\end{minipage}
|endpaper|:
Endpaper layout.
\begin{minipage}{\textwidth}
\begin{verbatim}
blockwidth 2x
<------------------------------->
+---------------+---------------+
| . |
| . |
| endpaper |
| . |
| . |
+---------------+---------------+
\end{verbatim}
\end{minipage}
|cover|
Book cover layout
\DescribeMacro{coverboardgrow=<len>}
\DescribeMacro{coverflap=<len>}
\DescribeMacro{spinewidth=<len>}
\DescribeMacro{spinewidth=<len>}
\begin{minipage}{\textwidth}
\begin{verbatim}
blockwidth blockwidth
<---------------> <--------------->
<-> coverboardgrow <-> coverboardgrow
<-> coverflap . <-> coverflap
. . . . . .
+-------------------++---++-------------------+ ---
| + - - - - - - - - ++ - ++ - - - - - - - - + | --^ coverflap
| . + - - - - - - - ++ - ++ - - - - - - - + . | --^ coverboardgrow
| . . .. .. . . | ^
| . . .. .. . . | | blockheight
| . . Back .. .. Front . . | |
| . . .. .. . . | |
| . . .. .. . . | v
| . + - - - - - - - ++ - ++ - - - - - - - + . | --v coverboardgrow
| + - - - - - - - - ++ - ++ - - - - - - - - + | --v coverflap
+-------------------++---++-------------------+ ---
. .
^. .^ spinefold
. .
<---> spinewidth
\end{verbatim}
\end{minipage}
|jacket|
Dust jacket layout
\DescribeMacro{jacketwrap=<len>}
\DescribeMacro{jacketflap=<len>}
\DescribeMacro{jacketflapfront=<len>}
\DescribeMacro{jacketflapback=<len>}
\begin{minipage}{\textwidth}
\begin{verbatim}
<---> jaketflap/jacketflapback <---> jaketflap/jacketflapfront
. . . .
. . blockwidth blockwidth . .
. . <---------------> <---------------> . .
. .<-> coverboardgrow <-> coverboardgrow
. . . . . .
+---++-----------------++---++-----------------++---+ ---
| .. + - - - - - - - ++ - ++ - - - - - - - + .. | --^ coverboardgrow
| .. . .. .. . .. | ^
| .. . .. .. . .. | | blockheight
| .. . Back .. .. Front . .. | |
| .. . .. .. . .. | |
| .. . .. .. . .. | v
| .. + - - - - - - - ++ - ++ - - - - - - - + .. | --v coverboardgrow
+---++-----------------++---++-----------------++---+ ---
.. . . ..
^ jacketwrap . . ^ jacketwrap
^. .^ spinefold
. .
<---> spinewidth
\end{verbatim}
\end{minipage}
Note that for |cover|, |endpaper|, and |jacket|,
\href{https://ctan.org/pkg/fancyhdr}{fancyhdr}'s |\pagestyle{..}| is
set to |empty| by default.
\subsection{Image clearance}\label{subsec:Image clearance}
\DescribeMacro{clearimage=<len>}
Distance from image to paper border (clearance) for full-page images.
this can be:
- negative value set image bleed,
- positive value set distance from paper edge to image.
\subsection{Image block layout}\label{subsec:Image block layout}
\DescribeMacro{imageblockwidth=<len>}
\DescribeMacro{imageblockheight=<len>}
\DescribeMacro{imageblockoffsettop=<len>}
Image block size relative to text block.
\subsection{PDF Viewer layout}\label{subsec:PDF Viewer layout}
\DescribeMacro{pdfpagelayout=<mode>}
\DescribeMacro{SinglePage}
\DescribeMacro{OneColumn}
\DescribeMacro{TwoColumnLeft}
\DescribeMacro{TwoColumnRight}
\DescribeMacro{TwoPageLeft}
\DescribeMacro{TwoPageRight}
Sets PDF page display mode.
Defaults to |TwoColumnLeft| for |layoutmode=block| and |SinglePage| for
other modes.
See:
\href{https://ctan.altspu.ru/macros/latex/contrib/hyperref/doc/hyperref-doc.pdf}{hyperref}'s
|pdfpagelayout| for more options.
\subsection{Other options}\label{subsec:Other options}
\DescribeMacro{nofoldmarks}
If given disable fold marks.
This sets |\iffoldmarks| to false, otherwise it is set to true.
\DescribeMacro{foldmarksize=<len>}
Sets the fold mark size (default: 6mm).
\DescribeMacro{geometrynodefaults}
let the user set geometry defaults.
If this is not set |photobook| will override some user settings when
initializing geometry.
If set |photobook| will only set override:
\begin{verbatim}
paperwidth=\bleedblockwidth
paperheight=\bleedblockheight
bindingoffset=\bindingoffset
\end{verbatim}
\DescribeMacro{roundprintedlengthsto=<num>}
Number of digits to round printed lengths to (default: 1).
This is a shorthand to |numprint|'s |\nprounddigits{..}|, us it to
change values mid-document if needed.
This is mostly used for |\GenerateTemplate|.
\section{Packages}\label{sec:Packages}
|photobook| adds and uses internally the following packages:
\href{https://ctan.org/pkg/geometry}{geometry},
\href{https://ctan.org/pkg/kvoptions}{kvoptions},
\href{https://ctan.org/pkg/calc}{calc},
\href{https://ctan.org/pkg/xargs}{xargs},
\href{https://ctan.org/pkg/ifthen}{ifthen},
\href{https://ctan.org/pkg/iftex}{iftex},
\href{https://ctan.org/pkg/pgffor}{pgffor},
\href{https://ctan.org/pkg/xint}{xint},
\href{https://ctan.org/pkg/xinttools}{xinttools},
\href{https://ctan.org/pkg/listofitems}{listofitems},
\href{https://ctan.org/pkg/xkeyval}{xkeyval},
\href{https://ctan.org/pkg/etoolbox}{etoolbox},
\href{https://ctan.org/pkg/atbegshi}{atbegshi},
\href{https://ctan.org/pkg/hyperref}{hyperref},
\href{https://ctan.org/pkg/eso-pic}{eso-pic},
\href{https://ctan.org/pkg/environ}{environ},
\href{https://ctan.org/pkg/numprint}{numprint},
\href{https://ctan.org/pkg/trimclip}{trimclip},
\href{https://ctan.org/pkg/xcolor}{xcolor},
\href{https://ctan.org/pkg/pagecolor}{pagecolor},
\href{https://ctan.org/pkg/colorspace}{colorspace},
\href{https://ctan.org/pkg/graphicx}{graphicx},
\href{https://ctan.org/pkg/adjustbox}{adjustbox},
\href{https://ctan.org/pkg/adjustbox}{adjustbox},
\href{https://ctan.org/pkg/fancyvrb}{fancyvrb},
\href{https://ctan.org/pkg/tikz}{tikz},
\href{https://ctan.org/pkg/rotating}{rotating},
\href{https://ctan.org/pkg/fancyhdr}{fancyhdr}, and
\href{https://ctan.org/pkg/pdfpages}{pdfpages}.
\newline
Most of these packages can be used by the book author without explicitly
importing them.
\section{Globals}\label{sec:Globals}
% \DescribeGlobal{layoutmode}
\DescribeMacro{\layoutmode=<mode>}
Layout mode
\DescribeMacro{\pdfpagelayout=<mode>}
Controls the default layout in the pdf viewer.
\DescribeMacro{\spinewidth=<len>}
Spine width
\DescribeMacro{\spinefold=<len>}
Spine fold width
\DescribeMacro{\coverboardgrow=<len>}
Controls how much biger the cover board is than the page block
\DescribeMacro{\coverflap=<len>}
Cover flap
\DescribeMacro{\jacketwrap=<len>}
\DescribeMacro{\jacketflap=<len>}
\DescribeMacro{\jacketflapfront=<len>}
\DescribeMacro{\jacketflapback=<len>}
Jacker configuration
\DescribeMacro{\blockwidth=<len>}
\DescribeMacro{\blockheight=<len>}
Page block size
\DescribeMacro{\bleedblockwidth=<len>}
\DescribeMacro{\bleedblockheight=<len>}
Page block size with bleeds
These are equivalent to |\paperwidth| and |\paperheight| but are
independent of them...
\DescribeMacro{\pageblockwidth=<len>}
\DescribeMacro{\pageblockheight=<len>}
Original page block size
for the block layout these are the same as |\blockwidth| and |\blockheight|
for other layouts these are the original page layout size while the
|\blockwidth| are set tho the current layout visible size.
\DescribeMacro{\bleed=<len>}
Page bleed size
\DescribeMacro{\bindingoffset=<len>}
Binding offset
\DescribeMacro{\defaultfoldout=<fold-spec>}
Set the default fold specification.
This can be set via the |foldout| class option.
For more information see: \nameref{subsec:Foldout page cells} section.
\DescribeMacro{\flatfold=<len>}
Sets the amount of paper to account for a flat fold.
\DescribeMacro{\pagefold=<fold>}
Default fold type.
This defaults to |out| for |jacket| and |cover| and to |in| for other
layouts.
\DescribeMacro{\foldmarkoffset=<len>}
Sets the offset of fold marks from outside of page edge (default: |0.5\bleed|).
Note that this can either be a command or a dimension.
\DescribeMacro{\foldmarksize=<len>}
Sets fold marker size (vertical).
\DescribeMacro{\iffoldmarks}
Disable/enable fold marks.
The default is true, to toggle on/off use |\foldmarkstrue| / |\foldmarksfalse|.
This can be set globally via the |nofoldmarks| class option.
\DescribeMacro{\clearimage=<len>}
Image clearance
\DescribeMacro{\imageblockwidth=<ratio>}
\DescribeMacro{\imageblockheight=<ratio>}
Image block width relative to |\textwidth|
\DescribeMacro{\pagetextwidth=<len>}
\DescribeMacro{\pagetextheight=<len>}
Root page text width/height.
\DescribeMacro{\imageblockoffsettop=<ratio>}
The ration by which the image is raised in |\ImagePage{..}| and
derived templates.
\DescribeMacro{\clearcaption=<len>}
Block caption clearance from edge of parent cell.
Used as default by |\captionblockcell{..}|
\DescribeMacro{\captioncellspacing=<len>}
Block caption spacing from parent cell.
Used as default by |\captionblockcell{..}|
\DescribeMacro{\captionclearpage=<len>}
The distance between a caption block on a template page and page
borders (defaults to: |\clearimage|).
This is relevant only in page/spread templates.
\DescribeMacro{\cellparentwidth=<len>}
\DescribeMacro{\cellparentheight=<len>}
\DescribeMacro{\cellwidth=<len>}
\DescribeMacro{\cellheight=<len>}
\DescribeMacro{\celloffsetleft=<len>}
\DescribeMacro{\celloffsettop=<len>}
\DescribeMacro{\clearance=<len>}
Cell geometry.
These are set automatically by cells, thus it is not recommended to
edit them manually.
For more details see the \nameref{subsec:Cells} section.
\DescribeMacro{\clearfoldoutbinding=<len>}
\DescribeMacro{\clearfoldoutfold=<len>}
\DescribeMacro{\clearfoldoutedge=<len>}
Foldout geometry.
For more info see \nameref{subsec:Foldout page cells} section.
\section{Initialization}\label{sec:Initialization}
\DescribeMacro{\InitPages}
Initialize page dimensions.
This is not intended for direct use.
\DescribeMacro{\ReInitPages}
Reset and re-initialize page dimentions.
\DescribeMacro{\ChangeLayout}
Change document layout.
\begin{verbatim} \ChangeLayout{<layoutmode>} \end{verbatim}
This is a shorthand for |\def\layoutmode{<layoutmode>}| and then
|\ReInitPages|, and as this is changing any other parameters that may
affect the layout, this should be done last.
\section{Generic commands}\label{sec:Generic commands}
\DescribeMacro{\keywords\{..\}}
Set pdf metadata keywords
\begin{verbatim} \keywords{<keywords>} \end{verbatim}
\DescribeMacro{\subject\{..\}}
Set pdf metadata subject
\begin{verbatim} \subject{<subject>} \end{verbatim}
\DescribeMacro{\mindim\{..\}}
\DescribeMacro{\maxdim\{..\}}
Get min/max dimension.
\begin{verbatim} \mindim{A}{B} \end{verbatim}
\begin{verbatim} \maxdim{A}{B} \end{verbatim}
\DescribeMacro{\emptypage\{..\}}
Create an empty page.
\begin{verbatim} \emptypage \end{verbatim}
\begin{verbatim} \emptypage[<style>] \end{verbatim}
|<style>| is the style name as defined via |fancyhdr| (default: |empty|).
\DescribeMacro{\cleartoleftpage}
Forces content to left page.
This is a companion to |\cleardoublepage|.
\section{Environments and Cells}\label{sec:Environments and Cells}
\subsection{Generic}\label{subsec:Generic}
\DescribeEnv{page}
Page environment.
This is mainly designed to wrap other cell environment described later.
Note that this may span more than one page if there is enough stuff
packed in.
\DescribeEnv{leftpage}
\EXPERIMENTAL
\subsection{Cells}\label{subsec:Cells}
A cell environment is a box of specified size.
Cells can be both placed inline relative to other content or in an
absolute location.
Note that absolute cells are placed relative to the page and currently
can not be placed relative to other absolute cells (this might change
in the future).
\DescribeMacro{\cellwidth=<len>}
\DescribeMacro{\cellheight=<len>}
\DescribeMacro{\cellparentwidth=<len>}
\DescribeMacro{\cellparentheight=<len>}
\DescribeMacro{\celloffsettop=<len>}
\DescribeMacro{\celloffsetleft=<len>}
\DescribeMacro{\clearance=<len>}
A cell defines a set of contextual lengths:
\begin{minipage}{\textwidth}
\begin{verbatim}
<--> celloffsetleft
. <--------------> cellwidth
<----------------------> cellparentwidth
. . . .
+----------------------+ . . . . . . .
| . . | ^ ^ celloffsettop
| . . | | |
| +--------------+ . | . . | . . . v
| | | | | ^
| | | | | | cellheight
| | cell | | | |
| | | | | |
| | | | | |
| +--------------+ . | . . | . v
| | |
| | | cellparentheight
+----------------------+ . . v
\end{verbatim}
\end{minipage}
For absolutely positioned cells these define the cell offset from
parent.
The bare page can be reasonably treated as a cell.
Initally, outside of any cells |\cellwidth|, |\cellparentwidth| and
|\cellheight|, |\cellparentheight| are equal to |\paperwidth| and
|\paperheight| respectively, and |\celloffsettop| and |\celloffsetleft|
are set to |0pt|.
Changing these is not recommended, it likely will not affect the
current cell but can mess up nested cells.
\DescribeEnv{inlinecell}
\DescribeEnv{inlinecell*}
Create a basic inline cell.
\begin{verbatim} \begin{inlinecell}{<width>}{<height>} ... \end{inlinecell} \end{verbatim}
\begin{verbatim} \begin{inlinecell}[<valign>]{<width>}{<height>} ... \end{inlinecell} \end{verbatim}
This will clip oversized content.
|inlinecell*| is like |inlinecell| but will not clip.
\begin{verbatim} \begin{inlinecell*}{<width>}{<height>} ... \end{inlinecell*} \end{verbatim}
\begin{verbatim} \begin{inlinecell*}[<valign>]{<width>}{<height>} ... \end{inlinecell*} \end{verbatim}
|<valign>| can be one of |t| (default) for top, |c| for center or |b| for bottom.
These are just like |minipage| but provide cell mechanics.
\DescribeEnv{minipagecell}
\DescribeEnv{minipagecell*}
\EXPERIMENTAL
\DescribeEnv{zinlinecell}
\DescribeEnv{zinlinecell*}
\EXPERIMENTAL
Like |inlinecell| / |inlinecell*| but will take up zero space and
sized to |\cellwidth| x |\cellheight|.
\begin{verbatim} \begin{zinlinecell} ... \end{zinlinecell} \end{verbatim}
\begin{verbatim} \begin{zinlinecell}[<valign>] ... \end{zinlinecell} \end{verbatim}
\DescribeEnv{cell}
\DescribeEnv{cell*}
Create a basic absolutely positioned cell.
\begin{verbatim} \begin{cell}{<left>, <top>}{<width>}{<height>} ... \end{cell} \end{verbatim}
Oversized content will be clipped.
|cell*| is just like |cell| but will not clip its content.
\begin{verbatim} \begin{cell*}{<left>, <top>}{<width>}{<height>} ... \end{cell*} \end{verbatim}
|cell| and |cell*| are absolutely positioned either relative to
the current page or to the closest savecell.
\DescribeEnv{adjustcell}
\DescribeEnv{adjustcell*}
\EXPERIMENTAL
\subsection{Save cells}\label{subsec:Save cells}
\DescribeMacro{\savecell\{..\}}
\DescribeMacro{\gsavecell\{..\}}
Create a saved cell.
\begin{verbatim} \savecell{<name>}{<width>}{<height>}{ .. } \end{verbatim}
This is similar to |\newsavebox{..}| and |\sbox{..}| but adds
cell functionality.
|\gsavecell{..}| is the same as |\savecell{..}| but creates a global
cell.
Note that both |\gsavecell{..}| and |\savecell{..}| make the nested
|cell| and |cell*| position relative to the cell and not the page.
This is done by setting |\TPoptions{absolute=false}| for the cell
content which will also affect |textpos|'s macros.
\DescribeMacro{\usecell\{..\}}
\DescribeMacro{\usecell*\{..\}}
Use part of a saved cell.
\begin{verbatim} \usecell{<name>}(<top>, <left>){<width>}{<height>} \end{verbatim}
This will clip the content to cell.
|\usecell*{..}| is similar to |\usecell{..}| but will not clip the
cell content.
\begin{verbatim} \usecell*{<name>}(<top>, <left>){<width>}{<height>} \end{verbatim}
These are similar to |\usebox{..}|.
\subsection{Cell macros}\label{subsec:Cell macros}
Cell macros require a cell environment to function correctly.
\DescribeEnv{topdown}
\DescribeEnv{bottomup}
Rotate cell content vertically, orienting it top-down or bottom-up.
\begin{verbatim} \begin{topdown} ... \end{topdown} \end{verbatim}
\begin{verbatim} \begin{bottomup} ... \end{bottomup} \end{verbatim}
\DescribeEnv{cliptocell}
Clip content to parent cell.
\DescribeMacro{\imagecell\{..\}}
Place image in cell.
\begin{verbatim} \imagecell{<caption-cell>}{<image>} \end{verbatim}
\begin{verbatim} \imagecell[<key>=<value>, ..]{<caption-cell>}{<image>} \end{verbatim}
\begin{verbatim} \imagecell[fit]{}{<image>} \end{verbatim}
\begin{verbatim} \imagecell[fill]{}{<image>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
fit (default) fill
+-----------------+ . . . +-----------------+ . . .
| | . . | | . .
+-----------------+ . | | .
| . . | . | . . | .
| . . | . | . . | .
| image | . | image | .
| . . | . | . . | .
| . . | . | . . | .
+-----------------+ . | | .
| | . . | | . .
+-----------------+ . . . +-----------------+ . . .
\end{verbatim}
\end{minipage}
Centering. The image will be centered by default.
\begin{verbatim} \imagecell{}{<image>} \end{verbatim}
\begin{verbatim} \imagecell[center]{}{<image>} \end{verbatim}
Vertical alignment
\begin{verbatim} \imagecell[top]{}{<image>} \end{verbatim}
\begin{verbatim} \imagecell[bottom]{}{<image>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
top center (default) bottom
+-----------------+ +-----------------+ +-----------------+
| . . | | | | |
| . . | +-----------------+ | |
| image | | . . | | |
| . . | | . . | +-----------------+
| . . | | image | | . . |
+-----------------+ | . . | | . . |
| | | . . | | image |
| | +-----------------+ | . . |
| | | | | . . |
+-----------------+ +-----------------+ +-----------------+
\end{verbatim}
\end{minipage}
Horizontal alignment
\begin{verbatim} \imagecell[left]{}{<image>} \end{verbatim}
\begin{verbatim} \imagecell[right]{}{<image>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
left center (default) right
+-------------+---+ +-+-------------+-+ +---+-------------+
| . . | | | | . . | | | | . . |
| . . | | | | . . | | | | . . |
| . . | | | | . . | | | | . . |
| . . | | | | . . | | | | . . |
| image | | | | image | | | | image |
| . . | | | | . . | | | | . . |
| . . | | | | . . | | | | . . |
| . . | | | | . . | | | | . . |
| . . | | | | . . | | | | . . |
+-------------+---+ +-+-------------+-+ +---+-------------+
\end{verbatim}
\end{minipage}
Horizontal and vertical alignment can be combined to control alignment
of both vertical and horizontal images at the same time.
Image |clearance|. This sets the amount of clearance around an image
(default: |0pt|).
\begin{verbatim} \imagecell[clearance=-4mm]{}{<image>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
clearance > 0pt clearance = 0pt clearance < 0pt
(default)
+--------v--------+ +-----------------+ +--------^--------+
| | | | | |
|+---------------+| +-----------------+ ..+-----------------+..
|| . . || | . . | . |. .| .
|| . . || | . . | . | . . | .
|> image <| | image | < | image | >
|| . . || | . . | . | . . | .
|| . . || | . . | . |. .| .
|+---------------+| +-----------------+ ..+-----------------+..
| | | | | |
+--------^--------+ +-----------------+ +--------v--------+
\end{verbatim}
\end{minipage}
Note that if |clearance| is less than 0, the image will take up more
space than the containing cell, |\imagecell{..}| will not clip
its content and the whole image surface will be shown. If clipping is
needed then use |clipcell| environment as a container.
\begin{minipage}{\textwidth}
\begin{verbatim}
+-----------------+ - - caption cell size
. . .
+-----------------+ .
| | .
..+-----------------+.. . +
. |.caption cell .| . |
. | . . | . |
. | . | . |
. | . . | . |
. |. .| . |
..+-----------------+.. . +
| |
+-----------------+
\end{verbatim}
\end{minipage}
|<caption-cell>| occupies the same space as the image clipped by the
containing cell and provides all the cell functionality.
If |captionclearparent| is set, the |<caption-cell>| will fit into an
intersection between the image area and the parent cell padded by
|captionclearparent|.
This will write image path, page and size to |\jobname|.image-list,
this is useful for final image pre-press.
To disable image list set:
\begin{verbatim} \writeimagelistfalse \end{verbatim}
\DescribeMacro{\captioncell\{..\}}
Caption cell
Placement:
\begin{verbatim} \captioncell[<position>]{<caption>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
over
+-----------------+
| top |
| |
| |
| |
| center |
| |
| |
| |
| bottom |
+-----------------+
under
\end{verbatim}
\end{minipage}
Default:
\begin{verbatim} \captioncell{<caption>} \end{verbatim}
\begin{verbatim} \captioncell[top]{<caption>} \end{verbatim}
\begin{verbatim} \captioncell[center]{<caption>} \end{verbatim}
\begin{verbatim} \captioncell[bottom]{<caption>} \end{verbatim}
\begin{verbatim} \captioncell[over]{<caption>} \end{verbatim}
\begin{verbatim} \captioncell[under]{<caption>} \end{verbatim}
Horizontal alignment
\begin{verbatim} \captioncell[align=<mode>]{<caption>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
+-----------------+ +-----------------+ +-----------------+
|flushleft | | center | | flushright|
| | | | | |
| | | | | |
\end{verbatim}
\end{minipage}
Default:
\begin{verbatim} \captioncell{<caption>} \end{verbatim}
\begin{verbatim} \captioncell[align=flushleft]{<caption>} \end{verbatim}
\begin{verbatim} \captioncell[align=center]{<caption>} \end{verbatim}
\begin{verbatim} \captioncell[align=flushright]{<caption>} \end{verbatim}
Note that a caption cell does not take up any space in the parent cell
so multiple captions can be used in combination with other elements.
Note that caption cells currently do not play well with other content
in the same cell that takes up space, e.g. text, pictures, ...etc.
Captions are mainly suited to play well with image cells.
\DescribeMacro{\vcaptioncell\{..\}}
Vertical caption cell
\begin{minipage}{\textwidth}
\begin{verbatim}
(topdown) (bottomup)
+-----------------+ +-----------------+
b | l c r | a | |
e | e e i | f | |
f | f n g | t | |
o | t t h | e e | r |
r | e t | r r | e t | r
e | r | o | t t h | e
| | f | f n g | t
| | e | e e i | f
| | b | l c r | a
+-----------------+ +-----------------+
\end{verbatim}
\end{minipage}
See samples for better illustration.
\DescribeMacro{\rcaptioncell\{..\}}
\EXPERIMENTAL
Upside-down caption cell.
\DescribeMacro{\captionblockcell\{..\}}
Add caption into a box left/right of current cell.
\begin{minipage}{\textwidth}
\begin{verbatim}
celloffsetleft celloffsetleft
<-------> v
. <--------------> .<-------------> cellwidth
<------------------------> <------------------------> cellparentwidth
. .. .. .. . .
+------------------------+ +------------------------+
| | | |
| | | |
|+-------++ - - - - - - +| |+ - - - - - - ++-------+|
|| |. .| |. .| ||
|| |. .| |. .| ||
|| cap. |. cell .| |. cell .| cap. ||
|| |. .| |. .| ||
|| |. .| |. .| ||
|+-------++ - - - - - - +| |+ - - - - - - ++-------+|
| | | |
| | | |
+------------------------+ +------------------------+
<> clearcaption .. <> clearcaption
<> spacing <> spacing
\end{verbatim}
\end{minipage}
\subsection{Paper cells}\label{subsec:Paper cells}
Paper and page cells are very similar but differ in one aspect -- paper
cells represent the paper as indicated by |layoutmode=<layout>| while
page cells are always the size of the page block, i.e. |layoutmode=block|.
\DescribeEnv{papercell}
Paper cell.
This does not include bleeds.
\DescribeEnv{paperbleedcell}
Paper bleed cell.
Like |papercell| but includes bleeds.
\subsection{Page cells}\label{subsec:Page cells}
Page cells always correspond to the page block size, i.e. |layoutmode=block|
regardless of the actual |layoutmode| set currently.
\DescribeEnv{pagecell}
\DescribeEnv{pagecell*}
Page cell.
This corresponds to the visible page in the |layoutmode=block| and
does not include bleeds.
\begin{minipage}{\textwidth}
\begin{verbatim}
<-> bleed <-> bleed
+ - - - - - - - - - + + bleed
. +---------------+ . v
. | | .
. | | .
. | pagecell | .
. | | .
. | | .
. +---------------+ . + bleed
+ - - - - - - - - - + v
\end{verbatim}
\end{minipage}
The star version accounts for |\bindingoffset|.
Note that |layoutmode|'s other than block will change the paper size
but will not affect this either in size (block size) or in position
(top-left).
\DescribeEnv{pagebleedcell}
Like |page| but includes bleeds.
\begin{minipage}{\textwidth}
\begin{verbatim}
<-> bleed <-> bleed
+-------------------+ + bleed
| + - - - - - - - + | v
| . . |
| . . |
| . pagebleedcell . |
| . . |
| . . |
| + - - - - - - - + | + bleed
+-------------------+ v
\end{verbatim}
\end{minipage}
Note that as with |pagecell| this is not affected by |layoutmode|.
\DescribeEnv{textcell}
\EXPERIMENTAL
A cell taking up the page text block.
\begin{verbatim} \begin{textcell}{<width>}{<height>} ... \end{textcell} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
<-----------> \textwidth
<-----------------> \pageblockwidth
+-----------------+ ^ \pageblockheight
| | |
| +-----------+ | | ^ \textheight
| | | | | |
| | | | | |
| | textcell | | | |
| | | | | |
| | | | | |
| +-----------+ | | v
| | |
+-----------------+ v
\end{verbatim}
\end{minipage}
Note that this is an inline cell and if something is on the page it
may not be centered properly.
\subsection{Foldout page cells}\label{subsec:Foldout page cells}
\EXPERIMENTAL
A foldout is a special case cell that changes the page format.
In addition to cell lengths a foldout defines a set of additional
lengths and lists within its context.
\DescribeMacro{\pagefoldpanels=<list>}
\DescribeMacro{\pagefoldpanelfolds=<list>}
Lists page folded panel widths and fold types respectively.
|pagefoldpanels| is set automatically for layouts other than |block|
and for foldout pages, changing this can mess up fold markers and
page cell placement.
|pagefoldpanelfolds| is generated when creating a foldout.
See:
\href{https://ctan.altspu.ru/macros/generic/listofitems/listofitems-en.pdf}{listofitems}
for list API.
\DescribeMacro{\foldoutwidth=<len>}
Total foldout page width, calculated when a foldout page is created.
\DescribeEnv{foldout}
Create 2 or more pages in foldout mode.
\begin{verbatim} \begin{foldout}[<fold-spec>] ... \end{foldout} \end{verbatim}
|<fold-spec>| can be a number of folds, or contain one or more fold
types (|in| or |out|), two or more panel widths (dimensions) or a
sequence of both (i.e. dim fold dim ...) where missing widths are
automatically calculated and missing folds are the same as the previous
fold or the default if no folds are specified.
If not |<fold-spec>| is given, then the value of |\defaultfoldout| is
used (default: |2|).
\begin{minipage}{\textwidth}
\begin{verbatim}
v \flatfold v
- --=----------------++---------------++--------------+
= .. .. |
= .. .. |
= .. .. |
= .. .. |
= .. .. |
= .. .. |
= .. .. |
= .. .. |
= .. .. |
= (1) .. (2) .. (3) |
- --=----------------++---------------++--------------+
+--------------++---------------++----------------=-- -
| .. .. =
| .. .. =
| .. .. =
| .. .. =
| .. .. =
| .. .. =
| .. .. =
| .. .. =
| .. .. =
| (1) .. (2) .. (3) =
+--------------++---------------++----------------=-- -
^ \flatfold ^
\end{verbatim}
\end{minipage}
A foldout always starts on the right/odd page and will always end on
the left/even page.
If |\foldoutpages{..}| is called on an even page, an empty normal
page will be created pushing the foldout to the right page of the
spread. If an odd number of pages is created the set will be padded
with an empty page before |\foldoutpages{..}| exits.
Foldout panel numbering
\begin{minipage}{\textwidth}
\begin{verbatim}
right page
- --=-------+-------+- --+-------+-------+
= | | | | |
= (1) | (2) | ... | (n-1) | (n) |
= | | | | |
- --=-------+-------+-- -+-------+-------+
left page
+-------+-------+- --+-------+-------=-- -
| | | | | =
| (1) | (2) | ... | (n-1) | (n) =
| | | | | =
+-------+-------+-- -+-------+-------=-- -
\end{verbatim}
\end{minipage}
Formal |<fold-spec>| grammar:
\begin{minipage}{\textwidth}
\begin{verbatim}
<fold-spec> ::
<count>
| <fold>
| <panels>
<panels> ::=
<panel>
| <panel> <panels>
<panel> ::=
<width> <fold>
| <width>
| <fold>
<fold> ::=
in | out
\end{verbatim}
\end{minipage}
\DescribeMacro{\clearfoldoutbinding=<len>}
\DescribeMacro{\clearfoldoutedge=<len>}
\DescribeMacro{\clearfoldoutfold=<len>}
Fold panel sizing for similar fold sequence:
\begin{minipage}{\textwidth}
\begin{verbatim}
\clearfoldoutedge <->
\clearfoldoutfold <->
<--> \clearfoldoutbinding
(3) /\ (2)
+---------------------------------+ / \
+------------------------------- | /
-------------------------------------+ / (1)
======================================== =====+=====
========================================
\end{verbatim}
\end{minipage}
Note that |in in| fold sequence is drawn, |out out| is identical in
sizing but reflectd.
Fold panel sizing for dissimilar fold sequence:
\begin{minipage}{\textwidth}
\begin{verbatim}
\clearfoldoutedge <-> /
<--> \clearfoldoutbinding (3) /
\
+---------------------------------- \ (2)
+---------------------------------+ /
-------------------------------------+ / (1)
======================================== =====+=====
========================================
\end{verbatim}
\end{minipage}
|in out| is drawn, |out it| is the same but reflected.
The size of the paper fold is set by |\flatfold|.
\DescribeEnv{foldoutcell}
\DescribeEnv{foldoutcell*}
Create a cell spanning one or more foldout panels.
\begin{verbatim} \begin{foldoutcell}[<num>] ... \end{foldoutcell} \end{verbatim}
\begin{verbatim} \begin{foldoutcell}[<from>-<to>] ... \end{foldoutcell} \end{verbatim}
If no arguments are given this will create a panel at |foldoutpanel|
counter and increment it by one.
\begin{verbatim} \begin{foldoutcell} ... \end{foldoutcell} \end{verbatim}
This will also auto-advance the page when all panels are filled.
Note that manual panel placement has no effect on the panel counter
thus care must be taken when mixing manual and auto-advanced panels.
Also note that |foldoutpanel|'s value is not maintained within manually
placed panels and should be treated as undefined.
|foldoutcell*| is the same as the non-star version but creates cells
including bleeds.
Neither version clips its content, to explicitly clip use the |cliptocell|
environment.
These can only be used from within a |foldout| cell.
\subsection{Multi-page cells}\label{subsec:Multi-page cells}
\DescribeEnv{spreadtopages}
\DescribeEnv{spreadtopages*}
\DescribeMacro{\usespreadpage\{..\}}
\DescribeMacro{\usespreadpage*\{..\}}
Spread cell into pages.
\begin{minipage}{\textwidth}
\begin{verbatim}
+----------------------------------- -
| <-- input cell
| . . .
| Oversized content cell...
| . . .
|
+----------.----------.----------.-- -
. . . . . . .
. . . . . . .
+----------+ +----------+ +----------+ +-- -
| | | | | | | <-- output pages
| | | | | | |
| Overs| |ized conte| |nt cell...| |
| | | | | | |
| | | | | | |
+----------+ +----------+ +----------+ +-- -
\end{verbatim}
\end{minipage}
|spreadtopages| creates a cell and spreads it into pages right away.
\begin{verbatim} \begin{spreadtopages} .. \end{spreadtopages} \end{verbatim}
\begin{verbatim} \begin{spreadtopages}[<page-count>] .. \end{spreadtopages} \end{verbatim}
|spreadtopages*| creates a named save cell only allowing the pages
to be placed manually via |\usespreadpage{..}|.
\begin{verbatim} \begin{spreadtopages*}{<name>} .. \end{spreadtopages*} \end{verbatim}
\begin{verbatim} \begin{spreadtopages*}[<page-count>]{<name>} .. \end{spreadtopages*} \end{verbatim}
|\usespreadpage{..}| places a page from a saved cell.
\begin{verbatim} \usespreadpage{<name>} \end{verbatim}
\begin{verbatim} \usespreadpage[<page-num>]{<name>} \end{verbatim}
|\usespreadpage*{..}| is the same as the non-star version but will
not use a |page| environment, enabling the user to populate the page
with other elements.
Page numbers are 1-based.
Note that the cell created by |spreadtopages*| env is a normal save
cell and can be manipulated via |\usecell{..}| and |\usecell*{..}|.
\subsection{Endpaper cells}\label{subsec:Endpaper cells}
\DescribeEnv{leftside}
\DescribeEnv{rightside}
\begin{minipage}{\textwidth}
\begin{verbatim}
+---------------+---------------+
| | |
| | |
| leftside | rightside |
| | |
| | |
+---------------+---------------+
\end{verbatim}
\end{minipage}
\subsection{Cover and dust jacket cells}\label{subsec:Cover and dust jacket cells}
\DescribeEnv{frontcover}
\DescribeEnv{backcover}
\DescribeEnv{spine}
\DescribeEnv{vspine}
\DescribeEnv{frontflap}
\DescribeEnv{backflap}
Covers and dust jackets differ only in that covers do not {usually}
have flaps.
\begin{minipage}{\textwidth}
\begin{verbatim}
backflap spine/vspine frontflap
. backcover . frontcover .
v v v v v
+---+---------------+---+---------------+---+
| | | | | |
| | | | | |
| | Back | | Front | |
| | | | | |
| | | | | |
+---+---------------+---+---------------+---+
\end{verbatim}
\end{minipage}
Note that when typesetting a spine with both top-down and bottom-up
text it is recommended to use |topdown|/|bottomup| in |zinlinecell|'s
in a normal |spine| rather than using a |vspine| and trying to rotate
part of the content.
\section{Caption Templates}\label{sec:Caption Templates}
\DescribeMacro{\captionsize\{..\}}
Defines the caption font.
Can be redefined to control caption font/style.
\DescribeMacro{\captionformat\{..\}}
General caption format.
\begin{verbatim} \captionformat{<code>} \end{verbatim}
This can be redefined to control the image caption.
\section{Page Templates}\label{sec:Page Templates}
This section contains a set of predefined configurable single-page
templates.
Note that most page templates do not |\clearpage| before expanding,
this enables one to prepend elements (like pdf comments), if clearing
a page is required add |\clearpage| manually before the template.
\subsection{Basic book information}\label{subsec:Basic book information}
\DescribeMacro{BookTitle=<text>}
\DescribeMacro{BookVersion=<text>}
\DescribeMacro{BookAuthors=<text>}
\DescribeMacro{BookYear=<text>}
\DescribeMacro{ByNotice=<text>}
\DescribeMacro{ThanksTo=<text>}
\DescribeMacro{ISBN=<text>}
\DescribeMacro{BookEdition=<text>}
\DescribeMacro{License=<text>}
\DescribeMacro{CopyrightNotice=<text>}
\DescribeMacro{OtherSoftware=<text>}
\DescribeMacro{BookFonts=<text>}
\DescribeMacro{SoftwareNotice=<text>}
These provide the default information used by the |\BookInfoPage| and
|\BookSoftwareInfoPage|.
\DescribeMacro{\BookInfoPage}
Generate book information page.
\begin{minipage}{\textwidth}
\begin{verbatim}
+---------------+
| |
| |
| |
| copyright |
| ISBN |
| info |
+---------------+
\end{verbatim}
\end{minipage}
This page is {\it usually} included near the start of the book, before
any of the logical sections of the book start, {\it usually} just after
the title pages but before any of the epigraphs, forewords, TOCs and
prefaces. This can also in some cases be pushed to the rear of the book.
\DescribeMacro{\BookSoftwareInfoPage}
Generate software info page.
\begin{minipage}{\textwidth}
\begin{verbatim}
+---------------+
| |
| |
| |
| |
| |
| notice |
+---------------+
\end{verbatim}
\end{minipage}
This page if present is usually placed at the very rear of the book.
\DescribeMacro{\BookFullInfoPage}
This page combines the |\BookInfoPage| and |\BookSoftwareInfoPage|
information into a single page.
\subsection{Tweaking}\label{subsec:Tweaking}
Most page/spread templates provide an ability to externally "tweak"
some image proportions.
This is an alternative means to setting template properties, e.g:
\begin{verbatim}
\tweakimagescale{0.8}
\ImagePage{image}
\end{verbatim}
Is equivalent to:
\begin{verbatim} \ImagePage[scale=0.8]{image} \end{verbatim}
Tweaks get reset after each template.
\DescribeMacro{\imagescale=<num>}
\DescribeMacro{\imageoffsettop=<len>}
\DescribeMacro{\imageoffsetleft=<len>}
Tweak next image templates scale/offsettop/offsetleft
Note that |\imagescale| is not a length.
\begin{verbatim} \edef\imagescale{<scale>} \end{verbatim}
\begin{verbatim} \setlength\imageoffsettop{<len>} \end{verbatim}
\begin{verbatim} \setlength\imageoffsetleft{<len>} \end{verbatim}
\DescribeMacro{\tweakimagescale\{..\}}
\DescribeMacro{\tweakimageoffsettop\{..\}}
\DescribeMacro{\tweakimageoffsetleft\{..\}}
Convenience commands
These provide a uniform interface for tweaking.
\begin{verbatim} \tweakimagescale{<scale>} \end{verbatim}
\begin{verbatim} \tweakimageoffsettop{<len>} \end{verbatim}
\begin{verbatim} \tweakimageoffsetleft{<len>} \end{verbatim}
\DescribeMacro{\resetimagetweaks\{..\}}
Reset tweaked values.
\subsection{General interface}\label{subsec:General interface}
A templates provide a uniform interface consisting of several commands:
Base template command:
\begin{verbatim} \<template-name>{<caption>}{<image>} \end{verbatim}
\begin{verbatim} \<template-name>[<options>]{<caption>}{<image>} \end{verbatim}
|<options>| is the same as for |\imagecell{..}|.
Template-specific caption command:
\begin{verbatim} \<template-name>Caption{<caption>} \end{verbatim}
This can be redefined to control typesetting the caption for all
consecutive templates.
Reset template caption to default:
\begin{verbatim} \reset<template-name>Caption \end{verbatim}
An equivalent to the non-star version but use the caption as-is:
\begin{verbatim} \<template-name>*{<caption>}{<image>} \end{verbatim}
\begin{verbatim} \<template-name>*[<options>]{<caption>}{<image>} \end{verbatim}
Note that thogh some template versions differ only in |<options>|
defaults passed to |\imagecell{..}|, they are split to provide ability
to configure the template defaults separately.
\subsection{No bleed}\label{subsec:No bleed}
\DescribeMacro{\ImagePage\{..\}}
\DescribeMacro{\ImagePageCaption\{..\}}
\DescribeMacro{\resetImagePageCaption}
\DescribeMacro{\ImagePage*\{..\}}
Basic image page
\begin{minipage}{\textwidth}
\begin{verbatim}
+-----------------+
| |
| +-------------+ |
| | . . | |
| | . . | |
| | image | |
| | . . | |
| | . . | |
| +-------------+ |
| c |
| |
+-----------------+
\end{verbatim}
\end{minipage}
Create an image page:
Note that |\ImagePage{..}| only supports tweaking |scale|, this is
intentional ad tweaking offset will mess up page alignment relative
to other pages in a book.
\DescribeMacro{\ImagePageClear\{..\}}
\DescribeMacro{\ImagePageClearCaption\{..\}}
\DescribeMacro{\resetImagePageClearCaption}
\DescribeMacro{\ImagePageClear*\{..\}}
\begin{verbatim} \ImagePageClear[<options>]{<caption>}{<image>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
\clearimage \clearimage
v v
+-----------------+ +-----------------+ < \clearimage
| | | +-----------+ |
|+---------------+| | | . . | |
|| . . || | | . . | |
|| . . || | | . . | |
|| image || | | image | |
|| . . || | | . . | |
|| . . || | | . . | |
|+---------------+| | | . . | |
| c | | +-----------+ |
+-----------------+ +-----------------+ < \clearimage
\end{verbatim}
\end{minipage}
Default image clearance is set by |\clearimage| global length.
This respects |\bindingoffset|.
\DescribeMacro{\ImagePageClear<D>\{..\}}
\DescribeMacro{\ImagePageClear<D>Caption\{..\}}
\DescribeMacro{\resetImagePageClear<D>Caption}
\DescribeMacro{\ImagePageClear<D>*\{..\}}
|<D>| can be one of T, B, L or R, for top, bottom, left and right
respectively.
\begin{minipage}{\textwidth}
\begin{verbatim}
+-----------------+ +-----------------+
| +-------------+ | | |
| | . . | | | c |
| | . . | | | +-------------+ |
| | image | | | | . . | |
| | . (T) . | | | | . . | |
| | . . | | | | image | |
| +-------------+ | | | . (B) . | |
| c | | | . . | |
| | | +-------------+ |
+-----------------+ +-----------------+
+-----------------+ +-----------------+
| +---------+ | | +---------+ |
| |. .| | | |. .| |
| | . . | | | | . . | |
| | . . | | | | . . | |
| | image | | | | image | |
| | .(L). | | | | .(R). | |
| | . . | | | | . . | |
| |. .| | | |. .| |
| +---------+ c | | c +---------+ |
+-----------------+ +-----------------+
\end{verbatim}
\end{minipage}
\subsection{Partial bleed}\label{subsec:Partial bleed}
\DescribeMacro{\ImagePageFit\{..\}}
\DescribeMacro{\ImagePageFitCaption\{..\}}
\DescribeMacro{\resetImagePageFitCaption}
\DescribeMacro{\ImagePageFit*\{..\}}
Fit image into page...
\begin{verbatim} \ImagePageFit[<options>]{<caption>}{<image>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
. . . . . . .
+-----------------+ +-----------------+
| | | |. .| |
. +-----------------+ . | | . . | |
. | . . | . | | . . | |
. | . . | . | | . . | |
. | image | . | | image | |
. | . . | . | | . . | |
. | . . | . | | . . | |
. +-----------------+ . | | . . | |
| c | | |. c.| |
+-----------------+ +-----------------+
. . . . . . .
\end{verbatim}
\end{minipage}
Default image clearance is set by |\bleed| global length.
If centered image fits vertically this will account for |\bindingoffset|.
\DescribeMacro{\ImagePageFit<D>\{..\}}
\DescribeMacro{\ImagePageFit<D>Caption\{..\}}
\DescribeMacro{\resetImagePageFit<D>Caption}
\DescribeMacro{\ImagePageFit<D>*\{..\}}
|<D>| can be one of T, B, L or R, for top, bottom, left and right
respectively.
\begin{minipage}{\textwidth}
\begin{verbatim}
. . . . . . . . . . . .
. +-----------------+ . +-----------------+
. | . . | . | |
. | . . | . | |
. | image | . | |
. | . (T) . | . . |-----------------| .
. | . . | . . | . . | .
. |-----------------| . . | . . | .
| | . | image | .
| | . | . (B) . | .
| | . | . . | .
+-----------------+ . +-----------------+ .
. . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. +-----------------+ +-----------------+ .
. |. .| | | |. .| .
. | . . | | | | . . | .
. | . . | | | | . . | .
. | . . | | | | . . | .
. | image | | | | image | .
. | .(L). | | | | .(R). | .
. | . . | | | | . . | .
. | . . | | | | . . | .
. |. .| c | | c |. .| .
. +-----------------+ +-----------------+ .
. . . . . . . . . . . . . . . .
\end{verbatim}
\end{minipage}
\subsection{Full bleed}\label{subsec:Full bleed}
\DescribeMacro{\ImagePageFill\{..\}}
\DescribeMacro{\ImagePageFillCaption\{..\}}
\DescribeMacro{\resetImagePageFillCaption}
\DescribeMacro{\ImagePageFill*\{..\}}
Like |\ImagePage| but will fill page with image.
\begin{verbatim} \ImagePageFill[<options>]{<caption>}{<image>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
. . . . . . . . . . . . . . . . . . .
. . +-----------------+ . .
. . | c | . .
. .| |. .
. | . . | .
. | . . | .
. | image | .
. | . . | .
. | . . | .
. .| |. .
. . | | . .
. . +-----------------+ . .
. . . . . . . . . . . . . . . . . . .
\end{verbatim}
\end{minipage}
Default image clearance is set by |\bleed| global length.
\DescribeMacro{\ImageHalfPageL\{..\}}
\DescribeMacro{\ImageHalfPageLCaption\{..\}}
\DescribeMacro{\resetImageHalfPageLCaption}
\DescribeMacro{\ImageHalfPageL*\{..\}}
Left half of image filling page with full bleed.
\begin{verbatim} \imageleftspreadfullbleed[<vertical-offset>]{<caption>}{<image>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
. . . . . . . . . . . . .
. +-----------------=
. | . =
. | . =
. | . =
. | . =
. | image
. | . =
. | . =
. | . =
. | . c =
. +-----------------=
. . . . . . . . . . . . .
\end{verbatim}
\end{minipage}
\DescribeMacro{\ImageHalfPageR\{..\}}
\DescribeMacro{\ImageHalfPageRCaption\{..\}}
\DescribeMacro{\resetImageHalfPageRCaption}
\DescribeMacro{\ImageHalfPageR*\{..\}}
Right half of image filling page with full bleed.
\begin{verbatim} \imagerightspreadfullbleed[<vertical-offset>]{<caption>}{<image>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
. . . . . . . . . . . . .
=-----------------+ .
= . | .
= . | .
= . | .
= . | .
image | .
= . | .
= . | .
= . | .
= . c | .
=-----------------+ .
. . . . . . . . . . . . .
\end{verbatim}
\end{minipage}
\section{Spread Templates}\label{sec:Spread Templates}
\subsection{No bleed}\label{subsec:No bleed}
\DescribeMacro{\ImageSpread\{..\}}
\DescribeMacro{\ImageSpreadCaption\{..\}}
\DescribeMacro{\resetImageSpreadCaption}
\DescribeMacro{\ImageSpread*\{..\}}
\begin{minipage}{\textwidth}
\begin{verbatim}
+---------------=---------------+
| +-------------=-------------+ |
| | . = . | |
| | . = . | |
| | . = . | |
| | image | |
| | . = . | |
| | . = . | |
| | . = . | |
| +-------------=-------------+ |
+---------------=---------------+
\end{verbatim}
\end{minipage}
\DescribeMacro{\ImageSpread<D>\{..\}}
\DescribeMacro{\ImageSpread<D>Caption\{..\}}
\DescribeMacro{\resetImageSpread<D>Caption}
\DescribeMacro{\ImageSpread<D>*\{..\}}
|<D>| can be one of T, B, L or R, for top, bottom, left and right
respectively.
\begin{minipage}{\textwidth}
\begin{verbatim}
+---------------=---------------+ +---------------=---------------+
| +-------------=-------------+ | | = |
| | . = . | | | c = |
| | . = . | | | +-------------=-------------+ |
| | image | | | | . = . | |
| | . (T) . | | | | . = . | |
| | . = . | | | | image | |
| +-------------=-------------+ | | | . (B) . | |
| = c | | | . = . | |
| = | | +-------------=-------------+ |
+---------------=---------------+ +---------------=---------------+
+---------------=---------------+ +---------------=---------------+
| +-------------=---------+ | | +---------=-------------+ |
| | . = . | | | | . = . | |
| | . = . | | | | . = . | |
| | . =. | | | | .= . | |
| | image | | | | image | |
| | . (L)=. | | | | .=(R) . | |
| | . = . | | | | . = . | |
| | . = . | | | | . = . | |
| +-------------=---------+ c | | c +---------=-------------+ |
+---------------=---------------+ +---------------=---------------+
\end{verbatim}
\end{minipage}
\subsection{Partial bleed}\label{subsec:Partial bleed}
\DescribeMacro{\ImageSpreadFit\{..\}}
\DescribeMacro{\ImageSpreadFitCaption\{..\}}
\DescribeMacro{\resetImageSpreadFitCaption}
\DescribeMacro{\ImageSpreadFit*\{..\}}
\begin{minipage}{\textwidth}
\begin{verbatim}
. . . . . . . . . . .
+---------------=---------------+ +---------------=---------------+
| = | | |. = .|. |
. |---------------=---------------| . | | . = . | |
. | . = . | . | | . = . | |
. | . = . | . | | . = . | |
. | image | . | | image | |
. | . = . | . | | . = . | |
. | . = . | . | | . = . | |
. |---------------=---------------| . | | . = . | |
| = c | | |. = .| c |
+---------------=---------------+ +---------------=---------------+
. . . . . . . . . . .
\end{verbatim}
\end{minipage}
\DescribeMacro{\ImageSpread<D>\{..\}}
\DescribeMacro{\ImageSpread<D>Caption\{..\}}
\DescribeMacro{\resetImageSpread<D>Caption}
\DescribeMacro{\ImageSpread<D>*\{..\}}
Image spread aligned left (with bleed).
\begin{verbatim} \ImageSpread<D>[<options>]{<caption>}{<image>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
. . . . . . . . . . . . . . . . . . .
. +---------------=---------------+ . +---------------=---------------+
. | . = . | . | c = |
. | . = . | . . |---------------=---------------| .
. | . = . | . . | . = . | .
. | image | . . | . = . | .
. | . (T) . | . . | . = . | .
. | . = . | . . | image | .
. | . = . | . . | . (B) . | .
. |---------------=---------------| . . | . = . | .
| = c | . | . = . | .
+---------------=---------------+ . +---------------=---------------+ .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. +---------------=---------------+ +---------------=---------------+ .
. | . = . | | | | . = . | .
. | . = . | | | | . = . | .
. | . = . | | | | . = . | .
. | . =. | | | | .= . | .
. | image | | | | image | .
. | . (L)=. | | | | .(R) . | .
. | . = . | | | | . = . | .
. | . = . | | | | . = . | .
. | . = . | c | | c | . = . | .
. +---------------=---------------+ +---------------=---------------+ .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
\end{verbatim}
\end{minipage}
\subsection{Full bleed}\label{subsec:Full bleed}
\DescribeMacro{\ImageSpreadFill\{..\}}
\DescribeMacro{\ImageSpreadFillCaption\{..\}}
\DescribeMacro{\resetImageSpreadFillCaption}
\DescribeMacro{\ImageSpreadFill*\{..\}}
Image spread with full bleed.
\begin{verbatim} \ImageSpreadFill[<options>]{<caption>}{<image>} \end{verbatim}
\begin{minipage}{\textwidth}
\begin{verbatim}
. . . . . . . . . . . . . . . . . . .
. +---------------=---------------+ .
. | . = . | .
. | . = . | .
. | . = . | .
. | . = . | .
. | image | .
. | . = . | .
. | . = . | .
. | . = . | .
. | . = . c | .
. +---------------=---------------+ .
. . . . . . . . . . . . . . . . . . .
\end{verbatim}
\end{minipage}
\section{Meta Macros / Environments}\label{sec:Meta Macros / Environments}
These macros and environments are used internally to help define cells
and templates and thus can be useful when extending the functionality
of this class both when authoring styles and when creating user
macros/templates.\footnote{%
Note that in code the relevant meta-macros are defined in the logical
locations for each macro, i.e. before first use and at the start of
the relevant context. This section in the reference is placed near
the end so as to focus the user's attention on the main class interface,
class internal architecture and extension API being secondary.}
\input{\jobname-meta}
\section{Miscellaneous}\label{sec:Miscellaneous}
\DescribeMacro{\PageInfo}
Display basic paper / page / cell geometry.
\DescribeMacro{\GenerateTemplate\{..\}}
Generate template page for current |layoutmode|.
\begin{verbatim} \GenerateTemplate \end{verbatim}
Cell size can be printed in |mm| (default) or in any explicit unit
supported by \LaTeX.
\begin{verbatim} \GenerateTemplate{<unit>} \end{verbatim}
This can be useful if one needs to make the cover/jacket/... in either a
different software package or by hand.
This is a no-op for |layoutmode=block|.
\DescribeMacro{\pdfboxesset\{..\}}
\begin{verbatim} \pdfboxesset[<bleed>]{<bleedblockwidth>}{<bleedblockheight>} \end{verbatim}
\DescribeMacro{\pdfcommentcell\{..\}}
Add pdf comment as margin overlay.
\begin{verbatim} \pdfcommentcell[<options>]{<comment>} \end{verbatim}
\DescribeMacro{\pdfpagecount\{..\}}
Get pdf page count
\begin{verbatim} \pdfpagecount{<file.pdf>} \end{verbatim}
\DescribeMacro{\pdfspinewidth\{..\}}
Calculate spine thickness
\begin{verbatim} \pdfspinewidth{<paper-thikness>}{<cover-thikness>}{<block-pdf>} \end{verbatim}
% \printindex
% XXX DEBUG...
%\AtBeginDocument{
%}
\blankfootnote{%
Why ASCII diagrams instead of normal graphics, you might ask?
Well, for the same reason as photo-books in \LaTeX\ -- I liked
the idea of it, the simplicity, and thought that it would be fun to
see how far can I push things before it all falling apart on me, and...
We are here, at the end, and it all is still here too :)}
\end{document} % vim:set ts=4 sw=4 nowrap :