10

Is there a package that will allow me to create a database entity relationship diagram such as the one below?

enter image description here

  • The question of "how to draw Database Entity-Relationship diagram" received an excellent answer there. It does not cover the particular case @sduplooy was looking at, but is much much extensive. – Clément Oct 2 '17 at 16:27
4

Run it with xelatexor latex=>dvips=>ps2pdf

\documentclass{article}
\usepackage{array,ragged2e,pst-node,pst-dbicons}
\newcolumntype{C}[1]{>{\Centering}p{#1}}
\def\Tab#1{\tabular{C{3cm}}\rule[-5mm]{0pt}{1cm}#1\\\hline
                           ~\\\hline~\endtabular}
\seticonparams{entity}{shadow,fillcolor=black!20,fillstyle=solid,framesep=0pt}
\begin{document}

\entity{students}[\Tab{Students}]\hspace{2.5cm}
\entity{courses}[\Tab{Courses}]
\ncline[arrowscale=2]{->}{students}{courses}
\naput[npos=0.1]{1}\naput{take}\naput[npos=0.85]{1..*}

\end{document}

enter image description here

5

You could use TikZ. Have a look at the TikZ diagram examples.

Another possibility is PSTricks.

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.