I downloaded the MacTeX and I am now using Texmaker to finish my algorithm homework.

When I try to add this line \usepackage{algorithms} in texmaker, it always keeps telling me that algorithms.sty is not found.enter image description here

However TeX Live Utility shows that this package has been installed. How could I solve this? enter image description here

  • 1
    Welcome! There is no algorithms.sty in TeX Live. Please do not post screen shots of code. Instead, post a Minimum Working Example, if possible, or a Minimum Non-Working Example, if not. Not every package corresponds to a .sty file by the same name. You need to look at the documentation or package contents to figure out what it provides.
    – cfr
    Aug 28 '15 at 1:57

Not every TeX Live package, package, includes a .sty file by the same name, package.sty. Sometimes it does. Sometimes it doesn't. To figure out what a package provides, read its documentation or look inside its directories. Alternatively, in some cases, you can simply ask TeX Live Manager. For example,

tlmgr info algorithms

returns this:

package:     algorithms
category:    Package
shortdesc:   A suite of tools for typesetting algorithms in pseudo-code
longdesc:    Consists of two environments: algorithm and algorithmic. The algorithm package defines a floating algorithm environment designed to work with the algorithmic style. Within an algorithmic environment a number of commands for typesetting popular algorithmic constructs are available.
installed:   Yes
revision:    38085
sizes:       src: 53k, doc: 365k, run: 17k
relocatable: No
cat-version: 0.1
cat-date:    2015-08-03 05:43:12 +0200
cat-license: lgpl
cat-topics:  pseudocode
cat-related: alg
collection:  collection-science

So the package probably provides algorithm.sty, at least.

And, indeed,

ls $(kpsewhich -var TEXMFMAIN)/tex/latex/algorithms/

confirms this:

algorithm.sty  algorithmic.sty

In addition to the general answer provided using shell commands, Mac users such as the OP can get this info by double-clicking the "algorithms" row in TeX Live Utility, which shows the documentation and all files associated with a given package.

TLU info screenshot

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.