1

enter image description here

This is a tree that I made by following code:

\begin{tikzpicture}[sibling distance=7em,
  every node/.style = {shape=rectangle, rounded corners,
    draw,
    top color=white, bottom color=blue!20}]]
  \node {$ C_{i} $}
    child { node {$ q_{1}k_{1} $} 
    child{node{$q_{2}k_{2} $}}
     child{node{$\cdots$}}
         child{node{$q_{2}k_{2}+(k_{2}-1) $}}}
    child { node {$ \cdots$} }
    child { node {$ q_{1}k_{1} +(k_{1}-1)$} 
    child{node{$q_{2}k_{2} $}}
     child{node{$\cdots$}}
         child{node{$q_{2}k_{2}+(k_{2}-1) $}}}
;
\end{tikzpicture}

As you can see two branch collapse and I wanna make the tree wider to make it nicer.

1

I agree with Alan Munn that you might want to switch to forest. Here are two variations that may illustrate some of its options.

\documentclass{article}
\usepackage[edges]{forest}

\begin{document}
\begin{forest}
for tree={shape=rectangle, rounded corners,calign=child,calign primary child=2,
    draw, top color=white, bottom color=blue!20,math content}
[C_{i}
 [q_{1}k_{1}
  [q_{2}k_{2}]
  [\cdots]
  [{q_{2}k_{2}+(k_{2}-1)}]
 ] 
 [\cdots[,phantom]]
 [{q_{2}k_{2}+(k_{2}-1)}
  [q_{2}k_{2}]
  [\cdots]
  [{q_{2}k_{2}+(k_{2}-1)}]
 ] 
]   
\end{forest}

or 

\tikzset{cbox/.style={shape=rectangle, rounded corners,
    draw, top color=white, bottom color=blue!20},
    none/.style={draw=none,shade=none},
    Dotted/.style={% https://tex.stackexchange.com/a/52856/194703
    dash pattern=on 0.1pt off 2mm,line cap=round,line width = 2pt,
    shorten <=2.5mm,shorten >=2.5mm}}
\begin{forest}
for tree={math content,calign=child,calign primary child=2,cbox}
[C_{i}
 [q_{1}k_{1},alias=left1
  [q_{2}k_{2},alias=left2]
  [,phantom]
  [{q_{2}k_{2}+(k_{2}-1)},alias=right2]
 ] 
 [,phantom[,phantom]]
 [{q_{2}k_{2}+(k_{2}-1)},alias=right1
  [{q_{2}k_{2}+(k_{2}-1)},alias=left3]
  [,phantom]
  [q_{2}k_{2},alias=right3]
 ] 
]   
\foreach \X in {1,2,3}  {\draw[Dotted](left\X.east) -- (right\X.west);}
\end{forest}
\end{document}

enter image description here

| improve this answer | |
  • Your second tree makes little sense, I think. The ellipses in the OPs example surely represent nodes with unspecified content rather than some connection between nodes. – Alan Munn Dec 23 '19 at 17:08
  • I used forest but now there is another problem. it doesn't fit in the paper – user9272398 Dec 23 '19 at 17:22
  • @user9272398 Could you please add the document class and its settings to your question such that one knows how much tree fits on a page. That is, please promote your example to a complete minimal document. – user194703 Dec 23 '19 at 17:33
  • please see tex.stackexchange.com/questions/521594/… – user9272398 Dec 23 '19 at 17:39
  • @user9272398 I think that this question is hard to answer without the full code that produces the tree. – user194703 Dec 23 '19 at 18:09

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