Im trying to install a package, the one called "mathtools". I am using MikTeX and Texmaker, and the Package Manager does not work, so i need to do it manually.

I have downloaded a folder from CTAN and that gave me a folder filled with some files. empheq.dtx, empheq.pdf, mathtools.dtx, mathtools.pdf, mhsetup.dtx, mhsetup.pdf and README.

In the README file it says to "run TeX on each dtx file" but i have no idea what this means. Please write a rookiefriendly guide like, open program X, use the button X etc. I won't understand if you just say "well just use TeX on it." I am really bad at this.

Hope you can help me, all i want is to use latex but it won't let me.

  • This doesn't answer your question, but... "The package manager does not work" - In what way?
    – darthbith
    Sep 11, 2014 at 20:04
  • @darthbith if i install "mathtools" from package manager and try to build in TeXmaker, it still says it is missing "mathtools.sty". So i just take it, that it doesn't work.
    – Ravn
    Sep 11, 2014 at 20:06
  • Welcome here. Did you have installed a TeX distro previously? Could be that texmaker uses this one and keep updating the newer one. Please add \listfiles at the beginning of your document and check the log-file.
    – Johannes_B
    Sep 11, 2014 at 20:08
  • @Johannes_B what am i looking for in the log file?
    – Ravn
    Sep 11, 2014 at 20:11
  • \listfiles won't be of any help, sorry. But when the LaTeX opens a file (package, class, etc) it writes it's path to the logfile. Do you know where you installed MikTeX? Compare with the logfile for any differences.
    – Johannes_B
    Sep 11, 2014 at 20:20

1 Answer 1


The comments above suggest that there may be a way to solve your problem without learning how to manually install LaTeX packages. But, it's not a bad idea to know how for troubleshooting, and quick fixes.


  1. create a TDS directory structure (once)
  2. place mathtools directory inside (most packages should go in latex/)
  3. run tex on .dtx files (creating .sty files)
    1. (I think I've more often seen latex <some package>.ins)
  4. (Optional) further cleanup towards TDS conventions

You'll want to create a texmf directory. Determining where to put it, that is, the default location, in Windows, is discussed here: packages - Where is texmf on a Windows install - TeX - LaTeX Stack Exchange.

So in your explorer, you'll want to head to your home directory, and create directories until you have the following chain:

c:\Users\<your user name>\texmf\tex\latex\

You would put the mathtools directory there, so that you have for instance

c:\Users\<your user name>\texmf\tex\latex\mathtools\mathtools.dtx

Now, open up a command prompt, and cd (change directory) to this location, that is,

cd c:\Users\<your user name>\texmf\tex\latex\mathtools\

From there, run tex on the appropriate files, that is, type

tex mathtools.dtx

You may also need

tex empheq.dtx

This will create the style files, mathtools.sty and empheq.sty.

This is enough. Latex may now know where to find the style files because of TDS (TeX directory structure). If it does not, you many have to run texhash or similar.

You could follow convention further, cleaning up, putting the documentation (pdfs) into texmf\doc\mathtools\, and put the .dtx (and sometimes .ins) files into some source directory for easy access if you want to recover them later (without internet?).

  • @Johannes_B, Oh, thank you, honest mistake. The directory as he describes it has no .ins nor .sty files, perhaps part of the problem. Will check out CTAN. Sep 11, 2014 at 20:37
  • 1
    Just checked, you ned to run tex on both dtx files. The dtx describes a way »If you insist on using LaTeX« as well.
    – Johannes_B
    Sep 11, 2014 at 20:38
  • I was commenting prematurely ;-)
    – Johannes_B
    Sep 11, 2014 at 20:39
  • 1
    Additionally, i think MikTeX has its Refresh FNDB (file name data base) which is a one-click synonym for texhash (not sure).
    – Johannes_B
    Sep 11, 2014 at 20:42
  • 2
    Usually (in my experience) the ins (running tex/latex on it) extracts the package and running latex/pdflatex on the dtx gives the doc. For the doc it is the case.
    – Johannes_B
    Sep 11, 2014 at 21:31

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.