mirror of
https://github.com/flynx/photobook.git
synced 2025-11-02 12:20:08 +00:00
partial tested xelatex + some cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6614b32985
commit
4b8aad4bc2
241
photobook.cls
241
photobook.cls
@ -84,8 +84,8 @@
|
|||||||
%%% \newcommand\DescribeGlobal[1]{%
|
%%% \newcommand\DescribeGlobal[1]{%
|
||||||
%%% \DescribeMacro{#1}}
|
%%% \DescribeMacro{#1}}
|
||||||
%%
|
%%
|
||||||
%% \newcommand\LEGACY{\fbox{LEGACY}}
|
%% \newcommand\LEGACY[1][]{\fbox{LEGACY #1}}
|
||||||
%% \newcommand\EXPERIMENTAL{\fbox{EXPERIMENTAL}}
|
%% \newcommand\EXPERIMENTAL[1][]{\fbox{EXPERIMENTAL #1}}
|
||||||
%%
|
%%
|
||||||
%%% sections to new pages...
|
%%% sections to new pages...
|
||||||
%% \newcommand\sectionbreak{\Needspace{5\baselineskip}}
|
%% \newcommand\sectionbreak{\Needspace{5\baselineskip}}
|
||||||
@ -473,6 +473,7 @@
|
|||||||
\RequirePackage{ifthen}
|
\RequirePackage{ifthen}
|
||||||
\RequirePackage{iftex}
|
\RequirePackage{iftex}
|
||||||
\RequirePackage{pgffor}
|
\RequirePackage{pgffor}
|
||||||
|
\RequirePackage{xinttools}
|
||||||
\RequirePackage{listofitems}
|
\RequirePackage{listofitems}
|
||||||
\RequirePackage{xkeyval}
|
\RequirePackage{xkeyval}
|
||||||
\RequirePackage{etoolbox}
|
\RequirePackage{etoolbox}
|
||||||
@ -2667,6 +2668,152 @@
|
|||||||
\end{inlinecell*}}
|
\end{inlinecell*}}
|
||||||
|
|
||||||
|
|
||||||
|
% XXX EXPERIMENTAL
|
||||||
|
%% \DescribeMacro{\foldoutpage\{..\}}
|
||||||
|
%% \DescribeMacro{\foldoutpagecell\{..\}}
|
||||||
|
%
|
||||||
|
%% \EXPERIMENTAL[(in progress)]
|
||||||
|
%%
|
||||||
|
%% \begin{minipage}{\textwidth}
|
||||||
|
%% \begin{verbatim}
|
||||||
|
%%
|
||||||
|
%% clearfoldoutfold
|
||||||
|
%% v v
|
||||||
|
%%
|
||||||
|
%% - --+----------------++---------------++--------------+
|
||||||
|
%% = .. .. |
|
||||||
|
%% = .. .. |
|
||||||
|
%% = .. .. |
|
||||||
|
%% = .. .. |
|
||||||
|
%% = .. .. |
|
||||||
|
%% = .. .. |
|
||||||
|
%% = .. .. |
|
||||||
|
%% = .. .. |
|
||||||
|
%% = .. .. |
|
||||||
|
%% = (1) .. (2) .. (3) |
|
||||||
|
%% - --+----------------++---------------++--------------+
|
||||||
|
%%
|
||||||
|
%% +--------------++---------------++----------------+-- -
|
||||||
|
%% | .. .. =
|
||||||
|
%% | .. .. =
|
||||||
|
%% | .. .. =
|
||||||
|
%% | .. .. =
|
||||||
|
%% | .. .. =
|
||||||
|
%% | .. .. =
|
||||||
|
%% | .. .. =
|
||||||
|
%% | .. .. =
|
||||||
|
%% | .. .. =
|
||||||
|
%% | (4) .. (5) .. (6) =
|
||||||
|
%% +--------------++---------------++----------------+-- -
|
||||||
|
%%
|
||||||
|
%% ^ ^
|
||||||
|
%% clearfoldoutfold
|
||||||
|
%%
|
||||||
|
%% \end{verbatim}
|
||||||
|
%% \end{minipage}
|
||||||
|
%%
|
||||||
|
%%
|
||||||
|
%% Fold mode |in-in| (default):
|
||||||
|
%%
|
||||||
|
%% \begin{minipage}{\textwidth}
|
||||||
|
%% \begin{verbatim}
|
||||||
|
%%
|
||||||
|
%% clearfoldoutblock <->
|
||||||
|
%% <--> clearfoldoutfold . . . . . . <->
|
||||||
|
%% (3) /\ (2)
|
||||||
|
%% +---------------------------------+ / \
|
||||||
|
%% +------------------------------- | /
|
||||||
|
%% -------------------------------------+ / (1)
|
||||||
|
%% ======================================== =====+=====
|
||||||
|
%% ========================================
|
||||||
|
%%
|
||||||
|
%% \end{verbatim}
|
||||||
|
%% \end{minipage}
|
||||||
|
%%
|
||||||
|
%%
|
||||||
|
%% Fold mode |in-out|:
|
||||||
|
%%
|
||||||
|
%% \begin{minipage}{\textwidth}
|
||||||
|
%% \begin{verbatim}
|
||||||
|
%%
|
||||||
|
%% clearfoldoutblock <-> /
|
||||||
|
%% <--> clearfoldoutfold (3) /
|
||||||
|
%% \
|
||||||
|
%% +---------------------------------- \ (2)
|
||||||
|
%% +---------------------------------+ /
|
||||||
|
%% -------------------------------------+ / (1)
|
||||||
|
%% ======================================== =====+=====
|
||||||
|
%% ========================================
|
||||||
|
%%
|
||||||
|
%% \end{verbatim}
|
||||||
|
%% \end{minipage}
|
||||||
|
%%
|
||||||
|
% XXX need to:
|
||||||
|
% - create two pages
|
||||||
|
% - first odd, second even
|
||||||
|
% - fold marks
|
||||||
|
% - cells for panels...
|
||||||
|
% - outer panel must be smaller than the inner panel by \clearfoldout
|
||||||
|
% XXX move to globals...
|
||||||
|
\newlength\foldoutwidth
|
||||||
|
\setlength\foldoutwidth{\blockwidth}
|
||||||
|
|
||||||
|
\newlength\foldoutcellwidth
|
||||||
|
\setlength\foldoutcellwidth{\blockwidth}
|
||||||
|
|
||||||
|
\newlength\clearfoldoutblock
|
||||||
|
\setlength\clearfoldoutblock{0.5mm}
|
||||||
|
|
||||||
|
\newlength\clearfoldoutfold
|
||||||
|
\setlength\clearfoldoutfold{5mm}
|
||||||
|
|
||||||
|
\newcommand\foldoutpagecell[2][1]{%
|
||||||
|
% XXX
|
||||||
|
}
|
||||||
|
|
||||||
|
\def\foldoutcellwidths{}
|
||||||
|
|
||||||
|
|
||||||
|
% XXX revise starting dimensions...
|
||||||
|
% XXX add fold type support -- in-in / in-out...
|
||||||
|
% XXX add manual mode -- list of lengths...
|
||||||
|
% XXX add fold marks in bleeds...
|
||||||
|
\newcommand\foldoutpage[2][2]{%
|
||||||
|
\begingroup%
|
||||||
|
% calculate fold geometry...
|
||||||
|
\setlength\foldoutwidth{0pt}%
|
||||||
|
\edef\foldoutcellwidths{}
|
||||||
|
\xintFor* ##1 in {\xintSeq{1}{#1}} \do {%
|
||||||
|
% foldout cell...
|
||||||
|
\setlength\foldoutcellwidth{
|
||||||
|
\dimexpr
|
||||||
|
\blockwidth
|
||||||
|
+ \clearfoldoutblock
|
||||||
|
% NOTE: this is an expanded (i - 1) because magic of LaTeX math =)
|
||||||
|
- ##1\clearfoldoutfold
|
||||||
|
+ \clearfoldoutfold \relax}%
|
||||||
|
% add cell to cell lengths....
|
||||||
|
\edef\foldoutcellwidths{%
|
||||||
|
\foldoutcellwidths, \the\foldoutcellwidth}%
|
||||||
|
% accumulate total width...
|
||||||
|
\setlength\foldoutwidth{
|
||||||
|
\dimexpr
|
||||||
|
\foldoutwidth
|
||||||
|
+ \foldoutcellwidth \relax}}%
|
||||||
|
% format the panel width list...
|
||||||
|
\setsepchar{,}%
|
||||||
|
\ignoreemptyitems%
|
||||||
|
\readlist\foldoutcellwidths{\foldoutcellwidths}%
|
||||||
|
%
|
||||||
|
% show the pages...
|
||||||
|
\cleardoublepage%
|
||||||
|
\resizedpage{\foldoutwidth}{\blockheight}{%
|
||||||
|
\ignorespaces%
|
||||||
|
#2%
|
||||||
|
\cleardoublepage}%
|
||||||
|
\endgroup}
|
||||||
|
|
||||||
|
|
||||||
%% \DescribeEnv{spreadtopages}
|
%% \DescribeEnv{spreadtopages}
|
||||||
%% \DescribeEnv{spreadtopages*}
|
%% \DescribeEnv{spreadtopages*}
|
||||||
%% \DescribeMacro{\usespreadpage\{..\}}
|
%% \DescribeMacro{\usespreadpage\{..\}}
|
||||||
@ -3641,71 +3788,6 @@
|
|||||||
\usespreadpage[2]{photobook@ImageHalfPageR@cell}}
|
\usespreadpage[2]{photobook@ImageHalfPageR@cell}}
|
||||||
|
|
||||||
|
|
||||||
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
%%%%% Foldout
|
|
||||||
|
|
||||||
% XXX move to globals...
|
|
||||||
\newlength\clearfoldoutblock
|
|
||||||
\setlength\clearfoldoutblock{0.5mm}
|
|
||||||
|
|
||||||
% XXX make this an option...
|
|
||||||
\newlength\foldoutpanelwidth
|
|
||||||
\setlength\foldoutpanelwidth{\blockwidth}
|
|
||||||
|
|
||||||
\newlength\clearfoldoutfold
|
|
||||||
\setlength\clearfoldoutfold{5mm}
|
|
||||||
|
|
||||||
% XXX account for paper thickness and number of panels..
|
|
||||||
\newcommand\foldoutcontentwidth[1][1]{\dimexpr
|
|
||||||
\foldoutpanelwidth
|
|
||||||
- (#1 - 1)\clearfoldoutfold
|
|
||||||
- \clearfoldoutblock \relax}
|
|
||||||
|
|
||||||
\newcommand\foldouttotalwidth[1]{\dimexpr
|
|
||||||
\foldoutpanelwidth
|
|
||||||
% XXX
|
|
||||||
\relax}
|
|
||||||
|
|
||||||
% XXX EXPERIMENTAL
|
|
||||||
%
|
|
||||||
% \begin{minipage}{\textwidth}
|
|
||||||
% \begin{verbatim}
|
|
||||||
%
|
|
||||||
% \clearfoldoutfold
|
|
||||||
% v v
|
|
||||||
%
|
|
||||||
% +----------------++---------------++--------------+
|
|
||||||
% = .. .. |
|
|
||||||
% = .. .. |
|
|
||||||
% = .. .. |
|
|
||||||
% = .. .. |
|
|
||||||
% = .. .. |
|
|
||||||
% = .. .. |
|
|
||||||
% = .. .. |
|
|
||||||
% = .. .. |
|
|
||||||
% = .. .. |
|
|
||||||
% = (1) .. (2) .. (3) |
|
|
||||||
% +----------------++---------------++--------------+
|
|
||||||
%
|
|
||||||
%
|
|
||||||
% +---------------+
|
|
||||||
% +-------------- |
|
|
||||||
% -----------------+
|
|
||||||
%
|
|
||||||
% \end{verbatim}
|
|
||||||
% \end{minipage}
|
|
||||||
%
|
|
||||||
% XXX need to:
|
|
||||||
% - create two pages
|
|
||||||
% - first odd, second even
|
|
||||||
% - fold marks
|
|
||||||
% - cells for panels...
|
|
||||||
% - outer panel must be smaller than the inner panel by \clearfoldout
|
|
||||||
\newcommand\FoldoutPage[3][2]{%
|
|
||||||
\cleardoublepage%
|
|
||||||
% XXX
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
%----------------------------------------------------------------------
|
%----------------------------------------------------------------------
|
||||||
%%%% Spread Templates
|
%%%% Spread Templates
|
||||||
@ -4146,24 +4228,6 @@
|
|||||||
\edef\photobook@pdfboxesset@r{\strip@pt\dimexpr
|
\edef\photobook@pdfboxesset@r{\strip@pt\dimexpr
|
||||||
0.996264009963\dimexpr #2 - #1 \relax\relax}%
|
0.996264009963\dimexpr #2 - #1 \relax\relax}%
|
||||||
%
|
%
|
||||||
% set the boxes...
|
|
||||||
\ifxetex%
|
|
||||||
% XXX not tested...
|
|
||||||
% XXX this is mostly the same as for the other branch -- reuse...
|
|
||||||
\AtBeginShipout{\AtBeginShipoutAddToBox{
|
|
||||||
\special{pdf:put @thispage <<
|
|
||||||
/MediaBox [0 0 \photobook@pdfboxesset@w\space \photobook@pdfboxesset@h]
|
|
||||||
/BleedBox [0 0 \photobook@pdfboxesset@w\space \photobook@pdfboxesset@h]
|
|
||||||
/ArtBox [
|
|
||||||
\photobook@pdfboxesset@bleed\space \photobook@pdfboxesset@bleed\space
|
|
||||||
\photobook@pdfboxesset@r\space \photobook@pdfboxesset@t]
|
|
||||||
/TrimBox [
|
|
||||||
\photobook@pdfboxesset@bleed\space \photobook@pdfboxesset@bleed\space
|
|
||||||
\photobook@pdfboxesset@r\space \photobook@pdfboxesset@t]
|
|
||||||
/CropBox [
|
|
||||||
\photobook@pdfboxesset@bleed\space \photobook@pdfboxesset@bleed\space
|
|
||||||
\photobook@pdfboxesset@r\space \photobook@pdfboxesset@t] >>}}}%
|
|
||||||
\else%
|
|
||||||
\edef\photobook@pdfboxes{
|
\edef\photobook@pdfboxes{
|
||||||
/MediaBox [0 0 \photobook@pdfboxesset@w\space \photobook@pdfboxesset@h]
|
/MediaBox [0 0 \photobook@pdfboxesset@w\space \photobook@pdfboxesset@h]
|
||||||
/BleedBox [0 0 \photobook@pdfboxesset@w\space \photobook@pdfboxesset@h]
|
/BleedBox [0 0 \photobook@pdfboxesset@w\space \photobook@pdfboxesset@h]
|
||||||
@ -4177,6 +4241,13 @@
|
|||||||
\photobook@pdfboxesset@bleed\space \photobook@pdfboxesset@bleed\space
|
\photobook@pdfboxesset@bleed\space \photobook@pdfboxesset@bleed\space
|
||||||
\photobook@pdfboxesset@r\space \photobook@pdfboxesset@t]}%
|
\photobook@pdfboxesset@r\space \photobook@pdfboxesset@t]}%
|
||||||
%
|
%
|
||||||
|
% set the boxes...
|
||||||
|
\ifxetex%
|
||||||
|
% XXX make this reusable -- currently this will add new boxes per
|
||||||
|
% call, need to cleanup...
|
||||||
|
\AtBeginShipout{\AtBeginShipoutAddToBox{%
|
||||||
|
\special{pdf:put @thispage << \photobook@pdfboxes >>}}}%
|
||||||
|
\else%
|
||||||
\expandafter\pdfpageattr\expandafter{\photobook@pdfboxes}\fi}
|
\expandafter\pdfpageattr\expandafter{\photobook@pdfboxes}\fi}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -35,18 +35,26 @@
|
|||||||
|
|
||||||
\ImagePageFill{\PageInfo}{\TestImage}
|
\ImagePageFill{\PageInfo}{\TestImage}
|
||||||
|
|
||||||
% XXX these are still a bit off...
|
%\resizedpage{2\blockwidth}{\blockheight}{%
|
||||||
% ...the problem is due to the code that accounts for binding offset when image fit...
|
% \ImagePageFill{\PageInfo}{\TestImageV}%
|
||||||
\resizedpage{2\blockwidth}{\blockheight}{%
|
% \ImagePageFill{\PageInfo}{\TestImage}}
|
||||||
|
%
|
||||||
|
%\ImagePage{Caption text}{\TestImage}
|
||||||
|
%
|
||||||
|
%\resizedpage{3\blockwidth}{\blockheight}{
|
||||||
|
% \ImagePage{Caption text}{\TestImage}}
|
||||||
|
%
|
||||||
|
%\ImagePage{Caption text}{\TestImage}
|
||||||
|
|
||||||
|
\foldoutpage[3]{
|
||||||
\ImagePageFill{\PageInfo}{\TestImageV}%
|
\ImagePageFill{\PageInfo}{\TestImageV}%
|
||||||
\ImagePageFill{\PageInfo}{\TestImage}}
|
\ImagePageFill{\PageInfo}{\TestImage}}
|
||||||
|
|
||||||
\ImagePage{Caption text}{\TestImage}
|
\ImagePage{Caption text}{\TestImage}
|
||||||
|
|
||||||
\resizedpage{3\blockwidth}{\blockheight}{
|
\foldoutpage[3]{
|
||||||
\ImagePage{Caption text}{\TestImage}}
|
%\ImagePageFill{\PageInfo}{\TestImageV}%
|
||||||
|
\ImagePageFill{\PageInfo}{\TestImage}}
|
||||||
\ImagePage{Caption text}{\TestImage}
|
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user