فهرست منبع

added 'graph with content and structure' example

Martin Thoma 11 سال پیش
والد
کامیت
abf2a07708

+ 35 - 0
tikz/graph-content-and-structure/Makefile

@@ -0,0 +1,35 @@
+SOURCE = graph-content-and-structure
+DELAY = 80
+DENSITY = 300
+WIDTH = 512
+
+make:
+	pdflatex $(SOURCE).tex -output-format=pdf
+	make clean
+
+clean:
+	rm -rf  $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
+
+gif:
+	pdfcrop $(SOURCE).pdf
+	convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
+	make clean
+
+png:
+	make
+	make svg
+	inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
+
+transparentGif:
+	convert $(SOURCE).pdf -transparent white result.gif
+	make clean
+
+svg:
+	make
+	#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
+	pdf2svg $(SOURCE).pdf $(SOURCE).svg
+	# Necessary, as pdf2svg does not always create valid svgs:
+	inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
+	rsvg-convert -a -w $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg
+	inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg
+	rm $(SOURCE)2.svg

+ 3 - 0
tikz/graph-content-and-structure/README.md

@@ -0,0 +1,3 @@
+Compiled example
+----------------
+![Example](graph-content-and-structure.png)

BIN
tikz/graph-content-and-structure/graph-content-and-structure.png


+ 42 - 0
tikz/graph-content-and-structure/graph-content-and-structure.tex

@@ -0,0 +1,42 @@
+\documentclass[varwidth=true, border=2pt]{standalone}
+\usepackage{tikz}
+
+\begin{document}
+\tikzstyle{vertex}=[draw,black,circle,minimum size=10pt,inner sep=0pt]
+\tikzstyle{edge}=[very thick]
+\begin{tikzpicture}[scale=1.3]
+    \node (a)[vertex] at (0,0) {};
+    \node (b)[vertex]  at (0,1) {};
+    \node (c)[vertex] at (0,2) {};
+    \node (d)[vertex] at (1,0) {};
+    \node (e)[vertex]  at (1,1) {};
+    \node (f)[vertex] at (1,2) {};
+    \node (g)[vertex] at (2,0) {};
+    \node (h)[vertex] at (2,1) {};
+    \node (i)[vertex] at (2,2) {};
+
+    \node (x)[vertex] at (4,0) {};
+    \node (y)[vertex] at (4,1) {};
+    \node (z)[vertex] at (4,2) {};
+
+    \draw[edge] (a) -- (d);
+    \draw[edge] (b) -- (d);
+    \draw[edge] (b) -- (c);
+    \draw[edge] (c) -- (d);
+    \draw[edge] (d) -- (e);
+    \draw[edge] (d) edge[bend left] (f);
+    \draw[edge] (d) edge[bend right] (x);
+    \draw[edge] (g) edge (x);
+    \draw[edge] (h) edge (x);
+    \draw[edge] (h) edge (y);
+    \draw[edge] (h) edge (e);
+    \draw[edge] (e) edge (z);
+    \draw[edge] (i) edge (y);
+
+    \draw [dashed] (-0.3,-0.3) rectangle (2.3,2.3);
+    \draw [dashed] (2.5,2.3) rectangle (5, -0.3);
+
+    \node (struktur)[label={[label distance=0cm]0:Sturkturknoten}] at (-0.1,2.5) {};
+    \node (struktur)[label={[label distance=0cm]0:Wortknoten}] at (2.7,2.5) {};
+\end{tikzpicture}
+\end{document}