From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31262 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: \combinepages[]: Change order Date: Mon, 9 Oct 2006 09:39:59 +0200 Message-ID: <115224fb0610090039o20a56200nd4a1882879b27227@mail.gmail.com> References: <4527DD70.9000309@net-b.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0624273924==" X-Trace: sea.gmane.org 1160379679 2665 80.91.229.2 (9 Oct 2006 07:41:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 Oct 2006 07:41:19 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Oct 09 09:41:17 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 1GWpkV-0001Sd-Q3 for gctc-ntg-context-518@m.gmane.org; Mon, 09 Oct 2006 09:40:32 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0C6B21FCC6; Mon, 9 Oct 2006 09:40:31 +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 12519-07-2; Mon, 9 Oct 2006 09:40:23 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 204421FC7C; Mon, 9 Oct 2006 09:40:23 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E3BB21FC77 for ; Mon, 9 Oct 2006 09:40:19 +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 13033-03 for ; Mon, 9 Oct 2006 09:40:05 +0200 (CEST) Original-Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.178]) by ronja.ntg.nl (Postfix) with SMTP id C33BE1FE35 for ; Mon, 9 Oct 2006 09:40:00 +0200 (CEST) Original-Received: by py-out-1112.google.com with SMTP id m51so2041272pye for ; Mon, 09 Oct 2006 00:39:59 -0700 (PDT) Original-Received: by 10.35.97.17 with SMTP id z17mr12260339pyl; Mon, 09 Oct 2006 00:39:59 -0700 (PDT) Original-Received: by 10.35.21.8 with HTTP; Mon, 9 Oct 2006 00:39:59 -0700 (PDT) Original-To: "mailing list for ConTeXt users" In-Reply-To: <4527DD70.9000309@net-b.de> 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:31262 Archived-At: --===============0624273924== Content-Type: multipart/alternative; boundary="----=_Part_38514_7240710.1160379599008" ------=_Part_38514_7240710.1160379599008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. \unprotect \startvariables dutch english german czech italian romanian french horizontal: horizontal horizontal horizontal horizontal horizontal horizontal horizontal \stopvariables \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, % added #2]% \@@ipbefore %\doglobal\newcounter\combinedpagescounter \globallet\combinedpagescounter\@@ipstart \doifelse\@@ipalternative\v!b\!!doneafalse\!!doneatrue \if!!donea \doifelse\@@ipdirection\v!horizontal % added % loop for left to right and top to bottom combination {\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}} % loop for top to bottom and left to right combination {\doloop {\vbox %to \textheight {\hsize\textwidth \scratchdimen\@@ipdistance \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax \hbox to \hsize {\dorecurse\@@ipnx {\@@ipleft \vbox to \textheight {\hsize\!!widtha {\dorecurse\@@ipny {\@@iptop \hbox to \hsize {\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}} \doglobal\increment\combinedpagescounter \@@ipbottom}% %\doglobal\increment\combinedpagescounter \vfil}% \vfilneg} \hfil}% \hfilneg}} \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 \@@ipafter \egroup} \protect \starttext \framed{\combinepages[your-pdf][nx=4,ny=6,direction=vertical]} \framed{\combinepages[your-pdf][nx=4,ny=6]} \stoptext Wolfgang ------=_Part_38514_7240710.1160379599008 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

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.
 

\unprotect

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

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

\stopvariables

\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, % added
      #2]%
   \@@ipbefore
  %\doglobal\newcounter\combinedpagescounter
   \globallet\combinedpagescounter\@@ipstart
   \doifelse\@@ipalternative\v!b\!!doneafalse\!!doneatrue
   \if!!donea
    \doifelse\@@ipdirection\v!horizontal % added
     % loop for left to right and top to bottom combination
     {\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}}
     % loop for top to bottom and left to right combination
     {\doloop
       {\vbox %to \textheight
         {\hsize\textwidth
          \scratchdimen\@@ipdistance
          \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax
          \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax
          \hbox to \hsize
           {\dorecurse\@@ipnx
              {\@@ipleft
               \vbox to \textheight
                 {\hsize\!!widtha
                   {\dorecurse\@@ipny
                       {\@@iptop
                        \hbox to \hsize
                          {\vbox to \!!heighta
                            {\hsize\!!widtha
                             \vsize\!!heighta
                             \ifnum\combinedpagesco unter>\@@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!backgrou ndcolor=\@@ipbackgroundcolor,
                                  \c!frame=\@@ipframe]%
                             \fi\fi}}
                        \doglobal\increment\combinedpagescounter
                        \@@ipbottom}%
                     %\doglobal\increment\combinedpa gescounter
                     \vfil}%
                  \vfilneg}
               \hfil}%
           \hfilneg}}
           \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
   \@@ipafter
   \egroup}

\protect

\starttext

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

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

\stoptext

Wolfgang


 
------=_Part_38514_7240710.1160379599008-- --===============0624273924== 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 --===============0624273924==--