Show More
@@ -122,12 +122,13 b' def single_ansi2latex(code):' | |||
|
122 | 122 | color_code = style_code.split(';')[1] |
|
123 | 123 | is_normal = style_code.split(';')[0] == '0' |
|
124 | 124 | |
|
125 |
# regular |
|
|
125 | # regular weight | |
|
126 | 126 | if (code == style_code) or (is_normal and code == color_code): |
|
127 | return '\\'+color[0].lower()+'{', 1 | |
|
128 | # bold fonts | |
|
127 | ||
|
128 | return r'{\color{'+color[0].lower()+'}', 1 | |
|
129 | # bold | |
|
129 | 130 | if code == style_code[:3]+str(1)+style_code[3:]: |
|
130 |
return '\ |
|
|
131 | return r'\textbf{\color{'+color[0].lower()+'}', 1 | |
|
131 | 132 | return '', 0 |
|
132 | 133 | |
|
133 | 134 | def ansi2latex(text): |
@@ -149,8 +150,8 b' def ansi2latex(text):' | |||
|
149 | 150 | texform, openbrack = single_ansi2latex(match.group()) |
|
150 | 151 | outstring += texform |
|
151 | 152 | last_end = match.end() |
|
152 | ||
|
153 | #Add the remainer of the string and THEN close any remaining color brackets. | |
|
153 | ||
|
154 | # Add the remainer of the string and THEN close any remaining color brackets. | |
|
154 | 155 | outstring += text[last_end:] |
|
155 | 156 | if openbrack: |
|
156 | 157 | outstring += '}'*openbrack |
General Comments 0
You need to be logged in to leave comments.
Login now