# Document will compile on TeXworks but not TeXstudio

I have a small problem with a document I am trying to compile. The following code will compile in TeXworks without any errors, but bleats about missing packages tqft, and missing .sty files for wasysm, cleveref, titlesec and tocbibind.

My main problem is that I have compiled this before on a different computer, without any problems, and I'm trying to compile it on a different one.

\documentclass[12pt,a4paper]{report}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

% Any packages should go here

\usepackage{graphicx,natbib}
\usepackage{mathrsfs,amsmath,amsfonts,amssymb,amsthm,relsize,geometry,faktor,mathtools,thmtools}
\usepackage{tikz-cd}
\usepackage{yfonts}
\usepackage{tikz}

\usepackage{url}
\usepackage{wasysym, stackengine, makebox, graphicx}

\usetikzlibrary{tqft}
\usepackage{yfonts}
\usepackage{hyperref}
\usepackage[capitalise]{cleveref}
\usepackage{url}

\usepackage{titlesec}

\usepackage[nottoc,notlof,notlot]{tocbibind}
\renewcommand\bibname{References}

\usepackage[nottoc,notlof,notlot]{tocbibind}
\renewcommand\bibname{References}

\begin{document}
test
\end{document}


The errors are all standard "x.sty not found" except for this tqft error:

Package tikz Error: I did not find the tikz library 'tqft'.

I looked for file be found in the current texmf trees.. \usetikzlibrary{tqft} I just installed MiKTeX without anything fancy, and then downloaded TeXstudio and tried to compile the document. Are they looking in different places? I have checked on the MiKTeX console, and I have all the relevant packages installed. Using the ctan archive for cleveref, here, it doesn't even seem to have a style file, so I am out of ideas.

I apologize in advance for the bad formatting in the above example. Thanks for the help!

I think I may have found the problem, but I am not sure. The console is telling me there is "PATH issue" and that the directory

~\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64


is not in the search path for executables or is in the wrong position of the path. Is there a way to fix this?

I think I may have fixed my own problem - move the texstudio executable to the folder x64, although I'm not sure if this is best practice. I will keep the question up in case there is a better way to do this.

• Welcome to tex.sx. Off topic: the packages amsmath, amsfonts, amssymb, and graphicx are loaded at the beginning as part of the template, so you don't need (or want) to load them again. Actually, the template doesn't even need to load amsfonts because it is automatically loaded by amssymb. Specifying any of these twice doesn't really hurt, but it's cleaner not to do so, and not all packages have the same safeguards. Feb 28, 2019 at 1:40
• Avoid moving apps into another since they may have conflicting support files & an update of one can upset the other (one of the reasons windows is now such an abhorrent mass of duplications) you should always use MiKTeX-console packages to update with any missing .sty or other files and resist at all costs downloading yourself from ctan (unless clear that it is NOT listed as supplied by MiKTeX) look at a few package descriptions to see that most are in both Tex Live and MiKTeX. ~~ BOTH one or more MiKTeX Bin folders AND the TeXstudio Binary folder MUST be on system path by using the installers
– user170109
Feb 28, 2019 at 2:35

If TeXworks can compile a file mwe.tex then we can say that your MiKTeX installation is working (because TeXworks is part of it).

If TeXStudio can not compile mwe.tex then the culprit is the installation of TeXStudio.

You should do the installation in the following order (did you?):

1. Install MiKTeX with installer from Homepage. Better use complete MiKTeX (netinstaller) than Basic MiKTeX.
2. Because the installer is usually based on an older version update all packages with package manager (click in the MiKTeX Console on "Packages").
3. Important for Windows: Reboot!
4. Install TeXStudio. It should recognize the installed MiKTeX and does then an automatic configuration to use the correct path(es) to be able to start compilation via MiKTeX.
5. Important for Windows: Reboot!

In your case it seems there was an error in point 4.

• Now check your system and check in which directory TeXStudio has been installed.
• type path on your terminal/console to get the actual path displayed. The directory of TeXStudio should appear more or less last in the shown directorys.
• Make sure TeXStudio is really in that directory, your moving of the binary was a bad action. Redo it!
• Check the configuration of TeXStudio, could be it has the wrong path to MiKTeX configured ... Correct the path if it is wrong.

If that does not help I suggest to

• deinstall TeXStudio (make sure you deleted the moved part too!),
• Reboot and
• start installing TeXStudio again (you can try to disconnect to internet, deactivate your anti virus software, install TeXStudio, activate anti virus system, connect to internet).
• Reboot!