ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Different printing positions on cards
@ 2010-07-23  4:04 Jaroslav Hajtmar
  2010-07-23  4:27 ` Jaroslav Hajtmar
  2010-07-23  7:40 ` Hans Hagen
  0 siblings, 2 replies; 5+ messages in thread
From: Jaroslav Hajtmar @ 2010-07-23  4:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello all...
I am looking for problem in my example but without success.
As you can see in my minimal example, that any printing positions on any 
cards are diferent.
I want to print always started at the same place!
Someone knows a solution? Forgotten that any gaps?

Thanx Jaroslav


\newcount\countofhor\countofhor=3
\newcount\countofvert\countofvert=4
\newdimen\paperedge\paperedge=0.5cm
\newdimen\disthor\disthor=2mm
\newdimen\distvert\distvert=2mm

\newdimen\cardheight\newdimen\cardwidth
\newcount\countofcardsonpage\countofcardsonpage=\countofhor
\multiply\countofcardsonpage\countofvert

\definepapersize[BC][width=\cardwidth,height=\cardheight] % not change!


%\setuppapersize [BC][A4]
\setuppapersize [BC][A4,landscape]



% Calculate only:
\cardheight=\dimexpr((\printpaperheight-2\paperedge-\distvert*(\countofvert-1))/\countofvert)
\cardwidth=\dimexpr((\printpaperwidth-2\paperedge-\dimexpr(\disthor)*(\countofhor-1))/\countofhor)
\definemeasure[topspace] [\dimexpr(\printpaperheight-(\cardheight + 
\distvert)*\countofvert+\distvert)/2\relax]
\definemeasure[backspace] [\dimexpr(\printpaperwidth-(\cardwidth + 
\disthor)*\countofhor+\disthor)/2\relax]

\setuppaper     
[topspace=\measure{topspace},backspace=\measure{backspace},bottomspace=\measure{topspace},cutspace=\measure{backspace}, 
dx=\disthor,dy=\distvert,nx=\countofhor,ny=\countofvert]
\setuplayout    [page] 
[topspace=\measure{topspace},backspace=\measure{backspace},bottomspace=\measure{topspace},cutspace=\measure{backspace}]
\setuplayout    [location=middle, marking=on]
\setuparranging [XY]


\setuppagenumbering [alternative=doublesided,location=, state=stop]


\defineoverlay[pozadifront][{\externalfigure[file1.jpg][width=\cardwidth,height=\cardheight]}]
\defineoverlay[pozadiback][{\externalfigure[file2.jpg][width=\cardwidth,height=\cardheight]}]


\startbuffer[Front]
\leftaligned{\recurselevel\ - Front}%
\stopbuffer


\startbuffer[Back]
\leftaligned{\recurselevel\ - Back}%
\stopbuffer


\def\printactionpageone{%
\setupbackgrounds [page][background={pozadifront}]%
\getbuffer[Front]\page%
}%

\def\printactionpagetwo{%
\setupbackgrounds [page][background={pozadiback}]%
\getbuffer[Back]\page%
}%

\showframe[edge]

\starttext
\dorecurse{\countofcardsonpage}{\printactionpageone}
\dorecurse{\countofcardsonpage}{\printactionpagetwo}
\stoptext


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Different printing positions on cards
  2010-07-23  4:04 Different printing positions on cards Jaroslav Hajtmar
@ 2010-07-23  4:27 ` Jaroslav Hajtmar
  2010-07-23  7:40 ` Hans Hagen
  1 sibling, 0 replies; 5+ messages in thread
From: Jaroslav Hajtmar @ 2010-07-23  4:27 UTC (permalink / raw)
  To: ntg-context

Sorry I added some more...

The problem is better seen when, instead of \showframe[edge] put 
\showframe only ...

Jaroslav



Dne 23.7.2010 6:04, Jaroslav Hajtmar napsal(a):
> Hello all...
> I am looking for problem in my example but without success.
> As you can see in my minimal example, that any printing positions on 
> any cards are diferent.
> I want to print always started at the same place!
> Someone knows a solution? Forgotten that any gaps?
>
> Thanx Jaroslav
>
>
> \newcount\countofhor\countofhor=3
> \newcount\countofvert\countofvert=4
> \newdimen\paperedge\paperedge=0.5cm
> \newdimen\disthor\disthor=2mm
> \newdimen\distvert\distvert=2mm
>
> \newdimen\cardheight\newdimen\cardwidth
> \newcount\countofcardsonpage\countofcardsonpage=\countofhor
> \multiply\countofcardsonpage\countofvert
>
> \definepapersize[BC][width=\cardwidth,height=\cardheight] % not change!
>
>
> %\setuppapersize [BC][A4]
> \setuppapersize [BC][A4,landscape]
>
>
>
> % Calculate only:
> \cardheight=\dimexpr((\printpaperheight-2\paperedge-\distvert*(\countofvert-1))/\countofvert) 
>
> \cardwidth=\dimexpr((\printpaperwidth-2\paperedge-\dimexpr(\disthor)*(\countofhor-1))/\countofhor) 
>
> \definemeasure[topspace] [\dimexpr(\printpaperheight-(\cardheight + 
> \distvert)*\countofvert+\distvert)/2\relax]
> \definemeasure[backspace] [\dimexpr(\printpaperwidth-(\cardwidth + 
> \disthor)*\countofhor+\disthor)/2\relax]
>
> \setuppaper     
> [topspace=\measure{topspace},backspace=\measure{backspace},bottomspace=\measure{topspace},cutspace=\measure{backspace}, 
> dx=\disthor,dy=\distvert,nx=\countofhor,ny=\countofvert]
> \setuplayout    [page] 
> [topspace=\measure{topspace},backspace=\measure{backspace},bottomspace=\measure{topspace},cutspace=\measure{backspace}] 
>
> \setuplayout    [location=middle, marking=on]
> \setuparranging [XY]
>
>
> \setuppagenumbering [alternative=doublesided,location=, state=stop]
>
>
> \defineoverlay[pozadifront][{\externalfigure[file1.jpg][width=\cardwidth,height=\cardheight]}] 
>
> \defineoverlay[pozadiback][{\externalfigure[file2.jpg][width=\cardwidth,height=\cardheight]}] 
>
>
>
> \startbuffer[Front]
> \leftaligned{\recurselevel\ - Front}%
> \stopbuffer
>
>
> \startbuffer[Back]
> \leftaligned{\recurselevel\ - Back}%
> \stopbuffer
>
>
> \def\printactionpageone{%
> \setupbackgrounds [page][background={pozadifront}]%
> \getbuffer[Front]\page%
> }%
>
> \def\printactionpagetwo{%
> \setupbackgrounds [page][background={pozadiback}]%
> \getbuffer[Back]\page%
> }%
>
> \showframe[edge]
>
> \starttext
> \dorecurse{\countofcardsonpage}{\printactionpageone}
> \dorecurse{\countofcardsonpage}{\printactionpagetwo}
> \stoptext
>
>
> ___________________________________________________________________________________ 
>
> If your question is of interest to others as well, please add an entry 
> to the Wiki!
>
> maillist : ntg-context@ntg.nl / 
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________ 
>
>

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Different printing positions on cards
  2010-07-23  4:04 Different printing positions on cards Jaroslav Hajtmar
  2010-07-23  4:27 ` Jaroslav Hajtmar
@ 2010-07-23  7:40 ` Hans Hagen
  2010-07-23  8:09   ` Jaroslav Hajtmar
  1 sibling, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2010-07-23  7:40 UTC (permalink / raw)
  To: hajtmar, mailing list for ConTeXt users

On 23-7-2010 6:04, Jaroslav Hajtmar wrote:
> Hello all...
> I am looking for problem in my example but without success.
> As you can see in my minimal example, that any printing positions on any
> cards are diferent.
> I want to print always started at the same place!
> Someone knows a solution? Forgotten that any gaps?

easier:

\setuppapersize[A8,landscape][A4,landscape]

\setuplayout[nx=3,ny=4,dx=3.5cm]

\setuplayout
   [height=middle,
    width=middle,
    topspace=3mm,
    backspace=3mm,
    header=0pt,
    footer=0pt]

\starttext

\startstandardmakeup
     \externalfigure[cow][width=\textwidth,height=\textheight]
\stopstandardmakeup

\startstandardmakeup
     \externalfigure[cow][width=\textwidth,height=\textheight]
\stopstandardmakeup

\stoptext

instead of A8 you can define and use another papersize

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Different printing positions on cards
  2010-07-23  7:40 ` Hans Hagen
@ 2010-07-23  8:09   ` Jaroslav Hajtmar
  2010-07-23  8:24     ` Jaroslav Hajtmar
  0 siblings, 1 reply; 5+ messages in thread
From: Jaroslav Hajtmar @ 2010-07-23  8:09 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Thanx, but I am afraid, that I understand what do you mean...

