这是我的 tikz 代码:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,shapes.geometric,arrows,fit,calc,positioning,automata,}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}[shorten >=1pt,auto,node distance=5 cm, scale = 0.5, transform shape]
\node[initial,state] (A) {$q_0$};
\node[state] (B) [right of=A,node distance=3 cm] {$q_1$};
\node[state] (C) [right of=B,node distance = 6.5 cm] {$q_2$};
\node[state] (D) [below right of=B] {$q_3$};
\node[state] (E) [below right of=D] {$q_5$};
\node[state] (F) [below left of=D] {$q_4$};
\path[->] (A) edge [above] node [align=center] {a} (B)
(B) edge [loop above] node [align=center] {a} (B)
edge [bend right,below] node [align=center] {b} (C)
edge [left] node [align=center] {a} (D)
(C) edge [loop above] node [align=center] {b} (C)
edge [bend right,right] node [above,align=center] {a} (B)
edge [right] node [align=center] {a} (D)
(D) edge [bend left,right] node [align=center] {d} (E)
edge [bend right,left] node [pos=0.4,align=center] {a} (F)
(E) edge [bend left] node [pos=0.2,align=center] {c} (D)
(F) edge [bend right,above] node [pos=0.6,align=center] {b} (D)
edge [bend left] node [pos=0.7,align=center] {a} (A);
\end{tikzpicture}
\end{document}
输出是:
我想增加边缘处的字体大小。该怎么做?
答案1
font=\Large
例如,您可以使用选项来增加尺寸。如果您将其应用于tikzpicture
选项,则所有文本都将变为大小\Large
。如果您只希望将其应用于,edges
则可以将此选项添加到 o edge
,可以手动按每个边缘添加,也可以使用:
\tikzset{every edge/.append style={font=\Large}}