# Errors using tikz-cd and TikZ

I was trying to install the tikz-cd package into my miktex in order to draw commutative diagram. However, I encountered the following error and I don't know how to solve it.

The situation:

In the bottom, it says

``````"! Undefined control sequence.
l.19 \usetikzlibrary
{matrix}
? "
``````

-
Welcome to TeX.SX! –  Papiro Jun 29 '13 at 11:52
What is your preamble, exactly ? Is tikz-cd really installed ? –  Bernard Jun 29 '13 at 12:18
hi bernard, what is meant by a preamble...? I actually am not sure whether I have installed the tikz-cd... Do you mind telling me how to install it? –  user32982 Jun 29 '13 at 12:49
Hello, and welcome to TeX.SX! Could you cut and paste your LaTeX code and put it into your question? (Older eyes have a hard time seeing the text in the picture, mine included.) If you can, also try trimming the unnecessary bits of your document to come to hat we call a minimal working example (MWE). This will make it easier for us, and very likely yourself, to come to a solution. –  Sean Allred Jun 29 '13 at 13:24
You do not have (correctly) TikZ installed. The error messages says `File `tikz.sty` not found.` You cannot substitute this with `tikz-cd.sty` (which is actually found) because it relies on TikZ. `\usetikzlibrary` is a TikZ macro is of course not defined then. The `tikz` package can be found in MiKTeX Package Manager under the name `pgf`. That said, it also looks like you isntalled `tikz-cd` in you local folder. Why don’t you use MiKTeX’s package manager for these default packages? –  Qrrbrbirlbel Jun 29 '13 at 14:32
show 4 more comments

And, as I commented, search also for `pgf` because that’s the name of the PGF/TikZ “package” (in MiKTeX at least). –  Qrrbrbirlbel Jun 29 '13 at 23:07