There is official documentation of all LaTeX macros at user level:
Leslie Lamport, “LaTeX: A Document Preparation System (2nd Edition)” ISBN 978-0201529838
(also known as the “LaTeX Manual”)
Frank Mittelbach and Michel Goossens (with Johannes Braams, David Carlisle and Chris Rowley), “The LaTeX Companion (Tools and Techniques for Computer Typesetting) 2nd Edition” ISBN 978-0201362992
(also known as the “Companion”)
Guessing from latex.ltx
the arguments is an almost hopeless task. For instance, \section
is a macro with no argument, which calls \@startsection
which has six arguments and in turn calls either \@ssect
(one argument) or \@sect
(one optional and one mandatory argument), depending on whether a *
follows \section
.
With some LaTeX programming experience, one can get through, but one of those manuals is necessary if the whole story is needed.
I own the first and second edition of both the Manual and the Companion; actually two copies of the second edition of the Companion, plus the electronic edition. One of the two paper copies is a gift of the publisher. And, believe it or not, I go and check them when I have to be sure about some command's syntax.
source2e.pdf
gives the insight to internals of LaTeX kernel macros, however, most[]
argument macros come from the standard classes rather than the Kernel, such as\section[]{}
etc. (This is a rough guess, however, I did not count the actual number ;-)) Please note that the LaTeX kernel sometimes uses\def\foo#1#2[#3]
etc. with moving arguments as well – user31729 Dec 4 '17 at 16:17\@startsection
for LaTeX? – Werner Dec 4 '17 at 16:19