BTW I think that this code o = document.body[i+1].find("\\length") if o == -1: document.warning("Error: Cannot find lenght for \\hspace!") break # search for the beginning of the value via the space k = document.body[i+1].find(" ") length = document.body[i+1][k+1:]
could be replaced by length = get_value(document.body, '\\length', i+1) if length == '': document.warning("Error: Cannot find lenght for \\hspace!") return (adapted from revert_hspace in lyx_1_6.py). Jürgen