ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Columns within a layer
@ 2009-12-25 19:25 Oliver Buerschaper
  2009-12-25 20:12 ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Oliver Buerschaper @ 2009-12-25 19:25 UTC (permalink / raw)
  To: mailing ConTeXt users list for

Dear all,

how can I get columns within a layer? I tried

---
\setupbackgrounds
    [page]
    [background=text]

\definelayer
    [text]
    [width=\paperwidth,
     height=\paperheight]

\startbuffer[test]
\startcolumns[n=2]
\input zapf
\stopcolumns
\stopbuffer



\starttext


\startstandardmakeup

\setlayerframed
    [text]
    [x=1cm,
     y=3cm]
    [width=12cm,
     height=6cm,
     align=normal,
     offset=none,
     framecolor=gray]
    {\getbuffer[test]}

\stopstandardmakeup


\stoptext
---

with no success :-( I'm running MkIV, by the way.

Any help much appreciated!

Best wishes,
Oliver
___________________________________________________________________________________
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] 9+ messages in thread

* Re: Columns within a layer
  2009-12-25 19:25 Columns within a layer Oliver Buerschaper
@ 2009-12-25 20:12 ` Wolfgang Schuster
  2009-12-26 11:50   ` Oliver Buerschaper
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2009-12-25 20:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 25.12.2009 um 20:25 schrieb Oliver Buerschaper:

> Dear all,
> 
> how can I get columns within a layer? I tried
> 
> ---
> \setupbackgrounds
>    [page]
>    [background=text]
> 
> \definelayer
>    [text]
>    [width=\paperwidth,
>     height=\paperheight]
> 
> \startbuffer[test]
> \startcolumns[n=2]
> \input zapf
> \stopcolumns
> \stopbuffer
> 
> 
> 
> \starttext
> 
> 
> \startstandardmakeup
> 
> \setlayerframed
>    [text]
>    [x=1cm,
>     y=3cm]
>    [width=12cm,
>     height=6cm,
>     align=normal,
>     offset=none,
>     framecolor=gray]
>    {\getbuffer[test]}
> 
> \stopstandardmakeup
> 
> 
> \stoptext
> ---
> 
> with no success :-( I'm running MkIV, by the way.

\usemodule[streams]

\definestreamlayer[test][method=overlay]

\setupbackgrounds[page][background=test]

\starttext

\startstreamlayer[test]
\startcolumns
\input knuth
\stopcolumns
\stopstreamlayer

\setlayer[test][x=5cm,y=10cm]{\placestreamlayer[test]}

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


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

* Re: Columns within a layer
  2009-12-25 20:12 ` Wolfgang Schuster
@ 2009-12-26 11:50   ` Oliver Buerschaper
  2009-12-26 16:16     ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Oliver Buerschaper @ 2009-12-26 11:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> \usemodule[streams]
> 
> \definestreamlayer[test][method=overlay]
> 
> \setupbackgrounds[page][background=test]
> 
> \starttext
> 
> \startstreamlayer[test]
> \startcolumns
> \input knuth
> \stopcolumns
> \stopstreamlayer
> 
> \setlayer[test][x=5cm,y=10cm]{\placestreamlayer[test]}
> 
> \stoptext

Many thanks! Now if only you could tell me how to set the width and height of the box and give it a frame ... I tried

\setlayerframed
    [test]
    [x=5cm,
     y=10cm]
    [width=10cm,
     height=5cm]
    {\placestreamlayer[test]}

but didn't get quite what I was hoping for :-(

Oliver
___________________________________________________________________________________
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] 9+ messages in thread

* Re: Columns within a layer
  2009-12-26 11:50   ` Oliver Buerschaper
@ 2009-12-26 16:16     ` Wolfgang Schuster
  2010-01-01 14:07       ` Oliver Buerschaper
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2009-12-26 16:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 26.12.2009 um 12:50 schrieb Oliver Buerschaper:

>> \usemodule[streams]
>> 
>> \definestreamlayer[test][method=overlay]
>> 
>> \setupbackgrounds[page][background=test]
>> 
>> \starttext
>> 
>> \startstreamlayer[test]
>> \startcolumns
>> \input knuth
>> \stopcolumns
>> \stopstreamlayer
>> 
>> \setlayer[test][x=5cm,y=10cm]{\placestreamlayer[test]}
>> 
>> \stoptext
> 
> Many thanks! Now if only you could tell me how to set the width and height of the box and give it a frame ... I tried

width:

\startsetups streamlayer:test:settings
  \overloadtextwidth{12cm}
\stopsetups

frame:

\definetextbackground[testframe]

\startstreamlayer[test]
\starttextbackground[testframe]
...
\stoptextbackground
\stopstreamlayer

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


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

* Re: Columns within a layer
  2009-12-26 16:16     ` Wolfgang Schuster
