- docstring str = ss.str();
- docstring const sep = str.empty() ? docstring() : from_ascii(", ");
- if (!presetarg.empty())
- str = presetarg + sep + str;
- if (ldelim != "{" && support::contains(str, rdelim))
- str = '{' + str + '}';
- // TODO: append texrow information
- os << ldelim << str << rdelim;
+ TexString ts = ots.release();
+ bool const add_braces = !ldelim.empty() && ldelim != "{"
+ && support::contains(ts.str, rdelim);
+ os << ldelim;
+ if (add_braces)
+ os << '{';
+ os << presetarg;
+ if (!presetarg.empty() && !ts.str.empty())
+ os << ", ";
+ os << move(ts);
+ if (add_braces)
+ os << '}';
+ os << rdelim;
+}
+
+
+void InsetArgument::addToToc(DocIterator const & dit, bool output_active,
+ UpdateType utype, TocBackend & backend) const
+{
+ if (!caption_of_toc_.empty()) {
+ docstring str;
+ text().forOutliner(str, TOC_ENTRY_LENGTH);
+ backend.builder(caption_of_toc_).argumentItem(str);
+ }
+ // Proceed with the rest of the inset.
+ InsetText::addToToc(dit, output_active, utype, backend);
+}
+
+
+void InsetArgument::fixParagraphLanguage(Language const * l)
+{
+ Font font(inherit_font, l);
+ if (pass_thru_)
+ font.setLanguage(latex_language);
+ paragraphs().front().resetFonts(font);