add basic LuaTeX backend.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36448 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2010-11-23 16:07:42 +00:00
parent d43cdfa5ef
commit 2868ff7a52
8 changed files with 28 additions and 7 deletions

View File

@ -507,6 +507,7 @@ def checkFormatEntries(dtl_tools):
\Format lilypond ly "LilyPond music" "" "" "%%" "vector"
\Format lilypond-book lytex "LilyPond book (LaTeX)" "" "" "%%" "document"
\Format latex tex "LaTeX (plain)" L "" "%%" "document"
\Format luatex tex "LaTeX (LuaTeX)" "" "" "%%" "document"
\Format pdflatex tex "LaTeX (pdflatex)" "" "" "%%" "document"
\Format xetex tex "LaTeX (XeTeX)" "" "" "%%" "document"
\Format text txt "Plain text" a "" "%%" "document"
@ -538,10 +539,12 @@ def checkFormatEntries(dtl_tools):
rc_entry = [r'''\Format pdf pdf "PDF (ps2pdf)" P "%%" "" "document,vector"
\Format pdf2 pdf "PDF (pdflatex)" F "%%" "" "document,vector"
\Format pdf3 pdf "PDF (dvipdfm)" m "%%" "" "document,vector"
\Format pdf4 pdf "PDF (XeTeX)" X "%%" "" "document,vector"'''])
\Format pdf4 pdf "PDF (XeTeX)" X "%%" "" "document,vector"
\Format pdf5 pdf "PDF (LuaTeX)" u "%%" "" "document,vector"'''])
#
checkViewer('a DVI previewer', ['xdvi', 'kdvi', 'okular', 'yap', 'dviout -Set=!m'],
rc_entry = [r'\Format dvi dvi DVI D "%%" "" "document,vector"'])
rc_entry = [r'''\Format dvi dvi DVI D "%%" "" "document,vector"
\Format dvi3 dvi "DVI (LuaTeX)" D "%%" "" "document,vector"'''])
if dtl_tools:
# Windows only: DraftDVI
addToRC(r'\Format dvi2 dvi DraftDVI "" "" "" "vector"')
@ -592,6 +595,12 @@ def checkConverterEntries():
checkProg('XeTeX', ['xelatex $$i'],
rc_entry = [ r'\converter xetex pdf4 "%%" "latex"' ])
checkProg('LuaTeX', ['lualatex $$i'],
rc_entry = [ r'\converter luatex pdf5 "%%" "latex"' ])
checkProg('LuaTeX (DVI)', ['dvilualatex $$i'],
rc_entry = [ r'\converter luatex dvi3 "%%" "latex"' ])
''' If we're running LyX in-place then tex2lyx will be found in
../src/tex2lyx. Add this directory to the PATH temporarily and
search for tex2lyx.

View File

@ -3406,6 +3406,8 @@ bool Buffer::doExport(string const & format, bool put_in_tempdir,
// FIXME: Don't hardcode format names here, but use a flag
if (backend_format == "pdflatex")
runparams.flavor = OutputParams::PDFLATEX;
else if (backend_format == "luatex")
runparams.flavor = OutputParams::LUATEX;
else if (backend_format == "xetex")
runparams.flavor = OutputParams::XETEX;
}
@ -3616,6 +3618,8 @@ vector<string> Buffer::backends() const
// FIXME: Don't hardcode format names here, but use a flag
if (v.back() == "latex")
v.push_back("pdflatex");
else if (v.back() == "xetex")
v.push_back("luatex");
v.push_back("xhtml");
v.push_back("text");
v.push_back("lyx");

View File

@ -1120,6 +1120,7 @@ void BufferParams::validate(LaTeXFeatures & features) const
features.require("ct-none");
}
break;
case OutputParams::LUATEX:
case OutputParams::PDFLATEX:
case OutputParams::XETEX:
if (xcolorulem) {
@ -1359,7 +1360,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
// set font encoding
// for arabic_arabi and farsi we also need to load the LAE and
// LFE encoding
// XeTeX (isFullUnicode() flavor) works without fontenc
// XeTeX and LuaTeX (isFullUnicode() flavor) work without fontenc
if (font_encoding() != "default" && language->lang() != "japanese"
&& !features.runparams().isFullUnicode() && !tclass.provides("fontenc")) {
size_t fars = language_options.str().find("farsi");

View File

@ -257,6 +257,8 @@ OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath const & path)
if (conv.latex)
if (contains(conv.from, "xetex"))
return OutputParams::XETEX;
if (contains(conv.from, "luatex"))
return OutputParams::LUATEX;
if (contains(conv.to, "pdf"))
return OutputParams::PDFLATEX;
if (conv.xml)
@ -747,6 +749,7 @@ vector<string> Converters::savers() const
v.push_back("docbook");
v.push_back("latex");
v.push_back("literate");
v.push_back("luatex");
v.push_back("lyx");
v.push_back("xhtml");
v.push_back("pdflatex");

View File

@ -45,13 +45,14 @@ OutputParams::~OutputParams()
bool OutputParams::isLaTeX() const
{
return flavor == LATEX || flavor == PDFLATEX || flavor == XETEX;
return flavor == LATEX || flavor == LUATEX
|| flavor == PDFLATEX || flavor == XETEX;
}
bool OutputParams::isFullUnicode() const
{
return flavor == XETEX;
return flavor == LUATEX || flavor == XETEX;
}
} // namespace lyx

View File

@ -29,6 +29,7 @@ class OutputParams {
public:
enum FLAVOR {
LATEX,
LUATEX,
PDFLATEX,
XETEX,
XML,

View File

@ -725,6 +725,7 @@ void InsetExternal::validate(LaTeXFeatures & features) const
case OutputParams::LATEX:
format = "LaTeX";
break;
case OutputParams::LUATEX:
case OutputParams::PDFLATEX:
case OutputParams::XETEX:
format = "PDFLaTeX";

View File

@ -102,9 +102,10 @@ namespace {
/// Note that \p format may be unknown (i. e. an empty string)
string findTargetFormat(string const & format, OutputParams const & runparams)
{
// Are we using latex or XeTeX/pdflatex?
// Are we using latex or XeTeX/LuaTeX/pdflatex?
if (runparams.flavor == OutputParams::PDFLATEX
|| runparams.flavor == OutputParams::XETEX) {
|| runparams.flavor == OutputParams::XETEX
|| runparams.flavor == OutputParams::LUATEX) {
LYXERR(Debug::GRAPHICS, "findTargetFormat: PDF mode");
Format const * const f = formats.getFormat(format);
// Convert vector graphics to pdf