Jens Noeckel wrote: > I had brought up an issue on the LyX users list, see the quoted text > below; meanwhile I've looked around for some more info on this, and > felt I could make some suggestions here. Looking at Bug 2419, I see > the rationale for having self-contained export from LyX to LaTeX that > includes the matching graphics formats as well. But I think in order > for LyX to retain its full customizability it is also essential to > have a pure LaTeX export function that leaves included graphics > untouched.
Why? The exported document is useless without the converted images. If the images are already in a suitable format they are not converted (at least in theory. If that is not the case please file a bug report). > Right now, both "plain and PDF"-latex exports run additional scripts > that attempt to provide not only the LaTeX file but also the > corresponding graphics files. But those kinds of scripts are not the > core functionality of a LaTeX export - they are added sugar. If they > have to be in the export menu, they should certainly not REPLACE the > original pure LaTeX file export; they should be offered IN ADDITION > to it. I guess that would not be too difficult to implement, but I see no reason to do it. Maybe it would help if you describe what exactly you are trying to do. The only drawback I see in converting the graphics is that it may take a long time if the document contains many graphics. The proper solution for this is IMO an image cache that LyX would use, because this problem exists also for e.g. viewing the final pdf, and the image cache would speedup both. In fact I am using a self written graphics converter with such a cache. > Regarding the new pdflatex export, it is in fact broken. I would > suggest stripping the file suffix ONLY if the included graphics are > non-compliant with pdflatex. Right now, ALL suffixes are stripped, > even if they are .pdf or .png etc. There is absolutely no need for > that if the export is explicitly designed for pdflatex. In fact, it > creates the potential for unintended consequences, as the following > example illustrates: > Say you have two files, > > picture.png > picture.pdf > > and they contain different information. In a LyX document, I can > include both in different places, and they will also appear with > their respective different information when the document is typeset. > But now when I try to export to LaTeX using the "pdflatex Export" in > LyX, I get a .tex file that has only the PNG file in it, duplicated > in the place where the PDF file was intended to be. That's because > pdflatex thinks png it "better" than PDF, an opinion that in this > case is not only presumptuous but also wrong (because the PDF file > could have a totally different picture in it). That is a different problem. Please file a bug report for this one. I am not sure at all how to handle this. > I guess one could file a bug report for the pdflatex Export function, > but the root of the problem in my opinion is that there needs to be a > bare LaTeX export that gives the user a hook to write their own > conversion scripts in order to handle the graphics the way they deem > best. I do not see yet why such an export would be useful (see above). Please describe in what cases you need the .tex file but do not need the converted graphics files. What we could do (this is in some bug report IIRC, but I don't find it yet) is to skip the conversion if an image in the correct format already exists. >> (a) >> When you do the plain export with a LyX document designed for >> pdflatex, LyX quietly (without warning!) goes through the graphics >> in my document and creates EPS versions of them, if they were in a >> format that pdflatex understands but latex doesn't. Fortunately it >> warns you if a pre-existing EPS file is about to be overwritten in >> the process (and of course that means the user has to watch the >> export process carefully and constantly answer warning dialogs). >> When I choose Export > "plain LaTeX" I don't want LyX to export >> tons of EPS files in the process - that's not very "plain" to me. "plain" means "for latex" instead of "for pdflatex". Do you have any better name? >> (b) >> The other way around, when choosing pdflatex export, LyX doesn't >> leave my graphics includes alone either! In that case, it silently >> (again without warning!) strips off all the graphics file suffixes. >> When I have multiple formats of a figure that are all suitable for >> pdflatex, I want to be sure that the format I specify in the suffix >> gets chosen. LyX doesn't seem to grant me that freedom any more. There is a workaround for now: name your images test.PDF instead of test.pdf. Then the suffix will not be stripped. Georg
