I heard that equations will be stored in separate files -- each equation in a separate file and you want to build a database of these files!: This is possible.
You can save an equation as a tex file, for example massenergy.tex:
E = mc^{2}
and curl of electric field to be saved as curlE.tex
\nabla \times \bm{E} = 0
Note that we have not used any math delimiters ($ or \begin{equation} or \[...\]) in these files so that they can be used inside variety of math environments. Now we have two .tex files: viz; massenergy.tex: and curlE.tex. For the time being, I assume that they are stored in the same folder as our main .tex file (you can store them elswhere and call them by providing the correct path).
Now we use them like this:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{massenergy.tex}
E = mc^{2}
\end{filecontents}
\begin{filecontents}{curlE.tex}
\nabla \times \bm{E} = 0
\end{filecontents}
\usepackage{amsmath,bm}
\begin{document}
This is Einstein's relation : $\input{massenergy}$.
This is the curl of electric field:
\begin{equation}
\input{curlE}
\end{equation}
and without number:
\[
\input{curlE}
\]
\end{document}
I have used filecontents so that one need not create the equation files separately while testing this example.
:)): http://tex.stackexchange.com/q/75831 Hope this helps! – Count Zero Dec 15 '12 at 11:03\input. – egreg Dec 15 '12 at 11:17\formula{name}writes something in the.auxfile and then a postprocessor fetches the needed entries from a database, building a.texfile to be\input, where for eachnamea macro can be defined. – egreg Dec 15 '12 at 11:56pgfkeys.\documentclass{article} \usepackage{amsmath} \usepackage{pgfkeys} \newcommand\useeq[1]{\pgfkeys{/equations/.cd, ab/.code={a=b}, Newton/.code={(a+b)^n=\sum^n_{i=0}\binom{n}{i}a^{i}b^{n-i}}, #1} } \begin{document} $\useeq{ab}$ $\useeq{Newton}$ \[\useeq{ab}\label{ab}\] \[\useeq{Newton}\label{Newton}\] \end{document}– Dec 16 '12 at 09:30