]> git.lyx.org Git - features.git/commitdiff
File format change caused by 34eadf5d4.
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 9 Apr 2015 09:01:44 +0000 (11:01 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 9 Apr 2015 09:01:44 +0000 (11:01 +0200)
development/FORMAT
lib/lyx2lyx/LyX.py
lib/lyx2lyx/lyx_2_2.py
src/version.h

index 6fb18ec2422ac9b7c56c4ceee4face8a69588c93..ffd2b070692217e089c078ab030e5284e7e051af 100644 (file)
@@ -11,6 +11,10 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
 
 -----------------------
 
+2015-04-09 Jürgen Spitzmüller <spitz@lyx.org>
+       * Format incremented to 485: new par layout for sigplanconf.layout: 
+         DOI.
+
 2015-04-06 Uwe Stöhr <uwestoehr@web.de> 
        * Format incremented to 484: support for Georgian: 
          \lang georgian
index 59723ef936a10e78c1d1843e6f30c4c3104533f7..2ab78bb6136c111de05c30fcfbdd8e803f5371b5 100644 (file)
@@ -85,7 +85,7 @@ format_relation = [("0_06",    [200], minor_versions("0.6" , 4)),
                    ("1_6", list(range(277,346)), minor_versions("1.6" , 10)),
                    ("2_0", list(range(346,414)), minor_versions("2.0" , 8)),
                    ("2_1", list(range(414,475)), minor_versions("2.1" , 0)),
-                   ("2_2", list(range(475,485)), minor_versions("2.2" , 0))
+                   ("2_2", list(range(475,486)), minor_versions("2.2" , 0))
                   ]
 
 ####################################################################
index aedd376e7a0045ee336fde42ebf4094cd7a00d7c..1fd0fed022d2de9dc0043993e95c882e2d35de95 100644 (file)
@@ -29,9 +29,9 @@ import sys, os
 #  find_token_exact, find_end_of_inset, find_end_of_layout, \
 #  find_token_backwards, is_in_inset, get_value, get_quoted_value, \
 #  del_token, check_token, get_option_value
-  
-from lyx2lyx_tools import add_to_preamble, put_cmd_in_ert#, \
-#  insert_to_preamble, lyx2latex, latex_length, revert_flex_inset, \
+
+from lyx2lyx_tools import add_to_preamble, put_cmd_in_ert, lyx2latex#, \
+#  insert_to_preamble, latex_length, revert_flex_inset, \
 #  revert_font_attrs, hex2ratio, str2bool
 
 from parser_tools import find_token, find_token_backwards, find_re, \
@@ -703,7 +703,30 @@ def revert_georgian(document):
         else:
            l = find_token(document.header, "\\use_default_options", 0)
            document.header.insert(l + 1, "\\options georgian")
-           
+
+
+def revert_sigplan_doi(document):
+    " Reverts sigplanconf DOI layout to ERT "
+
+    if document.textclass != "sigplanconf":
+        return
+
+    i = 0
+    while True:
+        i = find_token(document.body, "\\begin_layout DOI", i)
+        if i == -1:
+            return
+        j = find_end_of_layout(document.body, i)
+        if j == -1:
+            document.warning("Malformed LyX document: Can't find end of DOI layout")
+            i += 1
+            continue
+
+        content = lyx2latex(document, document.body[i:j + 1])
+        add_to_preamble(document, ["\\doi{" + content + "}"])
+        del document.body[i:j + 1]
+        # no need to reset i
+
 
 ##
 # Conversion hub
@@ -723,10 +746,12 @@ convert = [
            [481, [convert_dashes]],
            [482, [convert_phrases]],
            [483, [convert_specialchar]],
-           [484, []]
+           [484, []],
+           [485, []]
           ]
 
 revert =  [
+           [484, [revert_sigplan_doi]],
            [483, [revert_georgian]],
            [482, [revert_specialchar]],
            [481, [revert_phrases]],
index 249106bad4d4df6c1269110ca9c01b88891659c9..d9409d3e0d421835360f416a4dd98a7e327a45f2 100644 (file)
@@ -32,8 +32,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 484 // uwestoehr: support for Georgian 
-#define LYX_FORMAT_TEX2LYX 484
+#define LYX_FORMAT_LYX 485 // spitz: support DOI in sigplanconf
+#define LYX_FORMAT_TEX2LYX 485
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER