Reputation: 1007
I have a mysql database that contains snippets of latex code, identified by a unique id which I imaginatively called id.
Now I would like to typeset a document with latex in the following way:
\documentclass{article}
\newcommand{\dbquery}[1]{???}
\begin{document}
Some text \dbquery{23} some more text etc.
\end{document}
So the idea is, whenever the macro \dbquery appears, the latex code with id=23 in the db is inserted into the text.
Any ideas? Thanks in advance.
Upvotes: 3
Views: 3709
Reputation: 156
You may take a look at LaTeXDB. Since it connects LaTeX to a MySQL database, it should be your friend here.
Upvotes: 4