This builds on an extension of the natbib CiteEngine by tufte.
2018-05-10 Jürgen Spitzmüller <spitz@lyx.org>
- * format incremented to 552: support for float alignment
+ Format incremented to 552:
+ * support for float alignment
- add buffer param \float_alignment [class|left|center|right]
- add buffer param \float_placement class
- add float param alignment [class|document|left|center|right]
- add float param placement class (=> new param)
- add float param placement document(=> like formerly empty param)
+ * adapt class options in aa class documents to latin9 > utf8 default
+ encoding change.
2018-05-06 Jürgen Spitzmüller <spitz@lyx.org>
* format incremented to 551: add font info param \nospellcheck that prevents
i = j
+def convert_aaencoding(document):
+ " Convert default document option due to encoding change in aa class. "
+
+ if document.textclass != "aa":
+ return
+
+ i = 0
+
+ i = find_token(document.header, "\\use_default_options true", i)
+ if i == -1:
+ return
+ j = find_token(document.header, "\\inputencoding", 0)
+ if j == -1:
+ document.warning("Malformed LyX Document! Missing \\inputencoding header.")
+ return
+ val = get_value(document.header, "\\inputencoding", j)
+ if val == "auto" or val == "latin9":
+ document.header[i] = "\\use_default_options false"
+ k = find_token(document.header, "\\options", 0)
+ if k == -1:
+ document.header.insert(i, "\\options latin9")
+ else:
+ document.header[k] = document.header[k] + ",latin9"
+
+
+def revert_aaencoding(document):
+ " Revert default document option due to encoding change in aa class. "
+
+ if document.textclass != "aa":
+ return
+
+ i = 0
+
+ i = find_token(document.header, "\\use_default_options true", i)
+ if i == -1:
+ return
+ j = find_token(document.header, "\\inputencoding", 0)
+ if j == -1:
+ document.warning("Malformed LyX Document! Missing \\inputencoding header.")
+ return
+ val = get_value(document.header, "\\inputencoding", j)
+ if val == "utf8":
+ document.header[i] = "\\use_default_options false"
+ k = find_token(document.header, "\\options", 0)
+ if k == -1:
+ document.header.insert(i, "\\options utf8")
+ else:
+ document.header[k] = document.header[k] + ",utf8"
+
+
+
def revert_stretchcolumn(document):
" We remove the column varwidth flags or everything else will become a mess. "
i = 0
[549, []],
[550, [convert_fontenc]],
[551, []],
- [552, []],
+ [552, [convert_aaencoding]],
[553, []],
[554, []],
[555, []],
[554, [revert_vcolumns]],
[553, [revert_stretchcolumn]],
[552, [revert_tuftecite]],
- [551, [revert_floatpclass, revert_floatalignment]],
+ [551, [revert_floatpclass, revert_floatalignment, revert_aaencoding]],
[550, [revert_nospellcheck]],
[549, [revert_fontenc]],
[548, []],# dummy format change