ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* 2NUP, spreading a table on 2 pages
@ 2009-01-20  8:20 Antoine Junod
  2009-01-20  9:18 ` Diego Depaoli
  2009-01-20 11:25 ` Wolfgang Schuster
  0 siblings, 2 replies; 9+ messages in thread
From: Antoine Junod @ 2009-01-20  8:20 UTC (permalink / raw)
  To: ntg-context

Hello List,

I'm trying to design a little booklet on the form two A5 pages on a A4
sheet. It's not hard to do as it is well documented.

The problem is the following: I would like to add a table (actually a
people list with firstname, lastname, mobile, address and so on and so
on) that is quite wide. The idea is to put it on a double page (ie,
when you open the booklet, the table is on both the left and the right
page).

The easy way would be to 1) manually cut the table in two tables (a
left one and a right one) that fit on a page and 2) to put them each
on their own page, beeing sure the left one is on a left page. Here,
the difficulty is to align both tables accross the pages.

Another way would be to ask context to do that by himself. Is there a
way to do that?

Thanks for your reply,
-AJ

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: 2NUP, spreading a table on 2 pages
  2009-01-20  8:20 2NUP, spreading a table on 2 pages Antoine Junod
@ 2009-01-20  9:18 ` Diego Depaoli
  2009-01-20 10:10   ` Antoine Junod
  2009-01-20 11:25 ` Wolfgang Schuster
  1 sibling, 1 reply; 9+ messages in thread
From: Diego Depaoli @ 2009-01-20  9:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Jan 20, 2009 at 9:20 AM, Antoine Junod <toto@tots-ns.net> wrote:
> Hello List,
>
> I'm trying to design a little booklet on the form two A5 pages on a A4
> sheet. It's not hard to do as it is well documented.
>
> The problem is the following: I would like to add a table (actually a
> people list with firstname, lastname, mobile, address and so on and so
> on) that is quite wide. The idea is to put it on a double page (ie,
> when you open the booklet, the table is on both the left and the right
> page).
>
> The easy way would be to 1) manually cut the table in two tables (a
> left one and a right one) that fit on a page and 2) to put them each
> on their own page, beeing sure the left one is on a left page. Here,
> the difficulty is to align both tables accross the pages.
>
> Another way would be to ask context to do that by himself. Is there a
> way to do that?
look here
http://archive.contextgarden.net/message/20080623.074757.6c4176a1.en.html
Hope that helps


-- 
Diego Depaoli
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: 2NUP, spreading a table on 2 pages
  2009-01-20  9:18 ` Diego Depaoli
@ 2009-01-20 10:10   ` Antoine Junod
  0 siblings, 0 replies; 9+ messages in thread
From: Antoine Junod @ 2009-01-20 10:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

"Diego Depaoli" <trebestie@gmail.com> writes:

> On Tue, Jan 20, 2009 at 9:20 AM, Antoine Junod <toto@tots-ns.net> wrote:
>> Hello List,
>>
>> I'm trying to design a little booklet on the form two A5 pages on a A4
>> sheet. It's not hard to do as it is well documented.
>>
>> The problem is the following: I would like to add a table (actually a
>> people list with firstname, lastname, mobile, address and so on and so
>> on) that is quite wide. The idea is to put it on a double page (ie,
>> when you open the booklet, the table is on both the left and the right
>> page).
>>
>> The easy way would be to 1) manually cut the table in two tables (a
>> left one and a right one) that fit on a page and 2) to put them each
>> on their own page, beeing sure the left one is on a left page. Here,
>> the difficulty is to align both tables accross the pages.
>>
>> Another way would be to ask context to do that by himself. Is there a
>> way to do that?
>
> look here
> http://archive.contextgarden.net/message/20080623.074757.6c4176a1.en.html
> Hope that helps

Thanks Diego, it seems to do exactly what I need :)

A+
-AJ
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: 2NUP, spreading a table on 2 pages
  2009-01-20  8:20 2NUP, spreading a table on 2 pages Antoine Junod
  2009-01-20  9:18 ` Diego Depaoli
