-----------------------
+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
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]]
]
// 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."