Creating diagrams for latex
What is Dia?
Quote: " ia is inspired by the commercial Windows program 'Visio', though more geared towards informal diagrams for casual use. It can be used to draw many different kinds of diagrams. It currently has special objects to help draw entity relationship diagrams, UML diagrams, flowcharts, network diagrams, and many other diagrams. It is also possible to add support for new shapes by writing simple XML files, using a subset of SVG to draw the shape.
It can load and save diagrams to a custom XML format (gzipped by default, to save space), can export diagrams to a number of formats, including EPS, SVG, XFIG, WMF and PNG, and can print diagrams (including ones that span multiple pages)."
Installation
sudo apt-get install dia
This will install the packages dia-common dia-libs
Tip: For a better gnome implementation you could install gnome-dia
Start working with dia
- Open a new Diagram file with the action File->New
- Press F9 or walk trough File-Sheets and objects
- Drag object from the Diagram Editor window and drop them in to you digram file.
Exercise:
- Create a network diagram
Choose some objects from Cisco -Computer, Cisco Network, Cisco Switch
Export to latexClick the right button and choose File-> Export->Export options ->Determine file type-> LaTeX PGF macros (*.tex)" (pfg is the Tex portable graphic format).
Tip: Save it e.g. as mydiagram.tex in the same directory as the tex document you want to work with.
Using the diagram with latex
Now you can open your main document with Kile (or just create a new one with the quick wizard) and load the diagram. For this reason you just need the package tikz and the control sequence input.
- Example:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\input{mydiagram}
\end{document}
Note: As you see you do not need to put the *.tex suffix for mydiagram
Now you could make some further documentation. Then you can save the main tex document and create a pdf file. That's all.
For more Details about LaTeX PGF macros consult the vast pgf manual under
/usr/share/doc/texmf/pgf