# MiKTeX, TeXnicCenter and “cancel” package - errors [closed]

EDIT2: I answered it below. I had duplicate of my cancel.sty where my .tex file was. That made some troubles (obviously).

EDIT:

\documentclass[a4paper,11pt]{article}
\usepackage[croatian]{babel}
\usepackage{cancel}
\begin{document}
\mbox{}\cancel{a}
\end{document}


I went to MiKTeX Package Manager, found "cancel" package, right click -> Install. Refreshed FNDB. Opened TeXnicCenter, wrote that code and tried to render it. I got 16 errors. Why (for me "normal" LaTeX, packages like amsmath are working and I'm able it to render it just fine, but now I need some additional functionality like this strikethrough in cancel package)?

MiKTeX 2.9
TeXnicCenter 1.0 RC1
- rendered via Sumatra PDF


-
After installation, you need to refresh your FNDB (filename database). See How do I refresh the file name database?. From the command prompt, type initexmf --update-fndb or click "Refresh FNDB" from the MiKTeX start menu. Does this solve your problem? –  Werner Nov 18 '11 at 18:23
I did. But still the same. –  svebee Nov 18 '11 at 18:24
Use $\cancel{a}$. Does this work? –  Werner Nov 18 '11 at 18:25
No, 48 errors (before "only" 16). –  svebee Nov 18 '11 at 18:26
Does it work if you write something before \cancel{a}, or if you put it in mathmode? Your example didn't work for me either, unless I did one of those things. –  Torbjørn T. Nov 18 '11 at 18:26
show 3 more comments

## closed as too localized by egreg, Joseph Wright♦Nov 18 '11 at 21:47

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

## 3 Answers

Don't use \cancel on the very first word. It works for me, if I begin with a character or just \mbox:

\documentclass[a4paper,11pt]{article}
\usepackage[croatian]{babel}
\usepackage{cancel}
\begin{document}
\mbox{}\cancel{a}
\end{document}


If I use \cancel at the beginning of a paragraph, as in your example, I can confirm there's an error:

! You can't use \/' in vertical mode.
\@cancel ...ht \unitlength \p@ \canc@thinlines {\/
\raise \dimen@ \hbox {\ooa...
l.7 \cancel{a}

-
Still not working, no proper output and errors all around. See first post (updated). –  svebee Nov 18 '11 at 18:35
@svebee As your screenshot shows, you work with cancel.sty on your desktop, not with the MiKTeX installed cancel. Remove cancel.sty from your desktop and delete the testCancel.aux file, then try again. –  Stefan Kottwitz Nov 18 '11 at 18:39
Yeah, I realized it (put it as answer already). Thanks :) –  svebee Nov 18 '11 at 18:40
Final note for readers, the answer solved the initial problem, the error message in the question has bee edited, removed, replaced by another screenshot. –  Stefan Kottwitz Nov 18 '11 at 18:43
add comment

The cancel package description states:

A package to draw diagonal lines ("cancelling" a term) and arrows with limits (cancelling a term "to a value") through parts of maths formulae.

As such using $\cancel{a}$ should work. For this to work after installing the cancel package, you need to update your FNDB (filename database) first (See How do I refresh the file name database?).

This may be an isolated case since the use of \cancel{a} as the first element in a document (or paragraph) is unlikely in general and therefore particular to this test case. Prepending \cancel with anything is sufficient to remove the error.

-
Actually, \cancel should work in text mode as well (see the manual). –  Torbjørn T. Nov 18 '11 at 18:28
I got the output but with 48 errors (see above) :/ –  svebee Nov 18 '11 at 18:28
A minimal example with only $\cancel{a}$ worked in my case. –  Werner Nov 18 '11 at 18:31
add comment

Ok, the thing was I had copy of my cancel.sty on my desktop where was my source .tex file. When I deleted (.sty file) it - everything is working just fine :) As user Werner says

TeX searches the local folder first before examining the FNDB for packages/document classes. As such, the older copy of cancel was used instead of the updated/installed newer version, causing the error. Once the local copy was removed, the updated style file could be accessed, solving the problem.

-
Perhaps you can reword your answer into a more general form so that it helps others as well. Something like "TeX searches the local folder first before examining the FNDB for packages/document classes. As such, the older copy of cancel` was used instead of the updated/installed newer version, causing the error. Once the local copy was removed, the updated style file could be accessed, solving the problem." –  Werner Nov 18 '11 at 18:39
add comment