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 void InsetEnvironment::write(ostream & os) const
40 os << "Environment " << to_utf8(name()) << "\n";
45 void InsetEnvironment::read(Lexer & lex)
51 docstring InsetEnvironment::editMessage() const
53 return _("Opened Environment Inset: ") + name();
57 int InsetEnvironment::latex(odocstream & os,
58 OutputParams const & runparams) const
61 os << from_utf8(layout_.latexheader);
63 latexParagraphs(buffer(), text_, os, texrow, runparams,
64 layout_.latexparagraph);
66 os << from_utf8(layout_.latexfooter);
71 int InsetEnvironment::plaintext(odocstream & os,
72 OutputParams const & runparams) const
74 os << '[' << to_utf8(name()) << ":\n";
75 InsetText::plaintext(os, runparams);
78 return PLAINTEXT_NEWLINE + 1; // one char on a separate line
82 Layout const & InsetEnvironment::layout() const