conflict with pst-tree and align: auto-pst-pdf problems?

There appears to be a problem when using the pst-tree package together with the align environment and pdflatex (dvi-ps-pdf works, but there are reasons for me not to use it). Attached is a code example using the equation environment, leading to the correct result. When changing in both equations to \begin{align} the second equation shows the same picture as the first equation. This is definitely not correct.

Note that upon typesetting I get the message:

Package pst-pdf Warning: test_tree-pics.pdf' contains 4 pages
(pst-pdf)                but 2 pages are requested:
(pst-pdf)                File test_tree-pics.pdf' is no more valid!
(pst-pdf)                Recreate it .
[1
Non-PDF special ignored!
Non-PDF special ignored!
Non-PDF special ignored!


The file test_tree-pics.pdf appears to contains both figures twice.

Does anybody have suggestions? Is this a bug?

\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage[pdf]{pstricks}
\usepackage{pst-tree}

\newcommand{\TreeSpace}{0.7cm}
\newcommand{\RadiusMeagre}{3pt}
\newcommand{\RadiusFat}{5pt}

\begin{document}

$$\ddot{u} = \pstree[treemode=U,levelsep=\TreeSpace,radius=\RadiusMeagre]{\Tc*{\RadiusMeagre}}{\TC *} \,\,$$
$$\dot{p} = \pstree[treemode=U,levelsep=\TreeSpace,radius=\RadiusMeagre]{\Tc{\RadiusFat}}{\TC* \TC*}$$

\end{document}

-
hi Herbert, thanks for your quick response. unfortunately the error remains. –  Benjamin Sanderse Nov 8 '12 at 9:16

1 Answer

this should work:

\listfiles
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{pst-tree}
\usepackage{auto-pst-pdf}
\PreviewEnvironment{align*}%% Make it known to preview

\newcommand{\TreeSpace}{0.7cm}
\newcommand{\RadiusMeagre}{3pt}
\newcommand{\RadiusFat}{5pt}

\begin{document}

\begin{align*}
\ddot{u} = \pstree[treemode=U,levelsep=\TreeSpace,radius=\RadiusMeagre]{\Tc*{\RadiusMeagre}}{\TC *} \,\,
\end{align*}

\begin{align*}
\dot{p} = \pstree[treemode=U,levelsep=\TreeSpace,radius=\RadiusMeagre]{\Tc{\RadiusFat}}{\TC* \TC*}
\end{align*}

\end{document}


The equation environment is known by default but align*not.

[...]
\begin{center}
$\ddot{u} = \pstree[treemode=U,levelsep=\TreeSpace,radius=\RadiusMeagre]{\Tc*{\RadiusMeagre}}{\TC *} \,\,$

$\dot{p} = \pstree[treemode=U,levelsep=\TreeSpace,radius=\RadiusMeagre]{\Tc{\RadiusFat}}{\TC* \TC*}$
\end{center}
[...]

-
The pictures are correct, but there are no 'returns' present after the equations... so they are all on one line now (even when I put text inbetween). –  Benjamin Sanderse Nov 8 '12 at 9:25
add an empty line between the environments –  Herbert Nov 8 '12 at 9:28
hmm, it is still strange. now the equation numbers do not align anymore (I use align instead of align*). –  Benjamin Sanderse Nov 8 '12 at 9:31
that is a problem with the previewpackage. You can use {\raggedleft ...}. However, why can't you use simply xelatex and everything will be fine, without loading auto-pst-pdf –  Herbert Nov 8 '12 at 9:33
ok, I didn't try that. I am not sure if it works with the classic thesis style that I use, and if it works in Texshop. –  Benjamin Sanderse Nov 8 '12 at 9:39