2
\documentclass[preview,border=3pt,varwidth]{standalone}
\usepackage{pst-tree}

\psset{levelsep=2,treesep=-2,angleA=90,angleB=-90,arm=12pt}

\def\psedge#1#2{\ncangle{#2}{#1}}

\begin{document}

\psTree{\Tcircle{36}}
    \Tcircle{2}
    \psTree{\Tcircle{18}}
        \Tcircle{2}
        \psTree{\Tcircle{9}}
            \Tcircle{3}
            \Tcircle{3}
        \endpsTree
    \endpsTree
\endpsTree

\end{document}

The code produces a trimmed output as follows.

enter image description here

How to fix this issue so I can get a correct tight output?

Edit:

For comparison purposes, let's comment some code in the preamble as follows.

\documentclass[border=3pt,preview,varwidth]{standalone}
\usepackage{pst-tree}

%\psset{levelsep=2,treesep=-2,angleA=90,angleB=-90,arm=12pt}
%
%\def\psedge#1#2{\ncangle{#2}{#1}}

\begin{document}

\psTree{\Tcircle{36}}
    \Tcircle{2}
    \psTree{\Tcircle{18}}
        \Tcircle{2}
        \psTree{\Tcircle{9}}
            \Tcircle{3}
            \Tcircle{3}
        \endpsTree
    \endpsTree
\endpsTree

\end{document}

The output looks fine!

enter image description here

0

1 Answer 1

3

Instead of

treesep=-2

use

treesep=2,
treeflip

which mirrors the orientation and calculates the bounding box correct.

Code

\documentclass[preview,border=3pt,varwidth]{standalone}
\usepackage{pst-tree}
\psset{levelsep=2,treesep=2,treeflip,angleA=90,angleB=-90,arm=12pt}
\def\psedge#1#2{\ncangle{#2}{#1}}

\begin{document}

\psTree{\Tcircle{36}}
    \Tcircle{2}
    \psTree{\Tcircle{18}}
        \Tcircle{2}
        \psTree{\Tcircle{9}}
            \Tcircle{3}
            \Tcircle{3}
        \endpsTree
    \endpsTree
\endpsTree

\end{document}

Output

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .