]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/preamble.cpp
tex2lyx: support for subfloats
[lyx.git] / src / tex2lyx / preamble.cpp
index 6eb0b273ce3fa395830907cd2b8fd8f0c91d410f..e31a2a8252a497558d131848cbe6287568849fda 100644 (file)
@@ -571,9 +571,11 @@ void handle_package(Parser &p, string const & name, string const & opts,
 
        else if (name == "fontenc") {
                h_fontencoding = getStringFromVector(options, ",");
-               // as of version LyX 2.0 "T1" is equal to the setting "global"
-               if (h_fontencoding == "T1")
+               /* We could do the following for better round trip support,
+                * but this makes the document less portable, so I skip it:
+               if (h_fontencoding == lyxrc.fontenc)
                        h_fontencoding = "global";
+               */
                options.clear();
        }
 
@@ -646,6 +648,15 @@ void handle_package(Parser &p, string const & name, string const & opts,
                ; // Ignore this, the geometry settings are made by the \geometry
                  // command. This command is handled below.
 
+       else if (name == "rotfloat")
+               ; // ignore this
+
+       else if (name == "wrapfig")
+               ; // ignore this
+
+       else if (name == "subfig")
+               ; // ignore this
+
        else if (is_known(name, known_languages))
                h_language = name;
 
@@ -1272,6 +1283,13 @@ void parse_preamble(Parser & p, ostream & os,
                        } else if (arg1 == "definecolor" && arg2 == "\\usepackage{color}"
                                && arg3.empty()) {
                                ifundefined_color_set = true;
+                       // test for case
+                       //\@ifundefined{showcaptionsetup}{}{%
+                       // \PassOptionsToPackage{caption=false}{subfig}}
+                       // that LyX uses for subfloats
+                       } else if (arg1 == "showcaptionsetup" && arg2.empty()
+                               && arg3 == "%\n \\PassOptionsToPackage{caption=false}{subfig}") {
+                               ; // do nothing
                        } else if (!in_lyx_preamble) {
                                h_preamble << t.asInput()
                                           << '{' << arg1 << '}'