From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31275 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: \combinepages[]: Change order Date: Tue, 10 Oct 2006 09:25:23 +0200 Message-ID: <115224fb0610100025p10529c7eh7cfe3d789f6e410e@mail.gmail.com> References: <4527DD70.9000309@net-b.de> <115224fb0610090039o20a56200nd4a1882879b27227@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1669010011==" X-Trace: sea.gmane.org 1160465162 1963 80.91.229.2 (10 Oct 2006 07:26:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Oct 2006 07:26:02 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 10 09:26:00 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1GXBzs-0007I6-VX for gctc-ntg-context-518@m.gmane.org; Tue, 10 Oct 2006 09:25:53 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6C3A61FCE4; Tue, 10 Oct 2006 09:25:52 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01085-02; Tue, 10 Oct 2006 09:25:44 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C17881FCD3; Tue, 10 Oct 2006 09:25:43 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2B3101FCD3 for ; Tue, 10 Oct 2006 09:25:39 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01089-01 for ; Tue, 10 Oct 2006 09:25:28 +0200 (CEST) Original-Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.182]) by ronja.ntg.nl (Postfix) with SMTP id 791C41FCAF for ; Tue, 10 Oct 2006 09:25:25 +0200 (CEST) Original-Received: by py-out-1112.google.com with SMTP id m51so2477762pye for ; Tue, 10 Oct 2006 00:25:24 -0700 (PDT) Original-Received: by 10.35.123.10 with SMTP id a10mr14693647pyn; Tue, 10 Oct 2006 00:25:24 -0700 (PDT) Original-Received: by 10.35.21.8 with HTTP; Tue, 10 Oct 2006 00:25:23 -0700 (PDT) Original-To: "mailing list for ConTeXt users" In-Reply-To: <115224fb0610090039o20a56200nd4a1882879b27227@mail.gmail.com> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:31275 Archived-At: --===============1669010011== Content-Type: multipart/alternative; boundary="----=_Part_61563_27002052.1160465123765" ------=_Part_61563_27002052.1160465123765 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 2006/10/9, Wolfgang Schuster : > > > > 2006/10/7, Tobias Burnus : > > > > Hello, > > > > Using \combinepages[some-pdf][nx=3,ny=5], I get: > > > > 1 2 3 > > 4 5 6 > > 7 8 9 > > 10 11 12 > > > > However, I'd like to get: > > 1 5 9 > > 2 6 10 > > 3 7 11 > > 4 8 12 > > > > How can one achieve this? (I want to create again a poster out of > > talk.pdf.) > > > > Tobias > > > Hi Tobias, > > I can provide a first draft of a solution to your problem. > > The frame around the combination should you show a small problem with my > correction, > it is up to you change this and maybe to wikify this. > > [old macro deleted] I changed the macro to a (for mee) more readable form. \unprotect % a new variable for horizontal (default) direction \startvariables dutch english german czech italian romanian french horizontal: horizontal horizontal horizontal horizontal horizontal horizontal horizontal \stopvariables % we extract the combine macros from the core \def\docombinepages[#1][#2]% a=perpag b=free {\bgroup \dontcomplain \getfiguredimensions[#1]% \getparameters [\??ip] [\c!alternative=\v!a, \c!n=\noffigurepages,\c!nx=2,\c!ny=2,\c!start=1,\c!stop=\!!maxcard, \c!distance=\bodyfontsize, \c!bottom=\vfill,\c!top=\vss, \c!left=\hss,\c!right=\hss, \c!before=\page,\c!after=\page,\c!inbetween=\blank, \c!frame=,\c!background=,\c!backgroundcolor=, \c!direction=\v!horizontal, #2]% \@@ipbefore %\doglobal\newcounter\combinedpagescounter \globallet\combinedpagescounter\@@ipstart \doifelse\@@ipalternative\v!b\!!doneafalse\!!doneatrue \doifelse\@@ipdirection\v!horizontal\docombinepageshorizontal\docombinepagesvertical#1 % watch the #1 ;-) \@@ipafter \egroup} % we work from left to right and from top to bottom \def\docombinepageshorizontal#1 {\if!!donea \doloop {\vbox to \textheight {\hsize\textwidth % ? ? \scratchdimen\@@ipdistance \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax \dorecurse\@@ipny {\hbox to \hsize {\dorecurse\@@ipnx {\vbox to \!!heighta {\hsize\!!widtha \vsize\!!heighta \@@iptop \hbox to \hsize {\@@ipleft \ifnum\combinedpagescounter>\@@ipstop\relax \globallet\@@ipn\!!zerocount \else\ifnum\combinedpagescounter>\@@ipn \else \externalfigure[#1] [\c!object=\v!no, \c!page=\combinedpagescounter, \c!factor=\v!max, \c!background=\@@ipbackground, \c!backgroundcolor=\@@ipbackgroundcolor, \c!frame=\@@ipframe]% \fi\fi \@@ipright} \@@ipbottom}% \doglobal\increment\combinedpagescounter \hfil}% \hfilneg} \vfil}% \vfilneg}% \page \ifnum\combinedpagescounter>\@@ipn \exitloop\fi} \else \doloop {\startbaselinecorrection \scratchdimen\@@ipdistance \!!widtha\dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax \hbox to \hsize {\dorecurse\@@ipnx {\doglobal\increment\combinedpagescounter \ifnum\combinedpagescounter>\@@ipn \else \expanded{\externalfigure[#1] [\c!page=\combinedpagescounter, \c!width=\the\!!widtha,% todo \freezedimenmacro \c!background=\@@ipbackground, \c!backgroundcolor=\@@ipbackgroundcolor, \c!frame=\@@ipframe]}% \hfill \fi}\hfillneg}% \stopbaselinecorrection \ifnum\combinedpagescounter<\@@ipn\relax \@@ipinbetween \else \exitloop \fi} \fi} % we work from top to bottom and from left to right, no alternative=b \def\docombinepagesvertical#1 {\doloop {\vbox %to \textheight % neccesary? {\hsize\textwidth \vsize\textheight \scratchdimen\@@ipdistance \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax \hbox to \hsize {\dorecurse\@@ipnx {\vbox to \vsize {\hsize\!!widtha \dorecurse\@@ipny {\@@iptop \hbox to \hsize {\@@ipleft \vbox to \!!heighta {\hsize\!!widtha \vsize\!!heighta \ifnum\combinedpagescounter>\@@ipstop\relax \globallet\@@ipn\!!zerocount \else\ifnum\combinedpagescounter>\@@ipn \else \externalfigure[#1] [\c!object=\v!no, \c!page=\combinedpagescounter, \c!factor=\v!max, \c!background=\@@ipbackground, \c!backgroundcolor=\@@ipbackgroundcolor, \c!frame=\@@ipframe]% \fi\fi}% \@@ipright} \doglobal\increment\combinedpagescounter \@@ipbottom} \vfil}% \hfil} \hfilneg} \vfilneg} \page \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}} \protect > \starttext > > \framed{\combinepages[your-pdf][nx=4,ny=6,direction=vertical]} > > \framed{\combinepages[your-pdf][nx=4,ny=6]} > > \stoptext > Wolfgang ------=_Part_61563_27002052.1160465123765 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

