mirror of
https://github.com/flynx/photobook.git
synced 2025-10-29 02:10:08 +00:00
cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
df345e5f60
commit
717033a484
@ -259,19 +259,8 @@
|
|||||||
% XXX in cover layout setup pdf boxes in a way to use \bleed as foldover...
|
% XXX in cover layout setup pdf boxes in a way to use \bleed as foldover...
|
||||||
% ...see hyperref docs to set pdf view/print area (???)
|
% ...see hyperref docs to set pdf view/print area (???)
|
||||||
% .....should also set \bleed default to something like 17mm
|
% .....should also set \bleed default to something like 17mm
|
||||||
% XXX also need a way to:
|
|
||||||
% - setup front-cover
|
|
||||||
% - setup pine
|
|
||||||
% - setup back-cover
|
|
||||||
% ...envs??
|
|
||||||
% XXX do we need to implement cover fold over???
|
% XXX do we need to implement cover fold over???
|
||||||
% XXX not yet sure how to go about this -- should we update \blockwidth
|
|
||||||
% or should we define a new length and let some templates
|
|
||||||
% use one and some use the other???
|
|
||||||
% ...I'm leaning towards the later...
|
|
||||||
% XXX fold/cut marks???
|
% XXX fold/cut marks???
|
||||||
% XXX write all the dimensions to pdf comment...
|
|
||||||
% XXX EXPERIMENTAL...
|
|
||||||
\DeclareStringOption[block]{layoutmode}[block]
|
\DeclareStringOption[block]{layoutmode}[block]
|
||||||
\@DeclareLiteralOptionTo{layoutmode}{block}
|
\@DeclareLiteralOptionTo{layoutmode}{block}
|
||||||
%\@DeclareLiteralOptionTo{layoutmode}{web}
|
%\@DeclareLiteralOptionTo{layoutmode}{web}
|
||||||
@ -328,8 +317,6 @@
|
|||||||
%
|
%
|
||||||
%% Image block size relative to text block.
|
%% Image block size relative to text block.
|
||||||
%%
|
%%
|
||||||
%
|
|
||||||
% XXX better name...
|
|
||||||
\DeclareStringOption[0.85]{imageblockwidth}[1]
|
\DeclareStringOption[0.85]{imageblockwidth}[1]
|
||||||
\DeclareStringOption[0.85]{imageblockheight}[1]
|
\DeclareStringOption[0.85]{imageblockheight}[1]
|
||||||
\DeclareStringOption[-0.05]{imageblockoffsettop}[0]
|
\DeclareStringOption[-0.05]{imageblockoffsettop}[0]
|
||||||
@ -416,11 +403,7 @@
|
|||||||
\RequirePackage{iftex}
|
\RequirePackage{iftex}
|
||||||
\RequirePackage{pgffor}
|
\RequirePackage{pgffor}
|
||||||
\RequirePackage{listofitems}
|
\RequirePackage{listofitems}
|
||||||
|
|
||||||
% XXX argument processing -- use one of the following two...
|
|
||||||
%\RequirePackage{pgfkeys}
|
|
||||||
\RequirePackage{xkeyval}
|
\RequirePackage{xkeyval}
|
||||||
|
|
||||||
\RequirePackage{etoolbox}
|
\RequirePackage{etoolbox}
|
||||||
\RequirePackage{atbegshi}
|
\RequirePackage{atbegshi}
|
||||||
%\RequirePackage{afterpage}
|
%\RequirePackage{afterpage}
|
||||||
@ -925,43 +908,6 @@
|
|||||||
\hbox{}\newpage \fi\fi\fi }
|
\hbox{}\newpage \fi\fi\fi }
|
||||||
|
|
||||||
|
|
||||||
%% \DescribeMacro{\pdfpagecount\{..\}}
|
|
||||||
%
|
|
||||||
%% Get pdf page count
|
|
||||||
%%
|
|
||||||
%% >> \pdfpagecount{<file.pdf>}
|
|
||||||
%%
|
|
||||||
\newcommand\pdfpagecount[1]{
|
|
||||||
\ifpdftex
|
|
||||||
\pdfximage{#1}
|
|
||||||
\number\pdflastximagepages%
|
|
||||||
\else\ifxetex
|
|
||||||
\number\XeTeXpdfpagecount"#1"%
|
|
||||||
\else\ifluatex
|
|
||||||
\number\directlua{%
|
|
||||||
local pages = 0
|
|
||||||
local doc = pdfe.open("\luaescapestring{#1}")
|
|
||||||
if doc then
|
|
||||||
pages = pdfe.getnofpages(doc)
|
|
||||||
pdfe.close(doc)
|
|
||||||
end
|
|
||||||
tex.write(pages) } \fi\fi }
|
|
||||||
|
|
||||||
|
|
||||||
%% \DescribeMacro{\pdfspinewidth\{..\}}
|
|
||||||
%
|
|
||||||
%% Calculate spine thickness
|
|
||||||
%%
|
|
||||||
%% >> \pdfspinewidth{<paper-thikness>}{<cover-thikness>}{<block-pdf>}
|
|
||||||
%%
|
|
||||||
% NOTE: really "like" how LaTeX overcomplicats simple math...
|
|
||||||
\newcommand\pdfspinewidth[3]{%
|
|
||||||
\setlength\spinewidth{\dimexpr
|
|
||||||
(#1 mm) * \numexpr \pdfpagecount{#3} / 2 \relax
|
|
||||||
+ ((#2 mm) * 2)
|
|
||||||
\relax} }
|
|
||||||
|
|
||||||
|
|
||||||
% XXX workaround a problem with xelatex vs. lualatex...
|
% XXX workaround a problem with xelatex vs. lualatex...
|
||||||
\ifxetex
|
\ifxetex
|
||||||
\newcommand\ShipoutPicture[1]{%
|
\newcommand\ShipoutPicture[1]{%
|
||||||
@ -3008,6 +2954,43 @@
|
|||||||
\end{page} }
|
\end{page} }
|
||||||
|
|
||||||
|
|
||||||
|
%% \DescribeMacro{\pdfpagecount\{..\}}
|
||||||
|
%
|
||||||
|
%% Get pdf page count
|
||||||
|
%%
|
||||||
|
%% >> \pdfpagecount{<file.pdf>}
|
||||||
|
%%
|
||||||
|
\newcommand\pdfpagecount[1]{
|
||||||
|
\ifpdftex
|
||||||
|
\pdfximage{#1}
|
||||||
|
\number\pdflastximagepages%
|
||||||
|
\else\ifxetex
|
||||||
|
\number\XeTeXpdfpagecount"#1"%
|
||||||
|
\else\ifluatex
|
||||||
|
\number\directlua{%
|
||||||
|
local pages = 0
|
||||||
|
local doc = pdfe.open("\luaescapestring{#1}")
|
||||||
|
if doc then
|
||||||
|
pages = pdfe.getnofpages(doc)
|
||||||
|
pdfe.close(doc)
|
||||||
|
end
|
||||||
|
tex.write(pages) } \fi\fi }
|
||||||
|
|
||||||
|
|
||||||
|
%% \DescribeMacro{\pdfspinewidth\{..\}}
|
||||||
|
%
|
||||||
|
%% Calculate spine thickness
|
||||||
|
%%
|
||||||
|
%% >> \pdfspinewidth{<paper-thikness>}{<cover-thikness>}{<block-pdf>}
|
||||||
|
%%
|
||||||
|
% NOTE: really "like" how LaTeX overcomplicats simple math...
|
||||||
|
\newcommand\pdfspinewidth[3]{%
|
||||||
|
\setlength\spinewidth{\dimexpr
|
||||||
|
(#1 mm) * \numexpr \pdfpagecount{#3} / 2 \relax
|
||||||
|
+ ((#2 mm) * 2)
|
||||||
|
\relax} }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%----------------------------------------------------------------------
|
%----------------------------------------------------------------------
|
||||||
%%% XXX DEBUG...
|
%%% XXX DEBUG...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user