
He usado el paquete qtree para escribir el siguiente árbol:
\Tree[.F [.F[0] [.F[0][0] {[x, y, z]} ]
[.F[0][1] {[x, y, z]} ]
{\ldots}
[.F[0][m-1] {[x, y, z]} ]]
[.F[1] {\ldots} ]
{\ldots}
[.F[n-1] {\ldots} ]]
Sin embargo, cuando agregué otro subárbol a F[n-1], el árbol superó el margen. ¿Cómo puedo reducir el espacio entre los nodos bajo F para evitar esto?
Respuesta1
Con el uso del paquete forest
, puedes ajustar fácilmente las distancias entre los nodos del árbol:
\documentclass{article}
\usepackage{geometry}
\usepackage{forest}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{center}
\begin{forest}
for tree = {font=\small,
s sep=1mm, % <---
l sep=3mm % <---
}
%
[F
[{F[0]},fit=band
[{F[0][0]}
[{[x, y, z]}]
]
[{F[0][1]}
[{[x, y, z]}]
]
[\ldots]
[{F[0][m-1]}
[{[x, y, z]} ]
]
]
[{F[1]},fit=band
[{\ldots}]
]
[\ldots]
[{F[n-1]},fit=band
[{F[n-1][0]}
[{[x, y, z]}]
]
[{F[n-1][1]}
[{[x, y, z]}]
]
[\ldots]
[{F[n-1][m-1]}
[{[x, y, z]} ]
]
]
]
\end{forest}
\end{center}
\end{document}
(las líneas rojas presentan bordes de texto)