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

  • 1
    Can you post a bit more detail as to exactly what you want. Perhaps a diagram and some code of what you have attempted. Sep 15, 2011 at 2:02
  • 1
    IMHO, TikZ is the way to go for diagrams: See typesetting uml class diagrams for more options. Sep 15, 2011 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, 2011 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, 2011 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, 2011 at 14:07

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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