2 * \file InsetArgument.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 "InsetArgument.h"
15 #include "support/debug.h"
16 #include "support/docstream.h"
17 #include "support/gettext.h"
24 InsetArgument::InsetArgument(Buffer * buf)
25 : InsetCollapsable(buf)
29 void InsetArgument::write(ostream & os) const
31 os << "OptArg" << "\n";
32 InsetCollapsable::write(os);
36 int InsetArgument::latex(odocstream &, OutputParams const &) const
42 int InsetArgument::plaintext(odocstream &, OutputParams const &) const
44 return 0; // do not output optional arguments
48 int InsetArgument::docbook(odocstream &, OutputParams const &) const
54 docstring InsetArgument::xhtml(XHTMLStream &, OutputParams const &) const
59 int InsetArgument::latexArgument(odocstream & os,
60 OutputParams const & runparams, bool optional) const
63 int ret = InsetText::latex(ss, runparams);
64 docstring str = ss.str();
65 if (optional && str.find(']') != docstring::npos)
66 str = '{' + str + '}';
67 os << (optional ? '[' : '{') << str
68 << (optional ? ']' : '}');