Does there exist a tool to find in what package a given macro is defined? I have to work with LaTeX (not XeLaTeX, for legacy reasons). I'm dealing with very old code, which I have to get compiled. So, if I encounter an unknown command, I have to include the corresponding package. Currently, I just google and hope to find the right package. Does there exist something like Hoogle (which is a search engine for Haskell), but for LaTeX?
I don't know the answer but seeing how long this went unanswered ... in case you don't use Windows, you could use this kludge of a command line:
find `kpsewhich -show-path=tex | sed 's/:/ /g' | sed 's/\!\!//g'` -name '*.sty' -or -name '*.cls' -or -name '*.tex' | xargs grep MACRO
It probably finds much too much but if "MACRO" is not too common a word, it might help :/
This assumes of course, that you just installed every package there is with something like a full TeXLive install or something.