On 9-1-2011 12:45, Aditya Mahajan wrote:
Hans,
Since we have some leverage with backward compatibility in MkIV, can we make \setuppapersize (slightly) more intuitive.
Normally, one would expect
\setuppapersize[A5]
to be equivalent to
\setuppapersize[A5][A5]
but currently it is equivalent to
\setuppapersize[A5][A4]
This is a bit confusing, and means that we always have to specify the printpaper size; even if it is equal to paper size. Can we modify the definition of \dodefinepapersize to change this behavior?
\def\dodefinepapersize[#1][#2][#3]% {\ifsecondargument \doifsomething{#1} % to be sure {\doifassignmentelse{#2} {\getparameters [\??pp#1] % geen \c!scale, scheelt hash ruimte [\c!width=\@@ppwidth,\c!height=\@@ppheight,\c!offset=\@@ppoffset,#2]% %AM: Added these two lines \setvalue{\??pp:1:#1}{#1}% \setvalue{\??pp:2:#1}{#1}}% {\setvalue{\??pp:1:#1}{#2}% \setvalue{\??pp:2:#1}{#3}}}% (*) see below \else \getparameters[\??pp][#1]% \setuppapersize % hm. this will freeze ! \fi}
Perhaps, in line (*), we should also check if #3 is something, otherwise set ??p:2:#1 to #2:
\doifsomethingelse{#3} {\setvalue\??pp:2:#1}{#3}} {\setvalue\??pp:2:#1}{#2}}
What do you think?
more elegant and downward compatible is this: \definepapersize [samesized] [ \c!width=\paperwidth, \c!height=\paperheight] \setuppapersize [A4][samesized] in page-lay.mkiv ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------