# How to create an equation library, to be called like bibtex?

I am newby in LateX, but I want to create an stand alone document to be used as a equation library where I can select my equations by calling them by name, and finally produce a list of equations used in the working document, or a glossary with the equation and description. Thank you in advance.

• The sounds like it has quite limited applicability, no? – Mariano Suárez-Álvarez Feb 10 '11 at 22:10
• @Mariano: Why? If you have to cite the same equations over and over again in several papers you can make good use of it. I would guess the glossaries package could be used for it, or using biblatex for it, somehow. – Martin Scharrer Feb 10 '11 at 22:17
• @Martin: Does anyone write sufficiently many papers containing the same equations (for I assume no one sanely repeats the same equation in a paper many times...), of sufficient complexity each to justofy not simply retyping them, to make this significative? Only the remarkable notational consistency implied such a feat implies is worthy of praise! – Mariano Suárez-Álvarez Feb 11 '11 at 20:37
• @Mariano: I published only five papers so far and already had the same idea. And then there are also: thesis, presentation and, if you are a lecture, class notes, etc... Re-typing is out of the question for more complex equation. Ok, then there is still Copy&Paste. – Martin Scharrer Feb 11 '11 at 20:46

## 2 Answers

can be improved for your needs

\documentclass[12pt]{article}
\usepackage{float}
\newfloat{EQN}{H}{eqn}
\begin{document}

\begin{EQN}
\begin{equation}
y=f(x)
\end{equation}
\caption{my first equation}
\end{EQN}

\begin{EQN}
\begin{equation}
y=f(x)
\end{equation}
\caption{my second equation}
\end{EQN}

\listof{EQN}{my equations}

\end{document} • I think part of what the OP wants is to call equations several times, like you might cite the same book several times... – Seamus Feb 10 '11 at 22:56

Based on Herbert's answer, with glossaries package:

\documentclass[a4paper]{article}
\usepackage{glossaries}

\usepackage{float}
\newfloat{EQN}{H}{eqn}

\newcommand\eqcite{%
\begin{EQN}%
\begin{equation}%
\glssymbol{#1}%
\end{equation}%
\caption{\glsentryname{#1}}
\end{EQN}
}

\loadglsentries{glossdata.tex}
\makeglossaries

\begin{document}
\eqcite{eq1}
\eqcite{eq2}

\listof{EQN}{My equations}
\printglossaries
\end{document}


Your database is in file glossdata.tex

\newglossaryentry{eq1}{
name={First equation}
,symbol={y=f(x)}
,description={Some equation}
}
\newglossaryentry{eq2}{
name={Second equation}
,symbol={y=a+f(x)}
,description={Another equation}
}


To get list of descriptions, you have to run some indexing program, makeglossaries, makeindex or xindy.

makeglossaries nameofyourdocument
{"ft_lang_label":"__label__en","ft_lang_prob":0.60917556,"math_prob":0.9508237,"size":1702,"snap":"2021-04-2021-17","text_gpt3_token_len":529,"char_repetition_ratio":0.1778563,"word_repetition_ratio":0.01010101,"special_character_ratio":0.2532315,"punctuation_ratio":0.09090909,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9976297,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,1,null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-04-19T12:07:38Z\",\"WARC-Record-ID\":\"<urn:uuid:8ee599b5-1140-4385-9fa6-d9cc3ebc58af>\",\"Content-Length\":\"176448\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:54b02430-92db-4401-a432-544f9247539a>\",\"WARC-Concurrent-To\":\"<urn:uuid:e5a6e2d1-0259-4bce-94d0-7f02547ca732>\",\"WARC-IP-Address\":\"151.101.65.69\",\"WARC-Target-URI\":\"https://tex.stackexchange.com/questions/10799/how-to-create-an-equation-library-to-be-called-like-bibtex\",\"WARC-Payload-Digest\":\"sha1:CEP7I3DWG2Y6GGJLAW5XFEQB2E64TRR2\",\"WARC-Block-Digest\":\"sha1:LZRERVDHJ3DUOXXRSB74LOZ7JRQPR7XV\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-17/CC-MAIN-2021-17_segments_1618038879374.66_warc_CC-MAIN-20210419111510-20210419141510-00506.warc.gz\"}"}