]> git.lyx.org Git - features.git/commitdiff
Add missing backslashes
authorGeorg Baum <baum@lyx.org>
Wed, 8 Jun 2016 20:17:14 +0000 (22:17 +0200)
committerGeorg Baum <baum@lyx.org>
Wed, 8 Jun 2016 20:17:14 +0000 (22:17 +0200)
Found by 2to3, but useful for python2 as well for consistency reasons.

lib/lyx2lyx/lyx_1_2.py
lib/lyx2lyx/lyx_2_0.py
lib/lyx2lyx/lyx_2_1.py
lib/lyx2lyx/lyx_2_2.py

index 19b6647201df02942fba6bbc2e84593521341b26..e04a4e47a23518edcb65e8c895b898bacbd74d65 100644 (file)
@@ -824,7 +824,7 @@ def change_header(document):
     if i == -1:
         return
     lines[i+1:i+1] = ["\\use_natbib 0",
-                      "\use_numerical_citations 0"]
+                      "\\use_numerical_citations 0"]
 
 
 supported_versions = ["1.2.%d" % i for i in range(5)] + ["1.2"]
index 1f1015444043c367e0d570d30f7c726b030cab2b..bd43839ec009c8575e56fe37871659a91f87a15a 100644 (file)
@@ -279,8 +279,8 @@ def revert_xetex(document):
         pretext.append(tw)
     if osf:
         pretext.append('\\defaultfontfeatures{Numbers=OldStyle}')
-    pretext.append('\usepackage{xunicode}')
-    pretext.append('\usepackage{xltxtra}')
+    pretext.append('\\usepackage{xunicode}')
+    pretext.append('\\usepackage{xltxtra}')
     insert_to_preamble(document, pretext)
 
 
@@ -1699,7 +1699,7 @@ def revert_nameref(document):
       document.body[stins:endins + 1] = newcontent
 
   if foundone:
-    add_to_preamble(document, ["\usepackage{nameref}"])
+    add_to_preamble(document, ["\\usepackage{nameref}"])
 
 
 def remove_Nameref(document):
index fe5f9d69932ca2ab47e632609873f1e72391825b..2e53a6fd799e46e900084280eec37045e587d6d6 100644 (file)
@@ -970,7 +970,7 @@ def revert_cell_rotation(document):
         
   finally:
     if load_rotating:
-      add_to_preamble(document, ["\\@ifundefined{turnbox}{\usepackage{rotating}}{}"])
+      add_to_preamble(document, ["\\@ifundefined{turnbox}{\\usepackage{rotating}}{}"])
 
 
 def convert_cell_rotation(document):
@@ -1029,7 +1029,7 @@ def revert_table_rotation(document):
         
   finally:
     if load_rotating:
-      add_to_preamble(document, ["\\@ifundefined{turnbox}{\usepackage{rotating}}{}"])
+      add_to_preamble(document, ["\\@ifundefined{turnbox}{\\usepackage{rotating}}{}"])
 
 
 def convert_table_rotation(document):
index 37a26be592b04ab9e8a08a01efc7246c0bbd4ead..942aa6a094b10de29988e2ac2417a37bed44dbde 100644 (file)
@@ -1189,7 +1189,7 @@ def revert_textcolor(document):
                     # register that xcolor must be loaded in the preamble
                     if xcolor == False:
                         xcolor = True
-                        add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\usepackage{xcolor}}{}"])
+                        add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\\usepackage{xcolor}}{}"])
                     # find the next \\color and/or the next \\end_layout
                     j = find_token(document.body, "\\color", i + 1)
                     k = find_token(document.body, "\\end_layout", i + 1)
@@ -1273,7 +1273,7 @@ def revert_colorbox(document):
             pass
         else:
             # we also neeed to load xcolor in the preamble but only once
-            add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\usepackage{xcolor}}{}"])
+            add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\\usepackage{xcolor}}{}"])
             document.body[einset + 1 : einset + 1] = put_cmd_in_ert("}")
             if framecolor != defaultframecolor:
                 document.body[binset:binset] = put_cmd_in_ert("\\fcolorbox{" + framecolor + "}{" + backcolor + "}{")