]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/preamble.cpp
tex2lyx: support for wrapped floats and all their possible options
[lyx.git] / src / tex2lyx / preamble.cpp
index e988f1af52dd0093d9bdaa414a2cc4a8b77642b5..7ba86a243032885d2e75642af0664903eac25ae3 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,12 @@ 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 (is_known(name, known_languages))
                h_language = name;
 
@@ -917,8 +925,11 @@ void parse_preamble(Parser & p, ostream & os,
                        h_paperpagestyle = p.verbatim_item();
 
                else if (t.cs() == "date") {
-                       if (p.verbatim_item().empty())
+                       string argument = p.getArg('{', '}');
+                       if (argument.empty())
                                h_suppress_date = "true";
+                       else
+                               h_preamble << t.asInput() << '{' << argument << '}';
                }
 
                else if (t.cs() == "color") {