mirror of
https://github.com/flynx/photobook.git
synced 2025-10-29 10:20:08 +00:00
added block caption spacing + docs formatting and index...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
32e3f0c561
commit
af5e65b793
138
photobook.cls
138
photobook.cls
@ -28,9 +28,15 @@
|
|||||||
%% \documentclass{ltxdoc}
|
%% \documentclass{ltxdoc}
|
||||||
%%
|
%%
|
||||||
%% \usepackage[a4paper,margin=25mm,left=55mm,nohead]{geometry}
|
%% \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[numbered]{hypdoc}
|
||||||
%% \usepackage{doctools}
|
%% \usepackage{doctools}
|
||||||
%% \usepackage{environ}
|
%% \usepackage{needspace}
|
||||||
%%
|
%%
|
||||||
%% \usepackage[toc]{multitoc}
|
%% \usepackage[toc]{multitoc}
|
||||||
%% \renewcommand*{\multicolumntoc}{2}
|
%% \renewcommand*{\multicolumntoc}{2}
|
||||||
@ -49,15 +55,16 @@
|
|||||||
%% \newcommand\LEGACY{\fbox{LEGACY}}
|
%% \newcommand\LEGACY{\fbox{LEGACY}}
|
||||||
%% \newcommand\EXPERIMENTAL{\fbox{EXPERIMENTAL}}
|
%% \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\parindent{0pt}
|
||||||
%% \setlength\parskip{0.5em}
|
%% \setlength\parskip{0.5em}
|
||||||
%%
|
%%
|
||||||
%% \def\MetaDoc{}
|
|
||||||
%% \NewEnviron{MetaDocSection}{%
|
|
||||||
%% \global\edef\MetaDoc{%
|
|
||||||
%% \MetaDoc%
|
|
||||||
%%
|
|
||||||
%% \BODY}}
|
|
||||||
%%
|
%%
|
||||||
%% \begin{document}
|
%% \begin{document}
|
||||||
%%
|
%%
|
||||||
@ -458,6 +465,7 @@
|
|||||||
|
|
||||||
%----------------------------------------------------------------------
|
%----------------------------------------------------------------------
|
||||||
%%%% Globals
|
%%%% Globals
|
||||||
|
% XXX move these out to relevant sections + add a separate globals glossary...
|
||||||
%
|
%
|
||||||
% NOTE: most of these are setup in \InitPages...
|
% NOTE: most of these are setup in \InitPages...
|
||||||
|
|
||||||
@ -597,13 +605,31 @@
|
|||||||
\newlength\pagetextheight
|
\newlength\pagetextheight
|
||||||
\setlength\pagetextheight{\textheight}
|
\setlength\pagetextheight{\textheight}
|
||||||
|
|
||||||
|
|
||||||
%% \DescribeMacro{\imageblockoffsettop=<ratio>}
|
%% \DescribeMacro{\imageblockoffsettop=<ratio>}
|
||||||
%
|
%
|
||||||
%%
|
%%
|
||||||
%%
|
%%
|
||||||
\edef\imageblockoffsettop{\photobook@imageblockoffsettop}
|
\edef\imageblockoffsettop{\photobook@imageblockoffsettop}
|
||||||
|
|
||||||
|
%% \DescribeMacro{\clearcaption=<ratio>}
|
||||||
|
%
|
||||||
|
%% Block caption clearance from edge of parent cell.
|
||||||
|
%%
|
||||||
|
%% Used as default by |\captionblockcell{..}|
|
||||||
|
%%
|
||||||
|
\newlength\clearcaption
|
||||||
|
\setlength\clearcaption{0pt}
|
||||||
|
|
||||||
|
%% \DescribeMacro{\captioncellspacing=<ratio>}
|
||||||
|
%
|
||||||
|
%% Block caption spacing from parent cell.
|
||||||
|
%%
|
||||||
|
%% Used as default by |\captionblockcell{..}|
|
||||||
|
%%
|
||||||
|
% XXX should this be used in other caption cells???
|
||||||
|
\newlength\captioncellspacing
|
||||||
|
\setlength\captioncellspacing{5pt}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%----------------------------------------------------------------------
|
%----------------------------------------------------------------------
|
||||||
@ -773,6 +799,9 @@
|
|||||||
%----------------------------------------------------------------------
|
%----------------------------------------------------------------------
|
||||||
% Setup...
|
% Setup...
|
||||||
|
|
||||||
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
% on-import...
|
||||||
|
|
||||||
% init/update lengths...
|
% init/update lengths...
|
||||||
\InitPages
|
\InitPages
|
||||||
|
|
||||||
@ -783,9 +812,8 @@
|
|||||||
]{geometry}
|
]{geometry}
|
||||||
|
|
||||||
|
|
||||||
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
%----------------------------------------------------------------------
|
% pre-document...
|
||||||
% Setup (pre-document)...
|
|
||||||
|
|
||||||
\AtEndPreamble{
|
\AtEndPreamble{
|
||||||
|
|
||||||
@ -913,6 +941,10 @@
|
|||||||
%
|
%
|
||||||
%% >> \maxdim{A}{B}
|
%% >> \maxdim{A}{B}
|
||||||
%%
|
%%
|
||||||
|
% XXX do we actually need these??
|
||||||
|
% ...should be simple to replace with calc's:
|
||||||
|
% 0pt + \minof{..}
|
||||||
|
% 0pt + \maxof{..}
|
||||||
\newcommand\mindim[2]{
|
\newcommand\mindim[2]{
|
||||||
\ifdim \dimexpr #1 \relax < \dimexpr #2 \relax%
|
\ifdim \dimexpr #1 \relax < \dimexpr #2 \relax%
|
||||||
\dimexpr #1 \relax%
|
\dimexpr #1 \relax%
|
||||||
@ -1032,6 +1064,18 @@
|
|||||||
\clearpage}
|
\clearpage}
|
||||||
|
|
||||||
|
|
||||||
|
%% \DescribeEnv{leftpage}
|
||||||
|
%
|
||||||
|
%% \EXPERIMENTAL
|
||||||
|
%%
|
||||||
|
% XXX not sure about this...
|
||||||
|
\newenvironment{leftpage}{%
|
||||||
|
\begin{page}%
|
||||||
|
\cleartoleftpage%
|
||||||
|
}{%
|
||||||
|
\end{page}}
|
||||||
|
|
||||||
|
|
||||||
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
%%%%% Cells
|
%%%%% Cells
|
||||||
|
|
||||||
@ -2127,28 +2171,31 @@
|
|||||||
%% \begin{minipage}{\textwidth}
|
%% \begin{minipage}{\textwidth}
|
||||||
%% \begin{verbatim}
|
%% \begin{verbatim}
|
||||||
%%
|
%%
|
||||||
%% celloffsetleft celloffsetleft
|
%% celloffsetleft celloffsetleft
|
||||||
%% <------> v
|
%% <-------> v
|
||||||
%% . <--------------> <--------------> cellwidth
|
%% . <--------------> .<-------------> cellwidth
|
||||||
%% <----------------------> <----------------------> cellparentwidth
|
%% <------------------------> <------------------------> cellparentwidth
|
||||||
%% . . . .. . .
|
%% . .. .. .. . .
|
||||||
%% +----------------------+ +----------------------+
|
%% +------------------------+ +------------------------+
|
||||||
%% | | | |
|
%% | | | |
|
||||||
%% | | | |
|
%% | | | |
|
||||||
%% +-------+ - - - - - - +| |+ - - - - - - +-------+
|
%% |+-------++ - - - - - - +| |+ - - - - - - ++-------+|
|
||||||
%% | | .| |. | |
|
%% || |. .| |. .| ||
|
||||||
%% | | .| |. | |
|
%% || |. .| |. .| ||
|
||||||
%% | cap. | cell .| |. cell | cap. |
|
%% || cap. |. cell .| |. cell .| cap. ||
|
||||||
%% | | .| |. | |
|
%% || |. .| |. .| ||
|
||||||
%% | | .| |. | |
|
%% || |. .| |. .| ||
|
||||||
%% +-------+ - - - - - - +| |+ - - - - - - +-------+
|
%% |+-------++ - - - - - - +| |+ - - - - - - ++-------+|
|
||||||
%% | | | |
|
%% | | | |
|
||||||
%% | | | |
|
%% | | | |
|
||||||
%% +----------------------+ +----------------------+
|
%% +------------------------+ +------------------------+
|
||||||
|
%% <> clearcaption .. <> clearcaption
|
||||||
|
%% <> spacing <> spacing
|
||||||
%%
|
%%
|
||||||
%% \end{verbatim}
|
%% \end{verbatim}
|
||||||
%% \end{minipage}
|
%% \end{minipage}
|
||||||
%%
|
%%
|
||||||
|
% XXX add cell spacing...
|
||||||
% XXX need to do a caption block -- a cell to one side of an image to the
|
% XXX need to do a caption block -- a cell to one side of an image to the
|
||||||
% end of the page...
|
% end of the page...
|
||||||
% XXX can we use the normal caption and simply insert a minipage of the
|
% XXX can we use the normal caption and simply insert a minipage of the
|
||||||
@ -2178,13 +2225,17 @@
|
|||||||
\define@key{captionblockcell@args}{valign}{%
|
\define@key{captionblockcell@args}{valign}{%
|
||||||
\edef\photobook@captionblockcell@valign{#1}}
|
\edef\photobook@captionblockcell@valign{#1}}
|
||||||
|
|
||||||
% clearance=<len>
|
% clearance=<len> (defaults: \clearcaption)
|
||||||
\newlength\clearcaption
|
|
||||||
\setlength\clearcaption{0pt}
|
|
||||||
\newlength\photobook@captionblockcell@clearance
|
\newlength\photobook@captionblockcell@clearance
|
||||||
\define@key{captionblockcell@args}{clearance}{%
|
\define@key{captionblockcell@args}{clearance}{%
|
||||||
\setlength\photobook@captionblockcell@clearance{#1}}
|
\setlength\photobook@captionblockcell@clearance{#1}}
|
||||||
|
|
||||||
|
% spacing=<len> (default: \captioncellspacing)
|
||||||
|
\newlength\photobook@captionblockcell@spacing
|
||||||
|
\setlength\photobook@captionblockcell@spacing{0pt}
|
||||||
|
\define@key{captionblockcell@args}{spacing}{%
|
||||||
|
\setlength\photobook@captionblockcell@spacing{#1}}
|
||||||
|
|
||||||
% width=<len>
|
% width=<len>
|
||||||
\newlength\photobook@captionblockcell@width
|
\newlength\photobook@captionblockcell@width
|
||||||
\setlength\photobook@captionblockcell@width{0pt}
|
\setlength\photobook@captionblockcell@width{0pt}
|
||||||
@ -2216,6 +2267,7 @@
|
|||||||
left,
|
left,
|
||||||
valign=b,
|
valign=b,
|
||||||
clearance=\clearcaption,
|
clearance=\clearcaption,
|
||||||
|
spacing=\captioncellspacing,
|
||||||
#1}%
|
#1}%
|
||||||
%
|
%
|
||||||
\smash{\makebox[0pt][l]{%
|
\smash{\makebox[0pt][l]{%
|
||||||
@ -2226,19 +2278,25 @@
|
|||||||
\setlength\cellwidth{%
|
\setlength\cellwidth{%
|
||||||
\ifnum \photobook@captionblockcell@width = 0%
|
\ifnum \photobook@captionblockcell@width = 0%
|
||||||
\dimexpr
|
\dimexpr
|
||||||
\cellparentwidth
|
\cellparentwidth
|
||||||
- \cellwidth
|
- \photobook@captionblockcell@spacing
|
||||||
- \clearcaption
|
- \cellwidth
|
||||||
% XXX this is only present in images...
|
- \clearcaption
|
||||||
- \clearance \relax%
|
% XXX this is only present in images...
|
||||||
|
- \clearance \relax%
|
||||||
\else%
|
\else%
|
||||||
\photobook@captionblockcell@width\fi}%
|
\photobook@captionblockcell@width\fi}%
|
||||||
\setlength\cellparentwidth{\photobook@captionblockcell@tmplen}%
|
\setlength\cellparentwidth{\photobook@captionblockcell@tmplen}%
|
||||||
\setlength\celloffsetleft{%
|
\setlength\celloffsetleft{%
|
||||||
\ifKV@captionblockcell@args@left%
|
\ifKV@captionblockcell@args@left%
|
||||||
-\cellwidth%
|
\dimexpr
|
||||||
|
- \cellwidth%
|
||||||
|
- \photobook@captionblockcell@spacing \relax%
|
||||||
\else%
|
\else%
|
||||||
\cellparentwidth\fi}%
|
\dimexpr
|
||||||
|
\cellparentwidth
|
||||||
|
+ \photobook@captionblockcell@spacing \relax%
|
||||||
|
\fi}%
|
||||||
%
|
%
|
||||||
\hspace{\celloffsetleft}{%
|
\hspace{\celloffsetleft}{%
|
||||||
\ifKV@captionblockcell@args@showbox%
|
\ifKV@captionblockcell@args@showbox%
|
||||||
@ -3424,7 +3482,7 @@
|
|||||||
%% of this class both when authoring styles and when creating user
|
%% of this class both when authoring styles and when creating user
|
||||||
%% macros/templates.
|
%% macros/templates.
|
||||||
%%
|
%%
|
||||||
%% \input{photobook-meta}
|
%% \input{\jobname-meta}
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user