Graphics, Figures & TablesPS-Tree Problem

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

PS-Tree Problem

Post by coachbennett1981 »

I am working with this expression tree in Discrete Math. I am having trouble because of the location of the values of each number.

Code: Select all


\documentclass[12pt,a4paper]{article}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{pstricks}
\usepackage{pst-tree}
\begin{document}

			\pstree[treenodesize=1,nodesep=2pt]{\Tr{-}}
{\pstree{\Tr{$\div$}}
{\Tr{3}
	\pstree{\Tr{*}}
		{\Tr{9}
			\pstree{\Tr{-}}
				{\Tr{5}\Tr{2}}}}
\pstree{\Tr{$\div$}}
{\Tr{2}
	\pstree{\Tr{*}}
		{\Tr{4}
			\pstree{\Tr{-}}
				{\Tr{6}\Tr{1}}}}}

\end{document}


The right side of the tree is perfect. I would like the 3 and the * to switch orders. So 3 is the leftmost number and not the star.. The branches from the star must stay with the star. 3 should still be alone. I have tried all possible configurations that I can think of and I can't get anything to run properly..

Any help would be appreciated.

Nick
Last edited by coachbennett1981 on Fri Mar 25, 2011 4:41 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

PS-Tree Problem

Post by coachbennett1981 »

After several hours.....

Code: Select all


\pstree[treenodesize=1,nodesep=2pt]{\Tr{-}}
{\pstree{\Tr{/}}{
\pstree{\Tr{*}}{\Tr{9}{
\pstree{\Tr{-}}{\Tr{5}\Tr{2}}}}
\Tr{3}}

{\pstree{\Tr{/}}{
\pstree{\Tr{*}}{\Tr{4}{
\pstree{\Tr{-}}{\Tr{6}\Tr{1}}}}
\Tr{2}}
}}

LaTeX 550

Nick 1
Post Reply