ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \mframed not aligned in mkiv
@ 2013-10-21  8:35 Otared Kavian
  2013-10-21 14:18 ` Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: Otared Kavian @ 2013-10-21  8:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]

Dear Hans,

I noticed a difference between mkii and mkiv in the behavior of \mframed: it seems that in mkiv the frame is not vertically aligned with the the + sign in the following example (or rather it is not vertically centered, please see the attached PDF produced with ConTeXt  ver: 2013.10.15 13:52 MKIV). 
Does one have to use now a new key to require this sort of alignment?

Best regard: OK

%%%% begin mframed-example.tex
\setupcolors[state=start]

\def\graymath{\mframed[frame=off,
   background=color,
   backgroundcolor=lightgray,
   backgroundoffset=2pt
   ]}

\starttext

Since for $|x| < 1$ we have
\startformula
\log(1+x) = \graymath{x- \displaystyle{x^2\over2}} + {x^3 \over 3} + \cdots
\stopformula
we may write $\log(1+x) = x + O(x^2)$.

\stoptext
%%%% end mframed-example.tex


[-- Attachment #2: mframe.pdf --]
[-- Type: application/pdf, Size: 11056 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: \mframed not aligned in mkiv
  2013-10-21  8:35 \mframed not aligned in mkiv Otared Kavian
@ 2013-10-21 14:18 ` Aditya Mahajan
  2013-10-21 18:20   ` Otared Kavian
  2013-10-22 14:02   ` Otared Kavian
  0 siblings, 2 replies; 5+ messages in thread
From: Aditya Mahajan @ 2013-10-21 14:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 21 Oct 2013, Otared Kavian wrote:

> Dear Hans,
>
> I noticed a difference between mkii and mkiv in the behavior of \mframed: it seems that in mkiv the frame is not vertically aligned with the the + sign in the following example (or rather it is not vertically centered, please see the attached PDF produced with ConTeXt  ver: 2013.10.15 13:52 MKIV).
> Does one have to use now a new key to require this sort of alignment?
>
> Best regard: OK
>
> %%%% begin mframed-example.tex
> \setupcolors[state=start]
>
> \def\graymath{\mframed[frame=off,
>   background=color,
>   backgroundcolor=lightgray,
>   backgroundoffset=2pt
>   ]}
>
> \starttext
>
> Since for $|x| < 1$ we have
> \startformula
> \log(1+x) = \graymath{x- \displaystyle{x^2\over2}} + {x^3 \over 3} + \cdots
> \stopformula
> we may write $\log(1+x) = x + O(x^2)$.
>
> \stoptext
> %%%% end mframed-example.tex

Search for "Alignment in inmframed" in the mailing list archives.

% The next statement is part of the core. Included it here for 
% illustration.

\definemathframed[mcframed] [location=mathematics]

\starttext

\startformula
     \ln (1+x) = 
\mcframed[background=color,backgroundcolor=red,foregroundcolor=white,frame=off]{x 
- {\frac {x^2}{\frac{x^3}{\frac{x^3}{3}}}}} +
\frac{x^3}{3}-\cdots.
\stopformula

\startformula
     \ln (1+x) = \mcframed{x - {\frac {x^2}{\frac{x^3}{\frac{x^3}{3}}}}} + 