@ 2010-01-01 14:07       ` Oliver Buerschaper
  2010-01-01 18:09         ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Oliver Buerschaper @ 2010-01-01 14:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> width:
> 
> \startsetups streamlayer:test:settings
>  \overloadtextwidth{12cm}
> \stopsetups
> 
> frame:
> 
> \definetextbackground[testframe]
> 
> \startstreamlayer[test]
> \starttextbackground[testframe]
> ...
> \stoptextbackground
> \stopstreamlayer

That's exactly what I need! Based on your example I kept experimenting a bit and got to:

---
\usemodule[streams]

\definestreamlayer
    [columns]
    [method=overlay]

\startsetups streamlayer:columns:settings
    \overloadtextwidth{12cm}
\stopsetups

\setupbackgrounds
    [page]
    [background=columns]



\starttext

\startstreamlayer[columns]
\startcolumns
\input knuth
\stopcolumns
\stopstreamlayer

\setlayerframed
    [columns]
    [x=2cm,
     y=3cm]
    [width=12cm,
     height=8cm,
     align=normal,
     offset=none,
     framecolor=gray]
    {\placestreamlayer[columns]}

%\setlayer
%    [columns]
%    [x=1cm,
%     y=10cm]
%    {\placestreamlayer[columns]}

\stoptext
---

Observations:

1. One can even do without the textbackground material for some reason.
2. \placestreamlayer apparently can only be used once (try uncommenting the last lines). So it doesn't nearly behave like a buffer...
3. There's some vertical space between the frame and the first line of text. Is this some \topskip thing? How can I get rid of this space?

Many thanks again for your suggestions and a happy new year,
Oliver
___________________________________________________________________________________
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] 9+ messages in thread

* Re: Columns within a layer
  2010-01-01 14:07       ` Oliver Buerschaper
@ 2010-01-01 18:09         ` Wolfgang Schuster
  2010-01-02 10:18           ` Oliver Buerschaper
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2010-01-01 18:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 01.01.2010 um 15:07 schrieb Oliver Buerschaper:

> Observations:
> 
> 1. One can even do without the textbackground material for some reason.

You need textbackground to draw the frame around the text

> 2. \placestreamlayer apparently can only be used once (try uncommenting the last lines). So it doesn't nearly behave like a buffer...

You can still write the text in a buffer and use the buffer in the streamlayer.

> 3. There's some vertical space between the frame and the first line of text. Is this some \topskip thing? How can I get rid of this space?

When you want only text in two columns \startsimplecolumns ... \stopsimplecolumns
is a alternative to the normal columns environment and it works also in \framed
(which is used in \setlayerframed).

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


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

* Re: Columns within a layer
  2010-01-01 18:09         ` Wolfgang Schuster
@ 2010-01-02 10:18           ` Oliver Buerschaper
  2010-01-02 13:16             ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Oliver Buerschaper @ 2010-01-02 10:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> You need textbackground to draw the frame around the text

That's the funny thing ... apparently I don't! See the code in my previous mail. There I seem to get the frame from the \setlayerframed command alone.


> You can still write the text in a buffer and use the buffer in the streamlayer.

OK.


> When you want only text in two columns \startsimplecolumns ... \stopsimplecolumns
> is a alternative to the normal columns environment and it works also in \framed
> (which is used in \setlayerframed).

I'm afraid that doesn't make the vertial space vanish :-( Any ideas?

Also, can I force the streamlayer to have a fixed height? In the example I'd like the first column to be filled all the way down to the visible bottom frame and then the remaining text should be broken to the second column. At the moment both columns are filled with roughly equal amounts of text...

Oliver
___________________________________________________________________________________
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] 9+ messages in thread

