TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using a LaTeX or similar text-macro tool/library, how can I generate an Entity-Relationship Diagram then generate SQL from it?

share|improve this question
Can you post a bit more detail as to exactly what you want. Perhaps a diagram and some code of what you have attempted. – Peter Grill Sep 15 '11 at 2:02
IMHO, TikZ is the way to go for diagrams: See typesetting uml class diagrams for more options. – Peter Grill Sep 15 '11 at 2:28
I've decided to write the SQL by hand, and generate a diagram from that using SchemaSpy. Using Doc2TeX I can then embed it neatly into my TeX report. – A T Sep 19 '11 at 11:34
But I want people to mark it down if they think it's a bad idea, or mark it up if they think it's a good one – A T Sep 19 '11 at 15:06
This seems like the wrong way round. Wouldn't it be easier to write the SQL and then read that to create the diagram? Or have I misunderstood something? – Seamus Sep 20 '11 at 14:07

Run texdoc pst-dbicons then you'll get the documentation of pst-dbicons. But there is no package which can generate the corresponding sql code.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.