For explanation: I want create duplex cards (like Pexeso game - if you 
know ....), which must overlap (when cutting of A4)
I have a ready mechanism (in Lua) to the cards on the other side mirror 
rotates so that the parties themselves were approved.

In my solution (as shown in the example), although overlapping tiles, 
but some texts are shifted and I dont know WHY?..
It is seen, thet any frames are shifted... It is curious...

Thanx. Jaroslav

My new better example:

\newcount\countofhor\countofhor=3
\newcount\countofvert\countofvert=4
\newdimen\paperedge\paperedge=0.5cm
\newdimen\disthor\disthor=2mm
\newdimen\distvert\distvert=2mm

\newdimen\cardheight\newdimen\cardwidth
\newcount\countofcardsonpage\countofcardsonpage=\countofhor
\multiply\countofcardsonpage\countofvert

\definepapersize[BC][width=\cardwidth,height=\cardheight] % neměnit!!!


\setuppapersize [BC][A4]
%\setuppapersize [BC][A4,landscape]



% Calculate only:
\cardheight=\dimexpr((\printpaperheight-2\paperedge-\distvert*(\countofvert-1))/\countofvert)
\cardwidth=\dimexpr((\printpaperwidth-2\paperedge-\dimexpr(\disthor)*(\countofhor-1))/\countofhor)
\definemeasure[topspace] [\dimexpr(\printpaperheight-(\cardheight + 
\distvert)*\countofvert+\distvert)/2\relax]
\definemeasure[backspace] [\dimexpr(\printpaperwidth-(\cardwidth + 
\disthor)*\countofhor+\disthor)/2\relax]

\setuppaper 
[topspace=\measure{topspace},backspace=\measure{backspace},bottomspace=\measure{topspace},cutspace=\measure{backspace}, 
dx=\disthor,dy=\distvert,nx=\countofhor,ny=\countofvert]
\setuplayout [page] 
[topspace=\measure{topspace},backspace=\measure{backspace},bottomspace=\measure{topspace},cutspace=\measure{backspace}]
\setuplayout [location=middle, marking=on]
\setuparranging [XY]


\setuppagenumbering [alternative=doublesided,location=, state=stop]


\defineoverlay[pozadifront][{\externalfigure[file1.jpg][width=\cardwidth,height=\cardheight]}]
\defineoverlay[pozadiback][{\externalfigure[file2.jpg][width=\cardwidth,height=\cardheight]}]


\startbuffer[Front]
\leftaligned{\recurselevel\ - Front}%
\stopbuffer


\startbuffer[Back]
\leftaligned{\recurselevel\ - Back}%
\stopbuffer


\def\printactionpageone{%
\setupbackgrounds [page][background={pozadifront}]%
\getbuffer[Front]\page%
}%

\def\printactionpagetwo{%
\setupbackgrounds [page][background={pozadiback}]%
\getbuffer[Back]\page%
}%

\showframe

\starttext
\dorecurse{\countofcardsonpage}{\printactionpageone}
\dorecurse{\countofcardsonpage}{\printactionpagetwo}
\stoptext




Dne 23.7.2010 9:40, Hans Hagen napsal(a):
> \setuppapersize[A8,landscape][A4,landscape]
>
> \setuplayout[nx=3,ny=4,dx=3.5cm]
>
> \setuplayout
> [height=middle,
> width=middle,
> topspace=3mm,
> backspace=3mm,
> header=0pt,
> footer=0pt]
>
> \starttext
>
> \startstandardmakeup
> \externalfigure[cow][width=\textwidth,height=\textheight]
> \stopstandardmakeup
>
> \startstandardmakeup
> \externalfigure[cow][width=\textwidth,height=\textheight]
> \stopstandardmakeup
>
> \stoptext 

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Different printing positions on cards
  2010-07-23  8:09   ` Jaroslav Hajtmar
@ 2010-07-23  8:24     ` Jaroslav Hajtmar
  0 siblings, 0 replies; 5+ messages in thread
From: Jaroslav Hajtmar @ 2010-07-23  8:24 UTC (permalink / raw)
  To: ntg-context

It can be a rounding error?
When I put others parameters for example:
\newcount\countofhor\countofhor=2
\newcount\countofvert\countofvert=3

then result seen better (although beyond the frame, but all equally)..

Jaroslav


