wie kann man den Baum breiter machen?

wie kann man den Baum breiter machen?

Bildbeschreibung hier eingeben

Dies ist ein Baum, den ich mit folgendem Code erstellt habe:

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

Wie Sie sehen, brechen zwei Äste zusammen und ich möchte den Baum breiter machen, damit er schöner aussieht.

Antwort1

Ich stimme mit Alan Munn überein, dass Sie vielleicht zu wechseln möchten forest. Hier sind zwei Varianten, die einige der Optionen veranschaulichen.

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

Bildbeschreibung hier eingeben

verwandte Informationen