An example:
If I don't want to number an equation within the equation environment, I need to do two things:
Load the
amsmathpackage at the preamble.Use the command
\nonumberat the end of the equation.
Without the amsmath package, the compiler would not recognize the \nonumber command. As far as my understanding goes:
The
equationenvironment is part of Latex's core functions, and there is no package needed to call the environment. Its code specifies that it will always number the equation within.The
amsmathpackage allows the use of the command '\nonumber'.
My confusion is that it seems like the \nonumber command has interfered with the equation environment.
More specifically, the \nonumber command must somehow have communicated with the equation environment because once a \nonumber command is executed, the next equation environment automatically adjusts the numbering.
I find this hard to understand because loading a package doesn't mean erasing the existing commands. Moreover, it doesn't seem to me that the \nonumber command could have modified the code of the equation environment.
My question is: How could the equation environment recognize an unnumbered equation, which was done by a separate package, and adjust its numbering accordingly? More generally, how are packages integrated into existing LaTeX core functionalities?
My question might not have expresses fully my confusion so any additional information would be appreciated.
\nonumberis defined in LaTeX itself (in around the place where theequationexample is defined), not in theamsmathpackage. (But in general the kind of thing you describe is quite possible; a package can simply redefine things that were defined by LaTeX or other packages.) – ShreevatsaR Feb 16 '18 at 07:54amsmathpackage modifies the properties of theequationenvironment. – Mico Feb 16 '18 at 08:27