I agree with the sceptical tenor of the comments above - I don't see how such a list would be useful in real life. However, just for the heck of it, here is a little bash script that attempts to list all commands in all locally installed *.sty
files.
#!/bin/bash
# search file system for all latex package files
packages=$(sh -c "find / -name '*.sty' | grep -oE '/([^/]+)/[^/]+\.sty$' | cut -f2 -d'/' | sort | uniq" 2>/dev/null)
# iterate over all packages to list their macros.
for package in $packages; do
# run Martin Scharrer's `latexdef` on each package name to list the
# commands defined therein. The loop hangs on arsclassica, so we
# skip it.
if [ $package != "arsclassica" ]; then
echo "package: $package"
latexdef -l -p $package
fi
done
Note that latexdef
invokes TeX on each package, and sometimes that doesn't work properly, and you get compile error messages. You also get some empty lines, so you would have to filter the output. Also, it seems the compiler hangs when latexdef
tries to process package arsclassica
, which I therefore manually excluded. Since I only ever let the script run to package names starting with letter c
, it is quite possible that more hangups would occur, and more exemptions be required, further on.
Also note that this does not cover *.cls
or other files that may contain command definitions.
\mypkg@foo
etc.) to avoid name clashes. For user facing commands, if you have a name that's the same as another package's name, the chances are that the packages shouldn't be used together anyway. So it's not clear what a list would do for you.\StackUp
,\StackDown
,\StackBelow
,\StackBehind
,\StackAfter
,\StackBefore
,\StackHere
, and thousand variants :-P