From 2034e4fdfebaaa9e5f4eec6b2d72ca1f67f22837 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 24 Apr 2023 12:37:13 +0300 Subject: [PATCH] minor refactoring... Signed-off-by: Alex A. Naanou --- photobook.cls | 71 +++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/photobook.cls b/photobook.cls index 09a8d9a..e75fd1c 100644 --- a/photobook.cls +++ b/photobook.cls @@ -2003,42 +2003,45 @@ \newlength\photobook@cliptocell@bottom \setlength\photobook@cliptocell@bottom{0mm}% +% XXX EXPERIMENTAL +% XXX should this set the setsepchar back to default??? +\newcommand\cliptocellbleeds[1]{ + \setsepchar{ }% + \readlist*\photobook@cliptocell@bleeds{#1}% + % args: size + \ifnum \photobook@cliptocell@bleedslen = 1% + \setlength\photobook@cliptocell@left{% + \photobook@cliptocell@bleeds[1]}% + \setlength\photobook@cliptocell@bottom{% + \photobook@cliptocell@bleeds[1]}% + \setlength\photobook@cliptocell@right{% + \photobook@cliptocell@bleeds[1]}% + \setlength\photobook@cliptocell@top{% + \photobook@cliptocell@bleeds[1]}\fi% + % args: horizontal vertical + \ifnum \photobook@cliptocell@bleedslen = 2% + \setlength\photobook@cliptocell@left{% + \photobook@cliptocell@bleeds[1]}% + \setlength\photobook@cliptocell@bottom{% + \photobook@cliptocell@bleeds[2]}% + \setlength\photobook@cliptocell@right{% + \photobook@cliptocell@bleeds[1]}% + \setlength\photobook@cliptocell@top{% + \photobook@cliptocell@bleeds[2]}\fi% + % args: left bottom right top + \ifnum \photobook@cliptocell@bleedslen = 4% + \setlength\photobook@cliptocell@left{% + \photobook@cliptocell@bleeds[1]}% + \setlength\photobook@cliptocell@bottom{% + \photobook@cliptocell@bleeds[2]}% + \setlength\photobook@cliptocell@right{% + \photobook@cliptocell@bleeds[3]}% + \setlength\photobook@cliptocell@top{% + \photobook@cliptocell@bleeds[4]}\fi} + \newenvironment{cliptocell}[1][0mm]{% \begingroup% - \setsepchar{ }% - \readlist*\photobook@cliptocell@bleeds{#1}% - % - % args: size - \ifnum \photobook@cliptocell@bleedslen = 1% - \setlength\photobook@cliptocell@left{% - \photobook@cliptocell@bleeds[1]}% - \setlength\photobook@cliptocell@bottom{% - \photobook@cliptocell@bleeds[1]}% - \setlength\photobook@cliptocell@right{% - \photobook@cliptocell@bleeds[1]}% - \setlength\photobook@cliptocell@top{% - \photobook@cliptocell@bleeds[1]}\fi% - % args: horizontal vertical - \ifnum \photobook@cliptocell@bleedslen = 2% - \setlength\photobook@cliptocell@left{% - \photobook@cliptocell@bleeds[1]}% - \setlength\photobook@cliptocell@bottom{% - \photobook@cliptocell@bleeds[2]}% - \setlength\photobook@cliptocell@right{% - \photobook@cliptocell@bleeds[1]}% - \setlength\photobook@cliptocell@top{% - \photobook@cliptocell@bleeds[2]}\fi% - % args: left bottom right top - \ifnum \photobook@cliptocell@bleedslen = 4% - \setlength\photobook@cliptocell@left{% - \photobook@cliptocell@bleeds[1]}% - \setlength\photobook@cliptocell@bottom{% - \photobook@cliptocell@bleeds[2]}% - \setlength\photobook@cliptocell@right{% - \photobook@cliptocell@bleeds[3]}% - \setlength\photobook@cliptocell@top{% - \photobook@cliptocell@bleeds[4]}\fi% - % + \cliptocellbleeds{#1} % NOTE: the spaces at the end of each line here are significant!! \begin{trimbox}{{\photobook@cliptocell@left} % {\photobook@cliptocell@bottom} %