("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))
]
####################################################################
# 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, \
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
[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]],
// 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