# register that xcolor must be loaded in the preamble
if xcolor == False:
xcolor = True
- add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\usepackage{xcolor}}{}"])
+ add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\\usepackage{xcolor}}{}"])
# find the next \\color and/or the next \\end_layout
j = find_token(document.body, "\\color", i + 1)
k = find_token(document.body, "\\end_layout", i + 1)
pass
else:
# we also neeed to load xcolor in the preamble but only once
- add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\usepackage{xcolor}}{}"])
- document.body[einset + 1 : einset + 1] = put_cmd_in_ert("}")
+ add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\\usepackage{xcolor}}{}"])
+ document.body[einset + 2 : einset + 2] = put_cmd_in_ert("}")
if framecolor != defaultframecolor:
document.body[binset:binset] = put_cmd_in_ert("\\fcolorbox{" + framecolor + "}{" + backcolor + "}{")
else:
i = find_token(document.header, "tcolorbox", i)
if i == -1:
break
- else:
+ else:
flex = 0
flexEnd = -1
flex = find_token(document.body, "\\begin_inset Flex Subtitle", flex)
i = find_token(document.header, "tcolorbox", i)
if i == -1:
break
- else:
+ else:
flex = 0
flexEnd = -1
flex = find_token(document.body, "\\begin_inset Flex Raster Color Box", flex)
i = find_token(document.header, "tcolorbox", i)
if i == -1:
break
- else:
+ else:
flex = 0
flexEnd = -1
flex = find_token(document.body, "\\begin_inset Flex Custom Color Box 1", flex)
i = find_token(document.header, "tcolorbox", i)
if i == -1:
break
- else:
+ else:
flex = 0
flexEnd = -1
flex = find_token(document.body, "\\begin_inset Flex Custom Color Box 2", flex)
i = find_token(document.header, "tcolorbox", i)
if i == -1:
break
- else:
+ else:
flex = 0
flexEnd = -1
flex = find_token(document.body, "\\begin_inset Flex Custom Color Box 3", flex)
i = find_token(document.header, "tcolorbox", i)
if i == -1:
break
- else:
+ else:
flex = 0
flexEnd = -1
flex = find_token(document.body, "\\begin_inset Flex Custom Color Box 4", flex)
i = find_token(document.header, "tcolorbox", i)
if i == -1:
break
- else:
+ else:
flex = 0
flexEnd = -1
flex = find_token(document.body, "\\begin_inset Flex Custom Color Box 5", flex)