Using \@ifdefined
(in LaTeX), we can check whether a command is defined.
Using \meaning
, we can get the definition of a command.
Can we also get information about where a command was defined? For example, in terms of the source file and line number? Does TeX even keep track of this information?
We can grep
through source files, but with constructs like \csname
, there's no guarantee that the definition will show up.
Best Answer
Oh, I find a much better way to do this, also with help of
filehook
(the code is somewhat tricky):After compiling, we will get
in
\jobname.fnd
. That is to say,\url
is defined inurl.sty
, which is inputed byhyperref.sty
.