Currently, DVI export does not handle included graphics. They stay in the 
temp dir and are deleted on exit, so the .dvi file is useless for documents 
containing graphics. In order to change this, two steps are required:

1) Write relative graphics filenames in the .tex file. This is now trivial.
2) Collect a list of included graphics files and copy them from the temp dir 
to the document dir when exporting. This is not so trivial. The last time 
we discussed this, I sent a patch that collected the file names in 
InsetGraphics::latex() and InsetExternal::latex(). The problem is that I 
needed to circumvent the const'ness of the runparams argument by adding an 
ExportData struct to it:

struct ExportData {
        /** Generated files that might need to be copied to the destination
         *  dir
         */
        std::list<boost::filesystem::path> files;
};

struct OutputParams {
        ...
        ExportData *exportdata;
 };

This way, I can add a file to runparams with

runparams.exportdata->files.push_back(file);

Jean-Marc suggested to collect the filenames in validate() instead. 
Unfortunately this has also problems: We get the filename in latex() as a 
byproduct. If we want it in validate(), we have to duplicate the logic in 
InsetGraphics::prepareFile() or call it with a flag "validateOnly". The 
external inset is similar.
But these problems ar minor, the big problem is: How to get the collected 
filenames from Buffer::validate() to Exporter::Export()? One way would be 
the exportdata hack I described above, but then we gained nothing. Or 
Buffer::makeLaTeXFile() could return a list of filenames. Or it could 
return the LaTeXFeatures.

What do you think? Should I use the hack described above and collect the 
data in latex(), or should I do it in validate(), and how should I pass the 
files to Exporter::Export()?


Georg

Reply via email to