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

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