Add optional flavor flag to needaux

Also, use latex flavor if no flag is given rather than default output
format

Fixes: #9127
This commit is contained in:
Juergen Spitzmueller 2018-04-25 13:46:05 +02:00
parent 0add7120ba
commit 389352b3fb
5 changed files with 124 additions and 7 deletions

View File

@ -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 = ''

View File

@ -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

View File

@ -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, []]
]

View File

@ -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")

View File

@ -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 },