Okay, my goal is to make a diagram like this in LaTeX:
With the difference, that I want where you see dots
or dots2
, I want to have $\ldots$
displayed. I'm trying to get that working using the tkz-graph package. My only experience with tikz is that package, so therefore I'm trying to do this in that way. I know that I can use \Vertices{line}{0,1,dots,i,i+1,dots2}
to get all the vertices in a line, but I don't know how to get a vertex with math inside. I tried \Vertices{line}{0,1,$\ldots$,i,i+1,dots2}
but that wont work.
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, amssymb, amsthm}
\usepackage{tkz-graph}
\tikzset{EdgeStyle/.append style = {->}}
\tikzset{LabelStyle/.style= {draw,
fill = white,
text = black}}
\begin{document}
\begin{tikzpicture}
\SetGraphUnit{2}
\Vertices{line}{0,1,dots,i,i+1,dots2}
\Edge[label=q](1)(0)
\tikzset{EdgeStyle/.append style = {bend left}}
\Edge[label=p](1)(dots)
\Edge[label=q](dots)(1)
\Edge[label=p](dots)(i)
\Edge[label=q](i)(dots)
\Edge[label=p](i)(i+1)
\Edge[label=q](i+1)(i)
\Edge[label=p](i+1)(dots2)
\Edge[label=q](dots2)(i+1)
\end{tikzpicture}
\end{document}
Best Answer
You can use
Math
option. But this can't be mixed with other vertices which are not having math content. Hence we have to split the entire line and usex
andy
values to position them properly:Full code: