%---------------------------------------------------------------------- % % % This does the following: % - sets up the document/pdf for viewing as a book % - adds support for page bleeds % - adds basic templates for image pages (XXX) % % % % This file contains both the code and the reference, but in a slightly % more readable format than the traditional LaTeX .dtx format. In general % there are two main sections: % - code % - reference % lines starting with "%%" or "%X" where X is a section id % Sections are parts of the reference that are logically ordered differently % than the code, e.g. main user tools should have priority in the reference % while meta code (identified by "%M") can be described later, while in code % we strictly need to define macros before they are used thus meta-macros % and other building blocks and components come before the user tools. % % Docs are build by the Makefile, so reference it for more info. % % $ make doc % % % % XXX unify API -- see CellContent env... % XXX make this loadable both as a class and as a package... % \@ifclassloaded{photobook}{}{} % XXX revise command naming -- should be obvious from name what is what: % - meta commands -- ??? (currently same as templates) % - general macros -- \usecell{..} % - templates -- \ImagePage{..} % XXX see where we need to \ignorespaces... % XXX might be a good idea to add a spine calculator... % % %---------------------------------------------------------------------- %%% NOTE: \def\@[A-Z]+ macros will be visible to both the %%% code and the generated docs... \edef\photobook@FILEVERSION{v0.1} \edef\photobook@FILEDATE{2021-07-28} %% \documentclass{ltxdoc} %% %% \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{\fbox{LEGACY}} %% \newcommand\EXPERIMENTAL{\fbox{EXPERIMENTAL}} %% %%% sections to new pages... %% \newcommand\sectionbreak{\Needspace{5\baselineskip}} %% %% % remove section numbering... %% \setcounter{secnumdepth}{0} %% %% % paragraph configuration... %% \setlength\parindent{0pt} %% \setlength\parskip{0.5em} %% %% %% \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{center} %% \fbox{This class is still unstable} %% \end{center} %% %% \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 %% %%%% Introduction % %% XXX parameters, page spreads, templates, cell concept, ... % %%%% Usage % %% >> \documentclass[]{photobook} %% % %---------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} \ProvidesClass{photobook} [\photobook@FILEDATE \space \photobook@FILEVERSION Photo book document class] % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %%%% Options %% \RequirePackage{kvoptions} % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % Helpers... \newcommand\@DeclareLiteralOptionTo[2]{% \DeclareVoidOption{#2}{% \expandafter\edef\csname photobook@#1\endcsname{#2}}} % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %%%%% Page geometry % %% \DescribeMacro{blockwidth=} %% \DescribeMacro{blockheight=} %% \DescribeMacro{bindingoffset=} %% \DescribeMacro{bleed=} % %% 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 --------------> . | %% ^ binding line %% %% \end{verbatim} %% \end{minipage} %% % % NOTE: if blockwidth/blockheight are set they will force recalculations % and overriding of the paperwidth/paperheight if they were changed % by the user code anywhere between \documentclass[..]{photobook} % and \begin{document}... \DeclareStringOption{blockwidth} \DeclareStringOption{blockheight} \DeclareStringOption[0pt]{bindingoffset}[10mm] \DeclareStringOption[5mm]{bleed}[5mm] %%%%% layout % %% \DescribeMacro{layoutmode=} %% \DescribeMacro{block} %% \DescribeMacro{endpaper} %% \DescribeMacro{cover} %% \DescribeMacro{jacket} %% %% >> layoutmode=