views:

241

answers:

4

It is a simple question to which I am not able to find the answer:

Given a LaTeX command, how do I find out what package(s) it belongs to or comes from?

For example, given the \qquad horizontal spacing command, what package does it come from? Especially troublesome since it works without including any package!

+3  A: 

IMHO there's no standard way, use grep or Google.

Vlad
+6  A: 

You can search http://www.ctan.org/tex-archive/info/symbols/comprehensive/ for that information and more.

Remember that LaTeX is a macro language on top of TeX, and all the macros are made up of TeX which doesn't need to be imported. \qquad is in that category.

Ryan Prior
+4  A: 

Given a LaTeX command, how do I find out what package(s) it belongs to or comes from?

Consult your references:

  1. If it's in the index to the TeXbook, it's inherited from TeX, the engine that drives LaTeX.
  2. Otherwise, if it's in the index to the LaTeX manual, it's probably defined in latex.ltx or in one of the standard class files, not in a package.
  3. Otherwise, if it's in the index to The LaTeX Companion, the page number probably tells you what package it's from.
  4. Otherwise, you could do some fancy grepping on the results of find /usr/share/texmf -name '*.sty', but be prepared for a painful exercise.
  5. Or, you could ask on http://stackoverflow.com. But then some idiot will respond by asking why you want to know...
Norman Ramsey
+3  A: 
Steve