Dne 23.7.2010 10:09, Jaroslav Hajtmar napsal(a):
> Thanx, but I am afraid, that I understand what do you mean...
>
> For explanation: I want create duplex cards (like Pexeso game - if you 
> know ....), which must overlap (when cutting of A4)
> I have a ready mechanism (in Lua) to the cards on the other side 
> mirror rotates so that the parties themselves were approved.
>
> In my solution (as shown in the example), although overlapping tiles, 
> but some texts are shifted and I dont know WHY?..
> It is seen, thet any frames are shifted... It is curious...
>
> Thanx. Jaroslav
>
> My new better example:
>
> \newcount\countofhor\countofhor=3
> \newcount\countofvert\countofvert=4
> \newdimen\paperedge\paperedge=0.5cm
> \newdimen\disthor\disthor=2mm
> \newdimen\distvert\distvert=2mm
>
> \newdimen\cardheight\newdimen\cardwidth
> \newcount\countofcardsonpage\countofcardsonpage=\countofhor
> \multiply\countofcardsonpage\countofvert
>
> \definepapersize[BC][width=\cardwidth,height=\cardheight] % neměnit!!!
>
>
> \setuppapersize [BC][A4]
> %\setuppapersize [BC][A4,landscape]
>
>
>
> % Calculate only:
> \cardheight=\dimexpr((\printpaperheight-2\paperedge-\distvert*(\countofvert-1))/\countofvert) 
>
> \cardwidth=\dimexpr((\printpaperwidth-2\paperedge-\dimexpr(\disthor)*(\countofhor-1))/\countofhor) 
>
> \definemeasure[topspace] [\dimexpr(\printpaperheight-(\cardheight + 
> \distvert)*\countofvert+\distvert)/2\relax]
> \definemeasure[backspace] [\dimexpr(\printpaperwidth-(\cardwidth + 
> \disthor)*\countofhor+\disthor)/2\relax]
>
> \setuppaper 
> [topspace=\measure{topspace},backspace=\measure{backspace},bottomspace=\measure{topspace},cutspace=\measure{backspace}, 
> dx=\disthor,dy=\distvert,nx=\countofhor,ny=\countofvert]
> \setuplayout [page] 
> [topspace=\measure{topspace},backspace=\measure{backspace},bottomspace=\measure{topspace},cutspace=\measure{backspace}] 
>
> \setuplayout [location=middle, marking=on]
> \setuparranging [XY]
>
>
> \setuppagenumbering [alternative=doublesided,location=, state=stop]
>
>
> \defineoverlay[pozadifront][{\externalfigure[file1.jpg][width=\cardwidth,height=\cardheight]}] 
>
> \defineoverlay[pozadiback][{\externalfigure[file2.jpg][width=\cardwidth,height=\cardheight]}] 
>
>
>
> \startbuffer[Front]
> \leftaligned{\recurselevel\ - Front}%
> \stopbuffer
>
>
> \startbuffer[Back]
> \leftaligned{\recurselevel\ - Back}%
> \stopbuffer
>
>
> \def\printactionpageone{%
> \setupbackgrounds [page][background={pozadifront}]%
> \getbuffer[Front]\page%
> }%
>
> \def\printactionpagetwo{%
> \setupbackgrounds [page][background={pozadiback}]%
> \getbuffer[Back]\page%
> }%
>
> \showframe
>
> \starttext
> \dorecurse{\countofcardsonpage}{\printactionpageone}
> \dorecurse{\countofcardsonpage}{\printactionpagetwo}
> \stoptext
>
>
>
>
> Dne 23.7.2010 9:40, Hans Hagen napsal(a):
>> \setuppapersize[A8,landscape][A4,landscape]
>>
>> \setuplayout[nx=3,ny=4,dx=3.5cm]
>>
>> \setuplayout
>> [height=middle,
>> width=middle,
>> topspace=3mm,
>> backspace=3mm,
>> header=0pt,
>> footer=0pt]
>>
>> \starttext
>>
>> \startstandardmakeup
>> \externalfigure[cow][width=\textwidth,height=\textheight]
>> \stopstandardmakeup
>>
>> \startstandardmakeup
>> \externalfigure[cow][width=\textwidth,height=\textheight]
>> \stopstandardmakeup
>>
>> \stoptext 
>
> ___________________________________________________________________________________ 
>
> If your question is of interest to others as well, please add an entry 
> to the Wiki!
>
> maillist : ntg-context@ntg.nl / 
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________ 
>

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-23  8:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-23  4:04 Different printing positions on cards Jaroslav Hajtmar
2010-07-23  4:27 ` Jaroslav Hajtmar
2010-07-23  7:40 ` Hans Hagen
2010-07-23  8:09   ` Jaroslav Hajtmar
2010-07-23  8:24     ` Jaroslav Hajtmar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).