| 668 | } |
| 669 | |
| 670 | bool TeXParser::replaceScript() { |
| 671 | wchar_t ch = _parseString[_pos]; |
| 672 | auto it = SUP_SCRIPT_MAP.find(ch); |
| 673 | if (it != SUP_SCRIPT_MAP.end()) { |
| 674 | wstring sup = wstring(L"\\mathcumsup{").append(1, (wchar_t)(it->second)).append(L"}"); |
| 675 | _parseString.replace(_pos, 1, sup); |
| 676 | _len = _parseString.length(); |
| 677 | _pos += sup.size(); |
| 678 | return true; |
| 679 | } |
| 680 | it = SUB_SCRIPT_MAP.find(ch); |
| 681 | if (it != SUB_SCRIPT_MAP.end()) { |
| 682 | wstring sub = wstring(L"\\mathcumsub{").append(1, (wchar_t)(it->second)).append(L"}"); |
| 683 | _parseString.replace(_pos, 1, sub); |
| 684 | _len = _parseString.length(); |
| 685 | _pos += sub.size(); |
| 686 | return true; |
| 687 | } |
| 688 | return false; |
| 689 | } |
| 690 | |
| 691 | void TeXParser::preprocess(wstring& cmd, vector<wstring>& args, int& pos) throw(ex_parse) { |
| 692 | if (cmd == L"newcommand" || cmd == L"renewcommand") { |