[XeTeX] Some problems with PSTricks

John Was john.was at ntlworld.com
Sat Jun 21 15:47:27 CEST 2008


Hi

Well I'd like to try out the latest version of TeXLive but as far as I can 
see the process of updating the installation on Windows is fairly complex 
and error-prone (unlike the Mac - a good reason to buy one I suppose).  But 
with relevant instructions I'm happy to try it on a spare machine (I daren't 
on my main machine as I have two jobs using XeTeX almost at completion).

But here is an illustration of the problem.  I have tables on two 
consecutive pages, and the first problem I discovered was that it wasn't 
possible to add PS-Tricks line-drawing commands all the way through the 
table as I would normally do.  If I did that I got only the first line and 
no subsequent ones.  But by sitting down and working out precisely where 
each line would go on the page, it worked if I gave all the line commands 
one after another, thus:

\psline[linewidth=0.5pt]{->}(80pt,-80pt)(200pt,-88pt)%

\psline[linewidth=0.5pt]{->}(80pt,-80pt)(80pt,-88pt)%

\psline[linewidth=0.5pt]{->}(80pt,-102.5pt)(200pt,-110.5pt)%

\psline[linewidth=0.5pt]{->}(80pt,-102.5pt)(80pt,-110.5pt)%

\psline[linewidth=0.5pt]{->}(80pt,-125pt)(200pt,-133pt)%

\psline[linewidth=0.5pt]{->}(80pt,-125pt)(80pt,-133pt)%

\psline[linewidth=0.5pt]{->}(80pt,-147.5pt)(200pt,-155.5pt)%

\psline[linewidth=0.5pt]{->}(80pt,-147.5pt)(80pt,-155.5pt)%

\psline[linewidth=0.5pt]{->}(80pt,-170pt)(200pt,-178pt)%

\psline[linewidth=0.5pt]{->}(80pt,-170pt)(80pt,-178pt)%

\psline[linewidth=0.5pt]{->}(80pt,-192.5pt)(200pt,-200.5pt)%

\psline[linewidth=0.5pt]{->}(80pt,-192.5pt)(80pt,-200.5pt)%

\psline[linewidth=0.5pt]{->}(80pt,-215pt)(200pt,-223pt)%

\psline[linewidth=0.5pt]{->}(80pt,-215pt)(80pt,-223pt)%

\psline[linewidth=0.5pt]{->}(80pt,-237.5pt)(200pt,-245.5pt)%

\psline[linewidth=0.5pt]{->}(80pt,-237.5pt)(80pt,-245.5pt)%

\psline[linewidth=0.5pt]{->}(161pt,-31pt)(161pt,-44pt)%

\psline[linewidth=0.5pt]{->}(161pt,-54pt)(213pt,-64pt)%

\psline[linewidth=0.5pt]{->}(161pt,-54pt)(109pt,-64pt)%

\psline[linewidth=0.5pt,linestyle=dashed,dash=1.5pt 
1pt]{->}(161pt,-328pt)(161pt,-342pt)%

\psline[linewidth=0.5pt]{->}(161pt,-351pt)(213pt,-364pt)%

\psline[linewidth=0.5pt]{->}(161pt,-351pt)(109pt,-364pt)%

\psline[linewidth=0.5pt]{->}(69pt,-381pt)(69pt,-396pt)%



Of course it's a nuisance having to do all these calculations of distances - 
PSTricks, when working normally, will put the lines at the correct place in 
the text if I just specify where the two joining points are relative to each 
word, without having to work out where the words will fall on the page.



Now for the interesting bit.  On the next page I need a different set of 
lines for another table, and I had to go through the same procedure of 
working out their positions.  Here is the code:



\psline[linewidth=0.5pt,linestyle=dashed,dash=1.5pt 
1pt]{->}(161pt,24pt)(93pt,0pt)%

\psline[linewidth=0.5pt]{->}(93pt,-30pt)(93pt,-54pt)%

\psline[linewidth=0.5pt]{->}(93pt,-30pt)(150pt,-54pt)(150pt,-350pt)(126pt,-356pt)%

\psline[linewidth=0.5pt]{->}(93pt,-80pt)(93pt,-90pt)%

\psline[linewidth=0.5pt]{->}(93pt,-116.5pt)(93pt,-126.5pt)%

