Returns True if the given string *s* contains any mathtext.
(self, s)
| 528 | self._invalid = False |
| 529 | |
| 530 | def is_math_text(self, s): |
| 531 | """ |
| 532 | Returns True if the given string *s* contains any mathtext. |
| 533 | """ |
| 534 | # copied from Text.is_math_text -JJL |
| 535 | |
| 536 | # Did we find an even number of non-escaped dollar signs? |
| 537 | # If so, treat is as math text. |
| 538 | dollar_count = s.count(r'$') - s.count(r'\$') |
| 539 | even_dollars = (dollar_count > 0 and dollar_count % 2 == 0) |
| 540 | |
| 541 | if rcParams['text.usetex']: |
| 542 | return s, 'TeX' |
| 543 | |
| 544 | if even_dollars: |
| 545 | return s, True |
| 546 | else: |
| 547 | return s.replace(r'\$', '$'), False |
| 548 | |
| 549 | def text_get_vertices_codes(self, prop, s, usetex): |
| 550 | """ |
no test coverage detected