mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-26 06:48:04 +02:00
added 'graph with content and structure' example
This commit is contained in:
parent
3f6160ddaf
commit
abf2a07708
4 changed files with 80 additions and 0 deletions
35
tikz/graph-content-and-structure/Makefile
Normal file
35
tikz/graph-content-and-structure/Makefile
Normal file
|
@ -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
tikz/graph-content-and-structure/README.md
Normal file
3
tikz/graph-content-and-structure/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
Compiled example
|
||||
----------------
|
||||

|
BIN
tikz/graph-content-and-structure/graph-content-and-structure.png
Normal file
BIN
tikz/graph-content-and-structure/graph-content-and-structure.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
|
@ -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}
|
Loading…
Add table
Add a link
Reference in a new issue