diff --git a/development/FORMAT b/development/FORMAT index 10c1d88142..109c7a9347 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -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 * Format incremented to 416 (r39557) support for \negmedspace and \negthinspace outside of math diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py index 6c6c6fe113..ebff63693b 100644 --- a/lib/lyx2lyx/lyx_2_1.py +++ b/lib/lyx2lyx/lyx_2_1.py @@ -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]] ] diff --git a/src/version.h b/src/version.h index 99ae9e1337..dd0ad2ba2a 100644 --- a/src/version.h +++ b/src/version.h @@ -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."