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

Wolfgang Schuster schuster.wolfgang at googlemail.com
Wed Jan 25 21:13:35 CET 2012


Am 25.01.2012 um 20:20 schrieb Philipp A.:

> 2012/1/25 Hans Hagen <pragma at wxs.nl>
> \ifmmode
> 
> thanks. that was obvious…
> 
> $\StrikeMe{x}$
> 
> unfortunately this does the same as my tikz version: it exits math mode:
> 
> $\StrikeMe{\ifmmode math mode! \else no math mode :( \fi} \ifmmode math mode. \else wat \fi$
> 
> returns
> 
> no math mode :( math mode.

\framed puts the content in a \hbox and when you put a \hbox in a math environment the text in the box is typeset in text mode, this feature is used for the \text command. To get now the content of the \StrikeMe command in math mode a different definition.

\defineframed[StrikeMeFrame][background=strikeme,frame=off,offset=0pt,location=low,backgroundcolor=blue]

\define[1]\StrikeMe
  {\ifmmode
     \StrikeMeFrame{$#1$}%
   \else
     \StrikeMeFrame{#1}%
   \fi}

Wolfgang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20120125/a069677c/attachment.html>


More information about the ntg-context mailing list