* Re: Columns within a layer
  2010-01-02 10:18           ` Oliver Buerschaper
@ 2010-01-02 13:16             ` Wolfgang Schuster
  2010-01-02 15:35               ` Oliver Buerschaper
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2010-01-02 13:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 02.01.2010 um 11:18 schrieb Oliver Buerschaper:

>> You need textbackground to draw the frame around the text
> 
> That's the funny thing ... apparently I don't! See the code in my previous mail. There I seem to get the frame from the \setlayerframed command alone.

But the frame from setlayerframed has not the measures of the text,
to get the correct size you need textbackground.

>> When you want only text in two columns \startsimplecolumns ... \stopsimplecolumns
>> is a alternative to the normal columns environment and it works also in \framed
>> (which is used in \setlayerframed).
> 
> I'm afraid that doesn't make the vertial space vanish :-( Any ideas?

\definelayer[test][width=\paperwidth,height=\paperheight]

\setupbackgrounds[page][background=test]

\starttext

\startbuffer[test]
\hsize=12cm
\startsimplecolumns
\input zapf
\stopsimplecolumns
\stopbuffer

\setlayerframed
  [test]
  [x=5cm,y=10cm]
  [width=12cm]
  {\getbuffer[test]}

\page[empty]

\stoptext

> Also, can I force the streamlayer to have a fixed height? In the example I'd like the first column to be filled all the way down to the visible bottom frame and then the remaining text should be broken to the second column. At the moment both columns are filled with roughly equal amounts of text...

You can set \textheight in the streamlayer settings and disable the balancing for columns.

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


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

* Re: Columns within a layer
  2010-01-02 13:16             ` Wolfgang Schuster
@ 2010-01-02 15:35               ` Oliver Buerschaper
  0 siblings, 0 replies; 9+ messages in thread
From: Oliver Buerschaper @ 2010-01-02 15:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> But the frame from setlayerframed has not the measures of the text,
> to get the correct size you need textbackground.

Ah, I see! The reason I asked is I didn't see any frame with your code... I presume I need to hook some MP overlay into textbackground?


> \definelayer[test][width=\paperwidth,height=\paperheight]
> 
> \setupbackgrounds[page][background=test]
> 
> \starttext
> 
> \startbuffer[test]
> \hsize=12cm
> \startsimplecolumns
> \input zapf
> \stopsimplecolumns
> \stopbuffer
> 
> \setlayerframed
>  [test]
>  [x=5cm,y=10cm]
>  [width=12cm]
>  {\getbuffer[test]}
> 
> \page[empty]
> 
> \stoptext

No, that doesn't solve my problem :-( Compare the two buffers and watch the space between the frame's top border and the first line of text:

---
\definelayer
    [test]
    [width=\paperwidth,
     height=\paperheight]

\setupbackgrounds
    [page]
    [background=test]

\starttext

\startbuffer[test]
\hsize=12cm
\startsimplecolumns
\input zapf
\stopsimplecolumns
\stopbuffer

\startbuffer[test2]
\input zapf
\stopbuffer

\setlayerframed
    [test]
    [x=5cm,
     y=10cm]
    [width=12cm,
%     align=normal,
     offset=none]
    {\getbuffer[test]}
%    {\getbuffer[test2]}

\page[empty]


\stoptext
---

Also, I forgot to mention that I need three columns... my apologies.


> You can set \textheight in the streamlayer settings and disable the balancing for columns.

I managed to disable the balancing but I can't get the text height right. I'm probably not seeing the obvious but neither

\textheight{10cm}

nor

\overloadtextwidth{10cm}

between \startsetups and \stopsetups do the job :-( Please advise...

Oliver
___________________________________________________________________________________
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] 9+ messages in thread

end of thread, other threads:[~2010-01-02 15:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-25 19:25 Columns within a layer Oliver Buerschaper
2009-12-25 20:12 ` Wolfgang Schuster
2009-12-26 11:50   ` Oliver Buerschaper
2009-12-26 16:16     ` Wolfgang Schuster
2010-01-01 14:07       ` Oliver Buerschaper
2010-01-01 18:09         ` Wolfgang Schuster
2010-01-02 10:18           ` Oliver Buerschaper
2010-01-02 13:16             ` Wolfgang Schuster
2010-01-02 15:35               ` Oliver Buerschaper

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