@ 2009-01-20 11:25 ` Wolfgang Schuster
  2009-01-20 12:09   ` Antoine Junod
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2009-01-20 11:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 20.01.2009 um 09:20 schrieb Antoine Junod:

> Hello List,
>
> I'm trying to design a little booklet on the form two A5 pages on a A4
> sheet. It's not hard to do as it is well documented.
>
> The problem is the following: I would like to add a table (actually a
> people list with firstname, lastname, mobile, address and so on and so
> on) that is quite wide. The idea is to put it on a double page (ie,
> when you open the booklet, the table is on both the left and the right
> page).
>
> The easy way would be to 1) manually cut the table in two tables (a
> left one and a right one) that fit on a page and 2) to put them each
> on their own page, beeing sure the left one is on a left page. Here,
> the difficulty is to align both tables accross the pages.


How about linetables?

\setuplinetable[nx=2,width=.125\textwidth]

\starttext

\startlinetable
\NC firstname \NC lastname \NC phone       \NC mobile      \NC postal  
code \NC city    \NC address        \NC\NR
\NC John      \NC Jonhsons \NC 0800/987654 \NC 0171/123456 \NC  
12345       \NC New TeX \NC Meta street 12 \NC\NR
\stoplinetable

\stoptext

Wolfgang

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: 2NUP, spreading a table on 2 pages
  2009-01-20 11:25 ` Wolfgang Schuster
@ 2009-01-20 12:09   ` Antoine Junod
  2009-01-20 15:25     ` Antoine Junod
  0 siblings, 1 reply; 9+ messages in thread
From: Antoine Junod @ 2009-01-20 12:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

Wolfgang Schuster <schuster.wolfgang@googlemail.com> writes:

> Am 20.01.2009 um 09:20 schrieb Antoine Junod:
>
>> Hello List,
>>
>> I'm trying to design a little booklet on the form two A5 pages on a A4
>> sheet. It's not hard to do as it is well documented.
>>
>> The problem is the following: I would like to add a table (actually a
>> people list with firstname, lastname, mobile, address and so on and so
>> on) that is quite wide. The idea is to put it on a double page (ie,
>> when you open the booklet, the table is on both the left and the right
>> page).
>>
>> The easy way would be to 1) manually cut the table in two tables (a
>> left one and a right one) that fit on a page and 2) to put them each
>> on their own page, beeing sure the left one is on a left page. Here,
>> the difficulty is to align both tables accross the pages.
>
>
> How about linetables?
>
> \setuplinetable[nx=2,width=.125\textwidth]
>
> \starttext
>
> \startlinetable
> \NC firstname \NC lastname \NC phone       \NC mobile      \NC postal
> code \NC city    \NC address        \NC\NR
> \NC John      \NC Jonhsons \NC 0800/987654 \NC 0171/123456 \NC  12345
> \NC New TeX \NC Meta street 12 \NC\NR
> \stoplinetable
>
> \stoptext

Excellent, thanks Wolfgang. It exactly matches my needs :)

All the best,
-AJ
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: 2NUP, spreading a table on 2 pages
  2009-01-20 12:09   ` Antoine Junod
