else if (cit->first == "child") {
label = qt_("Child Documents");
in_other_list = false;
- } else if (cit->first == "equation")
+ } else if (cit->first == "embedded")
+ label = qt_("Embedded Files");
+ else if (cit->first == "equation")
label = qt_("List of Equations");
else if (cit->first == "index")
label = qt_("List of Indexes");
void InsetInclude::addToToc(ParConstIterator const & cpit) const
{
+ bool const embedded_status = !params()["embed"].empty();
+ TocBackend & backend = buffer().tocBackend();
+
if (isListings(params())) {
if (label_)
label_->addToToc(cpit);
string caption = p.getParamValue("caption");
if (caption.empty())
return;
- Toc & toc = buffer().tocBackend().toc("listing");
+ Toc & toc = backend.toc("listing");
docstring const str = convert<docstring>(toc.size() + 1)
+ ". " + from_utf8(caption);
ParConstIterator pit = cpit;
pit.push_back(*this);
toc.push_back(TocItem(pit, 0, str));
+ if (embedded_status)
+ backend.toc("embedded").push_back(TocItem(cpit, 0, str));
return;
}
Buffer const * const childbuffer = getChildBuffer(buffer(), params());
- if (!childbuffer)
+ if (!childbuffer) {
+ if (embedded_status)
+ // Add it to the embedded list nonetheless.
+ backend.toc("embedded").push_back(TocItem(cpit, 0,
+ params()["filename"]));
return;
+ }
- Toc & toc = buffer().tocBackend().toc("child");
+ Toc & toc = backend.toc("child");
docstring str = childbuffer->fileName().displayName();
- if (!params()["embed"].empty())
+ if (embedded_status)
str += _(" (embedded)");
toc.push_back(TocItem(cpit, 0, str));
+ if (embedded_status)
+ backend.toc("embedded").push_back(TocItem(cpit, 0, str));
- TocList & toclist = buffer().tocBackend().tocs();
+ TocList & toclist = backend.tocs();
TocList const & childtoclist = childbuffer->tocBackend().tocs();
TocList::const_iterator it = childtoclist.begin();
TocList::const_iterator const end = childtoclist.end();