pgf-tikz / pgf

A Portable Graphic Format for TeX
https://pgf-tikz.github.io/
1.11k stars 105 forks source link

PGF pages layout with border #537

Open pgf-tikz-bot opened 17 years ago

pgf-tikz-bot commented 17 years ago

Migrated from SourceForge Author: piefel Timestamp: 2006-12-08 11:04:03

The pgfpages packages contains the very nice option to print 8 on 1 etc. However, the pages are evenly distributed on the paper and too close. Using border shrink=5mm shrinks the slides, but not in a very useful way: There is a lot of space between the slides (particularly in the vertical middle) but little on the page borders.

I use the following code:

\pgfpagesdeclarelayout{8 on 1 (border)}
{
\edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
\edef\pgfpageoptionwidth{\the\paperheight}
\def\pgfpageoptionborder{0pt}
}
{
\pgfpagesphysicalpageoptions
{%
logical pages=8,%
physical height=\pgfpageoptionheight,%
physical width=\pgfpageoptionwidth%
}
\ifdim\paperheight>\paperwidth\relax
% put side-by-side
\pgfpageslogicalpageoptions{1}
{%
border shrink=\pgfpageoptionborder,%
resized width=.25\pgfphysicalwidth,%
resized height=.5\pgfphysicalheight,%
center=\pgfpoint{.1625\pgfphysicalwidth}{.725\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{2}
{%
border shrink=\pgfpageoptionborder,%
resized width=.25\pgfphysicalwidth,%
resized height=.5\pgfphysicalheight,%
center=\pgfpoint{.3875\pgfphysicalwidth}{.725\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{3}
{%
border shrink=\pgfpageoptionborder,%
resized width=.25\pgfphysicalwidth,%
resized height=.5\pgfphysicalheight,%
center=\pgfpoint{.6125\pgfphysicalwidth}{.725\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{4}
{%
border shrink=\pgfpageoptionborder,%
resized width=.25\pgfphysicalwidth,%
resized height=.5\pgfphysicalheight,%
center=\pgfpoint{.8375\pgfphysicalwidth}{.725\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{5}
{%
border shrink=\pgfpageoptionborder,%
resized width=.25\pgfphysicalwidth,%
resized height=.5\pgfphysicalheight,%
center=\pgfpoint{.1625\pgfphysicalwidth}{.275\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{6}
{%
border shrink=\pgfpageoptionborder,%
resized width=.25\pgfphysicalwidth,%
resized height=.5\pgfphysicalheight,%
center=\pgfpoint{.3875\pgfphysicalwidth}{.275\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{7}
{%
border shrink=\pgfpageoptionborder,%
resized width=.25\pgfphysicalwidth,%
resized height=.5\pgfphysicalheight,%
center=\pgfpoint{.6125\pgfphysicalwidth}{.275\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{8}
{%
border shrink=\pgfpageoptionborder,%
resized width=.25\pgfphysicalwidth,%
resized height=.5\pgfphysicalheight,%
center=\pgfpoint{.8375\pgfphysicalwidth}{.275\pgfphysicalheight}%
}%
\else
% stack on top of one another
\pgfpageslogicalpageoptions{1}
{%
border shrink=\pgfpageoptionborder,%
resized width=.5\pgfphysicalwidth,%
resized height=.25\pgfphysicalheight,%
center=\pgfpoint{.275\pgfphysicalwidth}{.8375\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{2}
{%
border shrink=\pgfpageoptionborder,%
resized width=.5\pgfphysicalwidth,%
resized height=.25\pgfphysicalheight,%
center=\pgfpoint{.725\pgfphysicalwidth}{.8375\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{3}
{%
border shrink=\pgfpageoptionborder,%
resized width=.5\pgfphysicalwidth,%
resized height=.25\pgfphysicalheight,%
center=\pgfpoint{.275\pgfphysicalwidth}{.6125\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{4}
{%
border shrink=\pgfpageoptionborder,%
resized width=.5\pgfphysicalwidth,%
resized height=.25\pgfphysicalheight,%
center=\pgfpoint{.725\pgfphysicalwidth}{.6125\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{5}
{%
border shrink=\pgfpageoptionborder,%
resized width=.5\pgfphysicalwidth,%
resized height=.25\pgfphysicalheight,%
center=\pgfpoint{.275\pgfphysicalwidth}{.3875\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{6}
{%
border shrink=\pgfpageoptionborder,%
resized width=.5\pgfphysicalwidth,%
resized height=.25\pgfphysicalheight,%
center=\pgfpoint{.725\pgfphysicalwidth}{.3875\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{7}
{%
border shrink=\pgfpageoptionborder,%
resized width=.5\pgfphysicalwidth,%
resized height=.25\pgfphysicalheight,%
center=\pgfpoint{.275\pgfphysicalwidth}{.1625\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{8}
{%
border shrink=\pgfpageoptionborder,%
resized width=.5\pgfphysicalwidth,%
resized height=.25\pgfphysicalheight,%
center=\pgfpoint{.725\pgfphysicalwidth}{.1625\pgfphysicalheight}%
}%
\fi
}

It differs from the original only in the center lines and is usable only with a skrunk border; IOW it is a hack. It would be much better to have some kind of option for this built-in into PGF.

pgf-tikz-bot commented 10 years ago

Migrated from SourceForge Author: tantau Timestamp: 2013-09-30 10:34:48.215000