Problem with plot, subdocuments and pstrick

Hello,

I have written a text with the following structure : A = main document which contains essentially references to sub-documents B1,..., Bn.

In B1, I have successfully drawn a picture with the plot documents. When I compile B1 individually, no pb. If I compile A, an error occurs. This error doesn't occurs if I replace the "plot" by a jpg or png snapshot... Meanwhile, I find difficult to get a good final image of the jpg or png picture... Moreover, the "plot" doesn't enable to write text anywhere in the picture so that it is not very efficient when you want to name some parts of the drawing.

Hence, I have used Inkscape to make the drawings in save them in latex format. This source requires the package pstrick-add. I have found it, add it in my SWP document and tried different locations in my hard drive but the swp compilator never found it though I even put the pstrick-add.sty file in a folder where other "*.sty" package are present...

I have found some topics about adding a package but none helped me to telle SWP how to find the package... :(

For Version 5.5, placing

For Version 5.5, placing typesetting specification files (.sty, cls, etc...) in or below the directory TCTTeX\TeX is sufficient.

The pstricks package, as far as I know, is specific for the dvips program.  I would not expect it to be able to be used with the TrueTeX Previewer.

If you are compiling for PDF when you see the problem, perhaps it is related to what is described at https://www.mackichan.com/techtalk/613.htm

If you continue to have difficulties, make a sample with a master document and a small subdocument that shows the problem and post the files.

pviton's picture

Following up on George's

Following up on George's post: as long as you've gone to the trouble of creating the image in Inkscape, why not just export it in a form that's easy for SWP5 to understand, like png?

pviton's picture

As far as I recall, just

As far as I recall, just putting the sty file with other sty files should do it: unlike most tex installations, with truetex you don't need to update a database for the file to be found. So:

1. where exactly did you place the sty file?
2. can you post the log file which records the problem?

1. I put the files in

1. I put the files in c:/swp55/TCITeX/tex/latex209/contrib/misc/. I don't know if it is an acceptable place but I put them there because swp find the packages "graphics.sty" there.

2. After I read yout post I took a more careful look and I understood that the compilator asked for "pstricks.sty" and not "pstricks-add.sty" which is the package I add by the way of "go native". So in the folder "c:/swp55/TCITeX/tex/latex209/contrib/misc/", I download all the files og https://www.ctan.org/tex-archive/graphics/pstricks/base/ . By the way, in this webpage, there is a link ( http://mirrors.ctan.org/graphics/pstricks/base.zip ) to download the complete package but there in it some files I have no idea for what there ayr needed) and where they should be in the harddrive...

Now, when I compile, I get this :

(c:/swp55/TCITeX/tex/latex/required/graphics/graphicx.sty
(c:/swp55/TCITeX/tex/latex/required/graphics/keyval.sty)
(c:/swp55/TCITeX/tex/latex/required/graphics/graphics.sty
(c:/swp55/TCITeX/tex/latex/required/graphics/trig.sty)
(c:/swp55/TCITeX/tex/latex/required/graphics/graphics.cfg)
(c:/swp55/TCITeX/tex/latex/required/graphics/pdftex.def)))
(c:/swp55/TCITeX/tex/latex209/contrib/misc/pstricks.sty

! LaTeX Error: File `iftex.sty' not found.

What is this file "iftex.sty" ? I made a Qwant search and found it in the texlive folder of my computer. I copied th file in the folder where pstrics.sty stands.

Then I get : ! LaTeX Error: File `pst-xkey.tex' not found.

Again I found the file in the Texlive folder and copied in the psttrick.sty folder.

And know : !
I can't find file `xkeyval'.
l.39 ...XKeyValLoaded\endinput\else\input xkeyval
\fi
This seems endless. I don't know what xkeyval file is required since there is no *.sty or *.tex or what-else extension...

Is there an easy way to do make these packages effective ?

@Pviton. «Following up on George's post: as long as you've gone to the trouble of creating the image in Inkscape, why not just export it in a form that's easy for SWP5 to understand, like png?»
Well, the quality of the picture is very bad while the picture I have in inkscape is very good. Before I tried inkscape, I did : plot>pdf>editing the pdf to write legends name of objects, drawing arrows in circle>snapschot>importing png or jpg file in the source Tex file... This procedure is long, cumbersome and often ends in poor quality drawing. It is also very difficult to change something (like the size of the picture - the scaling in SWP is totally inaccurate for getting good quality) without redoing almost all the procedure...

@Geoge «//www.mackichan.com/techtalk/613.htm» . I will tried this but this can't solve my main concern described before ;=)

You said, "found it in the

You said, "found it in the texlive folder".  You probably have a better chance of using the TeX Live distribtuion as your compile engine than getting pstricks to work with the distribtuion included with Version 5.5.  See http://support.mackichan.com/a/solutions/articles/24000044396  

The error  File `iftex.sty' not found is an indication that the LaTeX included with Version 5.5 would need to be updated, at least for certain packages.  The etex extensions are not supported and if you end up needing a package that requires etex you will not be able to continue except to move to a different TeX distribtuion.

The discussion at http://forum.mackichan.com/node/655#comment-1443 could help with the graphics issue.  

@George : my build version of

@George : my build version of SWP5 is 2960 ; how could I update it ?

I have follow all the instructions of http://forum.mackichan.com/node/655#comment-1443 and http://support.mackichan.com/a/solutions/articles/24000044396 . (by the way, the 6.0.30 swp6 installation file lead to an erroer when installing texlive - no SSL possible said the box - but I have downloaded directly texlive201).

With texlive2021, I can compile correctly a document containing a picture drawn by a plot command while it is not possible with truetex.
But there is a major drawback with texlive2021. The package {hyperref} doesn't work any more. When I write «\externaldocument{C:/Users/VJM/Documents/Dropbox/Livre/LivreBasePlus}» in the preamble, I get an error which I don't have with TrueTex.

I attach the log file generated by tex live and the source tex file

pviton's picture

I'm no expert, but it looks

I'm no expert, but it looks to me as if the first error is generated when trying to read the external .aux file (log, line 350). What happens if you comment out the externaldocument command (exemple.tex line 35)? Have you recently updated the external aux file? Maybe something went wrong with the way you named a reference in this file. It might also be helpful to post

C:/Users/VJM/Documents/Dropbox/Livre/LivreBasePlus.aux

ADDED later:
=======

Try the following: in the block around line 98 of exemple5.tex you have

\raisebox{-0pt}{\fbox [stuff]

1. delete the { before \fbox
2. move the part of the line beginning \fbox to a new line
3. delete one of the }'s on the line after
{C:/Users/VJM/Documents/Dropbox/Livre/graphics/Exemple5__1.pdf}%
(ie make the {'s and }'s match up, since you deleted a { in step 1).

With this change, exemple.tex compiles for me with only a stop when it can't find the pdf file. If you reply "r" to this, the other failures are because it can't find references: this is what I'd expect since I have the \externaldocument command commented out because I don't have it. But with this file present, the suggestion here may solve your problem.

I've no idea why this helps (if it does).

If I have understood you

If I have understood you correctly, you suggested me this modification :

\raisebox{-0pt}
\fbox{\includegraphics[
natheight=2.999900in,
natwidth=4.499800in,
height=2.9999in,
width=4.4998in
]%
{C:/Users/VJM/Documents/Dropbox/Livre/graphics/Exemple5__1.pdf}%
}
%EndExpansion

TeXlive compiles the document but still stops when the source calls the external TeX (this text is required to get the map between some labels and references). The picture is drawn. When I compile exemple.tex with truetex, it is the contrary : no pb with the external document but no picture...

I attach the resulting pdf with texlive.

Go to File, Document Info,

Go to File, Document Info, the Save Options tab and make sure Store Relative Graphics Paths is turned off.  Do this first in the master document, and then save the master document.  Then visit each subdocument, make a harmless change to the document (add then delete a character) and then save each subdocument.  This could solve the problem where the graphics image for the plot is not being found.

pviton's picture

Yes that was my

Yes that was my suggestion.

If by "calls the external TeX" you mean that the compilation stops when TeX tries to read the externaldocument .aux file, then please post this external file, and I'll see if I can spot the problem. Also, please post the pdf referenced in exemple5.tex. You can also see if it's the xr-related stuff that's a problem by commenting out the \externatcocument command: in this case all you should see are reports of external references missing.

Hello ! So I have turned off

Hello !

So I have turned off "Store Relative Graphics Paths". The pdf file is found when I use TeXlive but not when I use TrueTex... I attach the two log files.

The auxilary file is still not found by Texlive2021. The call to external document is made by the command "\externaldocument{C:/Users/VJM/Documents/Dropbox/Livre/LivreBasePlus}" written in the preamble. LivreBasePlus.aux, exemple.tex and exemple5.tex are in the same foler. Is the package hyperref welle understood by Tex2ive2021 ?

pviton's picture

Under texlive: after renaming

Under texlive: after renaming LivreBasePlus.aux_.tex as LivreBasePlus.aux (and editing exemple.tex to get the path correct for my setup) this runs correctly except for the fact that Exemple5__1.pdf' isn't found (since you didn't supply it). You may wish to do so.

Also note that the log file says that `E5/ cas 2 du thHurwitz' is multiply defined. I don't expect that this has any effect on the problems you're experiencing, but you may wish to fix it.

From within SWP5, TeX stops when it can't find the referenced pdf file. Again, it would be helpful to have this file available. I've no idea why you're getting the error in the log file. As far as I can see, your log file shows that package xr.sty is not being read. In my experiment, it is found and read. Where exactly is xr.sty in your truetex system?

I attach my log file for a run from within SWP5.

Hello ! I didn't attach

Hello !

I didn't attach Exempl5__1.pdf because it is automatically produced when you open the subdocument exempke5.tex and goes where I wrote the plot generating the drawing. I think it is a more meaningful experiment to get the pdf file so. ;)

Thank's for spotting that the label "E5/ cas 2 du thHurwitz" is used twice. I made a mistake in my book in introducing a label instead of a reference to a label... This kind of error is very difficult to discover in a 500 page book... Meanwhile, I should have a look on the log files to chase this kind of problem.

It is strange that compilation calls for the xr package since I don't use explicate. exemple.tex uses amsmath, eurosym, amssymb, float, makeidx, graphicx, hyperref, babel, ulem, times and amsfonts.

The file xr.sty is in the folder C:\swp55\TCITeX\TeX\LaTeX\required\tools. It is no present in my TeXlive folder.

However, my main concern is not that the picture issue (Texlive has no problem to insert the plot drawing) but the fact that TeXlive don't find the external aux file while it is in the same folder that "exemple.tex' and "exemple5.tex". Is it linked with the fact that xr package (something which has to do with cross referencing) is not within my TeXlive folder ?

The reason I try to use TeXlive is because I have read here that it gives better quality graphics and because it is supposed to run correctly with inkscape.

The macro \externaldocument

The macro \externaldocument is defined by the xr package.  The xr package is part of the tools package.  Your log file shows that other tools packages are being used.  The file xr.sty should be located in c:/texlive/2021/texmf-dist/tex/latex/tools on your system.  If not, then something is wrong with your TeX Live installation.  The xr package probably needs to be referenced in the document if \externaldocument is going to be used.

I have reinstalled

I have reinstalled TeXlive2021 andf now xr.sty is in C:\texlive\2021\texmf-dist\tex\latex-dev\tools as it should be.

Menawhile, compilation is, a complete failure :(

pviton's picture

Post the image file. I can't

Post the image file. I can't try to help further if I don't have that.

As I said, the pdf file is

As I said, the pdf file is generated by SWP itself wia "compute>Plot2D" when you open example5.tex and goes where the plot command is. Meanwhile, I have attached it to this post ;)

@pviton : thank you for you

@pviton : thank you for you message in the other post you opened - it seems that I can't "reply" to it. However, I'll try what you adivse and come back later for a report ;)

So, I have followed your path

So, I have followed your path but for me it ends as before : with TrueTex, the picture is not found and with TexLive, a final pdf is not even produced... Note that changing the style of the document did not help. Note that this is worse than at the first try since before I reinstalled TeXlive, the only problem with it was that it was unable to take in account external document... I made a try with Texlive2021 and all packages and external documents calls removed. Then compilation stops but a pdf with the picture is produced. I have attached the log file. May be it is a bad installation of texlive which causes the crash. I will make a new try after a reinstallation of Texlive from a dvd and not internet (may be connection pbs implies corrupted files..)

This comment is only about

This comment is only about Exemple.log that was attached.

The log file says that a nine page PDF was created.  It includes the message:

! Package pdftex.def Error: Options `bblly', `bblly', `bburx', `bbury',
(pdftex.def)                `natheight' and `natwidth' are not
(pdftex.def)                supported by pdftex driver:
(pdftex.def)                use `viewport' instead.

I would expect this means that graphics did not appear in the PDF file.

The \includegraphics statements generated by Version 5.5 includes natheight and natwidth options which are no longer supported by pdftex.def.  There are two possible work arounds.  One is to directly edit the .tex file and delete these options from the \includegraphics statement.  You would then need to directly run pdflatex from TeX Live 2021 on the modified .tex file.  Version 5.5 will replace the natheight and natwidth options when you next save the document.  The second work around is to copy pdftex.def from the Version 5.5 distribution to the TeX Live 2021 distribution.  Placing it in the texmf-local directory tree should be sufficient for TeX Live to find pdftex.def before finding the one in the texmf-dist directory tree.  This choice could have unintended side effects, more likely with other packages that may depend on the current version of pdftex.def.