\frac{x^3}{3}-\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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: \mframed not aligned in mkiv
  2013-10-21 14:18 ` Aditya Mahajan
@ 2013-10-21 18:20   ` Otared Kavian
  2013-10-22 14:02   ` Otared Kavian
  1 sibling, 0 replies; 5+ messages in thread
From: Otared Kavian @ 2013-10-21 18:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks Aditya!
I overlooked this change in mkiv…

Best regards: OK

On 21 oct. 2013, at 22:18, Aditya Mahajan <adityam@umich.edu> wrote:

> On Mon, 21 Oct 2013, Otared Kavian wrote:
> 
>> Dear Hans,
>> 
>> I noticed a difference between mkii and mkiv in the behavior of \mframed: it seems that in mkiv the frame is not vertically aligned with the the + sign in the following example (or rather it is not vertically centered, please see the attached PDF produced with ConTeXt  ver: 2013.10.15 13:52 MKIV).
>> Does one have to use now a new key to require this sort of alignment?
>> 
>> Best regard: OK
>> 
>> %%%% begin mframed-example.tex
>> \setupcolors[state=start]
>> 
>> \def\graymath{\mframed[frame=off,
>>  background=color,
>>  backgroundcolor=lightgray,
>>  backgroundoffset=2pt
>>  ]}
>> 
>> \starttext
>> 
>> Since for $|x| < 1$ we have
>> \startformula
>> \log(1+x) = \graymath{x- \displaystyle{x^2\over2}} + {x^3 \over 3} + \cdots
>> \stopformula
>> we may write $\log(1+x) = x + O(x^2)$.
>> 
>> \stoptext
>> %%%% end mframed-example.tex
> 
> Search for "Alignment in inmframed" in the mailing list archives.
> 
> % The next statement is part of the core. Included it here for % illustration.
> 
> \definemathframed[mcframed] [location=mathematics]
> 
> \starttext
> 
> \startformula
>    \ln (1+x) = \mcframed[background=color,backgroundcolor=red,foregroundcolor=white,frame=off]{x - {\frac {x^2}{\frac{x^3}{\frac{x^3}{3}}}}} +
> \frac{x^3}{3}-\cdots.
> \stopformula
> 
> \startformula
>    \ln (1+x) = \mcframed{x - {\frac {x^2}{\frac{x^3}{\frac{x^3}{3}}}}} + \frac{x^3}{3}-\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  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: \mframed not aligned in mkiv
  2013-10-21 14:18 ` Aditya Mahajan
  2013-10-21 18:20   ` Otared Kavian
@ 2013-10-22 14:02   ` Otared Kavian
  2013-10-22 17:44     ` Aditya Mahajan
  1 sibling, 1 reply; 5+ messages in thread
From: Otared Kavian @ 2013-10-22 14:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Aditya,

I wikified your remarks,

	http://wiki.contextgarden.net/Math/Display#Shaded_background_for_part_of_a_displayed_equation

but unfortunately the snippet of code does not compile on ConTeXt Garden: is there a way to typeset mkiv code there?

Best regards: OK

On 21 oct. 2013, at 22:18, Aditya Mahajan <adityam@umich.edu> wrote:

> On Mon, 21 Oct 2013, Otared Kavian wrote:
> 
>> Dear Hans,
>> 
>> I noticed a difference between mkii and mkiv in the behavior of \mframed: it seems that in mkiv the frame is not vertically aligned with the the + sign in the following example (or rather it is not vertically centered, please see the attached PDF produced with ConTeXt  ver: 2013.10.15 13:52 MKIV).
>> Does one have to use now a new key to require this sort of alignment?
>> 
>> Best regard: OK
>> 
>> %%%% begin mframed-example.tex
>> \setupcolors[state=start]
>> 
>> \def\graymath{\mframed[frame=off,
>>  background=color,
>>  backgroundcolor=lightgray,
>>  backgroundoffset=2pt
>>  ]}
>> 
>> \starttext
>> 
>> Since for $|x| < 1$ we have
>> \startformula
>> \log(1+x) = \graymath{x- \displaystyle{x^2\over2}} + {x^3 \over 3} + \cdots
>> \stopformula
>> we may write $\log(1+x) = x + O(x^2)$.
>> 
>> \stoptext
>> %%%% end mframed-example.tex
> 
> Search for "Alignment in inmframed" in the mailing list archives.
> 
> % The next statement is part of the core. Included it here for % illustration.
> 
> \definemathframed[mcframed] [location=mathematics]
> 
> \starttext
> 
> \startformula
>    \ln (1+x) = \mcframed[background=color,backgroundcolor=red,foregroundcolor=white,frame=off]{x - {\frac {x^2}{\frac{x^3}{\frac{x^3}{3}}}}} +
> \frac{x^3}{3}-\cdots.
> \stopformula
> 
> \startformula
>    \ln (1+x) = \mcframed{x - {\frac {x^2}{\frac{x^3}{\frac{x^3}{3}}}}} + \frac{x^3}{3}-\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  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: \mframed not aligned in mkiv
  2013-10-22 14:02   ` Otared Kavian
@ 2013-10-22 17:44     ` Aditya Mahajan
  0 siblings, 0 replies; 5+ messages in thread
From: Aditya Mahajan @ 2013-10-22 17:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, 22 Oct 2013, Otared Kavian wrote:

> Hi Aditya,
>
> I wikified your remarks,
>
> 	http://wiki.contextgarden.net/Math/Display#Shaded_background_for_part_of_a_displayed_equation

Rather than

\def\graymath{\mframed[frame=off,
     background=color,
     backgroundcolor=gray,
     backgroundoffset=3pt]}

you can just use:

\definemathframed[graymath]
    [
      frame=off,
      location=mathematics,
      background=color,
      ...,
    ]

This way, you can even override the options when using \graymath:

\graymath[backgroundcolor=red]{...}

> but unfortunately the snippet of code does not compile on ConTeXt Garden: is there a way to typeset mkiv code there?

Using <context mode="mkiv"> compiles the coding using MkIV, but 
contextgarden uses a rather old version of mkiv, so it is unlikely that a 
feature introduced a few months ago will run on the garden.

Aditya
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-22 17:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-21  8:35 \mframed not aligned in mkiv Otared Kavian
2013-10-21 14:18 ` Aditya Mahajan
2013-10-21 18:20   ` Otared Kavian
2013-10-22 14:02   ` Otared Kavian
2013-10-22 17:44     ` Aditya Mahajan

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