- return InsetText::latex(os, runparams);
-}
-
-
-int InsetCaption::getOptArg(odocstream & os,
- OutputParams const & runparams) const
-{
- return latexArgInsets(paragraphs()[0], os, runparams, 0, 1);
+ InsetLayout const & il = getLayout();
+
+ if (!il.leftdelim().empty())
+ os << il.leftdelim();
+
+ OutputParams rp = runparams;
+ if (isPassThru())
+ rp.pass_thru = true;
+ if (il.isNeedProtect())
+ rp.moving_arg = true;
+ if (il.isNeedMBoxProtect())
+ ++rp.inulemcmd;
+ rp.par_begin = 0;
+ rp.par_end = paragraphs().size();
+
+ // Output the contents of the inset
+ if (!paragraphs().empty())
+ os.texrow().forceStart(paragraphs()[0].id(), 0);
+ latexParagraphs(buffer(), text(), os, rp);
+ runparams.encoding = rp.encoding;
+
+ if (!il.rightdelim().empty())
+ os << il.rightdelim();