TextBackground text area
Hey folks, I've been pulling my hair out for hours, as I can't seem to figure out how to set the margin with and height for a textbackground area so the text doesn't start immediately at the left frame line and go to the right frame line. I am using this: \definetextbackground[FramedText][ location=paragraph, color=color_text, background=color, backgroundcolor=colour_page, framecolor=colour_text, leftoffset=1.0\bodyfontsize, rightoffset=1.0\bodyfontsize, before={ \blank \startnarrower }, after={ \blank \stopnarrower }, style=italic, corner=round, frame=on] -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Wed, 23 Nov 2011, Kip Warner wrote:
I've been pulling my hair out for hours, as I can't seem to figure out how to set the margin with and height for a textbackground area so the text doesn't start immediately at the left frame line and go to the right frame line. I am using this:
\definetextbackground[FramedText][ location=paragraph, color=color_text, background=color, backgroundcolor=colour_page, framecolor=colour_text, leftoffset=1.0\bodyfontsize, rightoffset=1.0\bodyfontsize, before={ \blank \startnarrower }, after={ \blank \stopnarrower }, style=italic, corner=round, frame=on]
Why not just increase the value of leftoffset and rightoffset? \definetextbackground[FramedText][ location=paragraph, color=black, background=color, backgroundcolor=blue:2, framecolor=green:2, leftoffset=1cm, rightoffset=1cm, style=italic, corner=round, frame=on] \starttext \startFramedText \input knuth \endgraf \stopFramedText \stoptext Aditya
On Wed, 2011-11-23 at 21:52 -0500, Aditya Mahajan wrote:
Why not just increase the value of leftoffset and rightoffset?
Because then the text is fine on the left side, but then goes past the right frame border. -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Wed, 2011-11-23 at 21:52 -0500, Aditya Mahajan wrote:
Why not just increase the value of leftoffset and rightoffset?
This seems to work, but I find a problem is that if the text box spans multiple pages, bottomoffset / topoffset are ignored at the points where the page breaks. Suggestions? -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Wed, 2011-11-23 at 21:52 -0500, Aditya Mahajan wrote:
Why not just increase the value of leftoffset and rightoffset?
This seems to work, but I find a problem is that if the text box spans multiple pages, bottomoffset / topoffset are ignored at the points where the page breaks. Suggestions? -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
Hey list, I am using the following to typeset a text box containing text. \definetextbackground[GeneralDocument][ location=paragraph, color=color_text, background=color, backgroundcolor=colour_page, framecolor=colour_text, topoffset=1.0cm, bottomoffset=1.0cm, leftoffset=1.0cm, rightoffset=1.0cm, before={ \blank[2*big] }, after={ \blank[2*big] }, style=small, corner=round, frame=on] This seems to work, but I find a problem is that if the text box spans multiple pages, bottomoffset / topoffset are ignored at the points where the page breaks. Suggestions? -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
Hey Hans, Aditya, and Wolfgang, You gentlemen seem to be very knowledgeable with ConTeXt, so I will run a question by you that has been plaguing me for months. I am using the following to typeset a text box containing text. \definetextbackground[GeneralDocument][ location=paragraph, color=color_text, background=color, backgroundcolor=colour_page, framecolor=colour_text, topoffset=1.0cm, bottomoffset=1.0cm, leftoffset=1.0cm, rightoffset=1.0cm, before={ \blank[2*big] }, after={ \blank[2*big] }, style=small, corner=round, frame=on] This works fine, but I still have a problem if the text box spans multiple pages because bottomoffset / topoffset seem to be ignored at the points where the page breaks. The text just goes right to the edge of the page top or bottom without any whitespace. Any ideas? -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Tue, Jan 31, 2012 at 5:18 AM, Kip Warner
Hey Hans, Aditya, and Wolfgang,
You gentlemen seem to be very knowledgeable with ConTeXt,
Yes, at least Hans. IIRC he is the *only* author of ConTeXt. -- luigi
On 31-1-2012 08:24, luigi scarso wrote:
On Tue, Jan 31, 2012 at 5:18 AM, Kip Warner
wrote: Hey Hans, Aditya, and Wolfgang,
You gentlemen seem to be very knowledgeable with ConTeXt,
Yes, at least Hans. IIRC he is the *only* author of ConTeXt.
well but sometimes others beat me in knowledge about the internals -) ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On Tue, 2012-01-31 at 09:50 +0100, Hans Hagen wrote:
well but sometimes others beat me in knowledge about the internals -)
Great, but can either of you help with the question? =) -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Mon, 30 Jan 2012, Kip Warner wrote:
Hey Hans, Aditya, and Wolfgang,
You gentlemen seem to be very knowledgeable with ConTeXt, so I will run a question by you that has been plaguing me for months. I am using the following to typeset a text box containing text.
\definetextbackground[GeneralDocument][ location=paragraph, color=color_text, background=color, backgroundcolor=colour_page, framecolor=colour_text, topoffset=1.0cm, bottomoffset=1.0cm, leftoffset=1.0cm, rightoffset=1.0cm, before={ \blank[2*big] }, after={ \blank[2*big] }, style=small, corner=round, frame=on]
This works fine, but I still have a problem if the text box spans multiple pages because bottomoffset / topoffset seem to be ignored at the points where the page breaks. The text just goes right to the edge of the page top or bottom without any whitespace.
Do you have to use textbackground (assuming, of course, that you are using MkIV)? Regular backgrounds take care of top and bottom offsets: \definebackground [whatever] [topoffset=1cm, bottomoffset=1cm, frame=on] \starttext \input ward \startwhatever \dorecurse{6}{\input knuth \endgraf} \stopwhatever \input ward \stoptext The main advantage of textbackground is that they adapt to pararagraph shapes (if you use things like \startplacefigure[location=left] ... \stopplacefigure), and can be nested. Aditya
On Tue, 2012-01-31 at 19:25 -0500, Aditya Mahajan wrote:
Do you have to use textbackground (assuming, of course, that you are using MkIV)?
I think so. I can't remember why, but someone on the list probably made a compelling argument for its use.
The main advantage of textbackground is that they adapt to pararagraph shapes (if you use things like \startplacefigure[location=left] ... \stopplacefigure), and can be nested.
Yes, which I may require from time to time. Why doesn't the bottomoffset and topoffset variables do anything in a textbackground? -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
participants (4)
-
Aditya Mahajan
-
Hans Hagen
-
Kip Warner
-
luigi scarso