Document Classespst-node - problem with labels

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
ororo
Posts: 3
Joined: Sun Sep 09, 2007 4:29 pm

pst-node - problem with labels

Post by ororo »

Hello everybody.
I am trying to use pstricks, and in particular pst-node.

All commands work, *but* the commands to position labels on the edges:

\ncline{A}{B} \ncput{label}

creates an edge and then puts the label on the node A, instead then on the edge (A,B). :(
The same happens with \naput, \nbput, \tvput, ...

Somebody has some idea? thanks a lot!

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

pst-node - problem with labels

Post by Stefan Kottwitz »

Hi ororo,

welcome to the LaTeX Community board!
I used those commands similar without problems. Can you give us a minimal working example, that is compilable and shows the problem? Then it would be easier for us to test, to look for the problem and probably to provide specific help.

Stefan
ororo
Posts: 3
Joined: Sun Sep 09, 2007 4:29 pm

Re: pst-node - problem with labels

Post by ororo »

Here is a little example:

\documentclass{article}
\usepackage{pst-node}

\begin{document}

$$\begin{psmatrix}[rowsep=1,colsep=1]
& A & [name=upper] B \\
& [name=lower] C & D
\end{psmatrix}
\ncline{->}{lower}{upper} \naput{label}
$$

\end{document}

I expected the label "label" would appear over the arrow, but it doesn't (see attachment).
Attachments
photo.png
photo.png (3.22 KiB) Viewed 5266 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

pst-node - problem with labels

Post by Stefan Kottwitz »

Hi ororo,

did you convert it to ps and viewed it with a postscript viewer? With dvi you cannot expect the right output. My result:
ps.png
ps.png (1.58 KiB) Viewed 5272 times
Stefan
ororo
Posts: 3
Joined: Sun Sep 09, 2007 4:29 pm

Re: pst-node - problem with labels

Post by ororo »

Thank you Stefan! sorry my problem was really stupid!

So I cannot use pstricks inside a dvi? there is no way to make a dvi?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: pst-node - problem with labels

Post by Stefan Kottwitz »

Hi ororo,

pstricks produces postscript code that will be embedded inside the dvi document. Some dvi-Viewer may show the embedded postscript code, if they can interpret it, like KDVI. You can work with pstricks and dvi, but at the end there should be a conversion to postscript for best results.

Stefan
Post Reply