[NTG-context] XY arranging ignores dx/dy

2005-08-03 Thread Angus Lees
The XY arranging macro basically ignores dx/dy parameters by always
padding out the space between "pages".

Here's the existing ConTeXt macro for reference - removing \vss and
\hss makes it do the right thing (imo).  I'd give a simple patch, but
I think the ideal behaviour might be to pad if (and only if) dx/dy
were not specified, which is starting to push my TeX skills.

\def\pusharrangedpageXY#1%
  {\doglobal\increment\arrangedpageN
   \reportarrangedpage\arrangedpageN
   \doglobal\increment\arrangedpageM
   \global\setbox\arrangedpageB\hbox
 \ifdim\@@ppwidth>\zeropoint to \@@ppwidth \fi
 {\ifvoid\arrangedpageB\else
\unhbox\arrangedpageB\hss\hskip\@@ppdx\hss
  \fi
  \box#1}%
   \ifnum\arrangedpageM<\arrangedpageX\else
 \global\setbox\arrangedpageA\vbox
  \ifdim\@@ppheight>\zeropoint to \@@ppheight \fi
   {\offinterlineskip
\ifvoid\arrangedpageA\else
  \unvbox\arrangedpageA\vss\vskip\@@ppdy\vss
\fi
\box\arrangedpageB}%
 \doglobal\newcounter\arrangedpageM
   \fi
   \ifnum\arrangedpageN<\arrangedpageT\else
 \poparrangedpages
   \fi}


Minimal test, note the dx/dy distances:

 \definepapersize[label][width=30mm,height=20mm]
 \setuppapersize[label][A4]
 \setuppaper[dx=1mm,dy=1mm,nx=2,ny=6]
 \setuparranging[XY]
 \showframe[edge]
 \starttext \dorecurse{6}{test \recurselevel \page} \stoptext

-- 
 - Gus
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: TeX run : 8

2005-03-05 Thread Angus Lees
At Thu, 03 Mar 2005 12:59:18 +0100, Hans Hagen wrote:
> [if it's indeed the perl hash, (maybe i should make it an array), then
> it looks like perl uses a different hash strategy each run and on each
> os]

Indeed, perl 5.8.1 introduced randomised hash functions to avoid the
"hash collision" attacks that were being published at the time.  You
can never assume hash traversal order will be constant across
different hashes.  See the discussion in the beginning of
`perldoc perl581delta' (and a followup in perl582delta).

-- 
 - Gus

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context