+def convert_plain_layout(document):
+ " Convert 'PlainLayout' to 'Plain Layout'"
+ i = 0
+ while True:
+ i = find_token(document.body, '\\begin_layout PlainLayout', i)
+ if i == -1:
+ return
+ document.body[i] = document.body[i].replace('\\begin_layout PlainLayout', \
+ '\\begin_layout Plain Layout')
+ i += 1
+
+
+def revert_plain_layout(document):
+ " Convert 'PlainLayout' to 'Plain Layout'"
+ i = 0
+ while True:
+ i = find_token(document.body, '\\begin_layout Plain Layout', i)
+ if i == -1:
+ return
+ document.body[i] = document.body[i].replace('\\begin_layout Plain Layout', \
+ '\\begin_layout PlainLayout')
+ i += 1
+
+def revert_plainlayout(document):
+ " Convert 'PlainLayout' to 'Plain Layout'"
+ i = 0
+ while True:
+ i = find_token(document.body, '\\begin_layout PlainLayout', i)
+ if i == -1:
+ return
+ # This will be incorrect for some document classes, since Standard is not always
+ # the default. But (a) it is probably the best we can do and (b) it will actually
+ # work, in fact, since an unknown layout will be converted to default.
+ document.body[i] = document.body[i].replace('\\begin_layout PlainLayout', \
+ '\\begin_layout Standard')
+ i += 1
+
+