@ 2009-01-20 15:25     ` Antoine Junod
  2009-01-20 16:09       ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Antoine Junod @ 2009-01-20 15:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Antoine Junod <toto@tots-ns.net> writes:

> Hi,
>
> Wolfgang Schuster <schuster.wolfgang@googlemail.com> writes:
>
>> Am 20.01.2009 um 09:20 schrieb Antoine Junod:
>>
>>> Hello List,
>>>
>>> I'm trying to design a little booklet on the form two A5 pages on a A4
>>> sheet. It's not hard to do as it is well documented.
>>>
>>> The problem is the following: I would like to add a table (actually a
>>> people list with firstname, lastname, mobile, address and so on and so
>>> on) that is quite wide. The idea is to put it on a double page (ie,
>>> when you open the booklet, the table is on both the left and the right
>>> page).
>>>
>>> The easy way would be to 1) manually cut the table in two tables (a
>>> left one and a right one) that fit on a page and 2) to put them each
>>> on their own page, beeing sure the left one is on a left page. Here,
>>> the difficulty is to align both tables accross the pages.
>>
>>
>> How about linetables?
>>
>> \setuplinetable[nx=2,width=.125\textwidth]
>>
>> \starttext
>>
>> \startlinetable
>> \NC firstname \NC lastname \NC phone       \NC mobile      \NC postal
>> code \NC city    \NC address        \NC\NR
>> \NC John      \NC Jonhsons \NC 0800/987654 \NC 0171/123456 \NC  12345
>> \NC New TeX \NC Meta street 12 \NC\NR
>> \stoplinetable
>>
>> \stoptext
>
> Excellent, thanks Wolfgang. It exactly matches my needs :)

In fact my reply was a bit fast: in the example below the table is
split on pages 2 and 3. But the lines of the table are not
aligned. I'll dig the sources too see if it's possible to do that. But
if anyone has a solution, I'm interested :)

Thanks for your help,
-AJ

%%%%%%%%%%%%%%%% Page setup
% Use A5 pages on A4 paper
\setuppapersize[A5][A4]

% Arrange the A5 pages such that there are two of them on each A4
% sheet. They are arranged such that they can be send to the printer
% set to print on both pages, flipping on the long edge.
\setuparranging[2UP,rotated,doublesided]

% The layout of the page
\setuplayout[margin=1cm,width=middle,height=middle,topspace=0cm,backspace=1.2cm]

%%%%%%%%%%%%%%%% Colors
% Enable the use of colors for the whole document
\setupcolors[state=start]

%%%%%%%%%%%%%%%% Debug
% Display the layout borders
\showframe

% Display the grid
\showgrid

% Display the current layout setup value
%\showsetups

%%%%%%%%%%%%%%%% Font
% Accept accents by default as input, like é, à and others.
\enableregime[utf]

%%%%%%%%%%%%%%%% Beginning of the document
\starttext

\section{Le mot du président}
\dorecurse{2}{\input tufte \par}

\section{Les comptes}

\section{Les récits}
\subsection{La dora}
\subsection{Mon premier match de polo}
\subsection{La piscine}

\section{List des membres}
% magic
\setuplinetable[nx=2,width=.125\textwidth]
\startlinetable
\NC firstname \NC lastname \NC phone       \NC mobile      \NC postal
code \NC city    \NC address        \NC\NR
\NC John      \NC Jonhsons \NC 0800/987654 \NC 0171/123456 \NC  12345
\NC New TeX \NC Meta street 12 \NC\NR
\stoplinetable

\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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: 2NUP, spreading a table on 2 pages
  2009-01-20 15:25     ` Antoine Junod
@ 2009-01-20 16:09       ` Wolfgang Schuster
  2009-01-21  9:16         ` Antoine Junod
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2009-01-20 16:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: booklet.tex --]
[-- Type: application/octet-stream, Size: 1203 bytes --]

\setuppapersize[A5][A4]
\setuparranging[2UP,rotated,doublesided]
\setuplayout[margin=1cm,width=middle,height=middle,topspace=0cm,backspace=1.2cm]
\setupcolors[state=start]
\showframe
\showgrid

\definetwopasslist{tableoffset}

\gettwopassdata{tableoffset}

\iftwopassdatafound
  \definelayout[\number\numexpr\twopassdata+1\relax][header=\the\dimexpr\headerheight+2\lineheight\relax]
\fi

\gettwopassdata{tableoffset}

\iftwopassdatafound
  \definelayout[\number\numexpr\twopassdata+1\relax][reset]
\fi

\setuplinetable[nx=2,width=.125\textwidth]

\definehead[tablehead][section]

\setuphead[tablehead][page=yes,before=,after=\blank]

\starttext

