Assume you have many documents in LaTeX (for example, Math word problems) and don't want to write the same formulas once and again. Instead, you would prefer to write something like \pythagoreantheorem and expect that this term is replaced by the right expression when rendering, expression that you have defined somewhere else.
Does LaTeX provide with such a mechanism to define system formulas that can be invoked from any document?
(Same question for graphics: any way to define system graphic objects that can be invoked in a document? - you write \cube and it gets replaced by the corresponding TikZ code).
\newcommand? that is the standard way to define custom macros in LateX. If you want to reuse the same macro in different documents, you can collect them in some personal package of yours. See for example https://tex.stackexchange.com/questions/119898/latex-cannot-find-my-personal-packages or https://tex.stackexchange.com/questions/229313/windows-tex-live-and-directory-for-personal-packages – Michael Palmer Jul 04 '17 at 19:57