2006/10/9, Wolfgang Schuster <schuster.wolfgang@googlemail.com>:


2006/10/7, Tobias Burnus <burnus@net-b.de>:
Hello,

Using \combinepages[some-pdf][nx=3,ny=5], I get:

1  2  3
4  5  6
7  8  9
10 11 12

However, I'd like to get:
1  5  9
2  6 10
3  7 11
4  8 12

How can one achieve this? (I want to create again a poster out of talk.pdf.)

Tobias
 
Hi Tobias,
 
I can provide a first draft of a solution to your problem.
 
The frame around the combination should you show a small problem with my correction,
it is up to you change this and maybe to wikify this.
 
 
 

[old macro deleted]
 
I changed the macro to a (for mee) more readable form.
 

\unprotect

% a new variable for horizontal (default) direction

\startvariables            dutch                     english
                           german                    czech
                           italian                   romanian
                 &nbs p;         french

               horizontal: horizontal                horizontal
                           horizontal                horizontal
                           horizontal                horizontal
                       &nb sp;   horizontal

\stopvariables

% we extract the combine macros from the core

\def\docombinepages[#1][#2]% a=perpag b=free
  {\bgroup
   \dontcomplain
   \getfiguredimensions[#1]%
   \getparameters
     [\??ip]
     [\c!alternative=\v!a,
      \c!n=\noffigurepages,\c!nx=2,\c!ny=2,\c!start=1,\c!stop=\!!maxcard,
      \c!distance=\bodyfontsize,
      \c!bottom=\vfill,\c!top=\vss,
      \c!left=\hss,\c!right=\hss,
      \c!before=\page,\c!after=\page,\c!inbetween=\blank,
      \c!frame=,\c!background=,\c!backgroundcolor=,
      \c!direction=\v!horizontal,
      #2]%
   \@@ipbefore
  %\doglobal\newcounter\combinedpagescounter
   \globallet\combinedpagescounter\@@ipstart
   \doifelse\@@ipalternative\v!b\!!doneafalse\!!doneatrue
   \doifelse\@@ipdirection\v!horizontal\docombinepageshorizontal\docombinepagesvertical#1 % watch the #1 ;-)
   \@@ipafter
   \egroup}

% we work from left to right and from top to bottom

\def\docombinepageshorizontal#1
  {\if!!donea
     \doloop
       {\vbox to \textheight
           {\hsize\textwidth % ? ?
            \scratchdimen\@@ipdistance
            \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax
            \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax
            \dorecurse\@@ipny
              {\hbox to \hsize
                 {\dorecurse\@@ipnx
                    {\vbox to \!!heighta
                       {\hsize\!!widtha
                        \vsize\!!heighta
                        \@@iptop
                        \hbox to \hsize
                          {\@@ipleft
                  &n bsp;        \ifnum\combinedpagescounter>\@@ipstop\re lax
                             \globallet\@@ipn\!!zerocount
                           \else\ifnum\combinedpagescounter>\@@ipn \else
                             \externalfigure[#1]
                               [\c!object=\v!no,
                                \c!page=\combinedpagescounter,
                                \c!factor=\v!max,
                                \c!background=\@@ipbackground,
                                \c!backgroundcolor=\@@ipbackgroundcolor,
                                \c!frame=\@@ipframe]%
                           \fi\fi
                           \@@ipright}
                        \@@ipbottom}%
                     \doglobal\increment\combinedpagescounter
                     \hfil}%
                  \hfilneg}
               \vfil}%
           \vfilneg}%
           \page
        \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}
   \else
     \doloop
       {\startbaselinecorrection
          \scratchdimen\@@ipdistance
          \!!widtha\dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax
          \hbox to \hsize
            {\dorecurse\@@ipnx
               {\doglobal\increment\combinedpagescounter
                \ifnum\combinedpagescounter>\@@ipn \else
                   \expanded{\externalfigure[#1]
                     [\c!page=\combinedpagescounter,
                      \c!width=\the\!!widtha,% todo \freezedimenmacro
                      \c!background=\@@ipbackground,
                      \c!backgroundcolor=\@@ipbackgroundcolor,
                      \c!frame=\@@ipframe]}%
                   \hfill
                \fi}\hfillneg}%
        \stopbaselinecorrection
        \ifnum\combinedpagescounter<\@@ipn\relax
          \@@ipinbetween
        \else
          \exitloop
        \fi}
   \fi}

% we work from top to bottom and from left to right, no alternative=b

\def\docombinepagesvertical#1
  {\doloop
     {\vbox %to \textheight % neccesary?
        {\hsize\textwidth
         \vsize\textheight
         \scratchdimen\@@ipdistance
         \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax
         \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax
         \hbox to \hsize
           {\dorecurse\@@ipnx
              {\vbox to \vsize
                 {\hsize\!!widtha
                  \dorecurse\@@ipny
                    {\@@iptop
                     \hbox to \hsize
                       {\@@ipleft
                        \vbox to \!!heighta
                          {\hsize\!!widtha
                           \vsize\!!heighta
                           \ifnum\combinedpagescounter>\@@ipstop\relax
                             \globallet\@@ipn\!!zerocount
                           \else\ifnum\combinedpagescounter>\@@ipn \else
                             \externalfigure[#1]
                               [\c!object=\v!no,
                                \c!page=\combinedpagescounter,
                                \c!factor=\v!max,
                                \c!background=\@@ipbackground,
                                \c!backgroundcolor=\@@ipbackgroundcolor,
                                \c!frame=\@@ipframe]%
                           \fi\fi}%
                        \@@ipright}
                     \doglobal\increment\combinedpagescounter
                     \@@ipbottom}
                  \vfil}%
               \hfil}
            \hfilneg}
         \vfilneg}
         \page
      \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}}

\protect

\starttext

\framed{\combinepages[your-pdf][nx=4,ny=6,direction=vertical]}

\framed{\combinepages[your-pdf][nx=4,ny=6]}

\stoptext

 
Wolfgang
 

 

------=_Part_61563_27002052.1160465123765-- --===============1669010011== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --===============1669010011==--