diff options
| author | 2026-11-07 06:12:48 +0000 | |
|---|---|---|
| committer | 2026-11-07 06:21:22 +0000 | |
| commit | 39dcac2281970febcce36a0151796af2986388b3 (patch) | |
| tree | 7339e54dc942a3ab0d9ba9daae56a2801c1917e9 /doc/tikz-er2.sty | |
| download | coursework-39dcac2281970febcce36a0151796af2986388b3.tar.gz | |
Diffstat (limited to 'doc/tikz-er2.sty')
| -rw-r--r-- | doc/tikz-er2.sty | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/doc/tikz-er2.sty b/doc/tikz-er2.sty new file mode 100644 index 0000000..10ac2ac --- /dev/null +++ b/doc/tikz-er2.sty | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | % The tikz-er2 package. | ||
| 2 | % Ver. 1.0 | ||
| 3 | % (c) P�vel Caldo | ||
| 4 | % January 2009 | ||
| 5 | |||
| 6 | \NeedsTeXFormat{LaTeX2e} | ||
| 7 | \ProvidesPackage{tikz-er2}[2009/01/31 Entity-relationship diagrams using the | ||
| 8 | Tikz library] | ||
| 9 | |||
| 10 | \RequirePackage{tikz} | ||
| 11 | \RequirePackage[normalem]{ulem} % for the dashed underline | ||
| 12 | |||
| 13 | \usetikzlibrary{shapes.geometric} | ||
| 14 | \usetikzlibrary{arrows} | ||
| 15 | \usetikzlibrary{fit} | ||
| 16 | |||
| 17 | \tikzstyle{every entity} = [] | ||
| 18 | \tikzstyle{every weak entity} = [] | ||
| 19 | \tikzstyle{every attribute} = [] | ||
| 20 | \tikzstyle{every relationship} = [] | ||
| 21 | \tikzstyle{every link} = [] | ||
| 22 | \tikzstyle{every isa} = [] | ||
| 23 | |||
| 24 | \tikzstyle{link} = [>=triangle 60, draw, thick, every link] | ||
| 25 | |||
| 26 | \tikzstyle{total} = [link, double] | ||
| 27 | |||
| 28 | \tikzstyle{entity} = [rectangle, draw, black, very thick, | ||
| 29 | minimum width=6em, minimum height=3em, | ||
| 30 | every entity] | ||
| 31 | |||
| 32 | \tikzstyle{weak entity} = [entity, double, double distance=2pt, | ||
| 33 | every weak entity] | ||
| 34 | |||
| 35 | \tikzstyle{attribute} = [ellipse, draw, black, very thick, | ||
| 36 | minimum width=5em, minimum height=2em, | ||
| 37 | every attribute] | ||
| 38 | |||
| 39 | %\tikzstyle{key attribute} = [attribute, font=\bfseries] | ||
| 40 | |||
| 41 | \tikzstyle{multi attribute} = [attribute, double, double distance=2pt] | ||
| 42 | |||
| 43 | \tikzstyle{derived attribute} = [attribute, dashed] | ||
| 44 | |||
| 45 | %\tikzstyle{discriminator} = [attribute, font=\itshape] | ||
| 46 | |||
| 47 | \tikzstyle{relationship} = [diamond, draw, black, very thick, | ||
| 48 | minimum width=2em, aspect=1, | ||
| 49 | every relationship] | ||
| 50 | |||
| 51 | \tikzstyle{ident relationship} = [relationship, double, double distance=2pt] | ||
| 52 | |||
| 53 | \tikzstyle{isa} = [isosceles triangle, isosceles triangle apex angle=60, | ||
| 54 | shape border rotate=90, | ||
| 55 | draw, black, very thick, minimum size=3em, | ||
| 56 | every isa] | ||
| 57 | |||
| 58 | % for text un key attributes | ||
| 59 | \newcommand{\key}[1]{\underline{#1}} | ||
| 60 | \newcommand{\weakkey}[1]{\dashuline{#1}} | ||
| 61 | |||
| 62 | % for text in discriminator attributes | ||
| 63 | \def\discriminator{\bgroup | ||
| 64 | \ifdim\ULdepth=\maxdimen % Set depth based on font, if not set already | ||
| 65 | \settodepth\ULdepth{(j}\advance\ULdepth.4pt\fi | ||
| 66 | \markoverwith{\kern.15em | ||
| 67 | \vtop{\kern\ULdepth \hrule width .3em}% | ||
| 68 | \kern.15em}\ULon} | ||
