mirror of
https://github.com/flynx/photobook.git
synced 2025-11-01 11:50:09 +00:00
experimenting....
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
641b2997b9
commit
cc51de3169
@ -409,6 +409,7 @@
|
|||||||
|
|
||||||
\RequirePackage{calc}
|
\RequirePackage{calc}
|
||||||
\RequirePackage{xargs}
|
\RequirePackage{xargs}
|
||||||
|
\RequirePackage{keyval}
|
||||||
\RequirePackage{ifthen}
|
\RequirePackage{ifthen}
|
||||||
\RequirePackage{iftex}
|
\RequirePackage{iftex}
|
||||||
\RequirePackage{pgffor}
|
\RequirePackage{pgffor}
|
||||||
@ -1089,7 +1090,7 @@
|
|||||||
|
|
||||||
%% \DescribeEnv{cliptocell}
|
%% \DescribeEnv{cliptocell}
|
||||||
%
|
%
|
||||||
%% Clip content to cell.
|
%% Clip content to cell env.
|
||||||
%%
|
%%
|
||||||
\newenvironment{cliptocell}{%
|
\newenvironment{cliptocell}{%
|
||||||
\begin{clipbox*}{0cm {\height - \cellheight} {\cellwidth} {\height}}%
|
\begin{clipbox*}{0cm {\height - \cellheight} {\cellwidth} {\height}}%
|
||||||
@ -1099,6 +1100,48 @@
|
|||||||
\end{clipbox*}}
|
\end{clipbox*}}
|
||||||
|
|
||||||
|
|
||||||
|
%% \DescribeMacro{\imagetocellfitTEST\{..\}}
|
||||||
|
%
|
||||||
|
%% \fbox{XXX EXPERIMENTAL}
|
||||||
|
%
|
||||||
|
%% >> \imagetocellfitTEST[<key>=<value>, ..]{<image>}
|
||||||
|
%%
|
||||||
|
% XXX RENAME...
|
||||||
|
\define@key\imagetocellfitTEST@keys{align}[center]{\def\imagetocellfitTEST@align{#1}}%
|
||||||
|
\define@key\imagetocellfitTEST@keys{left}{}%
|
||||||
|
\define@key\imagetocellfitTEST@keys{top}{}%
|
||||||
|
\define@key\imagetocellfitTEST@keys{clearence}{}%
|
||||||
|
\newcommand\imagetocellfitTEST[2][]{%
|
||||||
|
\setkeys{imagetocellfitTEST@keys}{align=center,#1}
|
||||||
|
% image...
|
||||||
|
\sbox{\photobook@imagebox}{%
|
||||||
|
\includegraphics[
|
||||||
|
keepaspectratio,
|
||||||
|
width=\dimexpr \cellwidth - ((#1) * 2) \relax,
|
||||||
|
height=\dimexpr \cellheight - ((#1) * 2) \relax, ]{#3} }%
|
||||||
|
% place image...
|
||||||
|
% XXX for some odd reason without this the alignment completely breaks...
|
||||||
|
\vspace{0pt}%
|
||||||
|
\adjustbox{
|
||||||
|
margin=
|
||||||
|
% left...
|
||||||
|
{\dimexpr
|
||||||
|
% XXX where is this coming from???!
|
||||||
|
% XXX setting margin-left to 0pt and setting center produces
|
||||||
|
% the same error...
|
||||||
|
% ...this is starting to look like a bug...
|
||||||
|
+1.5pt
|
||||||
|
+0.5\cellwidth
|
||||||
|
-0.5\wd\photobook@imagebox \relax}
|
||||||
|
0pt 0pt
|
||||||
|
% top...
|
||||||
|
{\dimxpr
|
||||||
|
+0.5\cellheight
|
||||||
|
-0.5\ht\photobook@imagebox \relax}}{%
|
||||||
|
\usebox\photobook@imagebox}%
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
%% \DescribeMacro{\imagetocellfit\{..\}}
|
%% \DescribeMacro{\imagetocellfit\{..\}}
|
||||||
%
|
%
|
||||||
%% Fit an image to cell (centered).
|
%% Fit an image to cell (centered).
|
||||||
@ -1164,7 +1207,7 @@
|
|||||||
\captionformat{#2}%
|
\captionformat{#2}%
|
||||||
\end{minipage}%
|
\end{minipage}%
|
||||||
\end{center}\fi}
|
\end{center}\fi}
|
||||||
%
|
|
||||||
|
|
||||||
%% \DescribeMacro{\imagetocellfill\{..\}}
|
%% \DescribeMacro{\imagetocellfill\{..\}}
|
||||||
%
|
%
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user