
Considere o seguinte 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 que essas duas setas diferem uma da outra apesar de terem as mesmas opções?
Responder1
Experimente o seguinte:
\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}
Eu defino setas e estilos de borda no preâmbulo da imagem. Também otimizo seu código: introduzo a biblioteca TikZ quotes
para uma rotulagem mais simples de caminhos. O resultado é:
Responder2
Você pode desenhá-lo pelo código a seguir, como noManual do 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}
que dá: