ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Sanjoy Mahajan <sanjoy@MIT.EDU>
To: ntg-context@ntg.nl
Subject: colored backgrounds in displayed math
Date: Thu, 09 Apr 2009 07:34:03 -0600	[thread overview]
Message-ID: <E1LruOK-0004L2-7e@approx.mit.edu> (raw)

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
___________________________________________________________________________________


             reply	other threads:[~2009-04-09 13:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-09 13:34 Sanjoy Mahajan [this message]
2009-04-09 20:44 ` Wolfgang Schuster
2009-04-13 18:53   ` Sanjoy Mahajan
2009-04-14  7:11     ` luigi scarso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1LruOK-0004L2-7e@approx.mit.edu \
    --to=sanjoy@mit.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).