Graphics, Figures & Tablesproblems with pstricks

Information and discussion about graphics, figures & tables in LaTeX documents.
sagan
Posts: 1
Joined: Tue Jul 13, 2010 10:49 pm

problems with pstricks

Post by sagan »

I am having trouble with pstricks under the two platforms I am using for compilation: texworks and led. Texworks won't recognize basic pstricks commands like psframe although it recognizes begin and end pspicture and something like
\rput(2,3){text}. Led will compile, and the picture shows up fine in the dvi file. But if I convert it to pdf then the picture disappears except for any text which appears but in the wrong place. Unfortunately, my printer refuses to print directly from the dvi file, so I can't get a hard copy either. Any help would be appreciated.

Recommended reading 2024:

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

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

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

problems with pstricks

Post by localghost »

TeXworks is meant to compile directly to PDF. It has no profiles which generate other (intermediate) formats. The reason for that is the built-in PDF viewer so it doesn't make sense to compile to other formats. For this editor try the (auto-)pst-pdf package to make pstricks work with pdflatex. Note the special remarks about compiler options in the manual (keyword: -shell-escape or --enable-write18).

For LEd you should consider to convert to PS first and then further to PDF. The direct conversion from DVI to PDF can cause problems.


Best regards and welcome to the board
Thorsten
User avatar
lanmmt
Posts: 21
Joined: Tue Sep 28, 2010 6:43 pm

Re: problems with pstricks

Post by lanmmt »

I have a similar problem. I don't know much about pstric - I got the code from LaTeXDraw, but it seames to be correct, but when I tried to compile it in LEd (to dvi) I can't see the picture, all I see is text (everything from \rput). I don't have informations about errors. What can be wrong?
Last edited by lanmmt on Sun Oct 03, 2010 10:27 pm, edited 1 time in total.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Re: problems with pstricks

Post by CrazyHorse »

view the PostScript or PDF-Output, not the dvi one.

HErbert
User avatar
lanmmt
Posts: 21
Joined: Tue Sep 28, 2010 6:43 pm

Re: problems with pstricks

Post by lanmmt »

well after dvi to pdf compilation it's the same...
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

problems with pstricks

Post by frabjous »

lanmmt wrote:well after dvi to pdf compilation it's the same...
If you're using pstricks, you need to convert the dvi to a ps (via dvips) and then the ps to a pdf (via ps2pdf).
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

problems with pstricks

Post by CrazyHorse »

lanmmt wrote:well after dvi to pdf compilation it's the same...
give a complete example of your code.

Herbert
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

problems with pstricks

Post by CrazyHorse »

frabjous wrote:
lanmmt wrote:well after dvi to pdf compilation it's the same...
If you're using pstricks, you need to convert the dvi to a ps (via dvips) and then the ps to a pdf (via ps2pdf).
can also be done with dvipdfmx ...

Herbert
User avatar
lanmmt
Posts: 21
Joined: Tue Sep 28, 2010 6:43 pm

problems with pstricks

Post by lanmmt »

If you're using pstricks, you need to convert the dvi to a ps (via dvips) and then the ps to a pdf (via ps2pdf).
well that would explain a lot ^^' - it works, but I'd like to know something more:
can also be done with dvipdfmx
what is this?
give a complete example of your code.
well I'll put only some part of preambule and what I'm trying to compile:

Code: Select all

\documentclass[11pt]{book}
\usepackage[usenames,dvipsnames]{pstricks}
\usepackage{graphicx}
\usepackage{picture}
\usepackage{epsfig}
\usepackage{psfrag}
\usepackage{color}
\usepackage{subfigure}
\usepackage{epsfig}
\usepackage{wrapfig}
//I guess that this are the only packages that are important in this case, oh of cours except 'math fonts' - I've shorted the code, because it was messy...

Code: Select all

\scalebox{1} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-1.1789062)(9.602813,1.1389062)
\psframe[linewidth=0.04,dimen=outer](6.8209376,1.1389062)(0.0409375,-0.62109375)
\psline[linewidth=0.04cm](3.8609376,1.1189063)(3.8609376,-0.62109375)
\usefont{T1}{ptm}{m}{n}
\rput(5.7923436,0.04890625){$U_B$, $V_B$, $N_B$}
\usefont{T1}{ptm}{m}{n}
\rput(1.9123437,0.04890625){$U_A$, $V_A$, $N_A$}
\usefont{T1}{ptm}{m}{n}
\rput(2.9223437,-0.95109373){$\Gamma_A$ -- number of states in $A$}
\usefont{T1}{ptm}{m}{n}
\rput(6.6023436,-0.95109373){$\Gamma_B$ -- number of states in $B$}
\usefont{T1}{ptm}{m}{n}
\rput(0.54234374,0.80890626){$A$}
\usefont{T1}{ptm}{m}{n}
\rput(4.302344,0.82890624){$B$}
\end{pspicture} 
}
and that's the picture I'm trying to compile.

