[pstricks] pst-pdf and pst-tree

Herbert Voss LaTeX at zedat.fu-berlin.de
Mon Aug 7 22:20:59 CEST 2006


Bernhard Walle wrote:

> when I run the example http://tug.org/PSTricks/pst-tree/tree14.tex
> through ps4pdf, I get a wrong result: the tree on the lest is shown
> but the text on the right is *missing*.
> 
> Does anybody have a solution for this problem? Thanks!

try the following one.

Herbert


\documentclass[12pt,a4paper]{article}% Walter Schmidt
\usepackage[T1]{fontenc}\usepackage{textcomp}
\usepackage{mathpazo}
\usepackage{courier}
\usepackage{geometry,url,ngerman}
\usepackage{pst-pdf}
\parindent0pt
\pagestyle{empty}

\usepackage{pstricks,pst-node}
\newcounter{leaves}
\newcounter{directories}

\newenvironment{directory}[2][\linewidth]{%
\setcounter{leaves}{0}%
\addtocounter{directories}{1}
\edef\directoryname{D\thedirectories}
\begin{minipage}[t]{#1}% <-------- !!!
   \setlength{\parindent}{\linewidth}
   \addtolength{\parindent}{-\dirshrink\parindent}
   \parskip0pt%
   \noindent
   \Rnode[href=-\dirshrink]{\directoryname}{\parbox[t]{#1}{#2}}%
   \par
}
{\end{minipage}}

\newcommand{\file}[2][]{%
   \addtocounter{leaves}{1}%
   \edef\leaflabel{L\theleaves\directoryname}%
   \par
   \Rnode{\leaflabel}{\parbox[t]{\dirshrink\linewidth}{#2\hfill#1}}%
   \ncangle[angleA=270,angleB=180,armB=0,nodesep=1pt]
     {\directoryname}{\leaflabel}%
   % \typeout{\directoryname,\leaflabel}% Debugging
\par}

\newcommand{\dirshrink}{.9}

\PreviewEnvironment{directory}

\begin{document}

\def\url#1{#1}

\begin{directory}{\url{fontinst}}
\file{\begin{directory}{\url{doc/}}
   \file{\begin{directory}{\url{manual/}}
     \file[ auxiliary file]{\url{fontinst.aux}}
     \file{\url{fontinst.log}}
     \file{\url{fontinst.pdf}}
     \file{\url{fontinst.tex}}
     \file[ table of contents ]{\url{fontinst.toc}}
     \file{\url{intro98.tex }}
     \file{\url{ltxguide.cfg}}
     \file{\url{roadmap.eps }}
   \end{directory}}
\file{\url{encspecs.zip }}
\end{directory}}
\file{\url{examples.zip }}
\file{\url{inputs.zip   }}
\file{\url{latex.zip    }}
\file{\url{README       }}
\file{\url{source.zip   }}
\file{\url{test.zip     }}
\end{directory}

\end{document}





More information about the PSTricks mailing list