\psline[linewidth=0.5pt]{->}(93pt,-153pt)(93pt,-163pt)%

\psline[linewidth=0.5pt]{->}(93pt,-189.5pt)(93pt,-199.5pt)%

\psline[linewidth=0.5pt]{->}(93pt,-226pt)(93pt,-236pt)%

\psline[linewidth=0.5pt]{->}(93pt,-262.5pt)(93pt,-272.5pt)%

\psline[linewidth=0.5pt]{->}(93pt,-299pt)(93pt,-309pt)%



BUT:  instead of giving me these lines XeTeX gives me the lines that I 
invoked on the preceding page, which are irrelevant on this second page. 
The only way I can get this second lot of lines to appear is to comment out 
the lines out on the preceding page.  Weird!



As to TikZ, here is a very simple piece of code from the start of the 
manual, which generates no compiling errors but produces nothing at all in 
the PDF output under XeTeX (I added the units 'pc' in case the default units 
were positioning the figure off the visible page):



\tikzpicture

\draw (-1.5,0) -- (1.5,0);

\draw (0,-1.5) -- (0,1.5);

\endtikzpicture




I may be doing something basically wrong with TikZ of course:  I wasn't 
about to get my nose into a 500-page manual without being sure that it 
worked so have not experimented beyond these bits of cutting and pasting 
from the examples.  But as I said earlier, I don't think TikZ is very suited 
to producing lines etc. in the midst of ordinary text.



I could also provide an example of fig4tex not working properly (a triangle 
has two of its lines incomplete) - again an example taken from the manual 
(and this time the figure shows up correctly in Sumatra but not in Acrobat). 
But that's enough for one message, I think.



Best





John


----- Original Message ----- 
From: "Jonathan Kew" <jonathan_kew at sil.org>
To: "Unicode-based TeX for Mac OS X and other platforms" <xetex at tug.org>
Sent: Saturday, June 21, 2008 12:34 PM
Subject: Re: [XeTeX] Some problems with PSTricks


> On 21 Jun 2008, at 12:22 pm, John Was wrote:
>
>> Hello all
>>
>> If it is of any relevance, using plain XeTeX in Windows XP I
>> certainly have
>> a lot of trouble with PS Tricks line-drawing commands mingled with
>> plain
>> text:  usually the very first command works and after that there
>> are many
>> strange effects (subsequent line-drawing commands on the same page
>> are often
>> ignored, and strangest of all, a line-drawing command on the next
>> page will
>> be ignored but the successful one on the preceding page will be
>> repeated on
>> the next page in the PDF output even though it is not present at
>> that point
>> in the .TEX file!).
>
> This sounds like some kind of confusion in the process of converting
> the individual drawing fragments; the wrong temporary files are being
> used, or something. Can you confirm whether the same behavior happens
> on Linux, or is it Windows-specific?
>
>> This is a pity since I do quite often want (for
>> example) to draw arrows between phrases in tables, and this is
>> unproblematic
>> in my old and very stable 4AllTeX distribution (which doesn't
>> handle Unicode
>> of course).
>
> I'd consider using TikZ for something like that. (That's not an
> excuse for failing to handle PSTricks properly, of course, but it
> might be a good -- and more reliable? -- alternative.)
>
>>
>> Other PS Tricks commands, such as \rput to reposition text or
>> \psscalebox to
>> stretch and shrink text, seem to work reliably.
>>
>> Separate PS Tricks pictures using lines and arrows are sometimes
>> incomplete
>> though there is no hint of an error in the input:  indeed, Sumatra
>> tends to
>> show them correctly whereas in Acrobat I might (for example) find
>> there is a
>> line missing from a triangle.  (Unfortunately, everything has to be
>> satisfactory in Acrobat in order to pass a PDF file on for book-
>> printing.)
>>
>> I'm hoping the glitches will disappear in the 2008 TeXLive
>> distribution!
>
> If you can try the pre-release TL2008 packages and report any
> problems, with appropriate test cases, that will improve the chances
> that we can deal with the glitches. I don't use either PSTricks or
> Windows myself, so I am unlikely to run into the issues personally; I
> do try to follow up on reported problems, though, if they're easy for
> me to reproduce here.
>
> JK
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
> 



More information about the XeTeX mailing list