In advance of a summer class I'm teaching, I decided to try compiling my notes, which I haven't touched in any way, shape or fashion for 4-5 months. However, in that interval, I've updated laTeX packages as new updates have come online (using MikTeX 2.9). I have a large number of lectures containing tikzpictures, of the following general form (all of which used to compile perfectly):
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{snakes,shapes,arrows,matrix,positioning}
\begin{document}
\begin{figure}[h]
\centering
\rule[-1.25cm]{0pt}{3.25cm}
\begin{tikzpicture}[>=stealth,->,shorten >=1.5pt,line width=0.75pt]
\matrix (a) [matrix of nodes,row sep=0.5em, column sep=3em]
{ \node[circle,draw,font=\small,minimum width=1cm] {\sffamily{1}}; & \node[circle,draw,font=\small,minimum width=1cm]{\sffamily{2}}; & \node[circle,draw,font=\small,minimum width=1cm] {\sffamily{3}}; \\};
\path[>=stealth,font=\small] (a-1-1) edge node[below] {$S_o$} (a-1-2);
\path[>=stealth,font=\small] (a-1-2) edge node[below] {$S_1$} (a-1-3);
\path[>=stealth,->,font=\small] (a-1-2) edge [bend right=50] node [above,near start] {$S_1F_2$} (a-1-1) ;
\path[>=stealth,->,font=\small] (a-1-3) edge [bend right=55] node [above,near start] {$S_2F_3$} (a-1-1) ;
\end{tikzpicture}
\end{figure}
\end{document}
When I try to compile the preceding MWE, I get all sorts of error messages about 'no shape named a-1-1 is know…' etc. etc.
Which I find odd, because clearly, when it compiled perfectly before, said shape was known. I gather something has changed.
Any insights/pointers to the obvious most appreciated.
Best Answer
Things have changed with
tikz
v3.BTW
\sffamily{1}
is wrong as\sffamily
is a switch. Usefont=\sffamily
as the option to the node instead..Edit:
You can customize each node by putting the attributes in a
\tikzset
. This way you have more control over the individual nodes.This way the styles will be usable across
tikzpictures
.