[pstricks] Strikeout macro

David Arnold dwarnold45 at suddenlink.net
Thu Mar 19 01:31:27 CET 2009


Doesn't seem to work the way I need it to work:

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{pstricks-add}
\usepackage[thicklines]{cancel}
\usepackage{xcolor}
\definecolor{darkred}{rgb}{0.625,0,0}

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

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



\renewcommand{\CancelColor}{\red}

\begin{document}

\begin{equation*}
\frac{\psCancel{(x+1)}(x+2)}{\psCancel{(x+1)}}
\end{equation*}

\begin{equation*}
\frac{\cancel{(x+1)}(x+2)}{\cancel{(x+1)}}
\end{equation*}

\begin{equation*}
\frac{\strikeout{(x+1)}(x+2)}{\strikeout{(x+1)}}
\end{equation*}


\end{document}


On Mar 18, 2009, at 5:17 PM, E. Krishnan wrote:

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
_______________________________________________
PSTricks mailing list
PSTricks at tug.org
http://tug.org/mailman/listinfo/pstricks



More information about the PSTricks mailing list