[NTG-context] "overscored" or "overlined" text … (or whatever it should be called)

Aditya Mahajan adityam at umich.edu
Thu Jan 26 01:22:37 CET 2012


On Thu, 26 Jan 2012, Philipp A. wrote:

> 2012/1/25 Aditya Mahajan <adityam at umich.edu>
>
>> Better is to use: \StrikeMeFrame{\mathsurround\zeropoint$#1$}. But for
>> this to work in subscripts and superscripts, you must use math palette.
>> IIRC, \mframed does that. In principle:
>>
>> \mframed[background=strikeme]{**...}
>>
>> should work (untested).
>>
>> @Hans: Can we have \definemframed etc as well?
>>
>> Aditya
>>
>
> so this should work?
>
> ‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒
>
> \startuniqueMPgraphic{strikeme}
>   path p ; p := OverlayBox topenlarged -ExHeight bottomenlarged -ExHeight ;
>   draw llcorner p -- urcorner p withcolor OverlayColor ;
> \stopuniqueMPgraphic
>
> \defineoverlay[strikeme][\uniqueMPgraphic{strikeme}]
>
> \def\strike#1{%
> \ifmmode%
> \mframed[background=strikeme,frame=off]{#1}%
> \else%
> \inframed[background=strikeme,frame=off]{#1}%
> \fi}
>
> \starttext
> \startformula
> {\strike2a + \strike ab \over \strike a} = a
> \stopformula
>
> Works in text, \strike{two}too!
>
> \stoptext


Don't use {... \over ...} as it will mess up the calculation of math 
style. \frac{...}{...} is more robust.

Aditya


More information about the ntg-context mailing list