Am Dienstag, 19. Oktober 2004 13:56 schrieb Angus Leeming: > What to do if the XFig picture *includes* an EPS figure? Our new, > improved handling of the conversion of such XFig files to EPS,PSTEX_T > in the tmp directory doesn't work as it did in LyX 1.3.x, because the > included EPS figure is not moved.
We discussed this problem already some months ago, but had no good solution back then. It is not limited to xfig: tgif files can include references to other files, too. The same holds for tex files, even eps files themselves, and probably some others. > One solution is to reference the EPS figure in the XFig file with an > absolute path. Which of course is bad if the user is forced to do that, but fine if it happens automatically. > Are there any other ways? I guess there are, because the conversion > is controlled by the script lib/scripts/fig2pstex.sh. Can we pass > this script the buffer directory so that it can modify the XFig file > if necessary? > > Here's an example of the offending entry: > 2 5 0 1 0 -1 60 -1 -1 0.000 0 0 -1 0 0 5 > 0 raw.eps > > If we have the buffer directory and if we can ascertain the XFig code > for 'picture', then it is trivial to use sed to convert this. > > Is such a strategy possible? Thoughts? As I understand it, this means that fig2pstex.sh, which is supposed to convert from fig to pstex, modifies its input. I don't like that. Please enlighten me if this is a misunderstanding. Another solution: Instead of copying files to the temp dir, send them through a special converter. This converter can be seen as a "converter from format x to format x in the temp dir". It would do the necessary transformations, e.g. your sed script would become the converter for .fig files. This special converter could be defined for every format that needs it. If a particular format has no such converter defined, then the file is simply copied as it is done right now. Both solutions have the following small problem, but I guess we have to live with that: lyx does not notice if the eps figure changes, so it does not convert the xfig file again. Georg