# Installation

## Mac OS X

You can install the cancel package on Mac by downloading cancel.zip, unzipping, and moving cancel.sty to ~/Library/texmf/tex/latex.

# Usage

To use the cancel package in a LaTeX document, you have to include the following in your preamble:

\usepackage{cancel}

There are two handy functions available from the cancel package: cancel and cancelto.

To use cancel:

\cancel{ a }

To use cancelto:

\cancel{ \infty }{ a }

An example of using the cancel commands is given here:

Latex Source Result
\dfrac{\partial\phi}{\partial t}

+\dfrac{\partial\left(u_{i}\phi\right)}{\partial x_{i}}

= \dfrac{\partial}{\partial x_{i}}\left(
D_{\phi}\dfrac{\partial\phi}{\partial x_{i}}
\right)
\cancel{ \dfrac{\partial\phi}{\partial t} }

+\dfrac{\partial\left(u_{i}\phi\right)}{\partial x_{i}}

= \dfrac{\partial}{\partial x_{i}}\left(
D_{\phi}\dfrac{\partial\phi}{\partial x_{i}}
\right)
\dfrac{\partial\phi}{\partial t}

+\dfrac{\partial\left(u_{i}\phi\right)}{\partial x_{i}}

= \cancelto{0}{
\dfrac{\partial}{\partial x_{i}}\left(
D_{\phi}\dfrac{\partial\phi}{\partial x_{i}}
\right)
}
\dfrac{\partial\phi}{\partial t}

+\dfrac{\partial\left(u_{i}\phi\right)}{\partial x_{i}}

=\cancelto{0}{
\dfrac{\partial}{\partial x_{i}}\left(
\dfrac{1}{  \cancelto{\infty}{Pr}  }
\,\,\,\,\,\,\,\,\dfrac{\partial\phi}{\partial x_{i}}
\right)
}

## Using Cancel Package in LyX

You can use the cancel package from LyX by including the following in your preamble:

\usepackage{cancel}

You can do this by opening your LyX document and clicking Document > Settings..., then picking the "Preamble" item from the sidebar. You can then add the line to your preamble.

To use it in the document, you have to type \cancel{. The "cancel" and the "{" bracket should both appear in red, and a matching brace "}" should automatically appear. If it doesn't, you probably forgot to add the above \usepackage to your preamble.

To use the \cancelto{}{} command, first type \cancelto{, and the matching brackets should appear. Next, copy this pair of brackets, and choose paste after the first pair.

When you edit the equation, there is no preview functionality for cancel, so you'll only see the cancel or cancelto commands in red:

But once you compile your document and view it in .ps/.dvi/.pdf format, it will show up as shown in above table.