mirror of
https://github.com/flynx/photobook.git
synced 2025-10-29 02:10:08 +00:00
fixes, tweaks and cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ceb4f2674d
commit
d4d7379cb1
181
photobook.cls
181
photobook.cls
@ -1719,11 +1719,11 @@
|
|||||||
\adjustbox{margin=\photobook@captioncell@margin}{#2}}}
|
\adjustbox{margin=\photobook@captioncell@margin}{#2}}}
|
||||||
|
|
||||||
|
|
||||||
%% \DescribeMacro{spreadcell}
|
%% \DescribeMacro{spreadtopages}
|
||||||
%
|
%
|
||||||
%%
|
%%
|
||||||
%% >> \begin{spreadcell} .. \end{spreadcell}
|
%% >> \begin{spreadtopages} .. \end{spreadtopages}
|
||||||
%% >> \begin{spreadcell}[<pagecount>] .. \end{spreadcell}
|
%% >> \begin{spreadtopages}[<pagecount>] .. \end{spreadtopages}
|
||||||
%%
|
%%
|
||||||
%
|
%
|
||||||
%% \begin{minipage}{\textwidth}
|
%% \begin{minipage}{\textwidth}
|
||||||
@ -1751,7 +1751,9 @@
|
|||||||
%%
|
%%
|
||||||
% XXX add a manual version of this...
|
% XXX add a manual version of this...
|
||||||
% ...i.e. name + use...
|
% ...i.e. name + use...
|
||||||
\NewEnviron{spreadcell}[1][2]{%
|
% XXX add nudge/grow support...
|
||||||
|
% XXX revise name...
|
||||||
|
\NewEnviron{spreadtopages}[1][2]{%
|
||||||
\begingroup%
|
\begingroup%
|
||||||
% create the actual cell...
|
% create the actual cell...
|
||||||
\setlength\cellparentwidth{\cellwidth}%
|
\setlength\cellparentwidth{\cellwidth}%
|
||||||
@ -1759,69 +1761,21 @@
|
|||||||
\setlength\cellwidth{#1\pageblockwidth}%
|
\setlength\cellwidth{#1\pageblockwidth}%
|
||||||
\setlength\cellheight{\pageblockheight}%
|
\setlength\cellheight{\pageblockheight}%
|
||||||
%
|
%
|
||||||
\savecell{photobook@spreadcell}{\cellwidth}{\cellheight}{\BODY}%
|
\savecell{photobook@spreadtopages}{\cellwidth}{\cellheight}{\BODY}%
|
||||||
%
|
%
|
||||||
% generate pages...
|
% generate pages...
|
||||||
\foreach \photobook@spreadcell@page in {0, ...,\numexpr #1 - 1 \relax}{%
|
\foreach \photobook@spreadtopages@page in {0, ...,\numexpr #1 - 1 \relax}{%
|
||||||
\null
|
\null
|
||||||
\begin{pagecell}%
|
\begin{pagecell}%
|
||||||
% NOTE: \cellwidth and \cellheight here are for a single page...
|
% NOTE: \cellwidth and \cellheight here are for a single page...
|
||||||
\usecell*{photobook@spreadcell}%
|
\usecell*{photobook@spreadtopages}%
|
||||||
(0pt, \photobook@spreadcell@page\cellwidth)%
|
(0pt, \photobook@spreadtopages@page\cellwidth)%
|
||||||
{\cellwidth}{\cellheight}%
|
{\cellwidth}{\cellheight}%
|
||||||
%{\photobook@spreadcell@page\cellwidth}{0pt}%
|
|
||||||
\end{pagecell}%
|
\end{pagecell}%
|
||||||
\clearpage}%
|
\clearpage}%
|
||||||
\endgroup}
|
\endgroup}
|
||||||
|
|
||||||
|
|
||||||
% XXX move to a better location... (???)
|
|
||||||
\newcommand\captionformat[1]{%
|
|
||||||
\adjustbox{margin=0.1em 0.2em}{%
|
|
||||||
\captionsize #1}}
|
|
||||||
|
|
||||||
|
|
||||||
%% \DescribeMacro{\imagetocellfit\{..\}}
|
|
||||||
%
|
|
||||||
%% Fit an image to cell (centered).
|
|
||||||
%
|
|
||||||
%% >> \imagetocellfit[<clearence>]{<caption>}{<image>}
|
|
||||||
%%
|
|
||||||
%% \begin{minipage}{\textwidth}
|
|
||||||
%% \begin{verbatim}
|
|
||||||
%%
|
|
||||||
%% +-----------------+
|
|
||||||
%% | |
|
|
||||||
%% +-----------------+
|
|
||||||
%% | . . |
|
|
||||||
%% | . . |
|
|
||||||
%% | image |
|
|
||||||
%% | . . |
|
|
||||||
%% | . . |
|
|
||||||
%% +-----------------+
|
|
||||||
%% | c |
|
|
||||||
%% +-----------------+
|
|
||||||
%%
|
|
||||||
%% \end{verbatim}
|
|
||||||
%% \end{minipage}
|
|
||||||
%%
|
|
||||||
%% Image position can be tweaked via |\vspace{..}| or |\hspace{..}|
|
|
||||||
%
|
|
||||||
% XXX do we need this???
|
|
||||||
% XXX revise caption for vertical images...
|
|
||||||
\newcommand\imagetocellfit[3][0mm]{%
|
|
||||||
\imagecell[center, clearance=#1]{%
|
|
||||||
\captioncell[under,align=flushright]{\captionformat{#2}}}{#3}}
|
|
||||||
|
|
||||||
|
|
||||||
% XXX like fill but trim to cell...
|
|
||||||
% XXX do we need this???
|
|
||||||
\newcommand\imagetocellclip[3][0pt]{%
|
|
||||||
\begin{cliptocell}%
|
|
||||||
\imagecell[fill,clearance=#1]{\captionformat{#2}}{#3}%
|
|
||||||
\end{cliptocell}}
|
|
||||||
|
|
||||||
|
|
||||||
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
%%%%% Paper cells
|
%%%%% Paper cells
|
||||||
|
|
||||||
@ -2151,33 +2105,16 @@
|
|||||||
\newcommand\captionsize{\fontsize{6.5pt}{8pt}\selectfont}
|
\newcommand\captionsize{\fontsize{6.5pt}{8pt}\selectfont}
|
||||||
|
|
||||||
|
|
||||||
%% \DescribeMacro{\imagecaption\{..\}}
|
% XXX move to a better location... (???)
|
||||||
%
|
\newcommand\captionformat[1]{%
|
||||||
%% >> \imagecaption{<caption>}{<location-date>}
|
\adjustbox{margin=0.1em 0.2em}{%
|
||||||
%%
|
\captionsize #1}}
|
||||||
\newcommand\imagecaption[2]{
|
|
||||||
{\captionsize%
|
|
||||||
#1 %
|
|
||||||
\par\vspace{-\parskip}%
|
|
||||||
#2}}
|
|
||||||
|
|
||||||
|
|
||||||
%% \DescribeMacro{\overlaycaption\{..\}}
|
|
||||||
%
|
|
||||||
%% >> \overlaycaption{<caption>}{<location-date>}
|
|
||||||
%%
|
|
||||||
\newcommand\overlaycaption[2]{
|
|
||||||
\begin{flushright}
|
|
||||||
\captionsize%
|
|
||||||
\color{black}{%
|
|
||||||
\colorbox{white}{ #1 }%
|
|
||||||
\par\vspace{-\parskip}%
|
|
||||||
\colorbox{white}{ #2 }}
|
|
||||||
\end{flushright}}
|
|
||||||
|
|
||||||
|
|
||||||
%% \DescribeMacro{\captionsidebox\{..\}}
|
%% \DescribeMacro{\captionsidebox\{..\}}
|
||||||
%
|
%
|
||||||
|
%% \LEGACY
|
||||||
|
%
|
||||||
%% >> \captionsidebox[<offset>]{<imagebox>}{<text>}
|
%% >> \captionsidebox[<offset>]{<imagebox>}{<text>}
|
||||||
%%
|
%%
|
||||||
\newcommand\captionsidebox[3][0mm]{
|
\newcommand\captionsidebox[3][0mm]{
|
||||||
@ -2196,6 +2133,8 @@
|
|||||||
%% \DescribeMacro{\captionboxleft\{..\}}
|
%% \DescribeMacro{\captionboxleft\{..\}}
|
||||||
%% \DescribeMacro{\captionboxright\{..\}}
|
%% \DescribeMacro{\captionboxright\{..\}}
|
||||||
%
|
%
|
||||||
|
%% \LEGACY
|
||||||
|
%
|
||||||
%% >> \captionboxleft[<offset>]{<imagebox>}{<text>}
|
%% >> \captionboxleft[<offset>]{<imagebox>}{<text>}
|
||||||
%% >> \captionboxright[<offset>]{<imagebox>}{<text>}
|
%% >> \captionboxright[<offset>]{<imagebox>}{<text>}
|
||||||
%%
|
%%
|
||||||
@ -2219,40 +2158,6 @@
|
|||||||
\end{flushright}}
|
\end{flushright}}
|
||||||
|
|
||||||
|
|
||||||
% XXX \CAPTIONWIDTHFIX
|
|
||||||
%% \DescribeMacro{\captionbottombox\{..\}}
|
|
||||||
%
|
|
||||||
%% >> \captionbottombox[<offset>]{<imagebox>}{<text>}
|
|
||||||
%%
|
|
||||||
% XXX for some reason the width is wrong here...
|
|
||||||
\newcommand\captionbottombox[3][0mm]{
|
|
||||||
\hspace{ #1 }{
|
|
||||||
% XXX the \CAPTIONWIDTHFIX factor is compensating for an odd alignment error...
|
|
||||||
\begin{minipage}{\dimexpr \CAPTIONWIDTHFIX + \wd#2 \relax}
|
|
||||||
{ \captionsize #3 }
|
|
||||||
\end{minipage}}}
|
|
||||||
|
|
||||||
|
|
||||||
%% \DescribeMacro{\graycaptionpage\{..\}}
|
|
||||||
%
|
|
||||||
%% >> \graycaptionpage{<text>}
|
|
||||||
%%
|
|
||||||
% XXX should this be \captionsize or \scriptsize
|
|
||||||
\newcommand\graycaptionpage[1]{
|
|
||||||
\pagestyle{empty}
|
|
||||||
\pagecolor{normgray}
|
|
||||||
\color{white}
|
|
||||||
\null
|
|
||||||
\vfill
|
|
||||||
\hspace{0.66\textwidth}{%
|
|
||||||
\begin{minipage}{0.33\textwidth}
|
|
||||||
\setlength{\parskip}{0.5em}%
|
|
||||||
\captionsize\it%
|
|
||||||
#1
|
|
||||||
\end{minipage} }
|
|
||||||
\newpage
|
|
||||||
\nopagecolor
|
|
||||||
\color{black} }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -2295,7 +2200,6 @@
|
|||||||
\begin{page}%
|
\begin{page}%
|
||||||
\begin{pagecell}%
|
\begin{pagecell}%
|
||||||
% XXX should we reduce width by bindingoffset???
|
% XXX should we reduce width by bindingoffset???
|
||||||
%\begin{minipage}[t][\cellheight][c]{\dimexpr \cellwidth - \bindingoffset \relax}%
|
|
||||||
\begin{minipage}[t][\cellheight][c]{\cellwidth}%
|
\begin{minipage}[t][\cellheight][c]{\cellwidth}%
|
||||||
\vspace{\imageblockoffsettop\pagetextheight}%
|
\vspace{\imageblockoffsettop\pagetextheight}%
|
||||||
\begin{center}%
|
\begin{center}%
|
||||||
@ -2313,40 +2217,40 @@
|
|||||||
\end{page}}
|
\end{page}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
% XXX
|
|
||||||
% XXX captions wrong...
|
|
||||||
%% \DescribeMacro{\imagepagefit\{..\}}
|
%% \DescribeMacro{\imagepagefit\{..\}}
|
||||||
%
|
%
|
||||||
%% Similar to |\imagepage| but will fit an image into page...
|
%% Similar to |\imagepage| but will fit an image into page...
|
||||||
%
|
%
|
||||||
%% >> \imagepagefit[<clearence>]{<caption>}{<image>}
|
%% >> \imagepagefit[<options>]{<caption>}{<image>}
|
||||||
%%
|
%%
|
||||||
%% \begin{minipage}{\textwidth}
|
%% \begin{minipage}{\textwidth}
|
||||||
%% \begin{verbatim}
|
%% \begin{verbatim}
|
||||||
%%
|
%%
|
||||||
%% . . . . . . .
|
%% . . . . . . .
|
||||||
%% +---------------+
|
%% +-----------------+ +---------------+
|
||||||
%% | |. .| |
|
%% | | | |. .| |
|
||||||
%% | | . . | |
|
%% . +-----------------+ . | | . . | |
|
||||||
%% | | . . | |
|
%% . | . . | . | | . . | |
|
||||||
%% | | . . | |
|
%% . | . . | . | | . . | |
|
||||||
%% | | image | |
|
%% . | image | . | | image | |
|
||||||
%% | | . . | |
|
%% . | . . | . | | . . | |
|
||||||
%% | | . . | |
|
%% . | . . | . | | . . | |
|
||||||
%% | | . . | |
|
%% . +-----------------+ . | | . . | |
|
||||||
%% | |. c.| |
|
%% | c | | |. c.| |
|
||||||
%% +---------------+
|
%% +-----------------+ +---------------+
|
||||||
%% . . . . . . .
|
%% . . . . . . .
|
||||||
%%
|
%%
|
||||||
%% \end{verbatim}
|
%% \end{verbatim}
|
||||||
%% \end{minipage}
|
%% \end{minipage}
|
||||||
%%
|
%%
|
||||||
\newcommand\imagepagefit[3][\clearimage]{%
|
% XXX caption template...
|
||||||
|
% XXX add options to better control caption...
|
||||||
|
% XXX add nudge/grow support...
|
||||||
|
\newcommand\imagepagefit[3][]{%
|
||||||
\null%
|
\null%
|
||||||
\begin{pagecell}%
|
\begin{pagecell}%
|
||||||
\imagecell[center, clearance=#1]{%
|
\imagecell[center, clearance=\clearimage, #1]{%
|
||||||
\captioncell[under,align=flushright]{\captionformat{#2}}}{#3}%
|
\captioncell[under, align=flushright]{\captionformat{#2}}}{#3}%
|
||||||
\end{pagecell}%
|
\end{pagecell}%
|
||||||
\clearpage }
|
\clearpage }
|
||||||
|
|
||||||
@ -2355,7 +2259,7 @@
|
|||||||
%
|
%
|
||||||
%% Like |\imagepage| but will fill page with image.
|
%% Like |\imagepage| but will fill page with image.
|
||||||
%
|
%
|
||||||
%% >> \imagepagefill[<clearence>]{<caption>}{<image>}
|
%% >> \imagepagefill[<options>]{<caption>}{<image>}
|
||||||
%%
|
%%
|
||||||
%% \begin{minipage}{\textwidth}
|
%% \begin{minipage}{\textwidth}
|
||||||
%% \begin{verbatim}
|
%% \begin{verbatim}
|
||||||
@ -2377,11 +2281,14 @@
|
|||||||
%% \end{verbatim}
|
%% \end{verbatim}
|
||||||
%% \end{minipage}
|
%% \end{minipage}
|
||||||
%%
|
%%
|
||||||
|
% XXX caption template...
|
||||||
|
% XXX add options to better control caption...
|
||||||
% XXX add nudge/grow support...
|
% XXX add nudge/grow support...
|
||||||
\newcommand\imagepagefill[3][\clearimage]{
|
\newcommand\imagepagefill[3][]{
|
||||||
\null%
|
\null%
|
||||||
\begin{pagecell}%
|
\begin{pagecell}%
|
||||||
\imagecell[clearance=#1,fill]{#2}{#3}%
|
\imagecell[fill, clearance=\clearimage, #1]{%
|
||||||
|
\captioncell[top, align=flushright]{\captionformat{#2}}}{#3}%
|
||||||
\end{pagecell}%
|
\end{pagecell}%
|
||||||
\clearpage }
|
\clearpage }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user