]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/text.cpp
Update tex2lyx tests
[lyx.git] / src / tex2lyx / text.cpp
index 73a8d6976596bc0989a5b46829f1c6a701231d1a..b3cbc46c660fb5d9aa2ef611d739de2ab164c23f 100644 (file)
@@ -521,8 +521,8 @@ docstring convert_unicodesymbols(docstring s)
                bool termination;
                docstring rem;
                set<string> req;
-               docstring parsed = encodings.fromLaTeXCommand(s,
-                               Encodings::TEXT_CMD, termination, rem, &req);
+               docstring parsed = normalize_c(encodings.fromLaTeXCommand(s,
+                               Encodings::TEXT_CMD, termination, rem, &req));
                set<string>::const_iterator it = req.begin();
                set<string>::const_iterator en = req.end();
                for (; it != en; ++it)
@@ -1682,8 +1682,8 @@ void parse_environment(Parser & p, ostream & os, bool outer,
                        p.skip_spaces(true);
                        os << "btprint " << '"' << "btPrintAll" << '"' << "\n";
                }
-               os << "bibfiles " << '"' << bibfile << '"' << "\n";
-               os << "options " << '"' << bibstyle << '"' <<  "\n";
+               os << "bibfiles " << '"' << bibfile << "\"\n"
+                  << "options " << '"' << bibstyle << "\"\n";
                parse_text_in_inset(p, os, FLAG_END, outer, parent_context);
                end_inset(os);
                p.skip_spaces();
@@ -2760,7 +2760,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        } else {
                                begin_command_inset(os, "bibitem", "bibitem");
                                os << "label \"" << label << "\"\n"
-                                     "key \"" << key << "\"\n";
+                                  << "key \"" << key << "\"\n"
+                                  << "literal \"true\"\n";
                                end_inset(os);
                        }
                }
@@ -3439,6 +3440,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        os << "target \"" << target << "\"\n";
                        if (type == "mailto:" || type == "file:")
                                os << "type \"" << type << "\"\n";
+                       os << "literal \"true\"\n";
                        end_inset(os);
                        skip_spaces_braces(p);
                }
@@ -3496,6 +3498,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                           << ":";
                        os << convert_command_inset_arg(p.verbatim_item())
                           << "\"\n";
+                       os << "plural \"false\"\n";
+                       os << "caps \"false\"\n";
+                       os << "noprefix \"false\"\n";
                        end_inset(os);
                        preamble.registerAutomaticallyLoadedPackage("refstyle");
                }
@@ -3512,6 +3517,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                                os << "reference \""
                                   << convert_command_inset_arg(p.verbatim_item())
                                   << "\"\n";
+                               os << "plural \"false\"\n";
+                               os << "caps \"false\"\n";
+                               os << "noprefix \"false\"\n";
                                end_inset(os);
                                if (t.cs() == "vref" || t.cs() == "vpageref")
                                        preamble.registerAutomaticallyLoadedPackage("varioref");
@@ -3579,7 +3587,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        os << "before " << '"' << before << '"' << "\n";
                        os << "key \""
                           << convert_command_inset_arg(p.verbatim_item())
-                          << "\"\n";
+                          << "\"\n"
+                          << "literal \"true\"\n";
                        end_inset(os);
                        // Need to set the cite engine if natbib is loaded by
                        // the document class directly
@@ -3631,9 +3640,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                                before.erase(before.length() - 1, 1);
                        }
                        begin_command_inset(os, "citation", command);
-                       os << "after " << '"' << after << '"' << "\n";
-                       os << "before " << '"' << before << '"' << "\n";
-                       os << "key " << '"' << citation << '"' << "\n";
+                       os << "after " << '"' << after << "\"\n"
+                          << "before " << '"' << before << "\"\n"
+                          << "key " << '"' << citation << "\"\n"
+                          << "literal \"true\"\n";
                        end_inset(os);
                        // Need to set the cite engine if jurabib is loaded by
                        // the document class directly
@@ -3650,8 +3660,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        // the BibTeX inset
                        if (key != "*") {
                                begin_command_inset(os, "citation", t.cs());
-                               os << "after " << '"' << after << '"' << "\n";
-                               os << "key " << '"' << key << '"' << "\n";
+                               os << "after " << '"' << after << "\"\n"
+                                  << "key " << '"' << key << "\"\n"
+                                  << "literal \"true\"\n";
                                end_inset(os);
                        } else if (t.cs() == "nocite")
                                btprint = key;
@@ -3681,7 +3692,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                           << convert_command_inset_arg(p.verbatim_item());
                        os << "\"\ndescription \""
                           << convert_command_inset_arg(p.verbatim_item())
-                          << "\"\n";
+                          << "\"\n"
+                          << "literal \"true\"\n";
                        end_inset(os);
                        preamble.registerAutomaticallyLoadedPackage("nomencl");
                }
@@ -3711,6 +3723,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                                        os << "type \"idx\"\n";
                                else
                                        os << "type \"" << indexname << "\"\n";
+                               os << "literal \"true\"\n";
                        }
                        end_inset(os);
                        skip_spaces_braces(p);
@@ -4745,10 +4758,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        }
                        // handle some TIPA special characters
                        else if (preamble.isPackageUsed("tipa")) {
-                               if (name == "\\textglobfall") {
-                                       name = "End";
-                                       skip_braces(p);
-                               } else if (name == "\\s") {
+                               if (name == "\\s") {
                                        // fromLaTeXCommand() does not yet
                                        // recognize tipa short cuts
                                        name = "\\textsyllabic";
@@ -4824,8 +4834,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        bool termination;
                        docstring rem;
                        set<string> req;
-                       docstring s = encodings.fromLaTeXCommand(from_utf8(name),
-                                       Encodings::TEXT_CMD, termination, rem, &req);
+                       docstring s = normalize_c(encodings.fromLaTeXCommand(from_utf8(name),
+                                       Encodings::TEXT_CMD, termination, rem, &req));
                        if (!s.empty()) {
                                context.check_layout(os);
                                os << to_utf8(s);