- i = find_token(document.body, '\\begin_inset Index', i+1)
+ # trailing blank needed here to exclude IndexMacro insets
+ i = find_token(document.body, '\\begin_inset Index ', i+1)
- # Two subindexes are allowed, thus the duplication
- imacros = ["seealso", "see", "subindex", "subindex", "sortkey"]
+ # Two subentries are allowed, thus the duplication
+ imacros = ["seealso", "see", "subentry", "subentry", "sortkey"]
for imacro in imacros:
iim = find_token(document.body, "\\begin_inset IndexMacro %s" % imacro, i, j)
if iim == -1:
for imacro in imacros:
iim = find_token(document.body, "\\begin_inset IndexMacro %s" % imacro, i, j)
if iim == -1:
xiim = find_token(document.body, "\\begin_inset IndexMacro sortkey", iimpl, iimple)
if xiim != -1:
xiime = find_end_of_inset(document.body, xiim)
xiim = find_token(document.body, "\\begin_inset IndexMacro sortkey", iimpl, iimple)
if xiim != -1:
xiime = find_end_of_inset(document.body, xiim)
- xicont = document.body[xiimpl:xiimple]
- xxicont = document.body[iimpl:xiimpl] + document.body[xiimple+1:iimple]
+ # the sortkey
+ xicont = document.body[xiimpl+1:xiimple]
+ # everything before ................... or after
+ xxicont = document.body[iimpl+1:xiim] + document.body[xiime+1:iimple]
+ # construct the latex sequence
document.body[ple:ple] = put_cmd_in_ert("|" + pagerange + "seealso{") + seealso + put_cmd_in_ert("}")
elif pageformat != "default":
document.body[ple:ple] = put_cmd_in_ert("|" + pagerange + pageformat)
document.body[ple:ple] = put_cmd_in_ert("|" + pagerange + "seealso{") + seealso + put_cmd_in_ert("}")
elif pageformat != "default":
document.body[ple:ple] = put_cmd_in_ert("|" + pagerange + pageformat)
- if len(subindex2) > 0:
- document.body[ple:ple] = put_cmd_in_ert("!") + subindex2
- if len(subindex) > 0:
- document.body[ple:ple] = put_cmd_in_ert("!") + subindex
+ if len(subentry2) > 0:
+ document.body[ple:ple] = put_cmd_in_ert("!") + subentry2
+ if len(subentry) > 0:
+ document.body[ple:ple] = put_cmd_in_ert("!") + subentry