3
\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\author{atchi}
\begin{document}
\begin{tikzpicture}
\draw (-6,0)--(0,6);
\end{tikzpicture}
\end{document}

How to fix this error:

LaTeX Error: File tikz.sty not found.

10
6

You need to call MiKTeX Console in the apps of Windows.

Then you have to choose using user mode or admin mode (I have an admin installation, so you will see admin mode in the following ...)

After that you have to click on packages (see left red circle):

miktex console

Now type tikz where the red arrow points to.

Now click on the symbol marked with the right red circle to get a list of installable packages containing tikz in the filename.

At last click on the +-sign before tikz to install the selected packages.

Do the same with pgf:

pgf installation

3
-3

Such errors occur from time to time with newer versions of Miktex and Latex packages, and while there are some fine solutions, often the good ol' reinstall of Miktex turns to be the least time consuming. (I mean a fresh install of the latest MiKTeX version.) Not to mention that it's often caused by a bug in Miktex, and then what you would be looking for is a workaround which might, or might not work.

Good luck!

2
  • 1
    Welcome to TeX.SE! Sorry that is not true. In this case the basic MiKTeX does not include TiKz -- therefore the error! – Mensch Feb 2 '19 at 18:56
  • Thank! Yes, the basic MiKTeX doesn't include TiKz, after the fresh install all packages would need to be installed again. However, after the fresh install all new packages are installed smoothly - without any errors. That's just my humble experience. I believe it's because of everything being up-to-date, including the package repository. – gari Feb 2 '19 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.