2
votes

I am making a .ps file (using dvips) which contains many .eps graphics located in multiple other directories, which in turn contain code imported from text files using the postscript "run" command.

My problem is with paths.

To view the .eps in GSview (as I write and debug it) clearly a relative path to the text file must be relative to the location of the .eps file.

The problem is that in order to successfully view the final .ps the relative paths to the various text files must be relative to the location of the .ps file.

The only way I can get the .eps files to display both directly and when embedded in my .ps is by specifying an absolute path for the included text file.

Is there any way to make this work using relative paths, or some other trick to make the project location independent? I have dozens of .eps files so I don't want to just drop them all in the same directory.

1

1 Answers

2
votes

Probably the only sensible way to do this is to override the 'run' operator in the final PostScript program so that it amends the path in the string it is supplied with.

The EPS files will work (if they currently do) because run will not at that time be redefined. The enclosing PostScript file would then redefine 'run' so that it prefixes all strings with a correct path, so the EPS files would work when encapsulated in the enclosing program.

I admit I'm surprised (and more than a little horrified) to find that the 'run' operator isn't forbidden in EPS.....