\dorecurse{5}
  {\section{Section #1}
   \dorecurse{2}{\input tufte\par}}

\tablehead{List des membres}

\lazysavetwopassdata{tableoffset}{1}{\pagenumber}

\startlinetable
\NC firstname \NC lastname \NC phone       \NC mobile      \NC postal code \NC city    \NC address        \NC\NR
\NC John      \NC Jonhsons \NC 0800/987654 \NC 0171/123456 \NC  12345      \NC New TeX \NC Meta street 12 \NC\NR
\stoplinetable

\lazysavetwopassdata{tableoffset}{2}{\pagenumber}

\page

\dorecurse{3}
  {\section{Section #1}
   \dorecurse{2}{\input tufte\par}}

\stoptext

[-- Attachment #2: Type: text/plain, Size: 541 bytes --]


Am 20.01.2009 um 16:25 schrieb Antoine Junod:

> In fact my reply was a bit fast: in the example below the table is
> split on pages 2 and 3. But the lines of the table are not
> aligned. I'll dig the sources too see if it's possible to do that. But
> if anyone has a solution, I'm interested :)

You can solve it with twopassdata and a few wrapper macros to hide
the underlying macros in your document. Take a look in my example
how this can be done.

You need the "arrange" key for texexec to let it work in imposition  
mode.

Wolfgang


[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: 2NUP, spreading a table on 2 pages
  2009-01-20 16:09       ` Wolfgang Schuster
@ 2009-01-21  9:16         ` Antoine Junod
  2009-01-21 10:02           ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Antoine Junod @ 2009-01-21  9:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Wolfgang,

Wolfgang Schuster <schuster.wolfgang@googlemail.com> writes:

> Am 20.01.2009 um 16:25 schrieb Antoine Junod:
>
>> In fact my reply was a bit fast: in the example below the table is
>> split on pages 2 and 3. But the lines of the table are not
>> aligned. I'll dig the sources too see if it's possible to do that. But
>> if anyone has a solution, I'm interested :)
>
> You can solve it with twopassdata and a few wrapper macros to hide
> the underlying macros in your document. Take a look in my example
> how this can be done.
>
> You need the "arrange" key for texexec to let it work in imposition
> mode.

That is a lot of things I haven't heard about :) But thanks, it's
doing the job in a perfect way.

Would it be constructive to put that in the wiki or is it just a hack
that won't be needed anymore with a future release? If it's not a
temporary hack, tell me and I'll edit the wiki.

Thanks,
-AJ
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: 2NUP, spreading a table on 2 pages
  2009-01-21  9:16         ` Antoine Junod
@ 2009-01-21 10:02           ` Wolfgang Schuster
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Schuster @ 2009-01-21 10:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Jan 21, 2009 at 10:16 AM, Antoine Junod <toto@tots-ns.net> wrote:

>> You can solve it with twopassdata and a few wrapper macros to hide
>> the underlying macros in your document. Take a look in my example
>> how this can be done.

> That is a lot of things I haven't heard about :) But thanks, it's
> doing the job in a perfect way.
>
> Would it be constructive to put that in the wiki or is it just a hack
> that won't be needed anymore with a future release? If it's not a
> temporary hack, tell me and I'll edit the wiki.

I use this method myself in a document in it's harmless if you know
what you do und what are the limitations e.g. the header above the table
should be longer than one line and you need a page break before the first
savetopassdata command and one after the second.

Wolfgang
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2009-01-21 10:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-20  8:20 2NUP, spreading a table on 2 pages Antoine Junod
2009-01-20  9:18 ` Diego Depaoli
2009-01-20 10:10   ` Antoine Junod
2009-01-20 11:25 ` Wolfgang Schuster
2009-01-20 12:09   ` Antoine Junod
2009-01-20 15:25     ` Antoine Junod
2009-01-20 16:09       ` Wolfgang Schuster
2009-01-21  9:16         ` Antoine Junod
2009-01-21 10:02           ` Wolfgang Schuster

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).