% =============================================================
% example_bookaspro.tex -- complete usage example for the
% bookaspro class
% Compile TWICE with LuaLaTeX (TikZ "remember picture" overlays
% need two passes):
%   lualatex example_bookaspro.tex
%   lualatex example_bookaspro.tex
% The example images (example-image-a/b/c) are provided by the
% standard `mwe` package shipped with TeX Live and MiKTeX.
% =============================================================
\documentclass{bookaspro}

% Optional: override any layout parameter (defaults shown in the
% class documentation). Example: a slightly wider outer margin.
% \bookasprosetup{outer=14mm}

% Caption configuration: the following keys (usable in the
% preamble) control every figure caption globally. Uncomment to
% change the defaults (footnotesize / 3pt / 0pt / 6mm):
%   captionfont      font used for figure captions
%   captionskip      vertical distance between image and caption
%   captionmargin    horizontal margin inset for the caption
%   bleedcaptionskip vertical offset of an overlaid bleed caption
%                    above the folio
% \bookasprosetup{
%   captionfont=small,
%   captionskip=6pt,
%   captionmargin=1em,
%   bleedcaptionskip=8mm
% }

% Proofing overlay: red trim line + crop marks, dashed blue inner
% safety margin, dashed green text block border, data label in mm.
% DISABLE before sending to print.
\showBleedMargin[bleed=3mm,margin=5mm]

\begin{document}

\frontmatter

\begin{titlepage}
\centering
\vspace*{3.5cm}
{\Huge\bfseries The Printed Mountain\par}
\vspace{1.2cm}
{\large\itshape A complete example with the bookaspro class\par}
\vspace{0.6cm}
{\small\itshape Layout, headings and image compositions\par}
\vfill
\end{titlepage}

\cleardoublepage
\pdfbookmark[1]{Contents}{toc}
\tableofcontents

\mainmatter

\chapter{The Layout Engine}

This short book exercises the main features of \textsf{bookaspro}:
the trim-plus-bleed page geometry, the styled chapter openings,
the centered folios, and the unified image macros. Every page of
this example carries the proofing overlay: the red rectangle is
the trim line (the final book size), the dashed blue rectangle is
the inner safety margin, and the small label at the bottom reports
both values in millimetres.

The text block of this paragraph exists only to give the floats
something to flow around. Good book typography keeps a calm gray
value: a generous line height, a classical paragraph indent, and
no extra space between paragraphs. Widows, orphans and broken
hyphenations are forbidden by the class, so the page builder
always moves whole lines instead of stranding them.

\section{Single images and grids}

A single file produces one centered photograph, capped at seventy
percent of the text height by default. This figure also shows the
local caption override: \texttt{captionfont=small} and
\texttt{captionskip=6pt} change the caption appearance for this
figure only, while the other figures keep the class defaults
(\texttt{captionfont=footnotesize}, \texttt{captionskip=3pt}).

\imageGrid[captionfont=small,captionskip=6pt]
  {example-image-a}{A single centered photograph (local caption overrides).}{fig:single}

Two or more files produce a grid. With \texttt{letters=true} each
photo receives an overlaid letter in its top-left corner, useful
for composite figures referenced from the text.

\imageGrid[columns=2,letters=true,lettercolor=white]
  {example-image-a,example-image-b,example-image-c,example-image-a}
  {A two-by-two grid with overlaid letters (a--d).}{fig:grid}

Setting \texttt{columns=1} stacks the photographs vertically.

\imageGrid[columns=1,maxheight=0.32\textheight,vgap=1.5ex]
  {example-image-b,example-image-c}
  {Two photographs stacked vertically.}{fig:stack}

\section{Columns and wrapped figures}

The column composition assigns one braced group per column; files
inside a group are stacked. Percentage widths are normalized
automatically when they do not sum to one hundred.

\imageColumns[widths={40,60},letters=true]
  {{example-image-a},{example-image-b,example-image-c}}
  {Two columns with a 40/60 width split; the right column stacks two photos.}{fig:columns}

A wrapped figure lets the text flow beside the photograph. The
argument of \texttt{wrap} chooses the side, \texttt{width} the
wrap width.

\imageGrid[wrap=right,width=0.38\textwidth]
  {example-image-b}{A wrapped photograph on the right.}{fig:wrap}

This paragraph flows beside the wrapped figure. The wrap mode is
intended for small portraits and details; large compositions are
better served by the regular grid or by a dedicated bleed page.
The text here is long enough to demonstrate that the paragraph
indentation and the line breaking behave exactly as in the rest
of the book, while the figure stays anchored to its side.

\chapterornament

\chapter{Bleed Compositions}

Bleed compositions extend the image beyond the trim line, into
the area that the printer trims away. The class computes the
cover scale from the physical sheet size, so the image always
reaches every edge without distortion.

\section{Full-page cover}

The default mode of \verb|\imageBleed| devotes a whole page to the
image: it covers the entire physical sheet, and the caption and
the folio are overlaid at the bottom on semi-transparent panels.

\imageBleed{example-image-a}{A full-bleed cover page with overlaid caption and folio.}{fig:full}

\section{Partial bleed}

With \texttt{mode=partial} the image spans the full sheet width
but keeps its natural height; text flows above and below it.

\imageBleed[mode=partial,place=b]{example-image-b}
  {A partial-bleed image: full sheet width, natural height.}{fig:partial}

With \texttt{place=t,extend=top} the image reaches the physical
top edge of the sheet, forming a full-width banner. On a
chapter-opening page the banner would sit below the chapter
title, so this example starts on a fresh page.

\clearpage
\imageBleed[mode=partial,place=t,extend=top]{example-image-c}
  {A top banner reaching the physical page edge.}{fig:banner}

Some text after the banner, to show that the reserved space is
correct and that the following paragraphs start at the usual
position inside the safety margin.

With \texttt{place=b,extend=bottom} the image reaches the physical
bottom edge of the sheet, forming a full footer. By default the
caption sits above the image; with \texttt{overlay} the caption is
overlaid on the image (colored, with a panel), exactly like the
full-page and vertical bleeds.

\imageBleed[mode=partial,place=b,extend=bottom,overlay]{example-image-a}
  {A full footer reaching the physical page bottom.}{fig:footer}

\section{Plate page}

With \texttt{mode=partial,place=c} the image is centered on a
dedicated plate page, edge to edge horizontally, with the caption
below and the normal folio.

\imageBleed[mode=partial,place=c]{example-image-a}
  {A centered plate page with horizontal bleed.}{fig:plate}

\section{Vertical bleed}

With \texttt{mode=vertical} the image fills the whole physical
sheet \emph{height} with uniform scaling, while its width stays
natural: a portrait image leaves white bands on the left and
right. The image, the caption and the folio are centered on the
text block (parity-aware), not on the physical sheet.

\imageBleed[mode=vertical]{example-image-b}
  {A vertical-bleed page filling the sheet height.}{fig:vertical}

\unnumberedchapter{Afterword}

This unnumbered chapter demonstrates \verb|\unnumberedchapter|:
it opens on a fresh recto page, appears in the table of contents
and in the PDF bookmarks, and sets the running-head marks even
though it carries no number.

The proofing overlay you see on every page is produced by
\verb|\showBleedMargin| and must be disabled (or simply removed)
before the file is sent to the printer: the final PDF must contain
neither crop marks nor debug labels.

\backmatter
\phantomsection
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

\end{document}
