After compiling the code for a tree diagram, some parts of the right hand side of the tree got cut off. I've already used \centering function but this does not fix the problem.I'm not sure how to fix it. Thanks guys
\documentclass[a4paper,landscape] {article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows,automata,calc,shapes,backgrounds}
\usepackage{amsmath, amssymb}
\tikzset{
treenode/.style = {align=center, inner sep=0pt, text centered,
font=\sffamily},
arn/.style = {treenode, circle, black, font=\sffamily\bfseries, draw=black,
fill=white, text width=4.1ex},
arnrec/.style = {treenode, rectangle, black, font=\sffamily\bfseries, draw=black,
fill=white, text width=7.5ex,minimum width=4.0ex, minimum height=4.0ex},
arnsmall/.style = {treenode, circle, black, font=\sffamily\bfseries, draw=black,
fill=white, text width=1.5ex},
}
\begin{document}
\centering
\tiny %font size
\begin{tikzpicture}[shorten >=1pt,scale=0.85]
\node [sibling distance=10mm,level distance = 0.5cm] [arn] {start}
child{[sibling distance=6.5cm,level distance = 3cm] node [arn] {249}
child{ [sibling distance=2.0cm, level distance = 2cm] node [arn] {281}
child{ [sibling distance=2cm] node [arn] {290}
child{[] node [arnrec] {z=312}
edge from parent node[below]
{$x_{34}=1$}
}
child{[] node [arnrec] {z=301}
edge from parent node[below]
{$x_{35}=1$}
}
edge from parent node[above]
{$x_{21}=1$} %label
}
child{ [sibling distance=2cm] node [arn] {301}
edge from parent node[above]
{$x_{23}=1$} %label
}
child{ [sibling distance=3cm] node [arn] {312}
edge from parent node[above]
{$x_{24}=1$} %label
}
edge from parent node[above left]
{$x_{12}=1$} %label
}
child{ [sibling distance=3cm,level distance = 2cm] node [arn] {249}
child{ [black, sibling distance=2cm] node [arn] {267}
child{[] node [arnrec] {z=312}
edge from parent node[below]
{$x_{34}=1$}
}
child{[] node [arnrec] {z=301}
edge from parent node[below]
{$x_{35}=1$}
}
edge from parent node[above]
{$x_{21}=1$} %label
}
child{ [sibling distance=2cm] node [arn] {276}
child{[] node [arnrec] {z=299}
edge from parent node[below]
{$x_{32}=1$}
}
child{[] node [arnrec] {z=325}
edge from parent node[below]
{$x_{35}=1$}
}
edge from parent node[above]
{$x_{24}=1$} %label
}
child{ [black, sibling distance=3cm] node [arn] {289}
edge from parent node[above]
{$x_{25}=1$} %label
}
edge from parent node[above]
{$x_{13}=1$} %label
}
child{ [sibling distance=2cm, level distance=2cm] node [arn] {287}
child{ [sibling distance=2cm] node [arn] {290}
edge from parent node[above]
{$x_{21}=1$} %label
}
child{ [sibling distance=2cm] node [arn] {301}
child{[] node [arnrec] {z=299}
edge from parent node[below]
{$x_{32}=1$}
}
child{[] node [arnrec] {z=325}
edge from parent node[below]
{$x_{35}=1$}
}
edge from parent node[above]
{$x_{23}=1$} %label
}
child{ [sibling distance=3cm] node [arn] {312}
edge from parent node[above]
{$x_{24}=1$} %label
}
edge from parent node[above]
{$x_{14}=1$} %label
}
child{ [sibling distance=3cm, level distance = 2cm] node [arn] {278}
child{ [sibling distance=2cm] node [arn] {296}
child{[] node [arnrec] {z=312}
edge from parent node[below]
{$x_{34}=1$}
}
child{[] node [arnrec] {z=301}
edge from parent node[below]
{$x_{35}=1$}
}
edge from parent node[above]
{$x_{21}=1$} %label
}
child{ [sibling distance=2cm] node [arn] {294}
child{[] node [arnrec] {z=299}
edge from parent node[below]
{$x_{32}=1$}
}
child{[] node [arnrec] {z=325}
edge from parent node[below]
{$x_{35}=1$}
}
edge from parent node[above]
{$x_{23}=1$} %label
}
child{ [sibling distance=2cm] node [arn] {298}
child{[] node [arnrec] {z=299}
edge from parent node[below]
{$x_{32}=1$}
}
child{[] node [arnrec] {z=325}
edge from parent node[below]
{$x_{35}=1$}
}
edge from parent node[above]
{$x_{24}=1$} %label
}
edge from parent node[above right]
{$x_{15}=1$} %label
}
edge from parent node[above right]
{} %label
}
;
\end{tikzpicture}
\end{document}
standalone
document class and it'll make sure the image fits... on a page the clips to the size of the image. What do you want exactly? Do you want to maintain thelandscape
,a4paper
size?