Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am looking for a database documentation software where I want to incorporate the output in LaTeX. I want to show the table structures, primary keys and other related information.

I found pst-dbicons (http://www.ctan.org/tex-archive/graphics/pstricks/contrib/pst-dbicons) at CTAN. I will forced to use this if I don't find an alternative. But I am not exactly looking for an ER diagram software.

share|improve this question
Looks like graphviz (graphviz.org/Gallery/undirected/ER.html) could be an option. –  MMA Nov 18 '12 at 16:54
You could perhaps be interested in seeing Drawing relationships between elements of a database. –  Claudio Fiandrino Nov 19 '12 at 18:38
Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. –  Papiro Apr 15 '13 at 12:26
add comment

1 Answer

up vote 6 down vote accepted

Based on the comments and web search, eventually I came up with a working framework for my purpose which might be useful for others.

enter image description here

sqlt-graph --show-datatypes -l dot -n record -f MySQL -t png --graphattr center,margin="0.0,0.0",overlap=false,sep=10,size="20.0,14,0",orientation=landscape --nodeattr fontsize=24,fontname=Helvetica --edgeattr weight=0.05,len=2.0 -o output.png input.sql

  • This produces a .png file which can be used in LaTeX or anywhere else.

  • When included in LaTeX, the output looks something like this (partially smudged out to preserve confidentiality).

Sample output from real life

share|improve this answer
For better results, I suggest to use PS or SVG(Z) format. –  Paul Gaborit Mar 13 '13 at 0:37
@PaulGaborit Thanks. Yes, in that case we will have to use -t ps or -t svg instead of -t png. –  MMA Mar 15 '13 at 8:10
Could someone possibly upload a picture of the generated output in LaTex? –  puk Jun 18 '13 at 6:43
@puk Sample image from real life added, please see the original answer. –  MMA Jun 18 '13 at 14:05
add comment

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.