Hi ,
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.

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 have my own conversion script that calls "lyx --export latex" and this has been working great up until I switched from LyX 1.3.6 to LyX 1.4.2. It seems that the old latex export functionality should be easy to restore to the File menu, and obviously it should also be accessible as a command-line option to preserve backwards- compatibility with LyX 1.3.x. I could imagine ways in which I can protect my lyx files from having their graphics includes processed by LyX export, but I imagine there must be many other users that will be missing the plain latex export, so I think it's much more reasonable to restore that function to LyX than to ask users to adapt to the new, more invasive export functions.

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).

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.

Jens


I just discovered one more thing that I find strange about LyX 1.4.2 - I'll explore this some more, but my initial impression is not favorable: when exporting to LaTeX, we now have the choice of plain versus pdflatex-versions. In both cases, LyX tries to be too clever for its own good - this rings warning bells, because it's one of the reasons why I don't use MS Word:

(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.

(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.

Given that all this was not an issue in LyX 1.3.x, I would be very much in favor if one could at least turn these "features" off. Maybe there's a way and I just haven't found it yet...


Reply via email to