* configure.py:

* Conerter.{cpp,h}:
	- use a backend=flavor flag format for latex instead of hardcoding format names

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36623 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2010-11-30 09:49:28 +00:00
parent 36986009d1
commit 2be72ce058
3 changed files with 17 additions and 12 deletions

View File

@ -391,7 +391,7 @@ def checkLatex(dtl_tools):
# run platex on chklatex.ltx and check result
if cmdOutput(PLATEX + ' chklatex.ltx').find('pLaTeX2e') != -1:
# We have the Japanese pLaTeX2e
addToRC(r'\converter platex dvi "%s" "latex"' % PLATEX)
addToRC(r'\converter platex dvi "%s" "latex=platex"' % PLATEX)
else:
PLATEX = ''
removeFiles(['chklatex.ltx', 'chklatex.log'])
@ -590,16 +590,16 @@ def checkFormatEntries(dtl_tools):
def checkConverterEntries():
''' Check all converters (\converter entries) '''
checkProg('the pdflatex program', ['pdflatex $$i'],
rc_entry = [ r'\converter pdflatex pdf2 "%%" "latex"' ])
rc_entry = [ r'\converter pdflatex pdf2 "%%" "latex=pdflatex"' ])
checkProg('XeTeX', ['xelatex $$i'],
rc_entry = [ r'\converter xetex pdf4 "%%" "latex"' ])
rc_entry = [ r'\converter xetex pdf4 "%%" "latex=xelatex"' ])
checkProg('LuaTeX', ['lualatex $$i'],
rc_entry = [ r'\converter luatex pdf5 "%%" "latex"' ])
rc_entry = [ r'\converter luatex pdf5 "%%" "latex=lualatex"' ])
checkProg('LuaTeX (DVI)', ['dvilualatex $$i'],
rc_entry = [ r'\converter luatex dvi3 "%%" "latex"' ])
rc_entry = [ r'\converter luatex dvi3 "%%" "latex=lualatex"' ])
''' If we're running LyX in-place then tex2lyx will be found in
../src/tex2lyx. Add this directory to the PATH temporarily and

View File

@ -108,9 +108,11 @@ void Converter::readFlags()
string flag_name, flag_value;
flag_list = split(flag_list, flag_value, ',');
flag_value = split(flag_value, flag_name, '=');
if (flag_name == "latex")
if (flag_name == "latex") {
latex = true;
else if (flag_name == "xml")
latex_flavor = flag_value.empty() ?
"latex" : flag_value;
} else if (flag_name == "xml")
xml = true;
else if (flag_name == "needaux")
need_aux = true;
@ -186,11 +188,12 @@ void Converters::add(string const & from, string const & to,
}
converter.readFlags();
if (converter.latex && (latex_command_.empty() || to == "dvi"))
latex_command_ = subst(command, token_from, "");
// If we have both latex & pdflatex, we set latex_command to latex.
// The latex_command is used to update the .aux file when running
// a converter that uses it.
if (converter.latex
&& (latex_command_.empty() || converter.latex_flavor == "latex"))
latex_command_ = subst(command, token_from, "");
if (it == converterlist_.end()) {
converterlist_.push_back(converter);
@ -255,11 +258,11 @@ OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath const & path)
cit != path.end(); ++cit) {
Converter const & conv = converterlist_[*cit];
if (conv.latex)
if (contains(conv.from, "xetex"))
if (conv.latex_flavor == "xelatex")
return OutputParams::XETEX;
if (contains(conv.from, "luatex"))
if (conv.latex_flavor == "lualatex")
return OutputParams::LUATEX;
if (contains(conv.to, "pdf"))
if (conv.latex_flavor == "pdflatex")
return OutputParams::PDFLATEX;
if (conv.xml)
return OutputParams::XML;

View File

@ -53,6 +53,8 @@ public:
/// The converter is latex or its derivatives
bool latex;
/// The latex derivate
std::string latex_flavor;
/// The converter is xml
bool xml;
/// This converter needs the .aux files