- ostringstream ss;
- if (params_.type == InsetNoteParams::Comment)
- ss << "<comment>\n";
-
- inset.linuxdoc(buf, ss, runparams);
-
+ OutputParams runparams(runparams_in);
+ string type;
+ if (params_.type == InsetNoteParams::Comment) {
+ type = "comment";
+ runparams.inComment = true;
+ // Ignore files that are exported inside a comment
+ runparams.exportdata.reset(new ExportData);
+ } else if (params_.type == InsetNoteParams::Greyedout)
+ type = "lyxgreyedout";
+ else if (params_.type == InsetNoteParams::Framed)
+ type = "framed";
+ else if (params_.type == InsetNoteParams::Shaded)
+ type = "shaded";
+
+ odocstringstream ss;
+ ss << "%\n\\begin{" << from_ascii(type) << "}\n";
+ InsetText::latex(buf, ss, runparams);
+ ss << "\n\\end{" << from_ascii(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.