![Ti*k*Z,自动机:改变初始状态的装饰?](https://linux22.com/image/408506/Ti*k*Z%EF%BC%8C%E8%87%AA%E5%8A%A8%E6%9C%BA%EF%BC%9A%E6%94%B9%E5%8F%98%E5%88%9D%E5%A7%8B%E7%8A%B6%E6%80%81%E7%9A%84%E8%A3%85%E9%A5%B0%EF%BC%9F.png)
我偏爱用指向状态的“>”(稍大一些)来标记自动机的初始状态。我发现“初始 -->”很让人分心。有什么方法可以更改默认值吗?
答案1
您可以减少initial distance
并用来arrows.meta
添加较大的箭头。
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{automata,arrows.meta}
\begin{document}
\begin{tikzpicture}[
every initial by arrow/.style={-{Straight Barb[length=5pt,width=6pt]}},
initial distance=0.01cm,initial text={}]
\node[state,initial] {$q_0$};
\end{tikzpicture}
\end{document}
答案2
这可能会让您感兴趣——来自 pgf 手册第 646 页的 decoration.markings 章节——
链接-->http://ctan.imsc.res.in/graphics/pgf/base/doc/pgfmanual.pdf
位置和颜色可以根据您的选择进行调整 - 这只是草稿
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata, decorations.shapes, shapes.geometric}
\begin{document}
\begin{tikzpicture}[>=latex, decoration={shape= isosceles triangle, shape
width=0.65cm, shape height=0.45cm,shape sep=0.75cm,shape backgrounds}]
\node[state] (q_0) {$q_0$};
\draw[decorate, fill=red] (-2cm,0)-- node[above]{start} (q_0);
\draw [decorate, fill=red](1,0);
\end{tikzpicture}
\end{document}
答案3
设置every initial by arrow
样式并修复scale
和line width
选项。
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{automata, arrows.meta, positioning}
\begin{document}
\begin{tikzpicture}[initial text = {}, initial distance = {0.01mm},
every initial by arrow/.style = { -{To[scale=2.0, line width=0.7pt]} }]
%
\node (q0) [state, accepting, initial] {$q_{0}$};
%
\end{tikzpicture}
\end{document}
看PGF/TikZ 手册了解更多箭头提示。