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 * buf)
25 : InsetCollapsable(buf)
29 void InsetOptArg::write(ostream & os) const
31 os << "OptArg" << "\n";
32 InsetCollapsable::write(os);
36 int InsetOptArg::latex(odocstream &, OutputParams const &) const
42 int InsetOptArg::plaintext(odocstream &, OutputParams const &) const
44 return 0; // do not output optional arguments
48 int InsetOptArg::docbook(odocstream &, OutputParams const &) const
54 docstring InsetOptArg::xhtml(XHTMLStream &, OutputParams const &) const
59 int InsetOptArg::latexOptional(odocstream & os,
60 OutputParams const & runparams) const
63 int ret = InsetText::latex(ss, runparams);
64 docstring str = ss.str();
65 if (str.find(']') != docstring::npos)
66 str = '{' + str + '}';
67 os << '[' << str << ']';