commit 389352b3fb920514c89ebb5fbb1b8311bfc698dc
Author: Juergen Spitzmueller <[email protected]>
Date: Wed Apr 25 13:46:05 2018 +0200
Add optional flavor flag to needaux
Also, use latex flavor if no flag is given rather than default output
format
Fixes: #9127
---
lib/configure.py | 2 +-
lib/doc/Customization.lyx | 112 ++++++++++++++++++++++++++++++++++++++
lib/scripts/prefs2prefs_prefs.py | 6 ++-
src/Converter.cpp | 8 ++-
src/LyXRC.cpp | 3 +-
5 files changed, 124 insertions(+), 7 deletions(-)
diff --git a/lib/configure.py b/lib/configure.py
index 8c6c168..863f2ab 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -1790,7 +1790,7 @@ if __name__ == '__main__':
lyx_check_config = True
lyx_kpsewhich = True
outfile = 'lyxrc.defaults'
- lyxrc_fileformat = 26
+ lyxrc_fileformat = 27
rc_entries = ''
lyx_keep_temps = False
version_suffix = ''
diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index 66d7533..9e7c136 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -2409,6 +2409,10 @@ status collapsed
\begin_layout Plain Layout
latex
+\change_inserted -712698321 1524656940
+=flavor
+\change_unchanged
+
\end_layout
\end_inset
@@ -2418,6 +2422,55 @@ latex
This will make \SpecialChar LyX
's \SpecialChar LaTeX
error logs available.
+
+\change_inserted -712698321 1524657018
+ The optional
+\begin_inset Flex Code
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1524657012
+flavor
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+ value specifies the form of \SpecialChar LaTeX
+ that is run (
+\begin_inset Flex Code
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1524657005
+latex, pdflatex, platex, xetex, luatex
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+).
+ If no value is specified,
+\begin_inset Flex Code
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1524657018
+latex
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+ is used.
+\change_unchanged
+
\end_layout
\begin_layout Labeling
@@ -2427,6 +2480,10 @@ status collapsed
\begin_layout Plain Layout
needaux
+\change_inserted -712698321 1524656935
+=flavor
+\change_unchanged
+
\end_layout
\end_inset
@@ -2443,6 +2500,61 @@ status collapsed
\end_inset
file for the conversion.
+
+\change_inserted -712698321 1524657047
+ The optional
+\begin_inset Flex Code
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1524657030
+flavor
+\end_layout
+
+\end_inset
+
+ value specifies the form of \SpecialChar LaTeX
+ that is run in order to generate the
+\begin_inset Flex Noun
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1524657047
+.aux
+\end_layout
+
+\end_inset
+
+ file (
+\begin_inset Flex Code
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1524657030
+latex, pdflatex, platex, xetex, luatex
+\end_layout
+
+\end_inset
+
+).
+ If no value is specified,
+\begin_inset Flex Code
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1524657030
+latex
+\end_layout
+
+\end_inset
+
+ is used.
+\change_unchanged
+
\end_layout
\begin_layout Labeling
diff --git a/lib/scripts/prefs2prefs_prefs.py b/lib/scripts/prefs2prefs_prefs.py
index 6007a95..8ea2072 100644
--- a/lib/scripts/prefs2prefs_prefs.py
+++ b/lib/scripts/prefs2prefs_prefs.py
@@ -108,6 +108,9 @@
# Incremented to format 26, by spitz
# Rename font_encoding preference
+# Incremented to format 27, by spitz
+# Add optional flavor value to needaux flag
+
# NOTE: The format should also be updated in LYXRC.cpp and
# in configure.py.
@@ -442,5 +445,6 @@ conversions = [
[ 23, []],
[ 24, [rename_collapsible]],
[ 25, [remove_use_qimage]],
- [ 26, [remove_font_encoding]]
+ [ 26, [remove_font_encoding]],
+ [ 27, []]
]
diff --git a/src/Converter.cpp b/src/Converter.cpp
index a157c22..118d0b6 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -123,9 +123,11 @@ void Converter::readFlags()
"latex" : flag_value;
} else if (flag_name == "xml")
xml_ = true;
- else if (flag_name == "needaux")
+ else if (flag_name == "needaux") {
need_aux_ = true;
- else if (flag_name == "resultdir")
+ latex_flavor_ = flag_value.empty() ?
+ "latex" : flag_value;
+ } else if (flag_name == "resultdir")
result_dir_ = (flag_value.empty())
? token_base : flag_value;
else if (flag_name == "resultfile")
@@ -265,7 +267,7 @@ OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath
const & path,
for (Graph::EdgePath::const_iterator cit = path.begin();
cit != path.end(); ++cit) {
Converter const & conv = converterlist_[*cit];
- if (conv.latex()) {
+ if (conv.latex() || conv.need_aux()) {
if (conv.latex_flavor() == "latex")
return OutputParams::LATEX;
if (conv.latex_flavor() == "xelatex")
diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp
index 4882bd2..8a1910e 100644
--- a/src/LyXRC.cpp
+++ b/src/LyXRC.cpp
@@ -59,8 +59,7 @@ namespace {
// The format should also be updated in configure.py, and conversion code
// should be added to prefs2prefs_prefs.py.
-static unsigned int const LYXRC_FILEFORMAT = 26; // spitz: remove font_encoding
-
+static unsigned int const LYXRC_FILEFORMAT = 27; // spitz: add flavor value to
needaux flag
// when adding something to this array keep it sorted!
LexerKeyword lyxrcTags[] = {
{ "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },