[pstricks] Strikeout macro

E. Krishnan ekmath at asianetindia.com
Thu Mar 19 01:17:08 CET 2009


On Wed, 18 Mar 2009, David Arnold wrote:

> Thus, \strikeout should adjust to whatever the braces surround. That
> is, it should work equally well with \strikeout{2} as it does with
> \strikeout{(x+1} or \strkeout{x^2-2x-3}.

Please try this:

   \newlength{\numwid}
   \newlength{\numht}

   \newcommand{\strikeout}[1]{%
     \settowidth{\numwid}{#1}
     \settoheight{\numht}{#1}
     \psline[linecolor=Red](0,0)(\the\numwid,\the\numht)#1}


   \strikeout{2}
   \strikeout{$x+1$}
   \strikeout{$x^2-2x+1$}



-- 
Krishnan


More information about the PSTricks mailing list