[LyX/2.3.1-staging] Amend 4ec133e1aeea8
commit 83c7e818f8d8b669b33b58847e90997b6edec8b5 Author: Juergen SpitzmuellerDate: Tue Mar 6 19:54:24 2018 +0100 Amend 4ec133e1aeea8 Didn't see this test is already there. --- lib/chkconfig.ltx |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 7a07851..3fd9572 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -444,7 +444,6 @@ \TestPackage{iwona} \TestPackage{kurier} \TestPackage{lh-lcy} -\TestPackage{libertine} \TestPackage{fontaxes} % required by libertine \TestPackage{libertine} \TestPackage{libertine-type1}
[LyX/2.3.1-staging] Braces need to be escaped as well on LATEXIFY
commit 9912e7ab8c096cbdd252f0f82277e0a9aa640da5 Author: Juergen SpitzmuellerDate: Tue Mar 6 18:17:01 2018 +0100 Braces need to be escaped as well on LATEXIFY part of #9563 --- src/insets/InsetCommandParams.cpp |7 --- status.23x|2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/insets/InsetCommandParams.cpp b/src/insets/InsetCommandParams.cpp index 39c7715..741f6aa 100644 --- a/src/insets/InsetCommandParams.cpp +++ b/src/insets/InsetCommandParams.cpp @@ -464,14 +464,15 @@ docstring InsetCommandParams::prepareCommand(OutputParams const & runparams, } // Now escape special commands static docstring const backslash = from_ascii("\\"); - static char_type const chars_escape[6] = { - '&', '_', '$', '%', '#', '^'}; + int const nchars_escape = 8; + static char_type const chars_escape[nchars_escape] = { + '&', '_', '$', '%', '#', '^', '{', '}'}; if (!result.empty()) { int previous; // The characters in chars_name[] need to be changed to a command when // they are LaTeXified. - for (int k = 0; k < 6; k++) + for (int k = 0; k < nchars_escape; k++) for (size_t i = 0, pos; (pos = result.find(chars_escape[k], i)) != string::npos; i = pos + 2) { diff --git a/status.23x b/status.23x index 6c71962..c659e78 100644 --- a/status.23x +++ b/status.23x @@ -41,6 +41,8 @@ What's new - Fix the implementation of new libertine font package. +- Properly escape braces in non-literate context in insets. + * LYX2LYX
[LyX/master] Amend 4ec133e1aeea8
commit 822aef947b627ca1db7d32206d0e5622e9b2abbb Author: Juergen SpitzmuellerDate: Tue Mar 6 19:54:24 2018 +0100 Amend 4ec133e1aeea8 Didn't see this test is already there. (cherry picked from commit 83c7e818f8d8b669b33b58847e90997b6edec8b5) --- lib/chkconfig.ltx |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 4afe8c1..ef37440 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -447,7 +447,6 @@ \TestPackage{iwona} \TestPackage{kurier} \TestPackage{lh-lcy} -\TestPackage{libertine} \TestPackage{fontaxes} % required by libertine \TestPackage{libertine} \TestPackage{libertine-type1}
[LyX/2.3.2-staging] status.23x: correct sorting
commit e9470e7d64117171a48c2cc3426c63856667c6d0 Author: Uwe StöhrDate: Tue Mar 6 22:34:21 2018 +0100 status.23x: correct sorting tex2lyx biblatex support is an improvement not a bugfix. At least in the past we sorted new tex2lyx features this way. --- status.23x |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/status.23x b/status.23x index ed12ee8..b13eaf5 100644 --- a/status.23x +++ b/status.23x @@ -21,6 +21,7 @@ What's new * TEX2LYX IMPROVEMENTS +- Add support for biblatex. * USER INTERFACE @@ -105,8 +106,6 @@ What's new - Consider options passed via \PassOptionsToPackage. -- Add support for biblatex. - - Add support for alignment pseudo-environments as used inside floats (bug 7857).
[LyX/master] Braces need to be escaped as well on LATEXIFY
commit e43ba7cf46779c6a8394310b9487ebe2c75132b2 Author: Juergen SpitzmuellerDate: Tue Mar 6 18:17:01 2018 +0100 Braces need to be escaped as well on LATEXIFY part of #9563 --- src/insets/InsetCommandParams.cpp |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/insets/InsetCommandParams.cpp b/src/insets/InsetCommandParams.cpp index 3f3befe..24d1afa 100644 --- a/src/insets/InsetCommandParams.cpp +++ b/src/insets/InsetCommandParams.cpp @@ -464,14 +464,15 @@ docstring InsetCommandParams::prepareCommand(OutputParams const & runparams, } // Now escape special commands static docstring const backslash = from_ascii("\\"); - static char_type const chars_escape[6] = { - '&', '_', '$', '%', '#', '^'}; + int const nchars_escape = 8; + static char_type const chars_escape[nchars_escape] = { + '&', '_', '$', '%', '#', '^', '{', '}'}; if (!result.empty()) { int previous; // The characters in chars_name[] need to be changed to a command when // they are LaTeXified. - for (int k = 0; k < 6; k++) + for (int k = 0; k < nchars_escape; k++) for (size_t i = 0, pos; (pos = result.find(chars_escape[k], i)) != string::npos; i = pos + 2) {
[LyX/2.3.2-staging] tex2lyx: fix subfloat import
commit 94fe1261619b591f0c1bab825bd56059a5609a80 Author: Juergen SpitzmuellerDate: Tue Mar 6 10:35:55 2018 +0100 tex2lyx: fix subfloat import Fixes: #10385 (cherry picked from commit 1dcb2a09766335aecbe3c8599d09358e135d699c) --- src/tex2lyx/text.cpp | 33 - status.23x |2 ++ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 6c93857..5fd4f0a 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -3176,7 +3176,6 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, if (t.cs() == "subfloat") { // the syntax is \subfloat[list entry][sub caption]{content} // if it is a table of figure depends on the surrounding float - // FIXME: second optional argument is not parsed p.skip_spaces(); // do nothing if there is no outer float if (!float_type.empty()) { @@ -3195,6 +3194,12 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, caption = parse_text_snippet(p, FLAG_BRACK_LAST, outer, context); has_caption = true; } + // In case we have two optional args, the second is the caption. + if (p.next_token().cat() != catEscape && + p.next_token().character() == '[') { + p.get_token(); // eat '[' + caption = parse_text_snippet(p, FLAG_BRACK_LAST, outer, context); + } // the content parse_text_in_inset(p, os, FLAG_ITEM, outer, context); // the caption comes always as the last @@ -3208,31 +3213,25 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, newcontext.check_layout(os); os << caption << "\n"; newcontext.check_end_layout(os); - // We don't need really a new paragraph, but - // we must make sure that the next item gets a \begin_layout. - //newcontext.new_paragraph(os); end_inset(os); p.skip_spaces(); + // close the layout we opened + os << "\n\\end_layout"; } - // We don't need really a new paragraph, but - // we must make sure that the next item gets a \begin_layout. - if (has_caption) - context.new_paragraph(os); end_inset(os); p.skip_spaces(); - context.check_end_layout(os); - // close the layout we opened - if (has_caption) - os << "\n\\end_layout\n"; } else { // if the float type is not supported or there is no surrounding float // output it as ERT + string opt_arg1; + string opt_arg2; if (p.hasOpt()) { - string opt_arg = convert_command_inset_arg(p.getArg('[', ']')); - output_ert_inset(os, t.asInput() + '[' + opt_arg + - "]{" + p.verbatim_item() + '}', context); - } else - output_ert_inset(os, t.asInput() + "{" + p.verbatim_item() + '}', context); + opt_arg1 = convert_command_inset_arg(p.getFullOpt()); + if (p.hasOpt()) + opt_arg2 = convert_command_inset_arg(p.getFullOpt()); + } + output_ert_inset(os, t.asInput() + opt_arg1 + opt_arg2 ++ "{" + p.verbatim_item() + '}', context); } continue; } diff --git a/status.23x b/status.23x index 3698b06..e828faa 100644 ---
[LyX/2.3.2-staging] Fix local polyglossia switch for Arabic
commit afeb5acb0fc958a1fb65f910ea15bf1899c175c7 Author: Juergen SpitzmuellerDate: Tue Mar 6 15:31:43 2018 +0100 Fix local polyglossia switch for Arabic We need to lowercase the language again (it's \begin{Arabic}, but \textarabic) Fixes: #11057. (cherry picked from commit 27584f5f7033f6abe127e66b4f5114663e043157) --- src/output_latex.cpp | 30 -- status.23x |2 ++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 67f9bdd..fa890f5 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -142,11 +142,16 @@ string const getPolyglossiaEnvName(Language const * lang) string const getPolyglossiaBegin(string const & lang_begin_command, -string const & lang, string const & opts) +string const & lang, string const & opts, +bool const localswitch = false) { string result; - if (!lang.empty()) - result = subst(lang_begin_command, "$$lang", lang); + if (!lang.empty()) { + // we need to revert the upcasing done in getPolyglossiaEnvName() + // in case we have a local polyglossia command (\textarabic). + string language = localswitch ? ascii_lowercase(lang) : lang; + result = subst(lang_begin_command, "$$lang", language); + } string options = opts.empty() ? string() : "[" + opts + "]"; result = subst(result, "$$opts", options); @@ -905,7 +910,9 @@ void TeXOnePar(Buffer const & buf, && (par_lang != openLanguageName(state) || localswitch) && !par_lang.empty()) { string bc = use_polyglossia ? - getPolyglossiaBegin(lang_begin_command, par_lang, par_language->polyglossiaOpts()) + getPolyglossiaBegin(lang_begin_command, par_lang, + par_language->polyglossiaOpts(), + localswitch) : subst(lang_begin_command, "$$lang", par_lang); os << bc; os << lang_command_termination; @@ -964,11 +971,13 @@ void TeXOnePar(Buffer const & buf, if (runparams.encoding->package() == Encoding::CJK && par_lang != openLanguageName(state) && !par_lang.empty()) { - os << from_ascii(subst( - lang_begin_command, - "$$lang", - par_lang)) - << lang_command_termination; + string bc = use_polyglossia ? + getPolyglossiaBegin(lang_begin_command, par_lang, + par_language->polyglossiaOpts(), + localswitch) + : subst(lang_begin_command, "$$lang", par_lang); + os << bc + << lang_command_termination; if (using_begin_end) pushLanguageName(par_lang, localswitch); } @@ -1135,7 +1144,8 @@ void TeXOnePar(Buffer const & buf, && current_lang != openLanguageName(state)) { string bc = use_polyglossia ? getPolyglossiaBegin(lang_begin_command, current_lang, - current_language->polyglossiaOpts()) + current_language->polyglossiaOpts(), + localswitch) : subst(lang_begin_command, "$$lang", current_lang); os << bc; pending_newline = !localswitch; diff --git a/status.23x b/status.23x index e828faa..715c252 100644 --- a/status.23x +++ b/status.23x @@ -60,6 +60,8 @@ What's new - Do not embrace numbers in \beginL ... \endL with polyglossia in Right- to-Left languages, since bidi handles the numbers automatically. +- Fix polyglossia language
[LyX/2.3.2-staging] tex2lyx: support alignment pseudo-environments.
commit 30cb99503f21c123976f968d61484632d93353e4 Author: Juergen SpitzmuellerDate: Tue Mar 6 17:54:32 2018 +0100 tex2lyx: support alignment pseudo-environments. Fixes: #7857 (cherry picked from commit 7a22ce7c09f54ca70f30dde05c3f77c478195e45) --- src/tex2lyx/text.cpp | 14 ++ status.23x |3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 5fd4f0a..914b42c 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1896,12 +1896,18 @@ void parse_environment(Parser & p, ostream & os, bool outer, // Alignment and spacing settings // FIXME (bug ): These settings can span multiple paragraphs and // therefore are totally broken! - // Note that \centering, raggedright, and raggedleft cannot be handled, as + // Note that \centering, \raggedright, and \raggedleft cannot be handled, as // they are commands not environments. They are furthermore switches that // can be ended by another switches, but also by commands like \footnote or // \parbox. So the only safe way is to leave them untouched. + // However, we support the pseudo-environments + // \begin{centering} ... \end{centering} + // \begin{raggedright} ... \end{raggedright} + // \begin{raggedleft} ... \end{raggedleft} + // since they are used by LyX in floats (for spacing reasons) else if (name == "center" || name == "centering" || -name == "flushleft" || name == "flushright" || +name == "flushleft" || name == "raggedright" || +name == "flushright" || name == "raggedleft" || name == "singlespace" || name == "onehalfspace" || name == "doublespace" || name == "spacing") { eat_whitespace(p, os, parent_context, false); @@ -1910,9 +1916,9 @@ void parse_environment(Parser & p, ostream & os, bool outer, parent_context.check_end_layout(os); parent_context.new_paragraph(os); } - if (name == "flushleft") + if (name == "flushleft" || name == "raggedright") parent_context.add_extra_stuff("\\align left\n"); - else if (name == "flushright") + else if (name == "flushright" || name == "raggedleft") parent_context.add_extra_stuff("\\align right\n"); else if (name == "center" || name == "centering") parent_context.add_extra_stuff("\\align center\n"); diff --git a/status.23x b/status.23x index 715c252..ed12ee8 100644 --- a/status.23x +++ b/status.23x @@ -107,6 +107,9 @@ What's new - Add support for biblatex. +- Add support for alignment pseudo-environments as used inside floats + (bug 7857). + * ADVANCED FIND AND REPLACE
[LyX/2.3.1-staging] Fix the implementation of new libertine package
commit 4ec133e1aeea862bbde3e2f9178f7bbc0df05213 Author: Juergen SpitzmuellerDate: Fri Mar 2 12:17:33 2018 +0100 Fix the implementation of new libertine package Needs to go to 2.3.1-staging (cherry picked from commit 905516fd706a90148a458f9936c565cbe5fcfcff) --- lib/chkconfig.ltx |1 + lib/latexfonts|9 - status.23x|2 ++ 3 files changed, 11 insertions(+), 1 deletions(-) diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 6573ef0..7a07851 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -446,6 +446,7 @@ \TestPackage{lh-lcy} \TestPackage{libertine} \TestPackage{fontaxes} % required by libertine +\TestPackage{libertine} \TestPackage{libertine-type1} \TestPackage{libertineMono-type1} \TestPackage{libertineMono} diff --git a/lib/latexfonts b/lib/latexfonts index 5cc0b3f..a0a93ee 100644 --- a/lib/latexfonts +++ b/lib/latexfonts @@ -171,10 +171,17 @@ Font libertine Family rm OsfOptionosf Package libertineRoman - CompleteFont libertine + CompleteFont libertine-full AltFonts libertine-type1,libertine-2012,libertine-legacy EndFont +AltFont libertine-full + GuiName "Libertine" + Family rm + Package libertine + Requires libertineRoman +EndFont + AltFont libertine-type1 GuiName "Libertine" Family rm diff --git a/status.23x b/status.23x index 3d1d7b6..6c71962 100644 --- a/status.23x +++ b/status.23x @@ -39,6 +39,8 @@ What's new - Properly escape labels entered for included program listings in Insert > File > Child Document (part of bug 10544). +- Fix the implementation of new libertine font package. + * LYX2LYX
[LyX/master] Fix local polyglossia switch for Arabic
commit 27584f5f7033f6abe127e66b4f5114663e043157 Author: Juergen SpitzmuellerDate: Tue Mar 6 15:31:43 2018 +0100 Fix local polyglossia switch for Arabic We need to lowercase the language again (it's \begin{Arabic}, but \textarabic) Fixes: #11057. --- src/output_latex.cpp | 30 -- 1 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/output_latex.cpp b/src/output_latex.cpp index c57663d..c91c069 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -142,11 +142,16 @@ string const getPolyglossiaEnvName(Language const * lang) string const getPolyglossiaBegin(string const & lang_begin_command, -string const & lang, string const & opts) +string const & lang, string const & opts, +bool const localswitch = false) { string result; - if (!lang.empty()) - result = subst(lang_begin_command, "$$lang", lang); + if (!lang.empty()) { + // we need to revert the upcasing done in getPolyglossiaEnvName() + // in case we have a local polyglossia command (\textarabic). + string language = localswitch ? ascii_lowercase(lang) : lang; + result = subst(lang_begin_command, "$$lang", language); + } string options = opts.empty() ? string() : "[" + opts + "]"; result = subst(result, "$$opts", options); @@ -903,7 +908,9 @@ void TeXOnePar(Buffer const & buf, && (par_lang != openLanguageName(state) || localswitch) && !par_lang.empty()) { string bc = use_polyglossia ? - getPolyglossiaBegin(lang_begin_command, par_lang, par_language->polyglossiaOpts()) + getPolyglossiaBegin(lang_begin_command, par_lang, + par_language->polyglossiaOpts(), + localswitch) : subst(lang_begin_command, "$$lang", par_lang); os << bc; os << lang_command_termination; @@ -962,11 +969,13 @@ void TeXOnePar(Buffer const & buf, if (runparams.encoding->package() == Encoding::CJK && par_lang != openLanguageName(state) && !par_lang.empty()) { - os << from_ascii(subst( - lang_begin_command, - "$$lang", - par_lang)) - << lang_command_termination; + string bc = use_polyglossia ? + getPolyglossiaBegin(lang_begin_command, par_lang, + par_language->polyglossiaOpts(), + localswitch) + : subst(lang_begin_command, "$$lang", par_lang); + os << bc + << lang_command_termination; if (using_begin_end) pushLanguageName(par_lang, localswitch); } @@ -1133,7 +1142,8 @@ void TeXOnePar(Buffer const & buf, && current_lang != openLanguageName(state)) { string bc = use_polyglossia ? getPolyglossiaBegin(lang_begin_command, current_lang, - current_language->polyglossiaOpts()) + current_language->polyglossiaOpts(), + localswitch) : subst(lang_begin_command, "$$lang", current_lang); os << bc; pending_newline = !localswitch;
[LyX/2.3.2-staging] Remove duplicate entries.
commit 566f3688859b6343369dcda35a3d8663d4167127 Author: Juergen SpitzmuellerDate: Tue Mar 6 17:31:19 2018 +0100 Remove duplicate entries. --- status.23x |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/status.23x b/status.23x index 7d0cb28..3698b06 100644 --- a/status.23x +++ b/status.23x @@ -21,10 +21,6 @@ What's new * TEX2LYX IMPROVEMENTS -- support for most commands provided by the biblatex package - -- support biblatex's qualified citation lists: - \cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}... * USER INTERFACE
[LyX/master] tex2lyx: support alignment pseudo-environments.
commit 7a22ce7c09f54ca70f30dde05c3f77c478195e45 Author: Juergen SpitzmuellerDate: Tue Mar 6 17:54:32 2018 +0100 tex2lyx: support alignment pseudo-environments. Fixes: #7857 --- src/tex2lyx/text.cpp | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 09f0037..f37f577 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1896,12 +1896,18 @@ void parse_environment(Parser & p, ostream & os, bool outer, // Alignment and spacing settings // FIXME (bug ): These settings can span multiple paragraphs and // therefore are totally broken! - // Note that \centering, raggedright, and raggedleft cannot be handled, as + // Note that \centering, \raggedright, and \raggedleft cannot be handled, as // they are commands not environments. They are furthermore switches that // can be ended by another switches, but also by commands like \footnote or // \parbox. So the only safe way is to leave them untouched. + // However, we support the pseudo-environments + // \begin{centering} ... \end{centering} + // \begin{raggedright} ... \end{raggedright} + // \begin{raggedleft} ... \end{raggedleft} + // since they are used by LyX in floats (for spacing reasons) else if (name == "center" || name == "centering" || -name == "flushleft" || name == "flushright" || +name == "flushleft" || name == "raggedright" || +name == "flushright" || name == "raggedleft" || name == "singlespace" || name == "onehalfspace" || name == "doublespace" || name == "spacing") { eat_whitespace(p, os, parent_context, false); @@ -1910,9 +1916,9 @@ void parse_environment(Parser & p, ostream & os, bool outer, parent_context.check_end_layout(os); parent_context.new_paragraph(os); } - if (name == "flushleft") + if (name == "flushleft" || name == "raggedright") parent_context.add_extra_stuff("\\align left\n"); - else if (name == "flushright") + else if (name == "flushright" || name == "raggedleft") parent_context.add_extra_stuff("\\align right\n"); else if (name == "center" || name == "centering") parent_context.add_extra_stuff("\\align center\n");
[LyX/2.3.2-staging] status.23x: mention the new biblatex support in tex2lyx
commit 150fb89e22742dcf1f61500b498bc9e7e2a7702c Author: Uwe StöhrDate: Tue Mar 6 13:52:42 2018 +0100 status.23x: mention the new biblatex support in tex2lyx --- status.23x |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/status.23x b/status.23x index 3698b06..7d0cb28 100644 --- a/status.23x +++ b/status.23x @@ -21,6 +21,10 @@ What's new * TEX2LYX IMPROVEMENTS +- support for most commands provided by the biblatex package + +- support biblatex's qualified citation lists: + \cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}... * USER INTERFACE
[LyX/master] tex2lyx: fix subfloat import
commit 1dcb2a09766335aecbe3c8599d09358e135d699c Author: Juergen SpitzmuellerDate: Tue Mar 6 10:35:55 2018 +0100 tex2lyx: fix subfloat import Fixes: #10385 --- src/tex2lyx/text.cpp | 33 - 1 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index cda081b..09f0037 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -3182,7 +3182,6 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, if (t.cs() == "subfloat") { // the syntax is \subfloat[list entry][sub caption]{content} // if it is a table of figure depends on the surrounding float - // FIXME: second optional argument is not parsed p.skip_spaces(); // do nothing if there is no outer float if (!float_type.empty()) { @@ -3201,6 +3200,12 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, caption = parse_text_snippet(p, FLAG_BRACK_LAST, outer, context); has_caption = true; } + // In case we have two optional args, the second is the caption. + if (p.next_token().cat() != catEscape && + p.next_token().character() == '[') { + p.get_token(); // eat '[' + caption = parse_text_snippet(p, FLAG_BRACK_LAST, outer, context); + } // the content parse_text_in_inset(p, os, FLAG_ITEM, outer, context); // the caption comes always as the last @@ -3214,31 +3219,25 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, newcontext.check_layout(os); os << caption << "\n"; newcontext.check_end_layout(os); - // We don't need really a new paragraph, but - // we must make sure that the next item gets a \begin_layout. - //newcontext.new_paragraph(os); end_inset(os); p.skip_spaces(); + // close the layout we opened + os << "\n\\end_layout"; } - // We don't need really a new paragraph, but - // we must make sure that the next item gets a \begin_layout. - if (has_caption) - context.new_paragraph(os); end_inset(os); p.skip_spaces(); - context.check_end_layout(os); - // close the layout we opened - if (has_caption) - os << "\n\\end_layout\n"; } else { // if the float type is not supported or there is no surrounding float // output it as ERT + string opt_arg1; + string opt_arg2; if (p.hasOpt()) { - string opt_arg = convert_command_inset_arg(p.getArg('[', ']')); - output_ert_inset(os, t.asInput() + '[' + opt_arg + - "]{" + p.verbatim_item() + '}', context); - } else - output_ert_inset(os, t.asInput() + "{" + p.verbatim_item() + '}', context); + opt_arg1 = convert_command_inset_arg(p.getFullOpt()); + if (p.hasOpt()) + opt_arg2 = convert_command_inset_arg(p.getFullOpt()); + } + output_ert_inset(os, t.asInput() + opt_arg1 + opt_arg2 ++ "{" + p.verbatim_item() + '}', context); } continue; }