49

I read on http://en.wikibooks.org/wiki/LaTeX/Mathematics:

The mathtools package fixes some amsmath quirks and adds some useful settings, symbols, and environments to amsmath.

It sounds like "mathtools has everything that amsmath has and more", isn't it?

Are there cases when it is justified to use amsmath instead of mathtools?

In other words: Is mathtools "always" better?

Werner
  • 603,163
  • 6
    mathtools is an add on to amsmath – Marco Daniel Feb 08 '12 at 18:42
  • 1
    See https://groups.google.com/group/comp.text.tex/msg/2cddb7e230d50439 – Philippe Goutet Feb 08 '12 at 19:54
  • 6
    If it was not clear from @MarcoDaniel's comment, the mathtools package includes the amsmath package. – Peter Grill Feb 08 '12 at 20:50
  • @Peter load might be a better word, mathtools does not come with its own version of amsmath;-) – daleif Feb 09 '12 at 09:00
  • So, maybe someone more competent would like to fix this page of LaTeX Wikibook ? :) – Grzegorz Wierzowiecki Feb 09 '12 at 10:25
  • 6
    @daleif: One of the lines of code in mathtools is \RequirePackage{amsmath}, so that contents of amsmath are included/loaded/imported by mathtools. Since I do not know of load as being part of the LaTeX syntax, I think include would be a better choice (but did not use syntax highlighting as in include to indicate that it was a keyword). English not be my bestest :-) so leave it up to others to select the correct word. – Peter Grill Feb 09 '12 at 15:35
  • Grzegorz: go right ahead. :) But based on the discussion I think the existing text is pretty accurate. – Matthew Leingang Feb 15 '12 at 14:15
  • Is there any alternative to the mathtool package? – skan Nov 19 '16 at 12:46
  • Why do you say ¨Certainly mathtools is not a replacement package for amsmath. This is clear from the package author's comments in the abstract and the introduction¨ if mathtools has amsmath inside then mathtools is a replacement... cause mathtools=amsmath+other stuffs – xshofi Nov 17 '15 at 19:00

1 Answers1

43

I believe that the answer has been provided, mostly in the comments but here is a short summary:

The mathtools package loads the amsmath package, if it has not already been loaded. This is common in many packages that need to ensure that dependencies are loaded. If you have a look in mathtools.sty line 60, you will see:

  \RequirePackage{amsmath}[2000/07/18]

As such if you only load mathtools, you will have both packages loaded and you do not need to \usepackage{amsmath} in your preamble. To see this you can run the following minimal:

  \documentclass{article}
  \usepackage{mathtools}
  \makeatletter
   \@ifpackageloaded{amsmath}{
     \AtBeginDocument{True amsmath is loaded\par}}{}
   \makeatother
  \begin{document}
  \end{document}

Certainly mathtools is not a replacement package for amsmath. This is clear from the package author's comments in the abstract and the introduction:

The mathtools package is an extension package to amsmath

Hope the above will help you a bit more as to how to find your way around LaTeX and the many packages that are available.

yannisl
  • 117,160