\documentclass{book}
\usepackage{tikz}
\usetikzlibrary{trees,positioning,fit}
\begin{document}
$$
\begin{tikzpicture}[sloped]
\node (a) at ( 0,0) [bag] {$C(0, 1)$\\\vspace{5pt}$S(0, 1)$};
\node (b1) at ( 4,1.5) [bag] {$C(\Delta t, 1)$\\\vspace{5pt}$S(\Delta t, 1)$};
\node (b2) at ( 4,-1.5) [bag] {$C(\Delta t, 2)$\\\vspace{5pt}$S(\Delta t, 2)$};
\node (c1) at ( 8,3) [bag] {$C(2\Delta t, 1)$\\\vspace{5pt}$S(2\Delta t, 1)$};
\node (c2) at ( 8,0) [bag] {$C(2\Delta t, 2)$\\\vspace{5pt}$S(2\Delta t, 2)$};
\node (c3) at ( 8,-3) [bag] {$C(2\Delta t, 3)$\\\vspace{5pt}$S(2\Delta t, 3)$};
\draw [->] (a) to node [above]{} (b1);
\draw [->] (a) to node [below]{} (b2);
\draw [->] (b1) to node [above]{} (c1);
\draw [->] (b1) to node [above]{} (c2);
\draw [->] (b2) to node [above]{} (c2);
\draw [->] (b2) to node [above]{} (c3);
\end{tikzpicture}
$$
$$
\begin{tikzpicture}[sloped]
\node (a) at ( 0,0) [bag] {$j\Delta S$};
\node (b1) at ( 3,2) [bag] {$(j-1)\Delta S$};
\node (b2) at ( 3,0) [bag] {$j\Delta S$};
\node (b3) at ( 3,-2) [bag] {$(j+1)\Delta S$};
\draw [->] (a) to node [above] {$p$} (b1);
\draw [->] (a) to node [above] {$1-p-q$} (b2);
\draw [->] (a) to node [below] {$q$} (b3);
\end{tikzpicture}
$$
\end{document}
The pictures are shown below. There are three problems:
In the first picture, arrows overlap the formula in the middle.
To spread the first line and second line in the formula, I use very naive way
$C(\Delta t, 2)$\\\vspace{5pt}$S(\Delta t, 2)$,is there any effective way?In the second picture, why the formula
$(j-1)\Delta S$automatically change the line.




bagstyle. And unrelated comment: Why is\[ … \]preferable to$$? – Torbjørn T. Sep 07 '17 at 10:10bagstyle includes atext widthsetting that is too narrow, so that the longer nodes in the second diagram are broken across two lines. – Torbjørn T. Sep 07 '17 at 10:13bagstyle here? – A.Oreo Sep 07 '17 at 10:21