]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/lyx_0_12.py
UserGuide.lyx: fix some typographic issues spotted by Mike
[lyx.git] / lib / lyx2lyx / lyx_0_12.py
index 856b3155805de7afa59e154cc293615e2b8eab03..6cbd145fb5fdafeee5dfedfc8b27a4842085a731 100644 (file)
@@ -14,7 +14,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 """ Convert files to the file format generated by lyx 0.12"""
 
@@ -308,6 +308,24 @@ def obsolete_latex_title(document):
         i = i + 1
 
 
+def remove_inset_latex(document):
+    "Replace inset latex with layout LaTeX"
+    body = document.body
+
+    i = 0
+    while 1:
+        i = find_token(body, '\\begin_inset Latex', i)
+        if i == -1:
+            return
+
+        body[i] = body[i].replace('\\begin_inset Latex', '\\layout LaTeX')
+        i = find_token(body, '\\end_inset', i)
+        if i == -1:
+            #this should not happen
+            return
+        del body[i]
+        
+    
 supported_versions = ["0.12.0","0.12.1","0.12"]
 convert = [[215, [header_update, add_end_document, remove_cursor,
                   final_dot, update_inset_label, update_latexdel,
@@ -315,7 +333,7 @@ convert = [[215, [header_update, add_end_document, remove_cursor,
                   formula_inset_space_eat, update_tabular,
                   update_vfill, remove_empty_insets,
                   remove_formula_latex, update_latexaccents,
-                  obsolete_latex_title]]]
+                  obsolete_latex_title, remove_inset_latex]]]
 revert  = []