"source2e - LATEX2ε kernel documentation for the entire system
as one document" at CTAN might be of interest to you.
That document comes as .pdf-file whose name is source2e.pdf.
The most recent version of source2e.pdf, which refers to the most recent version of the LaTeX2e-kernel, can be downloaded from the Comprehensive TeX Archive Network (CTAN) at:
https://ctan.org/pkg/source2e
The title of the version of that document relating to the most recent version of the LaTeX2e-kernel at the time of writing this answer (May 21, 2018) is:
The LaTeX2e Sources
Johannes Braams, David Carlisle, Alan Jeffrey, Leslie Lamport,
Frank Mittelbach, Chris Rowley, Rainer Schöpf
2018-04-01 Patch level 5
That document does not contain information about the code of LaTeX2e-classes and -packages, but it contains information about how the LaTex2e-format/the LaTeX2e-kernel itself is implemented.
Within that document you can find how, e.g., commands like \documentclass
or \usepackage
or \begin
or \end
are defined in the LaTeX2e-kernel.
E.g., in the section about File b: ltplain.dtx Date: 2017/04/10 Version v2.3c, on page 28 of that .pdf-file, you can find the LaTeX2e-kernel-definition of \hrulefill
:
\hrulefill LaTeX change: \kern\z@ added to end of \hrulefill and \dotfill to make them
\dotfill work in ‘tabular’ and ‘array’ environments. (Change made 24 July 1987). LaTeX
change: \leavevmode added at beginning of \dotfill and \hrulefill so that
they work as expected in vertical mode.
435 \def\hrulefill{\leavevmode\leaders\hrule\hfill\kern\z@}
The box in \dotfill originally contained (in plain.tex):
\mkern 1.5mu .\mkern 1.5mu;
the width of .44em differs from this by .04pt which is probably an acceptable
difference within leaders.
436 \def\dotfill{%
437 \leavevmode
438 \cleaders \hb@xt@ .44em{\hss.\hss}\hfill
439 \kern\z@}
latex.ltx
is a start. But you can use{\tt\meaning\hrulefill}
to get the definition in the document (or if you control the logs and such you can use\show\hrulefill
, but I prefer\meaning
since what I usually see is the result pdf).