diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 7c3dcc2da7..bd7a0d203c 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1161,6 +1161,8 @@ void parse_environment(Parser & p, ostream & os, bool outer, } else if (parent_context.textclass.floats().typeExist(unstarred_name)) { + eat_whitespace(p, os, parent_context, false); + string const opt = p.hasOpt() ? p.getArg('[', ']') : string(); eat_whitespace(p, os, parent_context, false); parent_context.check_layout(os); begin_inset(os, "Float " + unstarred_name + "\n"); @@ -1172,8 +1174,8 @@ void parse_environment(Parser & p, ostream & os, bool outer, float_type = unstarred_name; else float_type = ""; - if (p.hasOpt()) - os << "placement " << p.getArg('[', ']') << '\n'; + if (!opt.empty()) + os << "placement " << opt << '\n'; os << "wide " << convert(is_starred) << "\nsideways false" << "\nstatus open\n\n"; diff --git a/status.20x b/status.20x index a4c0927c86..14181e410f 100644 --- a/status.20x +++ b/status.20x @@ -170,6 +170,9 @@ What's new - Fix tex2lyx handling of description \item with spaces (bug 7663). +- tex2lyx does not start floats with lines containing only a single space + anymore (bug 7895). + - Store the autosave files of unnamed buffers in the correct directory and make sure they are not left behind after saving (bug 7793).