2 * \file InsetMarginal.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
14 #include "InsetMarginal.h"
17 #include "OutputParams.h"
18 #include "TocBackend.h"
20 #include "support/gettext.h"
28 InsetMarginal::InsetMarginal(Buffer const & buf)
33 docstring InsetMarginal::editMessage() const
35 return _("Opened Marginal Note Inset");
39 int InsetMarginal::latex(odocstream & os, OutputParams const & runparams) const
41 os << "%\n\\marginpar{";
42 int const i = InsetText::latex(os, runparams);
48 int InsetMarginal::plaintext(odocstream & os,
49 OutputParams const & runparams) const
51 os << '[' << buffer().B_("margin") << ":\n";
52 InsetText::plaintext(os, runparams);
55 return PLAINTEXT_NEWLINE + 1; // one char on a separate line
59 int InsetMarginal::docbook(odocstream & os,
60 OutputParams const & runparams) const
62 os << "<note role=\"margin\">";
63 int const i = InsetText::docbook(os, runparams);
70 void InsetMarginal::addToToc(ParConstIterator const & cpit) const
72 ParConstIterator pit = cpit;
75 Toc & toc = buffer().tocBackend().toc("marginalnote");
77 str = getNewLabel(str);
78 toc.push_back(TocItem(pit, 0, str));