ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* colored backgrounds in displayed math
@ 2009-04-09 13:34 Sanjoy Mahajan
  2009-04-09 20:44 ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Sanjoy Mahajan @ 2009-04-09 13:34 UTC (permalink / raw)
  To: ntg-context

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

* Re: colored backgrounds in displayed math
  2009-04-09 13:34 colored backgrounds in displayed math Sanjoy Mahajan
@ 2009-04-09 20:44 ` Wolfgang Schuster
  2009-04-13 18:53   ` Sanjoy Mahajan
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2009-04-09 20:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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

* Re: colored backgrounds in displayed math
  2009-04-09 20:44 ` Wolfgang Schuster
@ 2009-04-13 18:53   ` Sanjoy Mahajan
  2009-04-14  7:11     ` luigi scarso
  0 siblings, 1 reply; 4+ messages in thread
From: Sanjoy Mahajan @ 2009-04-13 18:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wolfgang Schuster <schuster.wolfgang@googlemail.com> 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.

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

* Re: colored backgrounds in displayed math
  2009-04-13 18:53   ` Sanjoy Mahajan
@ 2009-04-14  7:11     ` luigi scarso
  0 siblings, 0 replies; 4+ messages in thread
From: luigi scarso @ 2009-04-14  7:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 456 bytes --]

On Mon, Apr 13, 2009 at 8:53 PM, Sanjoy Mahajan <sanjoy@mit.edu> wrote:

> Wolfgang Schuster <schuster.wolfgang@googlemail.com> 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

[-- Attachment #1.2: Type: text/html, Size: 864 bytes --]

[-- Attachment #2: 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] 4+ messages in thread

end of thread, other threads:[~2009-04-14  7:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-09 13:34 colored backgrounds in displayed math Sanjoy Mahajan
2009-04-09 20:44 ` Wolfgang Schuster
2009-04-13 18:53   ` Sanjoy Mahajan
2009-04-14  7:11     ` luigi scarso

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