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 "BufferParams.h"
18 #include "OutputParams.h"
19 #include "TocBackend.h"
21 #include "support/docstream.h"
22 #include "support/gettext.h"
27 InsetMarginal::InsetMarginal(Buffer const & buf)
32 docstring InsetMarginal::editMessage() const
34 return _("Opened Marginal Note Inset");
38 int InsetMarginal::latex(odocstream & os, OutputParams const & runparams) const
40 os << "%\n\\marginpar{";
41 int const i = InsetText::latex(os, runparams);
47 int InsetMarginal::plaintext(odocstream & os,
48 OutputParams const & runparams) const
50 os << '[' << buffer().B_("margin") << ":\n";
51 InsetText::plaintext(os, runparams);
54 return PLAINTEXT_NEWLINE + 1; // one char on a separate line
58 int InsetMarginal::docbook(odocstream & os,
59 OutputParams const & runparams) const
61 os << "<note role=\"margin\">";
62 int const i = InsetText::docbook(os, runparams);
69 void InsetMarginal::addToToc(DocIterator const & cpit)
71 DocIterator pit = cpit;
72 pit.push_back(CursorSlice(*this));
74 Toc & toc = buffer().tocBackend().toc("marginalnote");
76 str = getNewLabel(str);
77 toc.push_back(TocItem(pit, 0, str));
78 // Proceed with the rest of the inset.
79 InsetFootlike::addToToc(cpit);