]> git.lyx.org Git - features.git/blobdiff - src/insets/insetnote.C
Fix bug 2768 (inset comment eats space after it)
[features.git] / src / insets / insetnote.C
index 3437fb12fb4ef16d117e2bbd55fa26b245272fa1..0fec72f0d0101eea3af0c03428672d0bfddfa1ed 100644 (file)
@@ -265,7 +265,20 @@ int InsetNote::latex(Buffer const & buf, ostream & os,
        ostringstream ss;
        ss << "%\n\\begin{" << type << "}\n";
        InsetText::latex(buf, ss, runparams);
-       ss << "%\n\\end{" << type << "}\n";
+       ss << "\n\\end{" << type << "}\n";
+       // the space after the comment in 'a[comment] b' will be eaten by the
+       // comment environment since the space before b is ignored with the
+       // following latex output:
+       //
+       // a%
+       // \begin{comment}
+       // comment
+       // \end{comment}
+       //  b
+       //
+       // Adding {} before ' b' fixes this.
+       if (params_.type == InsetNoteParams::Comment)
+               ss << "{}";
 
        string const str = ss.str();
        os << str;