2 * \file InsetOptArg.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Martin Vermeer
8 * Full author contact details are available in file CREDITS.
13 #include "InsetOptArg.h"
15 #include "support/debug.h"
16 #include "support/docstream.h"
17 #include "support/gettext.h"
24 InsetOptArg::InsetOptArg(Buffer const & buf)
25 : InsetCollapsable(buf)
29 docstring InsetOptArg::editMessage() const
31 return _("Opened Optional Argument Inset");
35 void InsetOptArg::write(ostream & os) const
37 os << "OptArg" << "\n";
38 InsetCollapsable::write(os);
42 int InsetOptArg::latex(odocstream &, OutputParams const &) const
48 int InsetOptArg::plaintext(odocstream &, OutputParams const &) const
50 return 0; // do not output optional arguments
54 int InsetOptArg::docbook(odocstream &, OutputParams const &) const
60 docstring InsetOptArg::xhtml(odocstream &, OutputParams const &) const
65 int InsetOptArg::latexOptional(odocstream & os,
66 OutputParams const & runparams) const
69 int ret = InsetText::latex(ss, runparams);
70 docstring str = ss.str();
71 if (str.find(']') != docstring::npos)
72 str = '{' + str + '}';
73 os << '[' << str << ']';