#include "TocBackend.h"
#include "support/debug.h"
+#include "support/docstream.h"
#include "support/lstrings.h"
#include <ostream>
if (!outer.layout().intitle && cnts.hasCounter(foot)) {
cnts.step(foot);
// FIXME: the counter should format itself.
- setLabel(support::bformat(from_ascii("%1$s %2$s"),
- getLayout(buffer().params()).labelstring(),
- cnts.theCounter(foot)));
+ custom_label_= support::bformat(from_ascii("%1$s %2$s"),
+ getLayout(buffer().params()).labelstring(),
+ cnts.theCounter(foot));
+ setLabel(custom_label_);
}
InsetCollapsable::updateLabels(it);
Toc & toc = buffer().tocBackend().toc("footnote");
// FIXME: we probably want the footnote number too.
docstring str;
- str = getNewLabel(str);
+ str = custom_label_ + ": " + getNewLabel(str);
toc.push_back(TocItem(pit, 0, str));
}
+docstring InsetFoot::toolTip(BufferView const & bv, int x, int y) const
+{
+ docstring default_tip = InsetCollapsable::toolTip(bv, x, y);
+ OutputParams rp(&buffer().params().encoding());
+ odocstringstream ods;
+ InsetText::plaintext(ods, rp);
+ docstring foot_tip = custom_label_ + ": " + ods.str();
+ // shorten it if necessary
+ if (foot_tip.size() > 200)
+ foot_tip = foot_tip.substr(0, 200) + "...";
+ if (!isOpen() && !foot_tip.empty())
+ return foot_tip + '\n' + default_tip;
+ return default_tip;
+}
+
+
int InsetFoot::latex(odocstream & os, OutputParams const & runparams_in) const
{
OutputParams runparams = runparams_in;
#include "InsetMarginal.h"
#include "Buffer.h"
+#include "BufferParams.h"
#include "OutputParams.h"
#include "TocBackend.h"
+#include "support/docstream.h"
#include "support/gettext.h"
#include <ostream>
}
+docstring InsetMarginal::toolTip(BufferView const & bv, int x, int y) const
+{
+ docstring default_tip = InsetCollapsable::toolTip(bv, x, y);
+ OutputParams rp(&buffer().params().encoding());
+ odocstringstream ods;
+ InsetText::plaintext(ods, rp);
+ docstring margin_tip = ods.str();
+ // shorten it if necessary
+ if (margin_tip.size() > 200)
+ margin_tip = margin_tip.substr(0, 200) + "...";
+ if (!isOpen() && !margin_tip.empty())
+ return margin_tip + '\n' + default_tip;
+ return default_tip;
+}
+
+
int InsetMarginal::latex(odocstream & os, OutputParams const & runparams) const
{
os << "%\n\\marginpar{";