An environment can be defined
in the LaTeX kernel (list
, but also enumerate
),
in the document class (quote
, titlepage
), or
in a package you load.
There's no hard and fast rule for finding what's the case for the environment you want to know about. Of course, if you want to know the definition of bytefield
, you'll look in the package that provides it.
Cases 1 and 2 are more difficult to distinguish. As a rule of thumb, the kernel provides for “generic” environments such as list
, trivlist
, center
, flushleft
; also enumerate
and itemize
are defined there, because they're felt as generic. But description
is left to the document class like quote
and quotation
.
Note that you don't find \newenvironment{enumerate}
in the LaTeX kernel, for saving token memory (remember that LaTeX was developed when memory resources were not as abundant as they are today).
However, an environment may be redefined by a package you load. An easy example is enumitem
, that changes the definitions of enumerate
, itemize
and description
.
A good tool is texdef
, distributed with TeX Live; here's a sample session:
> texdef -t latex enumerate
\enumerate:
macro:->\ifnum \@enumdepth >\thr@@ \@toodeep \else \advance \@enumdepth \@ne \edef \@enumctr {enum\romannumeral \the \@enumdepth }\expandafter \list \csname label\@enumctr \endcsname {\usecounter \@enumctr \def \makelabel ##1{\hss \llap {##1}}}\fi
> texdef -t latex -p enumitem enumerate
\enumerate:
macro:->\@protected@testopt \enumerate \\enumerate {}
\\enumerate:
\long macro:[#1]->\enit@enumerate \enitdp@enumerate {enum}\thr@@ {#1}
You may want to try the -s
option:
> texdef -t latex -s quote
% article.cls, line 404:
\newenvironment{quote}
{\list{}{\rightmargin\leftmargin}%
\item\relax}
{\endlist}
You see that, if possible, the file and line number where the definition is performed are printed in the output. The option doesn't generally work along with -p
, though.
quote
is inarticle.cls
(assuming you are usingarticle
class). Your log file shows you which source files have been read.\show
to see the macro that defines the environment, e.g.\show\quote
. Here, the definition is in the class file (article.cls
).\show
and looking at the log, but I understand that that information can be useful.