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 << "Argument" << "\n";
32 InsetCollapsable::write(os);
35 void InsetArgument::latexArgument(otexstream & os,
36 OutputParams const & runparams, bool optional) const
40 otexstream ots(ss, texrow);
41 InsetText::latex(ots, runparams);
42 docstring str = ss.str();
43 if (optional && str.find(']') != docstring::npos)
44 str = '{' + str + '}';
45 os << (optional ? '[' : '{') << str
46 << (optional ? ']' : '}');