By the way I didn't know I had to look at the ps (compile to ps), I had picture done like:

Code: Select all

\setlength{\unitlength}{0.240900pt}
\ifx\plotpoint\undefined\newsavebox{\plotpoint}\fi
\sbox{\plotpoint}{\rule[-0.200pt]{0.400pt}{0.400pt}}%
\begin{picture}(1500,900)(0,0)
\sbox{\plotpoint}{\rule[-0.200pt]{0.400pt}{0.400pt}}%
\put(211.0,131.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(191,131){\makebox(0,0)[r]{ 0}}
\put(1430.0,131.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(211.0,204.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(191,204){\makebox(0,0)[r]{ 0.1}}
\put(1430.0,204.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(211.0,277.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(191,277){\makebox(0,0)[r]{ 0.2}}
\put(1430.0,277.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(211.0,350.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(191,350){\makebox(0,0)[r]{ 0.3}}
\put(1430.0,350.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(211.0,423.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(191,423){\makebox(0,0)[r]{ 0.4}}
\put(1430.0,423.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(211.0,496.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(191,496){\makebox(0,0)[r]{ 0.5}}
\put(1430.0,496.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(211.0,568.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(191,568){\makebox(0,0)[r]{ 0.6}}
\put(1430.0,568.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(211.0,641.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(191,641){\makebox(0,0)[r]{ 0.7}}
\put(1430.0,641.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(211.0,714.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(191,714){\makebox(0,0)[r]{ 0.8}}
\put(1430.0,714.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(211.0,787.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(191,787){\makebox(0,0)[r]{ 0.9}}
\put(1430.0,787.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(211.0,860.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(191,860){\makebox(0,0)[r]{ 1}}
\put(1430.0,860.0){\rule[-0.200pt]{4.818pt}{0.400pt}}
\put(211.0,131.0){\rule[-0.200pt]{0.400pt}{4.818pt}}
\put(211,90){\makebox(0,0){-10}}
\put(211.0,840.0){\rule[-0.200pt]{0.400pt}{4.818pt}}
\put(521.0,131.0){\rule[-0.200pt]{0.400pt}{4.818pt}}
\put(521,90){\makebox(0,0){-5}}
\put(521.0,840.0){\rule[-0.200pt]{0.400pt}{4.818pt}}
\put(831.0,131.0){\rule[-0.200pt]{0.400pt}{4.818pt}}
\put(831,90){\makebox(0,0){ 0}}
\put(831.0,840.0){\rule[-0.200pt]{0.400pt}{4.818pt}}
\put(1140.0,131.0){\rule[-0.200pt]{0.400pt}{4.818pt}}
\put(1140,90){\makebox(0,0){ 5}}
\put(1140.0,840.0){\rule[-0.200pt]{0.400pt}{4.818pt}}
\put(1450.0,131.0){\rule[-0.200pt]{0.400pt}{4.818pt}}
\put(1450,90){\makebox(0,0){ 10}}
\put(1450.0,840.0){\rule[-0.200pt]{0.400pt}{4.818pt}}
\put(211.0,131.0){\rule[-0.200pt]{0.400pt}{175.616pt}}
\put(211.0,131.0){\rule[-0.200pt]{298.475pt}{0.400pt}}
\put(1450.0,131.0){\rule[-0.200pt]{0.400pt}{175.616pt}}
\put(211.0,860.0){\rule[-0.200pt]{298.475pt}{0.400pt}}
\put(70,495){\makebox(0,0){$y = \cosh x$}}
\put(830,29){\makebox(0,0){$x$}}
\put(1290,820){\makebox(0,0)[r]{$\cosh x$}}
\put(1310.0,820.0){\rule[-0.200pt]{24.090pt}{0.400pt}}
\put(211,131){\usebox{\plotpoint}}
\put(561,130.67){\rule{3.132pt}{0.400pt}}
\multiput(561.00,130.17)(6.500,1.000){2}{\rule{1.566pt}{0.400pt}}
\put(211.0,131.0){\rule[-0.200pt]{84.315pt}{0.400pt}}
\put(586,131.67){\rule{3.132pt}{0.400pt}}
\multiput(586.00,131.17)(6.500,1.000){2}{\rule{1.566pt}{0.400pt}}
\put(574.0,132.0){\rule[-0.200pt]{2.891pt}{0.400pt}}
\put(611,133.17){\rule{2.700pt}{0.400pt}}
\multiput(611.00,132.17)(7.396,2.000){2}{\rule{1.350pt}{0.400pt}}
\put(624,135.17){\rule{2.700pt}{0.400pt}}
\multiput(624.00,134.17)(7.396,2.000){2}{\rule{1.350pt}{0.400pt}}
\put(637,137.17){\rule{2.500pt}{0.400pt}}
\multiput(637.00,136.17)(6.811,2.000){2}{\rule{1.250pt}{0.400pt}}
\multiput(649.00,139.60)(1.797,0.468){5}{\rule{1.400pt}{0.113pt}}
\multiput(649.00,138.17)(10.094,4.000){2}{\rule{0.700pt}{0.400pt}}
\multiput(662.00,143.59)(1.033,0.482){9}{\rule{0.900pt}{0.116pt}}
\multiput(662.00,142.17)(10.132,6.000){2}{\rule{0.450pt}{0.400pt}}
\multiput(674.00,149.59)(0.728,0.489){15}{\rule{0.678pt}{0.118pt}}
\multiput(674.00,148.17)(11.593,9.000){2}{\rule{0.339pt}{0.400pt}}
\multiput(687.58,158.00)(0.492,0.582){21}{\rule{0.119pt}{0.567pt}}
\multiput(686.17,158.00)(12.000,12.824){2}{\rule{0.400pt}{0.283pt}}
\multiput(699.58,172.00)(0.493,0.734){23}{\rule{0.119pt}{0.685pt}}
\multiput(698.17,172.00)(13.000,17.579){2}{\rule{0.400pt}{0.342pt}}
\multiput(712.58,191.00)(0.492,1.186){21}{\rule{0.119pt}{1.033pt}}
\multiput(711.17,191.00)(12.000,25.855){2}{\rule{0.400pt}{0.517pt}}
\multiput(724.58,219.00)(0.493,1.567){23}{\rule{0.119pt}{1.331pt}}
\multiput(723.17,219.00)(13.000,37.238){2}{\rule{0.400pt}{0.665pt}}
\multiput(737.58,259.00)(0.492,2.349){21}{\rule{0.119pt}{1.933pt}}
\multiput(736.17,259.00)(12.000,50.987){2}{\rule{0.400pt}{0.967pt}}
\multiput(749.58,314.00)(0.493,2.915){23}{\rule{0.119pt}{2.377pt}}
\multiput(748.17,314.00)(13.000,69.067){2}{\rule{0.400pt}{1.188pt}}
\multiput(762.58,388.00)(0.492,3.986){21}{\rule{0.119pt}{3.200pt}}
\multiput(761.17,388.00)(12.000,86.358){2}{\rule{0.400pt}{1.600pt}}
\multiput(774.58,481.00)(0.493,4.303){23}{\rule{0.119pt}{3.454pt}}
\multiput(773.17,481.00)(13.000,101.831){2}{\rule{0.400pt}{1.727pt}}
\multiput(787.58,590.00)(0.492,4.804){21}{\rule{0.119pt}{3.833pt}}
\multiput(786.17,590.00)(12.000,104.044){2}{\rule{0.400pt}{1.917pt}}
\multiput(799.58,702.00)(0.493,3.748){23}{\rule{0.119pt}{3.023pt}}
\multiput(798.17,702.00)(13.000,88.725){2}{\rule{0.400pt}{1.512pt}}
\multiput(812.58,797.00)(0.492,2.392){21}{\rule{0.119pt}{1.967pt}}
\multiput(811.17,797.00)(12.000,51.918){2}{\rule{0.400pt}{0.983pt}}
\put(599.0,133.0){\rule[-0.200pt]{2.891pt}{0.400pt}}
\multiput(837.58,844.84)(0.492,-2.392){21}{\rule{0.119pt}{1.967pt}}
\multiput(836.17,848.92)(12.000,-51.918){2}{\rule{0.400pt}{0.983pt}}
\multiput(849.58,784.45)(0.493,-3.748){23}{\rule{0.119pt}{3.023pt}}
\multiput(848.17,790.73)(13.000,-88.725){2}{\rule{0.400pt}{1.512pt}}
\multiput(862.58,686.09)(0.492,-4.804){21}{\rule{0.119pt}{3.833pt}}
\multiput(861.17,694.04)(12.000,-104.044){2}{\rule{0.400pt}{1.917pt}}
\multiput(874.58,575.66)(0.493,-4.303){23}{\rule{0.119pt}{3.454pt}}
\multiput(873.17,582.83)(13.000,-101.831){2}{\rule{0.400pt}{1.727pt}}
\multiput(887.58,467.72)(0.492,-3.986){21}{\rule{0.119pt}{3.200pt}}
\multiput(886.17,474.36)(12.000,-86.358){2}{\rule{0.400pt}{1.600pt}}
\multiput(899.58,378.13)(0.493,-2.915){23}{\rule{0.119pt}{2.377pt}}
\multiput(898.17,383.07)(13.000,-69.067){2}{\rule{0.400pt}{1.188pt}}
\multiput(912.58,305.97)(0.492,-2.349){21}{\rule{0.119pt}{1.933pt}}
\multiput(911.17,309.99)(12.000,-50.987){2}{\rule{0.400pt}{0.967pt}}
\multiput(924.58,253.48)(0.493,-1.567){23}{\rule{0.119pt}{1.331pt}}
\multiput(923.17,256.24)(13.000,-37.238){2}{\rule{0.400pt}{0.665pt}}
\multiput(937.58,214.71)(0.492,-1.186){21}{\rule{0.119pt}{1.033pt}}
\multiput(936.17,216.86)(12.000,-25.855){2}{\rule{0.400pt}{0.517pt}}
\multiput(949.58,188.16)(0.493,-0.734){23}{\rule{0.119pt}{0.685pt}}
\multiput(948.17,189.58)(13.000,-17.579){2}{\rule{0.400pt}{0.342pt}}
\multiput(962.58,169.65)(0.492,-0.582){21}{\rule{0.119pt}{0.567pt}}
\multiput(961.17,170.82)(12.000,-12.824){2}{\rule{0.400pt}{0.283pt}}
\multiput(974.00,156.93)(0.728,-0.489){15}{\rule{0.678pt}{0.118pt}}
\multiput(974.00,157.17)(11.593,-9.000){2}{\rule{0.339pt}{0.400pt}}
\multiput(987.00,147.93)(1.033,-0.482){9}{\rule{0.900pt}{0.116pt}}
\multiput(987.00,148.17)(10.132,-6.000){2}{\rule{0.450pt}{0.400pt}}
\multiput(999.00,141.94)(1.797,-0.468){5}{\rule{1.400pt}{0.113pt}}
\multiput(999.00,142.17)(10.094,-4.000){2}{\rule{0.700pt}{0.400pt}}
\put(1012,137.17){\rule{2.500pt}{0.400pt}}
\multiput(1012.00,138.17)(6.811,-2.000){2}{\rule{1.250pt}{0.400pt}}
\put(1024,135.17){\rule{2.700pt}{0.400pt}}
\multiput(1024.00,136.17)(7.396,-2.000){2}{\rule{1.350pt}{0.400pt}}
\put(1037,133.17){\rule{2.700pt}{0.400pt}}
\multiput(1037.00,134.17)(7.396,-2.000){2}{\rule{1.350pt}{0.400pt}}
\put(824.0,853.0){\rule[-0.200pt]{3.132pt}{0.400pt}}
\put(1062,131.67){\rule{3.132pt}{0.400pt}}
\multiput(1062.00,132.17)(6.500,-1.000){2}{\rule{1.566pt}{0.400pt}}
\put(1050.0,133.0){\rule[-0.200pt]{2.891pt}{0.400pt}}
\put(1087,130.67){\rule{3.132pt}{0.400pt}}
\multiput(1087.00,131.17)(6.500,-1.000){2}{\rule{1.566pt}{0.400pt}}
\put(1075.0,132.0){\rule[-0.200pt]{2.891pt}{0.400pt}}
\put(1100.0,131.0){\rule[-0.200pt]{84.315pt}{0.400pt}}
\put(211.0,131.0){\rule[-0.200pt]{0.400pt}{175.616pt}}
\put(211.0,131.0){\rule[-0.200pt]{298.475pt}{0.400pt}}
\put(1450.0,131.0){\rule[-0.200pt]{0.400pt}{175.616pt}}
\put(211.0,860.0){\rule[-0.200pt]{298.475pt}{0.400pt}}
\end{picture}
so I thought it would be the same^^' /by the way the last code was from gnuplot, if anyone would ask/
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

problems with pstricks

Post by CrazyHorse »

lanmmt wrote:If you're using pstricks, you need to convert the dvi to a ps (via dvips) and then the ps to a pdf (via ps2pdf).
As I wrote, you should send a _complete_ and if possible
a minimal example, which shows your problem when I run it.
You sent only fragments of your code.

Herbert
Post Reply