Graphics, Figures & Tablespstricks & xdvi

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
jamesm
Posts: 13
Joined: Sun Aug 09, 2009 5:01 pm

pstricks & xdvi

Post by jamesm »

I use emacs/auctex and xdvi (or rather xdvik) to process and view my LaTeX files. And I often use pstricks for figures. So far so good. And xdvi produces good figures.

However, if I use include the pst-plot package then xdvi has problems placing text in figures.

A minimal example:

Code: Select all

\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-plot}

\begin{document}
\begin{pspicture}(0,0)(2,2)
\psline(0,0)(2,2)
\cput(1,1){Hello}
\end{pspicture}

\end{document}
The circle from \cput is placed in the correct place, but "Hello" is put at the bottom of the figure. However, when I comment out the package pst-plot then the text is put in the correct place. Once I process the file with dvips -> ps2pdf then everything is ok.

The same thing happens with pst-poly or pst-node (I haven't tried any others).

Anyone have any ideas how to resolve this, or should I report it as a bug? And is it a bug with pst-plot etc, or with xdvi?

Thanks
James

This happens on both Mac OSX 10.6.8 and Linux KUbuntu 13.04

EDIT:
If I write
\cput(1,1){\psline(0,0)(1,0)}
(or \rput) it works fine. So it's an issue with placing text.
Last edited by cgnieder on Sun Jun 23, 2013 10:45 am, edited 1 time in total.

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
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pstricks & xdvi

Post by localghost »

The DVI file format is an intermediate format and not intended for viewing. Most viewers can't display it correctly. Convert your DVI file to PS (and perhaps to PDF) and view this output.

In case of PSTricks you can try packages like auto-pst-pdf or pdftricks2 to allow PSTricks code directly with PDFLaTeX.


Thorsten
jamesm
Posts: 13
Joined: Sun Aug 09, 2009 5:01 pm

Re: pstricks & xdvi

Post by jamesm »

Thorsten, thanks for your reply.

I know DVI is intermediate, and I run dvips and ps2pdf to produce the final oputput. That's fine. And works well. But I'm very happy with using auctex with xdvik and its inverse search - it's just a small issue in the scheme of things.

But anyway, just saying that one shouldn't expect it of xdvi is a bit lame - it uses postscript to render the images, and there's obviously a problem with placing text, so why not try and improve it?

James
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pstricks & xdvi

Post by localghost »

[…] I know DVI is intermediate, and I run dvips and ps2pdf to produce the final oputput. That's fine. And works well. But I'm very happy with using auctex with xdvik and its inverse search - it's just a small issue in the scheme of things. […]
Have you ever heard of the SyncTeX technology? It achieves the same for PDF as the inverse search function does for DVI. PDFLaTeX must be called with the -synctex command line option. And of course the used viewer must support this, too.
jamesm wrote:[…] But anyway, just saying that one shouldn't expect it of xdvi is a bit lame - it uses postscript to render the images, and there's obviously a problem with placing text, so why not try and improve it? […]
What do you expect us to say? XDVI is not the only viewer with problems in this regard. Every other viewer I know doesn't perform better.

But this forum is not the right place to ask for improvements. We discuss LaTeX as such, not the development and bug fixing of software.
jamesm
Posts: 13
Joined: Sun Aug 09, 2009 5:01 pm

pstricks & xdvi

Post by jamesm »

Thanks for your response. That's me told!

I suppose I was looking for some agreement that this was a problem. But anyway, I'll think about contacting the xdvi(k) developers.

As for pdftricks2, how does one pass the colour options? I use

Code: Select all

\usepackage[svgnames]{pstricks}
Thanks again
James
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pstricks & xdvi

Post by localghost »

jamesm wrote:[…] As for pdftricks2, how does one pass the colour options? I use

Code: Select all

\usepackage[svgnames]{pstricks}
[…]
What about just reading Section 3 of the pdftricks2 manual?
Post Reply