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
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
\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
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
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
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
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
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
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
participants (2)
-
Oliver Buerschaper
-
Wolfgang Schuster