11

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

enter image description here

sduplooy
  • 483
  • 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 02 '17 at 16:27

2 Answers2

5

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

Another possibility is PSTricks.

Stefan Kottwitz
  • 231,401
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