-int InsetCollapsable::latex(odocstream & os,
- OutputParams const & runparams) const
-{
- // This implements the standard way of handling the LaTeX output of
- // a collapsable inset, either a command or an environment. Standard
- // collapsable insets should not redefine this, non-standard ones may
- // call this.
- InsetLayout const & il = getLayout();
- if (!il.latexname().empty()) {
- if (il.latextype() == InsetLayout::COMMAND) {
- // FIXME UNICODE
- if (runparams.moving_arg)
- os << "\\protect";
- os << '\\' << from_utf8(il.latexname());
- if (!il.latexparam().empty())
- os << from_utf8(il.latexparam());
- os << '{';
- } else if (il.latextype() == InsetLayout::ENVIRONMENT) {
- os << "%\n\\begin{" << from_utf8(il.latexname()) << "}\n";
- if (!il.latexparam().empty())
- os << from_utf8(il.latexparam());
- }
- }
- OutputParams rp = runparams;
- if (il.isPassThru())
- rp.verbatim = true;
- if (il.isNeedProtect())
- rp.moving_arg = true;
- int i = InsetText::latex(os, rp);
- if (!il.latexname().empty()) {
- if (il.latextype() == InsetLayout::COMMAND) {
- os << "}";
- } else if (il.latextype() == InsetLayout::ENVIRONMENT) {
- os << "\n\\end{" << from_utf8(il.latexname()) << "}\n";
- i += 4;
- }
- }
- return i;
-}
-
-
-// FIXME It seems as if it ought to be possible to do this more simply,
-// maybe by calling InsetText::docbook() in the middle there.
-int InsetCollapsable::docbook(odocstream & os, OutputParams const & runparams) const