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.
:)
): tex.stackexchange.com/q/75831 Hope this helps!\input
.\formula{name}
writes something in the.aux
file and then a postprocessor fetches the needed entries from a database, building a.tex
file to be\input
, where for eachname
a macro can be defined.