colored backgrounds in displayed math
In displayed math I was trying to highlight a piece of a formula using a gray background. After a few spacing failures with \framed, I discovered \mframed in the core-rul.tex source file. The comments there say: %D As usual, one can specify in what way the text should be %D framed. One should be aware of the fact that, inorder to %D preserve the proper spacing, the \type {offset} is set to %D \type {overlay} and \type {frameoffset} is used used %D instead. But I couldn't get the following example of setting frameoffset to enlarge the box; instead the gray box barely surrounds the x^2/2. Is the cause the \@@oioffset in line 1502 of core-rul.tex: [\c!frameoffset=\@@oioffset,\c!offset=\v!overlay,#2] (I'm using ConTeXt - 2008.10.31 13:58, Mk II) \setupcolors[state=start] \def\graymath{\mframed[frame=off, background=color, backgroundcolor=gray, frameoffset=5pt]} \starttext \startformula \ln(1+x) = \graymath{x- \displaystyle{x^2\over2}} + \cdots \stopformula \stoptext
Hi Sanjoy, welcome back
In displayed math I was trying to highlight a piece of a formula using a gray background. After a few spacing failures with \framed, I discovered \mframed in the core-rul.tex source file. The comments there say:
Use backgroundoffset, not frameoffset. Wolfgang
Wolfgang Schuster
Hi Sanjoy, welcome back
Thanks! It's absurdly enjoyable but exhausting raising a small child (22 months old)...and we have only one so I don't know how people with two or more children manage even to tie their shoes.
In displayed math I was trying to highlight a piece of a formula using a gray background.
Use backgroundoffset, not frameoffset.
Ah! Because I used frame=off, I did not notice that frameoffset=5pt was correctly moving the frame (rather than the background) outward. So, thanks for the recipe; it works perfectly, I've wikified at http://wiki.contextgarden.net/Framed. -Sanjoy `Until lions have their historians, tales of the hunt shall always glorify the hunters.' --African Proverb
On Mon, Apr 13, 2009 at 8:53 PM, Sanjoy Mahajan
Wolfgang Schuster
wrote: Hi Sanjoy, welcome back
Thanks! It's absurdly enjoyable but exhausting raising a small child (22 months old)...and we have only one so I don't know how people with two or more children manage even to tie their shoes.
Ah, it's easy for me : all you need is... ...uhm, I don't remember what... -- luigi
participants (3)
-
luigi scarso
-
Sanjoy Mahajan
-
Wolfgang Schuster