3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jürgen Spitzmüller
10 * Full author contact details are available in file CREDITS.
15 #include "InsetFloat.h"
18 #include "InsetCaption.h"
19 #include "InsetGraphics.h"
20 #include "InsetLabel.h"
23 #include "BufferParams.h"
24 #include "BufferView.h"
27 #include "DispatchResult.h"
29 #include "FloatList.h"
30 #include "FuncRequest.h"
31 #include "FuncStatus.h"
32 #include "LaTeXFeatures.h"
35 #include "output_docbook.h"
36 #include "output_xhtml.h"
37 #include "ParIterator.h"
39 #include "texstream.h"
40 #include "TextClass.h"
41 #include "InsetList.h"
43 #include "support/debug.h"
44 #include "support/docstream.h"
45 #include "support/gettext.h"
46 #include "support/lstrings.h"
48 #include "frontends/Application.h"
51 using namespace lyx::support;
56 // With this inset it will be possible to support the latex package
57 // float.sty, and I am sure that with this and some additional support
58 // classes we can support similar functionality in other formats
60 // By using float.sty we will have the same handling for all floats, both
61 // for those already in existence (table and figure) and all user created
62 // ones¹. So suddenly we give the users the possibility of creating new
63 // kinds of floats on the fly. (and with a uniform look)
66 // \newfloat{type}{placement}{ext}[within]
67 // type - The "type" of the new class of floats, like program or
68 // algorithm. After the appropriate \newfloat, commands
69 // such as \begin{program} or \end{algorithm*} will be
71 // placement - The default placement for the given class of floats.
72 // They are like in standard LaTeX: t, b, p and h for top,
73 // bottom, page, and here, respectively. On top of that
74 // there is a new type, H, which does not really correspond
75 // to a float, since it means: put it "here" and nowhere else.
76 // Note, however that the H specifier is special and, because
77 // of implementation details cannot be used in the second
78 // argument of \newfloat.
79 // ext - The file name extension of an auxiliary file for the list
80 // of figures (or whatever). LaTeX writes the captions to
82 // within - This (optional) argument determines whether floats of this
83 // class will be numbered within some sectional unit of the
84 // document. For example, if within is equal to chapter, the
85 // floats will be numbered within chapters.
87 // style - plain, boxed, ruled
88 // \floatname{float}{floatname}
91 // \floatplacement{float}{placement}
94 // \restylefloat{float}
96 // \listof{type}{title}
99 // ¹ the algorithm float is defined using the float.sty package. Like this
100 // \floatstyle{ruled}
101 // \newfloat{algorithm}{htbp}{loa}[<sect>]
102 // \floatname{algorithm}{Algorithm}
104 // The intention is that floats should be definable from two places:
106 // - the "gui" (i.e. by the user)
108 // From layout files.
109 // This should only be done for floats defined in a documentclass and that
110 // does not need any additional packages. The two most known floats in this
111 // category is "table" and "figure". Floats defined in layout files are only
112 // stored in lyx files if the user modifies them.
115 // There should be a gui dialog (and also a collection of lyxfuncs) where
116 // the user can modify existing floats and/or create new ones.
118 // The individual floats will also have some settable
119 // variables: wide and placement.
123 //FIXME: why do we set in stone the type here?
124 InsetFloat::InsetFloat(Buffer * buf, string const & params_str)
125 : InsetCaptionable(buf)
127 string2params(params_str, params_);
128 setCaptionType(params_.type);
132 // Enforce equality of float type and caption type.
133 void InsetFloat::setCaptionType(std::string const & type)
135 InsetCaptionable::setCaptionType(type);
136 params_.type = captionType();
137 // check if the float type exists
138 if (buffer().params().documentClass().floats().typeExist(params_.type))
141 setLabel(bformat(_("ERROR: Unknown float type: %1$s"), from_utf8(params_.type)));
145 docstring InsetFloat::layoutName() const
147 return "Float:" + from_utf8(params_.type);
151 docstring InsetFloat::toolTip(BufferView const & bv, int x, int y) const
154 return InsetCaptionable::toolTip(bv, x, y);
156 OutputParams rp(&buffer().params().encoding());
157 return getCaptionText(rp);
161 void InsetFloat::doDispatch(Cursor & cur, FuncRequest & cmd)
163 switch (cmd.action()) {
165 case LFUN_INSET_MODIFY: {
166 if (!buffer().params().documentClass().floats().typeExist(cmd.getArg(0))) {
167 // not for us: pass further.
171 InsetFloatParams params;
172 string2params(to_utf8(cmd.argument()), params);
173 cur.recordUndoInset(this);
175 // placement, wide and sideways are not used for subfloats
176 if (!params_.subfloat) {
177 params_.placement = params.placement;
178 params_.wide = params.wide;
179 params_.sideways = params.sideways;
181 params_.alignment = params.alignment;
183 if (params_.type != params.type)
184 setCaptionType(params.type);
185 // what we really want here is a TOC update, but that means
186 // a full buffer update
187 cur.forceBufferUpdate();
191 case LFUN_INSET_DIALOG_UPDATE: {
192 cur.bv().updateDialog("float", params2string(params()));
197 InsetCaptionable::doDispatch(cur, cmd);
203 bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
204 FuncStatus & flag) const
206 switch (cmd.action()) {
208 case LFUN_INSET_MODIFY:
209 if (!buffer().params().documentClass().floats().typeExist(cmd.getArg(0)))
210 return Inset::getStatus(cur, cmd, flag);
212 case LFUN_INSET_DIALOG_UPDATE:
213 flag.setEnabled(true);
216 case LFUN_INSET_SETTINGS:
217 if (InsetCaptionable::getStatus(cur, cmd, flag)) {
218 flag.setEnabled(flag.enabled() && !params_.subfloat);
223 case LFUN_NEWLINE_INSERT:
224 if (params_.subfloat) {
225 flag.setEnabled(false);
232 return InsetCaptionable::getStatus(cur, cmd, flag);
237 bool InsetFloat::hasSubCaptions(ParIterator const & it) const
239 return (it.innerInsetOfType(FLOAT_CODE) || it.innerInsetOfType(WRAP_CODE));
243 string InsetFloat::getAlignment() const
246 string const buf_alignment = buffer().params().float_alignment;
247 if (params_.alignment == "document"
248 && !buf_alignment.empty()) {
249 alignment = buf_alignment;
250 } else if (!params_.alignment.empty()
251 && params_.alignment != "class"
252 && params_.alignment != "document") {
253 alignment = params_.alignment;
259 LyXAlignment InsetFloat::contentAlignment() const
261 LyXAlignment align = LYX_ALIGN_NONE;
262 string alignment = getAlignment();
263 if (alignment == "left")
264 align = LYX_ALIGN_LEFT;
265 else if (alignment == "center")
266 align = LYX_ALIGN_CENTER;
267 else if (alignment == "right")
268 align = LYX_ALIGN_RIGHT;
274 void InsetFloatParams::write(ostream & os) const
277 // Better this than creating a parse error. This in fact happens in the
278 // parameters dialog via InsetFloatParams::params2string.
279 os << "senseless" << '\n';
283 if (!placement.empty())
284 os << "placement " << placement << "\n";
285 if (!alignment.empty())
286 os << "alignment " << alignment << "\n";
291 os << "wide false\n";
294 os << "sideways true\n";
296 os << "sideways false\n";
300 void InsetFloatParams::read(Lexer & lex)
302 lex.setContext("InsetFloatParams::read");
304 if (lex.checkFor("placement"))
306 if (lex.checkFor("alignment"))
308 lex >> "wide" >> wide;
309 lex >> "sideways" >> sideways;
313 void InsetFloat::write(ostream & os) const
317 InsetCaptionable::write(os);
321 void InsetFloat::read(Lexer & lex)
324 InsetCaptionable::read(lex);
325 setCaptionType(params_.type);
329 void InsetFloat::validate(LaTeXFeatures & features) const
331 if (support::contains(params_.placement, 'H'))
332 features.require("float");
334 if (params_.sideways)
335 features.require("rotfloat");
337 if (features.inFloat())
338 features.require("subfig");
340 if (features.inDeletedInset()) {
341 features.require("tikz");
342 features.require("ct-tikz-object-sout");
345 features.useFloat(params_.type, features.inFloat());
346 features.inFloat(true);
347 InsetCaptionable::validate(features);
348 features.inFloat(false);
352 docstring InsetFloat::xhtml(XMLStream & xs, OutputParams const & rp) const
354 FloatList const & floats = buffer().params().documentClass().floats();
355 Floating const & ftype = floats.getType(params_.type);
356 string const & htmltype = ftype.htmlTag();
357 string const & attr = ftype.htmlAttrib();
359 odocstringstream ods;
360 XMLStream newxs(ods);
361 newxs << xml::StartTag(htmltype, attr);
362 InsetText::XHTMLOptions const opts =
363 InsetText::WriteLabel | InsetText::WriteInnerTag;
364 docstring deferred = InsetText::insetAsXHTML(newxs, rp, opts);
365 newxs << xml::EndTag(htmltype);
367 if (rp.inFloat == OutputParams::NONFLOAT) {
368 // In this case, this float needs to be deferred, but we'll put it
369 // before anything the text itself deferred.
370 deferred = ods.str() + '\n' + deferred;
372 // In this case, the whole thing is already being deferred, so
373 // we can write to the stream.
374 // Note that things will already have been escaped, so we do not
375 // want to escape them again.
376 xs << XMLStream::ESCAPE_NONE << ods.str();
382 void InsetFloat::latex(otexstream & os, OutputParams const & runparams_in) const
384 if (runparams_in.inFloat != OutputParams::NONFLOAT) {
385 if (!paragraphs().empty() && !runparams_in.nice)
386 // improve TexRow precision in non-nice mode
389 if (runparams_in.moving_arg)
393 OutputParams rp = runparams_in;
394 rp.moving_arg = true;
395 rp.inFloat = OutputParams::SUBFLOAT;
396 os << getCaption(rp);
398 // The main argument is the contents of the float. This is not a moving argument.
399 rp.moving_arg = false;
400 InsetText::latex(os, rp);
405 OutputParams runparams(runparams_in);
406 runparams.inFloat = OutputParams::MAINFLOAT;
408 FloatList const & floats = buffer().params().documentClass().floats();
409 string tmptype = params_.type;
410 if (params_.sideways && floats.allowsSideways(params_.type))
411 tmptype = "sideways" + params_.type;
412 if (params_.wide && floats.allowsWide(params_.type)
413 && (!params_.sideways ||
414 params_.type == "figure" ||
415 params_.type == "table"))
417 // Figure out the float placement to use.
418 // From lowest to highest:
419 // - float default placement
420 // - document wide default placement
421 // - specific float placement
423 string const buf_placement = buffer().params().float_placement;
424 string const def_placement = floats.defaultPlacement(params_.type);
425 if (params_.placement == "document"
426 && !buf_placement.empty()
427 && buf_placement != def_placement) {
428 tmpplacement = buf_placement;
429 } else if (!params_.placement.empty()
430 && params_.placement != "document"
431 && params_.placement != def_placement) {
432 tmpplacement = params_.placement;
435 // Check if placement is allowed by this float
436 string const allowed_placement =
437 floats.allowedPlacement(params_.type);
439 string::const_iterator lit = tmpplacement.begin();
440 string::const_iterator end = tmpplacement.end();
441 for (; lit != end; ++lit) {
442 if (contains(allowed_placement, *lit))
446 // Force \begin{<floatname>} to appear in a new line.
447 os << breakln << "\\begin{" << from_ascii(tmptype) << '}';
448 if (runparams.lastid != -1)
449 os.texrow().start(runparams.lastid, runparams.lastpos);
450 // We only output placement if different from the def_placement.
451 // sidewaysfloats always use their own page,
452 // therefore don't output the p option that is always set
453 if (!placement.empty()
454 && (!params_.sideways || from_ascii(placement) != "p"))
455 os << '[' << from_ascii(placement) << ']';
458 if (runparams.inDeletedInset) {
459 // This has to be done manually since we need it inside the float
460 OutputParams::CtObject ctobject = runparams.ctObject;
461 runparams.ctObject = OutputParams::CT_DISPLAYOBJECT;
462 Changes::latexMarkChange(os, buffer().params(), Change(Change::UNCHANGED),
463 Change(Change::DELETED), runparams);
464 runparams.ctObject = ctobject;
467 string alignment = getAlignment();
468 if (alignment == "left")
469 os << "\\raggedright" << breakln;
470 else if (alignment == "center")
471 os << "\\centering" << breakln;
472 else if (alignment == "right")
473 os << "\\raggedleft" << breakln;
475 InsetText::latex(os, runparams);
477 if (runparams.inDeletedInset)
480 // Force \end{<floatname>} to appear in a new line.
481 os << breakln << "\\end{" << from_ascii(tmptype) << "}\n";
485 int InsetFloat::plaintext(odocstringstream & os, OutputParams const & runparams, size_t max_length) const
487 os << '[' << buffer().B_("float") << ' '
488 << floatName(params_.type) << ":\n";
489 InsetText::plaintext(os, runparams, max_length);
492 return PLAINTEXT_NEWLINE + 1; // one char on a separate line
496 std::vector<const InsetCollapsible *> findSubfiguresInParagraph(const Paragraph &par)
499 // Don't make the hypothesis that all subfigures are in the same paragraph.
500 // Similarly, there may be several subfigures in the same paragraph (most likely case, based on the documentation).
501 // Any box is considered as a subfigure, even though the most likely case is \minipage.
502 // Boxes are not required to make subfigures. The common root between InsetBox and InsetFLoat is InsetCollapsible.
503 std::vector<const InsetCollapsible *> subfigures;
504 for (pos_type pos = 0; pos < par.size(); ++pos) {
505 const Inset *inset = par.getInset(pos);
508 if (const auto box = dynamic_cast<const InsetBox *>(inset))
509 subfigures.push_back(box);
510 else if (const auto fl = dynamic_cast<const InsetFloat *>(inset))
511 subfigures.push_back(fl);
517 /// Takes an unstructured subfigure container (typically, an InsetBox) and find the elements within:
518 /// actual content (image or table), maybe a caption, maybe a label.
519 std::tuple<InsetCode, const Inset *, const InsetCaption *, const InsetLabel *> docbookParseHopelessSubfigure(const InsetText * subfigure)
521 InsetCode type = NO_CODE;
522 const Inset * content = nullptr;
523 const InsetCaption * caption = nullptr;
524 const InsetLabel * label = nullptr;
526 for (const auto & it : subfigure->paragraphs()) {
527 for (pos_type posIn = 0; posIn < it.size(); ++posIn) {
528 const Inset * inset = it.getInset(posIn);
530 switch (inset->lyxCode()) {
535 type = inset->lyxCode();
540 caption = dynamic_cast<const InsetCaption *>(inset);
542 // A label often hides in a caption. Make a simplified version of the main loop.
544 for (const auto &cit : caption->paragraphs()) {
545 for (pos_type cposIn = 0; cposIn < cit.size(); ++cposIn) {
546 const Inset *cinset = cit.getInset(posIn);
547 if (cinset && cinset->lyxCode() == LABEL_CODE) {
548 label = dynamic_cast<const InsetLabel *>(cinset);
561 label = dynamic_cast<const InsetLabel *>(inset);
569 if (content && caption && label)
573 return std::make_tuple(type, content, caption, label);
577 void docbookSubfigures(XMLStream & xs, OutputParams const & runparams, const InsetCaption * caption,
578 const InsetLabel * label, std::vector<const InsetCollapsible *> const & subfigures)
580 // Ensure there is no label output, it is supposed to be handled as xml:id.
581 OutputParams rpNoLabel = runparams;
583 rpNoLabel.docbook_anchors_to_ignore.emplace(label->screenLabel());
585 // First, open the formal group.
586 docstring attr = docstring();
588 attr += "xml:id=\"" + xml::cleanID(label->screenLabel()) + "\"";
590 xs.startDivision(false);
591 xs << xml::StartTag("formalgroup", attr);
594 xs << xml::StartTag("title"); // Don't take attr here, the ID should only go in one place, not two.
596 caption->getCaptionAsDocBook(xs, rpNoLabel);
599 // No caption has been detected, but this tag is required for the document to be valid DocBook.
601 xs << xml::EndTag("title");
604 // Deal with each subfigure individually. This should also deal with their caption and their label.
605 // This should be a recursive call to InsetFloat.
606 // An item in subfigure should either be an InsetBox containing an InsetFloat, or an InsetBox directly containing
607 // an image or a table, or directly an InsetFloat.
608 for (const InsetCollapsible * subfigure: subfigures) {
609 if (subfigure == nullptr)
612 // The collapsible may already be a float (InsetFloat).
613 if (dynamic_cast<const InsetFloat *>(subfigure)) {
614 subfigure->docbook(xs, runparams);
618 // Subfigures are in boxes, then in InsetFloat.
620 bool foundInsetFloat = false;
621 for (const auto &it : subfigure->paragraphs()) {
622 for (pos_type posIn = 0; posIn < it.size(); ++posIn) {
623 const Inset *inset = it.getInset(posIn);
624 if (inset && inset->lyxCode() == FLOAT_CODE) {
625 foundInsetFloat = true;
626 inset->docbook(xs, runparams);
638 // Subfigures are in boxes, then directly an image or a table. In that case, generate the whole content of the
639 // InsetBox, but not the box container.
640 // Impose some model on the subfigure: at most a caption, at most a label, exactly one figure or one table.
642 InsetCode stype = NO_CODE;
643 const Inset * scontent = nullptr;
644 const InsetCaption * scaption = nullptr;
645 const InsetLabel * slabel = nullptr;
647 std::tie(stype, scontent, scaption, slabel) = docbookParseHopelessSubfigure(subfigure);
649 // If there is something, generate it. This is very much like docbookNoSubfigures, but many things
650 // must be coded differently because there is no float.
651 // TODO: some code is identical to Floating, like Floating::docbookTag or Floating::docbookCaption. How to reuse that code?
653 // Floating::docbookCaption()
654 string docbook_caption = "caption"; // This is already correct for tables.
655 if (stype == GRAPHICS_CODE)
656 docbook_caption = "title";
658 // Floating::docbookTag() with hasTitle = true, as we are in formalgroup.
659 string stag = "float";
660 if (stype == GRAPHICS_CODE)
662 else if (stype == TABULAR_CODE)
665 // Ensure there is no label output, it is supposed to be handled as xml:id.
667 rpNoLabel.docbook_anchors_to_ignore.emplace(slabel->screenLabel());
669 // Ensure the float does not output its caption, as it is handled here (DocBook mandates a specific place for
670 // captions, they cannot appear at the end of the float, albeit LyX is happy with that).
671 OutputParams rpNoTitle = runparams;
672 rpNoTitle.docbook_in_float = true;
673 if (stype == TABULAR_CODE)
674 rpNoTitle.docbook_in_table = true;
676 // Organisation: <float> <title if any/> <contents without title/> </float>.
677 docstring sattr = docstring();
679 sattr += "xml:id=\"" + xml::cleanID(slabel->screenLabel()) + "\"";
680 // No layout way of adding attributes, unlike the normal code path.
682 xs << xml::StartTag(stag, sattr);
684 xs << xml::StartTag(docbook_caption);
686 scaption->getCaptionAsDocBook(xs, rpNoLabel);
687 else // Mandatory in formalgroup.
688 xs << "No caption detected";
689 xs << xml::EndTag(docbook_caption);
691 scontent->docbook(xs, rpNoTitle);
692 xs << xml::EndTag(stag);
695 // This subfigure could be generated.
700 // If there is no InsetFloat in the inset, output a warning.
701 xs << XMLStream::ESCAPE_NONE << "Error: no float found in the box. "
702 "To use subfigures in DocBook, elements must be wrapped in a float "
703 "inset and have a title/caption.";
704 // TODO: could also output a table, that would ensure that the document is correct and *displays* correctly (but without the right semantics), instead of just an error.
706 // Recurse to generate as much content as possible (avoid any loss).
707 subfigure->docbook(xs, runparams);
710 // Every subfigure is done: close the formal group.
711 xs << xml::EndTag("formalgroup");
717 void docbookNoSubfigures(XMLStream & xs, OutputParams const & runparams, const InsetCaption * caption,
718 const InsetLabel * label, Floating const & ftype, const InsetFloat * thisFloat)
720 string const &titleTag = ftype.docbookCaption();
722 // Ensure there is no label output, it is supposed to be handled as xml:id.
723 OutputParams rpNoLabel = runparams;
725 rpNoLabel.docbook_anchors_to_ignore.emplace(label->screenLabel());
727 // Ensure the float does not output its caption, as it is handled here (DocBook mandates a specific place for
728 // captions, they cannot appear at the end of the float, albeit LyX is happy with that).
729 OutputParams rpNoTitle = runparams;
730 rpNoTitle.docbook_in_float = true;
731 if (ftype.docbookFloatType() == "table")
732 rpNoTitle.docbook_in_table = true;
734 // Organisation: <float> <title if any/> <contents without title/> </float>.
735 docstring attr = docstring();
737 attr += "xml:id=\"" + xml::cleanID(label->screenLabel()) + "\"";
738 if (!ftype.docbookAttr().empty()) {
741 attr += from_utf8(ftype.docbookAttr());
744 xs << xml::StartTag(ftype.docbookTag(caption != nullptr), attr);
747 xs << xml::StartTag(titleTag);
748 caption->getCaptionAsDocBook(xs, rpNoLabel);
749 xs << xml::EndTag(titleTag);
752 thisFloat->InsetText::docbook(xs, rpNoTitle);
753 xs << xml::EndTag(ftype.docbookTag(caption != nullptr));
758 void InsetFloat::docbook(XMLStream & xs, OutputParams const & runparams) const
760 // if (runparams.docbook_in_par) {
761 // xs << xml::EndTag("para");
765 const InsetCaption* caption = getCaptionInset();
766 const InsetLabel* label = getLabelInset();
768 // Determine whether the float has subfigures.
769 std::vector<const InsetCollapsible *> subfigures;
770 auto end = paragraphs().end();
771 for (auto it = paragraphs().begin(); it != end; ++it) {
772 std::vector<const InsetCollapsible *> foundSubfigures = findSubfiguresInParagraph(*it);
773 if (!foundSubfigures.empty()) {
774 subfigures.reserve(subfigures.size() + foundSubfigures.size());
775 subfigures.insert(subfigures.end(), foundSubfigures.begin(), foundSubfigures.end());
779 // Gather a few things from global environment that are shared between all following cases.
780 FloatList const &floats = buffer().params().documentClass().floats();
781 Floating const &ftype = floats.getType(params_.type);
783 // Switch on subfigures.
784 if (!subfigures.empty())
785 docbookSubfigures(xs, runparams, caption, label, subfigures);
787 docbookNoSubfigures(xs, runparams, caption, label, ftype, this);
789 // if (runparams.docbook_in_par) {
791 // xs << xml::StartTag("para");
796 bool InsetFloat::insetAllowed(InsetCode code) const
798 // The case that code == FLOAT_CODE is handled in Text3.cpp,
799 // because we need to know what type of float is meant.
806 return InsetCaptionable::insetAllowed(code);
811 void InsetFloat::setWide(bool w, bool update_label)
813 if (!buffer().params().documentClass().floats().allowsWide(params_.type))
814 params_.wide = false;
822 void InsetFloat::setSideways(bool s, bool update_label)
824 if (!buffer().params().documentClass().floats().allowsSideways(params_.type))
825 params_.sideways = false;
827 params_.sideways = s;
833 void InsetFloat::setSubfloat(bool s, bool update_label)
835 params_.subfloat = s;
841 void InsetFloat::setNewLabel()
843 docstring lab = _("float: ");
845 if (params_.subfloat)
846 lab = _("subfloat: ");
848 lab += floatName(params_.type);
850 FloatList const & floats = buffer().params().documentClass().floats();
852 if (params_.wide && floats.allowsWide(params_.type))
855 if (params_.sideways && floats.allowsSideways(params_.type))
856 lab += _(" (sideways)");
862 bool InsetFloat::allowsCaptionVariation(std::string const & newtype) const
864 return !params_.subfloat && newtype != "Unnumbered";
868 TexString InsetFloat::getCaption(OutputParams const & runparams) const
870 InsetCaption const * ins = getCaptionInset();
875 ins->getArgs(os, runparams);
878 // increase TexRow precision in non-nice mode
881 otexstringstream os2;
882 ins->getArgument(os2, runparams);
883 TexString ts = os2.release();
884 docstring & arg = ts.str;
886 if (arg.find(']') != docstring::npos)
887 arg = '{' + arg + '}';
896 void InsetFloat::string2params(string const & in, InsetFloatParams & params)
898 params = InsetFloatParams();
902 istringstream data(in);
905 lex.setContext("InsetFloat::string2params");
910 string InsetFloat::params2string(InsetFloatParams const & params)