Fix export of new LaTeX formats: xetex and luatex. Prior to this, child

documents and graphics were not copied to the export directory, since
the format passed to addExternalFile() was wrong.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38378 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-04-14 18:32:42 +00:00
parent bcdb0dfcce
commit 1b6803bc7b
4 changed files with 45 additions and 4 deletions

View File

@ -21,10 +21,12 @@
#include "support/debug.h" #include "support/debug.h"
#include "support/filetools.h" #include "support/filetools.h"
#include "support/gettext.h" #include "support/gettext.h"
#include "support/lassert.h"
#include "support/lstrings.h" #include "support/lstrings.h"
#include "support/os.h" #include "support/os.h"
#include "support/Systemcall.h" #include "support/Systemcall.h"
#include "support/textutils.h" #include "support/textutils.h"
#include "support/Translator.h"
#include <algorithm> #include <algorithm>
@ -413,7 +415,41 @@ string const Formats::extension(string const & name) const
} }
namespace {
typedef Translator<OutputParams::FLAVOR, string> FlavorTranslator;
FlavorTranslator initFlavorTranslator()
{
FlavorTranslator f(OutputParams::LATEX, "latex");
f.addPair(OutputParams::LUATEX, "luatex");
f.addPair(OutputParams::PDFLATEX, "pdflatex");
f.addPair(OutputParams::XETEX, "xetex");
f.addPair(OutputParams::XML, "docbook-xml");
f.addPair(OutputParams::HTML, "xhtml");
f.addPair(OutputParams::TEXT, "text");
return f;
}
FlavorTranslator const & flavorTranslator()
{
static FlavorTranslator translator = initFlavorTranslator();
return translator;
}
}
std::string flavor2format(OutputParams::FLAVOR flavor)
{
return flavorTranslator().find(flavor);
}
/* Not currently needed, but I'll leave the code in case it is.
OutputParams::FLAVOR format2flavor(std::string fmt)
{
return flavorTranslator().find(fmt);
} */
Formats formats; Formats formats;

View File

@ -14,6 +14,8 @@
#include "support/docstring.h" #include "support/docstring.h"
#include "OutputParams.h"
#include <vector> #include <vector>
@ -168,6 +170,11 @@ private:
FormatList formatlist; FormatList formatlist;
}; };
///
std::string flavor2format(OutputParams::FLAVOR flavor);
// Not currently used.
// OutputParams::FLAVOR format2flavor(std::string fmt);
extern Formats formats; extern Formats formats;
extern Formats system_formats; extern Formats system_formats;

View File

@ -611,8 +611,7 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
FileName source_file = runparams.nice ? FileName(params().filename) : temp_file; FileName source_file = runparams.nice ? FileName(params().filename) : temp_file;
// determine the export format // determine the export format
string const tex_format = (runparams.flavor == OutputParams::LATEX) ? string const tex_format = flavor2format(runparams.flavor);
"latex" : "pdflatex";
// If the file is compressed and we have specified that it // If the file is compressed and we have specified that it
// should not be uncompressed, then just return its name and // should not be uncompressed, then just return its name and

View File

@ -547,8 +547,7 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
LYXERR(Debug::LATEX, "exportfile:" << exportfile); LYXERR(Debug::LATEX, "exportfile:" << exportfile);
LYXERR(Debug::LATEX, "writefile:" << writefile); LYXERR(Debug::LATEX, "writefile:" << writefile);
string const tex_format = (runparams.flavor == OutputParams::LATEX) ? string const tex_format = flavor2format(runparams.flavor);
"latex" : "pdflatex";
if (runparams.inComment || runparams.dryrun) { if (runparams.inComment || runparams.dryrun) {
//Don't try to load or copy the file if we're //Don't try to load or copy the file if we're
//in a comment or doing a dryrun //in a comment or doing a dryrun