]> git.lyx.org Git - lyx.git/commitdiff
File format bump after r39982 (renaming of the japanese encodings for pLaTeX).
authorJulien Rioux <jrioux@lyx.org>
Mon, 7 Nov 2011 18:36:56 +0000 (18:36 +0000)
committerJulien Rioux <jrioux@lyx.org>
Mon, 7 Nov 2011 18:36:56 +0000 (18:36 +0000)
LyX file format incremented to 417.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40155 a592a061-630c-0410-9148-cb99ea01b6c8

development/FORMAT
lib/lyx2lyx/lyx_2_1.py
src/version.h

index 10c1d88142e2d299eae2740592bcb33d8096b3be..109c7a934752ad31d1362b79841f549cf481d987 100644 (file)
@@ -11,6 +11,10 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
 
 -----------------------
 
+2011-11-07 Julien Rioux (jrioux@lyx.org)
+       * Format incremented to 417 (r39982 and r40155)
+         Rename the japanese encodings to names understood by pLaTeX.
+
 2011-08-29 Uwe Stöhr <uwestoehr@web.de>
        * Format incremented to 416 (r39557)
          support for \negmedspace and \negthinspace outside of math
index 6c6c6fe1130dcd1f63b738d517175e1319a72ba8..ebff63693b43ef0084502148bc5a679fd4935c7a 100644 (file)
@@ -162,17 +162,51 @@ def revert_math_spaces(document):
       i = i + 1
 
 
+def convert_japanese_encodings(document):
+    " Rename the japanese encodings to names understood by platex "
+    jap_enc_dict = {
+        "EUC-JP-pLaTeX": "euc",
+        "JIS-pLaTeX":    "jis",
+        "SJIS-pLaTeX":   "sjis"
+    }
+    i = find_token(document.header, "\\inputencoding" , 0)
+    if i == -1:
+        return
+    val = get_value(document.header, "\\inputencoding", i)
+    if val in jap_enc_dict.keys():
+        document.header[i] = "\\inputencoding %s" % jap_enc_dict[val]
+
+
+def revert_japanese_encodings(document):
+    " Revert the japanese encodings name changes "
+    jap_enc_dict = {
+        "euc":  "EUC-JP-pLaTeX",
+        "jis":  "JIS-pLaTeX",
+        "sjis": "SJIS-pLaTeX"
+    }
+    i = find_token(document.header, "\\inputencoding" , 0)
+    if i == -1:
+        return
+    val = get_value(document.header, "\\inputencoding", i)
+    if val in jap_enc_dict.keys():
+        document.header[i] = "\\inputencoding %s" % jap_enc_dict[val]
+
+
 ##
 # Conversion hub
 #
 
 supported_versions = ["2.1.0","2.1"]
-convert = [[414, []],
+convert = [
+           [414, []],
            [415, [convert_undertilde]],
-           [416, []]
+           [416, []],
+           [417, [convert_japanese_encodings]],
           ]
 
-revert =  [[415, [revert_negative_space,revert_math_spaces]],
+revert =  [
+           [416, [revert_japanese_encodings]],
+           [415, [revert_negative_space,revert_math_spaces]],
            [414, [revert_undertilde]],
            [413, [revert_visible_space]]
           ]
index 99ae9e13371f1f4d98f8c3bd8d815ba2d5192bba..dd0ad2ba2a6e1f10ba313547b5d91eb1269e2b2b 100644 (file)
@@ -30,8 +30,8 @@ extern char const * const lyx_version_info;
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 416 //uwestoehr : support for horizontal spaces (bug 7728)
-#define LYX_FORMAT_TEX2LYX 416
+#define LYX_FORMAT_LYX 417 // jrioux : rename the japanese encodings
+#define LYX_FORMAT_TEX2LYX 417
 
 #if LYX_FORMAT_FOR_TEX2LYX != LYX_FORMAT_FOR_LYX
 #warning "tex2lyx produces an out of date file format."