The icons are available on the cisco website. You can download the zip file containing the EPS files, unzip it into a new directory and remove the spaces in the names (which cause problems when you try to include the icons into your LaTeX document) using the shell command rename 's/ /_/g' *
. You can then include the icons into your document using \includegraphics
if you also load the package epstopdf
.
Here's an example of using TikZ chains to build a diagram:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains}
\usepackage{epstopdf}
\begin{document}
\begin{tikzpicture}[
start chain=going right,
diagram item/.style={
on chain,
join
}
]
\node [
diagram item,
label=center:Internet
] {\includegraphics{cloud}};
\node [
diagram item,
label=right:Cable Modem
] {\includegraphics{cable_modem}};
\node [
continue chain=going below,
diagram item,
label=right:Router
] {\includegraphics{router}};
\node [
diagram item,
label=right:Workgroup Switch
] {\includegraphics{workgroup_switch}};
\node [
start branch=1 going below right,
diagram item,
label=below:PC
] {\includegraphics{pc}};
\node [
start branch=2 going below left,
diagram item,
label=below:Supercomputer
] {\includegraphics{supercomputer}};
\node [
diagram item,
label=below:Office
] {\includegraphics{end_office}};
\end{tikzpicture}
\end{document}
You can add the option ->
to draw the arrows. To add the ellipses, load the shapes.geometric
library, and add
nodes={ellipse,draw,minimum width=<length>}
to the list of options for the \matrix
command. Here, ellipse
causes the node to have an elliptical shape, draw
draws the elliptical border of the node, and minimum width=<length>
specifies the minimal width of the node.
Code
\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,shapes.geometric}
\begin{document}
\begin{tikzpicture}[description/.style={fill=white,inner sep=2pt}]
\matrix (m)[matrix of math nodes,
row sep=3em,column sep=2.5em,
text height=1.5ex, text depth=0.25ex,
nodes={ellipse,draw,minimum width=2cm},
]{
X && Y \\
& V & \\
};
\path[->,font=\scriptsize]
(m-1-1) edge node[auto] {$ f $} (m-1-3)
edge node[description] {$ g \circ f $} (m-2-2)
(m-1-3) edge node[auto] {$ g $} (m-2-2);
\end{tikzpicture}
\end{document}
Output
Upadate
An example that more closely resemble your picture:
Code
\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,positioning,shapes.geometric}
\begin{document}
\begin{tikzpicture}
\tikzset{
elps/.style 2 args={draw,ellipse,minimum width=#1,minimum height=#2},
node distance=3cm,
font=\footnotesize,
>=latex,
}
\node(x)[elps={1.3cm}{1cm},label={below left:$X$}]{};
\node(y)[elps={2cm}{1.2cm},right=of x,label={below left:$Y$}]{};
\node(v)[elps={1.5cm}{.9cm},below right=2cm of x,label={below left:$V$}]{};
\fill[gray!50]($(y.center)-(5pt,5pt)$)circle[x radius=.7cm,y radius=.3cm]coordinate(im);
\node at (im){$\mathrm{im}(f)$};
\draw[->](x)to[bend right]node[above right]{$g\circ f$}(v);
\draw[->](y)to[bend left]node[right]{$g$}(v);
\draw[->](x)to[bend left=20]node[above]{$f$}(y);
\end{tikzpicture}
\end{document}
Output
Best Answer
This is a
forest
solution which involves a little less typing than some other possibilities.The basic idea is to see the diagram as a tree with an invisible root note on the far right. This has two children: the final and the detached third place match. To avoid affecting the main tree, the detached node is drawn after all of the other nodes are typeset and their positions set.
matchnode={<flag-1>}{<team-1>}{<score-1>}{<flag-2>}{<team-2>}{<score-3>}
is a style used to define the tabular content for each match. Each<flag>
should be the name of the image file containing the relevant<team>
's flag.round name={<name>}
is a style used to define the competition stages marked at the top. The title of the third place match is added directly to the relevant node, since this is a one off.The colours are set as
lineblue
,fillblue
andtextblue
. The overall appearance of all nodes is set using thefootnode
style which can be modified as desired. The general shape and thickness of the branches is set usingforest
'sedge
. If you want straight edges, for example, just sayedge={ultra thick}
, removing therounded corners...
specification.EDIT
Here's another version which uses a freeware font to supply the flag symbols, and a colour series to randomly apply colours to them. Instead of specifying the image file of the relevant flag, the first and fourth arguments of the
matchnode
style now specify the relevant character from the freeware font.This solution requires
lualatex
. Note thatxelatex
will NOT work. (And, of course,pdflatex
,latex
etc. won't either as the code requiresfontspec
.)The font I used is 'Flags' by Sunwalk and is available here.