0

I'm partial to marking the initial state of my automata with a '>' (somewhat larger) pointing at the state. I find the "initial -->" distracting. Is there any way to change the default?

2

You can just decrease the initial distance and use arrows.meta to add a largish arrow.

\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}

enter image description here

1
  • Fooling around before seeing your answer I came to essentially the same solution. Thanks!
    – vonbrand
    Feb 23 '20 at 0:15
1

This may interest you -- from the pgf manual chapter on decoration.markings at page 646 --

link--> http://ctan.imsc.res.in/graphics/pgf/base/doc/pgfmanual.pdf

enter image description here

Position and color can be adjusted as per your choice -- this is only a rough draft

enter image description here

\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.