
Considere el siguiente código:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning,automata,arrows.meta}
\begin{document}
\begin{frame}[t]
\begin{tikzpicture}[overlay,remember picture,
every state/.style={ellipse,draw=blue}]
\node[state,xshift=3cm,yshift=-4cm,align=center] (q1) {A};
\node[state,align=center,right=3cm of q1] (q2) {B};
\path[draw=blue!50,very thick,arrows={-
Latex[blue!50]
%Stealth[length=11pt,open,round]
% Computer Modern Rightarrow
}]
(q1) edge [above] node {\small 1} (q2);
\path[draw=blue!50,very thick,arrows={-
Latex[blue!50]
%Stealth[length=8pt,open]
}]
(q1) edge [above,loop] node {\small 0} (q1);
\end{tikzpicture}
\end{frame}
\end{document}
¿Por qué estas dos flechas se diferencian entre sí a pesar de tener las mismas opciones?
Respuesta1
Pruebe lo siguiente:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,automata,quotes,positioning,shapes}
\begin{document}
\begin{frame}
\centering
\begin{tikzpicture}[
node distance=3cm,
>={Latex[blue!50]},
every state/.style={ellipse,draw=blue},
every edge/.style={draw=blue!50,very thick,->},
every loop/.style={min distance=12mm},
auto
]
\node (q1) [state] {A};
\node (q2) [state,right=of q1] {B};
\path (q1) edge ["1"] (q2)
(q1) edge [loop above,"0"] ();
\end{tikzpicture}
\end{frame}
\end{document}
Defino flechas y estilos de borde en el preámbulo de la imagen. También optimizo su código: presento la biblioteca TikZ quotes
para un etiquetado de rutas más simple. El resultado es:
Respuesta2
Puedes dibujarlo con el siguiente código, como en elmanual de tikzpágina 159:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning,automata,arrows.meta}
\begin{document}
\begin{frame}[t]
\begin{tikzpicture}[%
overlay,remember picture,
every state/.style={ellipse,draw=blue},
every loop/.style={to path={..controls..+(-0.3,0.2) .. +(-0.4,0.3).. (\tikztotarget) \tikztonodes}},
every edge/.style={draw=blue!50,very thick,arrows={- Latex[blue!50]}}
]
\node[state] (q1) at (3,-3) {A};
\node[state,right=3cm of q1] (q2) {B};
\path (q1) edge node[above] {\small 1} (q2); %[draw=blue!50,very thick,arrows={- Latex[blue!50] }]
\path (q1) edge [loop above] node[above] {\small 0} (q1); %[draw=blue!50,very thick,arrows={- Latex[blue!50]}]
\end{tikzpicture}
\end{frame}
\end{document}
lo que da: