+# Bullets
+#
+def convert_bullets(header, opt):
+ i = 0
+ while 1:
+ i = find_token(header, "\\bullet", i)
+ if i == -1:
+ return
+ if header[i][:12] == '\\bulletLaTeX':
+ header[i] = header[i] + ' ' + strip(header[i+1])
+ n = 3
+ else:
+ header[i] = header[i] + ' ' + strip(header[i+1]) +\
+ ' ' + strip(header[i+2]) + ' ' + strip(header[i+3])
+ n = 5
+ del header[i+1:i + n]
+ i = i + 1
+
+
+def revert_bullets(header, opt):
+ i = 0
+ while 1:
+ i = find_token(header, "\\bullet", i)
+ if i == -1:
+ return
+ if header[i][:12] == '\\bulletLaTeX':
+ n = find(header[i], '"')
+ if n == -1:
+ opt.warn("Malformed header")
+ return
+ else:
+ header[i:i+1] = [header[i][:n-1],'\t' + header[i][n:], '\\end_bullet']
+ i = i + 3
+ else:
+ frag = split(header[i])
+ if len(frag) != 5:
+ opt.warn("Malformed header")
+ return
+ else:
+ header[i:i+1] = [frag[0] + ' ' + frag[1],
+ '\t' + frag[2],
+ '\t' + frag[3],
+ '\t' + frag[4],
+ '\\end_bullet']
+ i = i + 5
+
+
+##
+# \begin_header and \begin_document