2 * \file InsetEnvironment.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InsetEnvironment.h"
16 #include "BufferParams.h"
18 #include "OutputParams.h"
19 #include "output_latex.h"
21 #include "TextClass.h"
23 #include "support/gettext.h"
30 InsetEnvironment::InsetEnvironment(Buffer const & buf, docstring const & name)
31 : InsetText(buf), layout_(buf.params().documentClass()[name]), name_(name)
33 setAutoBreakRows(true);
38 InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
39 : InsetText(in), layout_(in.layout_)
43 void InsetEnvironment::write(ostream & os) const
45 os << "Environment " << to_utf8(name()) << "\n";
50 void InsetEnvironment::read(Lexer & lex)
56 docstring InsetEnvironment::editMessage() const
58 return _("Opened Environment Inset: ") + name();
62 int InsetEnvironment::latex(odocstream & os,
63 OutputParams const & runparams) const
66 os << from_utf8(layout_->latexheader);
68 latexParagraphs(buffer(), text_, os, texrow, runparams,
69 layout_->latexparagraph);
71 os << from_utf8(layout_->latexfooter);
76 int InsetEnvironment::plaintext(odocstream & os,
77 OutputParams const & runparams) const
79 os << '[' << to_utf8(name()) << ":\n";
80 InsetText::plaintext(os, runparams);
83 return PLAINTEXT_NEWLINE + 1; // one char on a separate line
87 LayoutPtr const & InsetEnvironment::layout() const