diff --git a/development/FORMAT b/development/FORMAT index eeae6d703d..1c8ea98d84 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,9 @@ LyX file-format changes ----------------------- +2008-03-01 Jürgen Spitzmüller + * Format incremented to 316: support for subfloats (subfig package). + 2008-02-18 Richard Heck * Format incremented to 315: support for column separation in page margins diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 03a23e09c2..6ca50ffa17 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -251,7 +251,7 @@ \TestPackage{rotfloat} \TestPackage{setspace} \TestPackage{soul} -\TestPackage{subfigure} +\TestPackage{subfig} \TestPackage{textcomp} \TestPackage{units} \TestPackage{url} diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index f4d9d4ccf9..b4edb9f1dd 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -1,5 +1,5 @@ #LyX 1.6.0svn created this file. For more info see http://www.lyx.org/ -\lyxformat 315 +\lyxformat 316 \begin_document \begin_header \textclass article @@ -4307,14 +4307,14 @@ rotfloat \end_layout \begin_layout Subsection -subfigure +subfig \end_layout \begin_layout Description Found: \begin_inset Info type "package" -arg "subfigure" +arg "subfig" \end_inset @@ -4323,17 +4323,18 @@ arg "subfigure" \begin_layout Description CTAN: \family typewriter -macros/latex/contrib/subfigure +macros/latex/contrib/subfig \end_layout \begin_layout Description Notes: The package \family sans -subfigure +subfig \family default - is used by LyX when you select ``subfigure'' in the EPS figure popup. - Several figures marked in this way can be packed into a single float with - individual subcaptions. + is used by LyX to produce subfloats (i.\InsetSpace \thinspace{} +e., subfigures, subtables, etc.). + Subfloats are floats that are embedded inside other floats and that can + have individual subcaptions. \end_layout \begin_layout Subsection diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index 0c1cbdb302..99e8399f39 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -80,7 +80,7 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)), ("1_3", [221], minor_versions("1.3" , 7)), ("1_4", range(222,246), minor_versions("1.4" , 5)), ("1_5", range(246,277), minor_versions("1.5" , 2)), - ("1_6", range(277,316), minor_versions("1.6" , 0))] # rgh: colsep + ("1_6", range(277,317), minor_versions("1.6" , 0))] # jspitzm: subfig def formats_list(): diff --git a/lib/lyx2lyx/lyx_1_6.py b/lib/lyx2lyx/lyx_1_6.py index d4cd21fe05..0783dae66f 100644 --- a/lib/lyx2lyx/lyx_1_6.py +++ b/lib/lyx2lyx/lyx_1_6.py @@ -1241,6 +1241,127 @@ def revert_widesideways(document): i = i + 1 +def convert_subfig(document): + " Convert subfigures to subfloats. " + i = 0 + while 1: + i = find_token(document.body, '\\begin_inset Graphics', i) + if i == -1: + return + j = find_end_of_inset(document.body, i) + if j == -1: + document.warning("Malformed lyx document: Missing '\\end_inset'.") + i = i + 1 + continue + k = find_token(document.body, '\tsubcaption', i, j) + if k == -1: + i = i + 1 + continue + l = find_token(document.body, '\tsubcaptionText', i, j) + caption = get_value(document.body, '\tsubcaptionText', i, j).strip('"') + savestr = document.body[i] + document.body[i] = '\\begin_inset Float figure\nwide false\nsideways false\n' \ + 'status open\n\n\\begin_layout PlainLayout\n\\begin_inset Caption\n\n\\begin_layout PlainLayout\n' \ + + caption + '\n\\end_layout\n\n\\end_inset\n\n\\end_layout\n\n\\begin_layout PlainLayout\n' + savestr + savestr = document.body[j] + document.body[j] = '\n\\end_layout\n\n\\end_inset\n' + savestr + del document.body[k] + del document.body[l] + + +def revert_subfig(document): + " Revert subfloats. " + i = 0 + while 1: + i = find_token(document.body, '\\begin_inset Float', i) + if i == -1: + return + while 1: + j = find_end_of_inset(document.body, i) + if j == -1: + document.warning("Malformed lyx document: Missing '\\end_inset' (float).") + i = i + 1 + continue + # look for embedded float (= subfloat) + k = find_token(document.body, '\\begin_inset Float', i + 1, j) + if k == -1: + break + l = find_end_of_inset(document.body, k) + if l == -1: + document.warning("Malformed lyx document: Missing '\\end_inset' (embedded float).") + i = i + 1 + continue + m = find_token(document.body, "\\begin_layout PlainLayout", k + 1, l) + # caption? + cap = find_token(document.body, '\\begin_inset Caption', k + 1, l) + caption = '' + shortcap = '' + if cap != -1: + capend = find_end_of_inset(document.body, cap) + if capend == -1: + document.warning("Malformed lyx document: Missing '\\end_inset' (caption).") + return + # label? + label = '' + lbl = find_token(document.body, '\\begin_inset CommandInset label', cap, capend) + if lbl != -1: + lblend = find_end_of_inset(document.body, lbl + 1) + if lblend == -1: + document.warning("Malformed lyx document: Missing '\\end_inset' (label).") + return + for line in document.body[lbl:lblend + 1]: + if line.startswith('name '): + label = line.split()[1].strip('"') + break + else: + lbl = capend + lblend = capend + label = '' + # opt arg? + opt = find_token(document.body, '\\begin_inset OptArg', cap, capend) + if opt != -1: + optend = find_end_of_inset(document.body, opt) + if optend == -1: + document.warning("Malformed lyx document: Missing '\\end_inset' (OptArg).") + return + optc = find_token(document.body, "\\begin_layout PlainLayout", opt, optend) + if optc == -1: + document.warning("Malformed LyX document: Missing `\\begin_layout PlainLayout' in Float inset.") + return + optcend = find_end_of(document.body, optc, "\\begin_layout", "\\end_layout") + for line in document.body[optc:optcend]: + if not line.startswith('\\'): + shortcap += line.strip() + else: + opt = capend + optend = capend + for line in document.body[cap:capend]: + if line in document.body[lbl:lblend]: + continue + elif line in document.body[opt:optend]: + continue + elif not line.startswith('\\'): + caption += line.strip() + if len(label) > 0: + caption += "\\backslash\nlabel{" + label + "}" + document.body[l] = '\\begin_layout PlainLayout\n\\begin_inset ERT\nstatus collapsed\n\n' \ + '\\begin_layout PlainLayout\n\n}\n\\end_layout\n\n\\end_inset\n\n\\end_layout\n\n\\begin_layout PlainLayout\n' + del document.body[cap:capend+1] + del document.body[k+1:m-1] + insertion = '\\begin_inset ERT\nstatus collapsed\n\n' \ + '\\begin_layout PlainLayout\n\n\\backslash\n' \ + 'subfloat' + if len(shortcap) > 0: + insertion = insertion + "[" + shortcap + "]" + if len(caption) > 0: + insertion = insertion + "[" + caption + "]" + insertion = insertion + '{%\n\\end_layout\n\n\\end_inset\n\n\\end_layout\n' + document.body[k] = insertion + add_to_preamble(document, + ['\\usepackage{subfig}\n']) + i = i + 1 + + ## # Conversion hub # @@ -1284,10 +1405,12 @@ convert = [[277, [fix_wrong_tables]], [312, []], [313, [convert_module_names]], [314, []], - [315, []] + [315, []], + [316, [convert_subfig]] ] -revert = [[314, [revert_colsep]], +revert = [[314, [revert_subfig]], + [314, [revert_colsep]], [313, []], [312, [revert_module_names]], [311, [revert_rotfloat, revert_widesideways]], diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 2ffe443302..31e61455b2 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -115,7 +115,7 @@ namespace os = support::os; namespace { -int const LYX_FORMAT = 315; // Richard Heck: column separation +int const LYX_FORMAT = 316; // JSpitzm: subfig support } // namespace anon diff --git a/src/Counters.cpp b/src/Counters.cpp index 39e177b1f6..54fb9a720a 100644 --- a/src/Counters.cpp +++ b/src/Counters.cpp @@ -171,6 +171,7 @@ void Counters::step(docstring const & ctr) void Counters::reset() { appendix_ = false; + subfloat_ = false; current_float_.erase(); CounterList::iterator it = counterList.begin(); CounterList::iterator const end = counterList.end(); diff --git a/src/Counters.h b/src/Counters.h index f7d2cea134..96b14266c3 100644 --- a/src/Counters.h +++ b/src/Counters.h @@ -116,6 +116,10 @@ public: std::string const & current_float() const { return current_float_; } /// Sets the current enclosing float. void current_float(std::string const & f) { current_float_ = f; } + /// Are we in a subfloat? + bool isSubfloat() const { return subfloat_; } + /// Set the state variable indicating whether we are in a subfloat. + void isSubfloat(bool s) { subfloat_ = s; }; private: /// returns the expanded string representation of the counter /// with recursion protection through callers. @@ -137,6 +141,8 @@ private: bool appendix_; /// The current enclosing float. std::string current_float_; + /// Are we in a subfloat? + bool subfloat_; }; diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 7bd0944d3e..8a142ce876 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -433,9 +433,12 @@ void LaTeXFeatures::addPreambleSnippet(string const & preamble) } -void LaTeXFeatures::useFloat(string const & name) +void LaTeXFeatures::useFloat(string const & name, bool subfloat) { - usedFloats_.insert(name); + if (!usedFloats_[name]) + usedFloats_[name] = subfloat; + if (subfloat) + require("subfig"); // We only need float.sty if we use non builtin floats, or if we // use the "H" modifier. This includes modified table and // figure floats. (Lgb) @@ -510,7 +513,7 @@ char const * simplefeatures[] = { "rotating", "latexsym", "pifont", - "subfigure", + "subfig", "varioref", "prettyref", /*For a successful cooperation of the `wrapfig' package with the @@ -914,7 +917,7 @@ void LaTeXFeatures::getFloatDefinitions(ostream & os) const UsedFloats::const_iterator end = usedFloats_.end(); // ostringstream floats; for (; cit != end; ++cit) { - Floating const & fl = floats.getType((*cit)); + Floating const & fl = floats.getType((cit->first)); // For builtin floats we do nothing. if (fl.builtin()) continue; @@ -959,6 +962,8 @@ void LaTeXFeatures::getFloatDefinitions(ostream & os) const // used several times, when the same style is still in // effect. (Lgb) } + if (cit->second) + os << "\n\\newsubfloat{" << fl.type() << "}\n"; } } diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h index 268f6b05b0..bcf1ed43b8 100644 --- a/src/LaTeXFeatures.h +++ b/src/LaTeXFeatures.h @@ -82,7 +82,7 @@ public: */ bool mustProvide(std::string const & name) const; /// - void useFloat(std::string const & name); + void useFloat(std::string const & name, bool subfloat = false); /// void useLanguage(Language const *); /// @@ -124,7 +124,7 @@ private: /// used languages (only those that are supported by babel) LanguageList UsedLanguages_; /// - typedef std::set UsedFloats; + typedef std::map UsedFloats; /// UsedFloats usedFloats_; /// diff --git a/src/TextClass.cpp b/src/TextClass.cpp index aa2f307330..6342c1f691 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -763,8 +763,12 @@ void TextClass::readFloat(Lexer & lexrc) style, name, listName, builtin); floatlist_->newFloat(fl); // each float has its own counter - counters_->newCounter(from_ascii(type), from_ascii(within), + counters_->newCounter(from_ascii(type), from_ascii(within), docstring(), docstring()); + // also define sub-float counters + docstring const subtype = "sub-" + from_ascii(type); + counters_->newCounter(subtype, from_ascii(type), + "\\alph{" + subtype + "}", docstring()); } lexrc.popTable(); diff --git a/src/frontends/qt4/GuiGraphics.cpp b/src/frontends/qt4/GuiGraphics.cpp index bc8ea18c35..b7286edbce 100644 --- a/src/frontends/qt4/GuiGraphics.cpp +++ b/src/frontends/qt4/GuiGraphics.cpp @@ -204,10 +204,6 @@ GuiGraphics::GuiGraphics(GuiView & lv) // setChecked(). Note, too, that clicked() would get called whenever it // is clicked, even right clicked (I think), not just whenever it is // toggled. - connect(subfigure, SIGNAL(toggled(bool)), - this, SLOT(change_adaptor())); - connect(subcaption, SIGNAL(textChanged(const QString&)), - this, SLOT(change_adaptor())); connect(displayGB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); connect(showCB, SIGNAL(currentIndexChanged(int)), @@ -223,7 +219,6 @@ GuiGraphics::GuiGraphics(GuiView & lv) bc().setCancel(closePB); bc().addReadOnly(latexoptions); - bc().addReadOnly(subfigure); bc().addReadOnly(filenameL); bc().addReadOnly(filename); bc().addReadOnly(browsePB); @@ -500,10 +495,6 @@ void GuiGraphics::updateContents() clip->setChecked(igp.clip); unzipCB->setChecked(igp.noUnzip); - // Update the subcaption check button and input field - subfigure->setChecked(igp.subcaption); - subcaption->setText(toqstr(igp.subcaptionText)); - int item = 0; switch (igp.display) { case graphics::DefaultDisplay: item = 0; break; @@ -624,8 +615,6 @@ void GuiGraphics::applyView() igp.draft = draftCB->isChecked(); igp.clip = clip->isChecked(); - igp.subcaption = subfigure->isChecked(); - igp.subcaptionText = fromqstr(subcaption->text()); switch (showCB->currentIndex()) { case 0: igp.display = graphics::DefaultDisplay; break; diff --git a/src/frontends/qt4/ui/GraphicsUi.ui b/src/frontends/qt4/ui/GraphicsUi.ui index 45574777f1..a921de4423 100644 --- a/src/frontends/qt4/ui/GraphicsUi.ui +++ b/src/frontends/qt4/ui/GraphicsUi.ui @@ -643,61 +643,6 @@ - - - - Qt::StrongFocus - - - S&ubfigure - - - true - - - true - - - false - - - - 9 - - - 6 - - - - - The caption for the sub-figure - - - Ca&ption: - - - subcaption - - - - - - - - 3 - 0 - 0 - 0 - - - - The caption for the sub-figure - - - - - - @@ -836,8 +781,6 @@ latexoptions draftCB unzipCB - subfigure - subcaption displayGB showCB displayscale diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp index 47dc0f0c0f..5c7a9753b8 100644 --- a/src/insets/InsetCaption.cpp +++ b/src/insets/InsetCaption.cpp @@ -220,6 +220,9 @@ bool InsetCaption::getStatus(Cursor & cur, FuncRequest const & cmd, int InsetCaption::latex(odocstream & os, OutputParams const & runparams_in) const { + if (in_subfloat_) + // caption is output as an optional argument + return 0; // This is a bit too simplistic to take advantage of // caption options we must add more later. (Lgb) // This code is currently only able to handle the simple @@ -282,6 +285,7 @@ void InsetCaption::updateLabels(ParIterator const & it) string const & type = cnts.current_float(); // Memorize type for addToToc(). type_ = type; + in_subfloat_ = cnts.isSubfloat(); if (type.empty()) full_label_ = buffer().B_("Senseless!!! "); else { @@ -292,11 +296,17 @@ void InsetCaption::updateLabels(ParIterator const & it) name = buffer().B_("Listing"); else name = buffer().B_(tclass.floats().getType(type).name()); - if (cnts.hasCounter(from_utf8(type))) { - cnts.step(from_utf8(type)); + docstring counter = from_utf8(type); + if (in_subfloat_) { + counter = "sub-" + from_utf8(type); + name = bformat(_("Sub-%1$s"), + buffer().B_(tclass.floats().getType(type).name())); + } + if (cnts.hasCounter(counter)) { + cnts.step(counter); full_label_ = bformat(from_ascii("%1$s %2$s:"), - name, - cnts.theCounter(from_utf8(type))); + name, + cnts.theCounter(counter)); } else full_label_ = bformat(from_ascii("%1$s #:"), name); } diff --git a/src/insets/InsetCaption.h b/src/insets/InsetCaption.h index 837aaa442b..cbfba828da 100644 --- a/src/insets/InsetCaption.h +++ b/src/insets/InsetCaption.h @@ -87,6 +87,8 @@ private: /// std::string type_; /// + bool in_subfloat_; + /// docstring custom_label_; }; diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index b7c34f02aa..370a29d16d 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -5,6 +5,7 @@ * * \author Jürgen Vigna * \author Lars Gullik Bjønnes + * \author Jürgen Spitzmüller * * Full author contact details are available in file CREDITS. */ @@ -12,6 +13,7 @@ #include #include "InsetFloat.h" +#include "InsetCaption.h" #include "Buffer.h" #include "BufferParams.h" @@ -23,9 +25,11 @@ #include "FloatList.h" #include "FuncRequest.h" #include "FuncStatus.h" +#include "InsetList.h" #include "LaTeXFeatures.h" #include "Lexer.h" #include "OutputParams.h" +#include "ParIterator.h" #include "TextClass.h" #include "support/debug.h" @@ -131,6 +135,7 @@ void InsetFloat::doDispatch(Cursor & cur, FuncRequest & cmd) params_.placement = params.placement; params_.wide = params.wide; params_.sideways = params.sideways; + params_.subfloat = params.subfloat; wide(params_.wide, cur.buffer().params()); sideways(params_.sideways, cur.buffer().params()); break; @@ -143,6 +148,8 @@ void InsetFloat::doDispatch(Cursor & cur, FuncRequest & cmd) case LFUN_MOUSE_RELEASE: { if (cmd.button() == mouse_button::button3 && hitButton(cmd)) { + if (params_.subfloat) + break; InsetFloatMailer(*this).showDialog(&cur.bv()); break; } @@ -177,14 +184,23 @@ void InsetFloat::updateLabels(ParIterator const & it) { Counters & cnts = buffer().params().documentClass().counters(); string const saveflt = cnts.current_float(); + bool const savesubflt = cnts.isSubfloat(); + + bool const subflt = it.innerInsetOfType(FLOAT_CODE); + // floats can only embed subfloats of their own kind + if (subflt) + params_.type = saveflt; + subfloat(subflt, buffer().params()); // Tell to captions what the current float is cnts.current_float(params().type); + cnts.isSubfloat(subflt); InsetCollapsable::updateLabels(it); //reset afterwards cnts.current_float(saveflt); + cnts.isSubfloat(savesubflt); } @@ -250,6 +266,7 @@ void InsetFloat::read(Lexer & lex) params_.read(lex); wide(params_.wide, buffer().params()); sideways(params_.sideways, buffer().params()); + subfloat(params_.subfloat, buffer().params()); InsetCollapsable::read(lex); } @@ -263,7 +280,10 @@ void InsetFloat::validate(LaTeXFeatures & features) const if (params_.sideways) features.require("rotfloat"); - features.useFloat(params_.type); + if (params_.subfloat) + features.require("subfig"); + + features.useFloat(params_.type, params_.subfloat); InsetCollapsable::validate(features); } @@ -282,6 +302,23 @@ docstring InsetFloat::editMessage() const int InsetFloat::latex(odocstream & os, OutputParams const & runparams) const { + if (params_.subfloat) { + if (runparams.moving_arg) + os << "\\protect"; + os << "\\subfloat"; + + OutputParams rp = runparams; + docstring const caption = getCaption(rp); + if (!caption.empty()) { + os << caption; + } + os << '{'; + int const i = InsetText::latex(os, runparams); + os << "}"; + + return i + 1; + } + FloatList const & floats = buffer().params().documentClass().floats(); string tmptype = params_.type; if (params_.sideways) @@ -341,6 +378,7 @@ int InsetFloat::plaintext(odocstream & os, OutputParams const & runparams) const int InsetFloat::docbook(odocstream & os, OutputParams const & runparams) const { + // FIXME Implement subfloat! // FIXME UNICODE os << '<' << from_ascii(params_.type) << '>'; int const i = InsetText::docbook(os, runparams); @@ -352,9 +390,9 @@ int InsetFloat::docbook(odocstream & os, OutputParams const & runparams) const bool InsetFloat::insetAllowed(InsetCode code) const { - return code != FLOAT_CODE - && code != FOOT_CODE - && code != MARGIN_CODE; + return code != FOOT_CODE + && code != MARGIN_CODE + && (code != FLOAT_CODE || !params_.subfloat); } @@ -386,6 +424,42 @@ void InsetFloat::sideways(bool s, BufferParams const & bp) } +void InsetFloat::subfloat(bool s, BufferParams const & bp) +{ + params_.subfloat = s; + docstring lab = _("float: ") + floatName(params_.type, bp); + if (s) + lab = _("subfloat: ") + floatName(params_.type, bp); + setLabel(lab); +} + + +docstring InsetFloat::getCaption(OutputParams const & runparams) const +{ + if (paragraphs().empty()) + return docstring(); + + ParagraphList::const_iterator pit = paragraphs().begin(); + for (; pit != paragraphs().end(); ++pit) { + InsetList::const_iterator it = pit->insetList().begin(); + for (; it != pit->insetList().end(); ++it) { + Inset & inset = *it->inset; + if (inset.lyxCode() == CAPTION_CODE) { + odocstringstream ods; + InsetCaption * ins = + static_cast(it->inset); + ins->getOptArg(ods, runparams); + ods << '['; + ins->getArgument(ods, runparams); + ods << ']'; + return ods.str(); + } + } + } + return docstring(); +} + + string const InsetFloatMailer::name_("float"); InsetFloatMailer::InsetFloatMailer(InsetFloat & inset) diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h index 8a39303310..cf50e2a53c 100644 --- a/src/insets/InsetFloat.h +++ b/src/insets/InsetFloat.h @@ -23,7 +23,7 @@ namespace lyx { class InsetFloatParams { public: /// - InsetFloatParams() : wide(false), sideways(false) {} + InsetFloatParams() : wide(false), sideways(false), subfloat(false) {} /// void write(std::ostream & os) const; /// @@ -36,6 +36,8 @@ public: bool wide; /// bool sideways; + /// + bool subfloat; }; @@ -79,6 +81,8 @@ public: /// void sideways(bool s, BufferParams const &); /// + void subfloat(bool s, BufferParams const &); + /// bool showInsetDialog(BufferView *) const; /// InsetFloatParams const & params() const { return params_; } @@ -92,6 +96,8 @@ private: /// virtual Inset * clone() const; /// + docstring getCaption(OutputParams const &) const; + /// InsetFloatParams params_; /// docstring name_; diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index eb6fbb0572..8e592b8e3b 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -22,8 +22,6 @@ TODO filename. * Add support for the 'picins' package. * Add support for the 'picinpar' package. - * Improve support for 'subfigure' - Allow to set the various options - that are possible. */ /* NOTES: @@ -764,13 +762,6 @@ int InsetGraphics::latex(odocstream & os, // after the actual includegraphics command. string before; string after; - // Do we want subcaptions? - if (params().subcaption) { - if (runparams.moving_arg) - before += "\\protect"; - before += "\\subfigure[" + params().subcaptionText + "]{"; - after = '}'; - } if (runparams.moving_arg) before += "\\protect"; @@ -898,9 +889,6 @@ void InsetGraphics::validate(LaTeXFeatures & features) const if (contains(rel_file, ".")) features.require("lyxdot"); } - - if (params().subcaption) - features.require("subfigure"); } diff --git a/src/insets/InsetGraphicsParams.cpp b/src/insets/InsetGraphicsParams.cpp index c7419b39ea..0b044a0ec5 100644 --- a/src/insets/InsetGraphicsParams.cpp +++ b/src/insets/InsetGraphicsParams.cpp @@ -78,8 +78,6 @@ void InsetGraphicsParams::init() rotateAngle = "0"; // angle of rotation in degrees rotateOrigin.erase(); // Origin of rotation - subcaption = false; // subfigure - subcaptionText.erase(); // subfigure caption special.erase(); // additional userdefined stuff } @@ -102,8 +100,6 @@ void InsetGraphicsParams::copy(InsetGraphicsParams const & igp) rotateAngle = igp.rotateAngle; rotateOrigin = igp.rotateOrigin; - subcaption = igp.subcaption; - subcaptionText = igp.subcaptionText; special = igp.special; } @@ -127,8 +123,6 @@ bool operator==(InsetGraphicsParams const & left, left.rotateAngle == right.rotateAngle && left.rotateOrigin == right.rotateOrigin && - left.subcaption == right.subcaption && - left.subcaptionText == right.subcaptionText && left.special == right.special; } @@ -180,10 +174,6 @@ void InsetGraphicsParams::Write(ostream & os, Buffer const & buffer) const os << "\trotateAngle " << rotateAngle << '\n'; if (!rotateOrigin.empty()) os << "\trotateOrigin " << rotateOrigin << '\n'; - if (subcaption) - os << "\tsubcaption\n"; - if (!subcaptionText.empty()) - os << "\tsubcaptionText \"" << subcaptionText << '\"' << '\n'; if (!special.empty()) os << "\tspecial " << special << '\n'; } @@ -246,13 +236,6 @@ bool InsetGraphicsParams::Read(Lexer & lex, string const & token, string const & } else if (token == "rotateOrigin") { lex.next(); rotateOrigin=lex.getString(); - } else if (token == "subcaption") { - subcaption = true; - } else if (token == "subcaptionText") { - lex.eatLine(); - string sub = lex.getString(); - // strip surrounding " " - subcaptionText = sub.substr(1, sub.length() - 2); } else if (token == "special") { lex.eatLine(); special = lex.getString(); diff --git a/src/insets/InsetGraphicsParams.h b/src/insets/InsetGraphicsParams.h index 90274f7b98..5a321ecc6a 100644 --- a/src/insets/InsetGraphicsParams.h +++ b/src/insets/InsetGraphicsParams.h @@ -60,10 +60,6 @@ public: std::string rotateAngle; /// Origin point of rotation std::string rotateOrigin; - /// Do we have a subcaption? - bool subcaption; - /// The text of the subcaption. - std::string subcaptionText; /// any userdefined special command std::string special;