+ // the common case
+ Buffer const * const childbuffer = loadIfNeeded();
+
+ TocBuilder & b = backend.builder("child");
+ string const fname = ltrim(to_utf8(params()["filename"]));
+ // mark non-existent file with MISSING
+ docstring const str = (file_exist_ ? from_ascii("") : _("MISSING: "))
+ + from_utf8(onlyFileName(fname)) + " (" + from_utf8(fname) + ")";
+ b.pushItem(cpit, str, output_active);
+ b.pop();
+
+ if (!childbuffer)
+ return;
+
+ if (checkForRecursiveInclude(childbuffer))
+ return;
+ buffer().pushIncludedBuffer(childbuffer);
+ // Update the child's tocBackend. The outliner uses the master's, but
+ // the navigation menu uses the child's.
+ childbuffer->tocBackend().update(output_active, utype);
+ // Include Tocs from children
+ childbuffer->inset().addToToc(DocIterator(), output_active, utype,
+ backend);
+ buffer().popIncludedBuffer();
+ // Copy missing outliner names (though the user has been warned against
+ // having different document class and module selection between master
+ // and child).
+ for (auto const & name
+ : childbuffer->params().documentClass().outlinerNames())
+ backend.addName(name.first, translateIfPossible(name.second));