main
HuangHai 3 weeks ago
parent b98ac2c19f
commit 5efa0d7564

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/mtef-go-3.iml" filepath="$PROJECT_DIR$/.idea/mtef-go-3.iml" />
</modules>
</component>
</project>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

@ -0,0 +1,112 @@
# 测试
```
$ go run main.go -f test/oleObject1.bin
```
输出:
```
$$ \frac { -b±\sqrt[] { b ^ { 2 } -4ac } } { 2a } $$
```
# 字节数据
```
[5 1 0 6 9 68 83 77 84 54 0 1 19 87 105 110 65 108 108 66 97 115 105 99 67 111 100 101 80 97 103 101 115 0 17 5 84 105 109 101 115 32 78 101 119 32 82 111 109 97 110 0 17 3 83 121 109 98 111 108 0 17 5 67 111 117 114 105 101 114 32 78 101 119 0 17 4 77 84 32 69 120 116 114 97 0 19 87 105 110 65 108 108 67 111 100 101 80 97 103 101 115 0 17 6 203 206 204 229 0 18 0 8 33 47 69 143 68 47 65 80 244 16 15 71 95 65 80 242 31 30 65 80 244 21 15 65 0 244 69 244 37 244 143 66 95 65 0 244 16 15 67 95 65 0 244 143 69 244 42 95 72 244 143 65 0 244 16 15 64 244 143 65 127 72 244 16 15 65 42 95 68 95 69 244 95 69 244 95 65 15 12 1 0 1 0 1 2 2 2 2 0 2 0 1 1 1 0 3 0 1 0 4 0 5 0 10 1 0 2 2 130 99 0 2 0 130 111 0 2 0 130 115 0 3 0 28 0 0 11 1 1 1 0 2 4 134 18 34 45 2 0 136 49 0 0 0 10 2 4 132 184 3 113 2 2 130 115 0 2 0 130 105 0 2 0 130 110 0 3 0 28 0 0 11 1 1 1 0 2 4 134 18 34 45 2 0 136 49 0 0 0 10 2 4 132 184 3 113 2 2 130 97 0 2 0 130 114 0 2 0 130 99 0 2 0 130 115 0 2 0 130 105 0 2 0 130 110 0 2 4 132 184 3 113 2 0 131 101 0 3 0 28 0 0 11 1 1 1 0 2 0 131 105 0 2 4 132 184 3 113 0 0 10 3 0 11 0 0 1 0 2 0 129 79 0 2 0 129 112 0 2 0 129 112 0 2 0 129 111 0 2 0 129 115 0 2 0 129 105 0 2 0 129 116 0 2 0 129 101 0 0 1 0 2 0 129 72 0 2 0 129 121 0 2 0 129 112 0 2 0 129 111 0 2 0 129 116 0 2 0 129 101 0 2 0 129 110 0 2 0 129 117 0 2 0 129 115 0 2 0 129 101 0 0 0 3 0 1 3 0 1 0 3 0 11 0 0 1 0 2 4 132 192 3 112 0 1 0 2 0 136 50 0 0 0 2 4 134 18 34 45 2 4 132 184 3 113 0 2 0 150 40 0 2 0 150 41 0 0 8 2 2 2 4 127 184 3 113 2 4 127 198 3 106 0 0]
ENCODING_DEF WinAllBasicCodePages
FONT_DEF 5 Times New Roman
FONT_DEF 3 Symbol
FONT_DEF 5 Courier New
FONT_DEF 4 MT Extra
ENCODING_DEF WinAllCodePages
FONT_DEF 6 <20><><EFBFBD><EFBFBD>
EQN_PREFS &{[pt12 %58 %42 %150 %100 %75 %150 pt1] [%150 %150 %100 %45 %25 %8 %25 %100 %100 %35 %100 %8 %5 %2.5 %8 %8 %100 %100 %0 %8 %17 %8 %100 %12.5 %45 %5 %5 %5 %5 %10] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 0 0 1 0 0 0 0 0]}
FULL
LINE &{0 0 0 false <nil> <nil>}
CHAR &{0 0 0 130 99 0 0 <nil>}
CHAR &{0 0 0 130 111 0 0 <nil>}
CHAR &{0 0 0 130 115 0 0 <nil>}
TMPL &{0 0 28 0 0 <nil>}
SUB
LINE &{0 0 0 true <nil> <nil>}
LINE &{0 0 0 false <nil> <nil>}
CHAR &{0 0 0 134 8722 45 0 <nil>}
CHAR &{0 0 0 136 49 0 0 <nil>}
END
END
FULL
CHAR &{0 0 0 132 952 113 0 <nil>}
CHAR &{0 0 0 130 115 0 0 <nil>}
CHAR &{0 0 0 130 105 0 0 <nil>}
CHAR &{0 0 0 130 110 0 0 <nil>}
TMPL &{0 0 28 0 0 <nil>}
SUB
LINE &{0 0 0 true <nil> <nil>}
LINE &{0 0 0 false <nil> <nil>}
CHAR &{0 0 0 134 8722 45 0 <nil>}
CHAR &{0 0 0 136 49 0 0 <nil>}
END
END
FULL
CHAR &{0 0 0 132 952 113 0 <nil>}
CHAR &{0 0 0 130 97 0 0 <nil>}
CHAR &{0 0 0 130 114 0 0 <nil>}
CHAR &{0 0 0 130 99 0 0 <nil>}
CHAR &{0 0 0 130 115 0 0 <nil>}
CHAR &{0 0 0 130 105 0 0 <nil>}
CHAR &{0 0 0 130 110 0 0 <nil>}
CHAR &{0 0 0 132 952 113 0 <nil>}
CHAR &{0 0 0 131 101 0 0 <nil>}
TMPL &{0 0 28 0 0 <nil>}
SUB
LINE &{0 0 0 true <nil> <nil>}
LINE &{0 0 0 false <nil> <nil>}
CHAR &{0 0 0 131 105 0 0 <nil>}
CHAR &{0 0 0 132 952 113 0 <nil>}
END
END
FULL
TMPL &{0 0 11 0 0 <nil>}
LINE &{0 0 0 false <nil> <nil>}
CHAR &{0 0 0 129 79 0 0 <nil>}
CHAR &{0 0 0 129 112 0 0 <nil>}
CHAR &{0 0 0 129 112 0 0 <nil>}
CHAR &{0 0 0 129 111 0 0 <nil>}
CHAR &{0 0 0 129 115 0 0 <nil>}
CHAR &{0 0 0 129 105 0 0 <nil>}
CHAR &{0 0 0 129 116 0 0 <nil>}
CHAR &{0 0 0 129 101 0 0 <nil>}
END
LINE &{0 0 0 false <nil> <nil>}
CHAR &{0 0 0 129 72 0 0 <nil>}
CHAR &{0 0 0 129 121 0 0 <nil>}
CHAR &{0 0 0 129 112 0 0 <nil>}
CHAR &{0 0 0 129 111 0 0 <nil>}
CHAR &{0 0 0 129 116 0 0 <nil>}
CHAR &{0 0 0 129 101 0 0 <nil>}
CHAR &{0 0 0 129 110 0 0 <nil>}
CHAR &{0 0 0 129 117 0 0 <nil>}
CHAR &{0 0 0 129 115 0 0 <nil>}
CHAR &{0 0 0 129 101 0 0 <nil>}
END
END
TMPL &{0 0 1 3 0 <nil>}
LINE &{0 0 0 false <nil> <nil>}
TMPL &{0 0 11 0 0 <nil>}
LINE &{0 0 0 false <nil> <nil>}
CHAR &{0 0 0 132 960 112 0 <nil>}
END
LINE &{0 0 0 false <nil> <nil>}
CHAR &{0 0 0 136 50 0 0 <nil>}
END
END
CHAR &{0 0 0 134 8722 45 0 <nil>}
CHAR &{0 0 0 132 952 113 0 <nil>}
END
CHAR &{0 0 0 150 40 0 0 <nil>}
CHAR &{0 0 0 150 41 0 0 <nil>}
END
FONT_STYLE_DEF 2 <>q<>j
END
&{5 1 0 6 9 DSMT6 1 0xc0000642d0}
Process finished with exit code 0
```

@ -0,0 +1,95 @@
package docx
import (
"archive/zip"
"github.com/zhexiao/mtef-go/eqn"
"io"
"io/ioutil"
"os"
"path/filepath"
)
type DocxWord struct {
Filename string
Target string
}
// 转换文档
func (d *DocxWord) ParseDocx() (string, error) {
err := d.unzip()
if err != nil {
return "", err
}
return d.getLatex()
}
// 转latex
func (d *DocxWord) getLatex() (string, error) {
var result string
latexDir := filepath.Join(d.Target, "word/embeddings")
if _, err := os.Stat(latexDir); os.IsNotExist(err) {
return "", err
}
dirList, err := ioutil.ReadDir(latexDir)
if err != nil {
return "", err
}
for _, file := range dirList {
latexFile := filepath.Join(latexDir, file.Name())
latex := eqn.Convert(latexFile)
result += latex + "\n"
}
return result, nil
}
// 解压缩文件
func (d *DocxWord) unzip() error {
reader, err := zip.OpenReader(d.Filename)
if err != nil {
return err
}
if err := os.MkdirAll(d.Target, 0755); err != nil {
return err
}
for _, file := range reader.File {
path := filepath.Join(d.Target, file.Name)
if file.FileInfo().IsDir() {
os.MkdirAll(path, file.Mode())
continue
}
dir := filepath.Dir(path)
if len(dir) > 0 {
if _, err := os.Stat(dir); os.IsNotExist(err) {
err = os.MkdirAll(dir, 0755)
if err != nil {
return err
}
}
}
fileReader, err := file.Open()
defer fileReader.Close()
if err != nil {
return err
}
targetFile, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, file.Mode())
defer targetFile.Close()
if err != nil {
return err
}
if _, err := io.Copy(targetFile, fileReader); err != nil {
return err
}
}
return nil
}

@ -0,0 +1,939 @@
package eqn
var SpecialChar = map[string]string{
"!": "\\!",
"#": "\\#",
"$": "\\$",
"%": "\\%",
"&": "\\&",
":": "\\:",
";": "\\;",
"_": "\\_",
"{": "\\{",
"|": "\\|",
"}": "\\}",
}
var Chars = map[string]string{
"char/0x0020": " ",
"char/0x0021": "!",
"char/0x0022": "''",
"char/0x0023/mathmode": "\\@#",
"char/0x0024/mathmode": "\\$",
"char/0x0025/mathmode": "%",
"char/0x0026/mathmode": "\\And ",
"char/0x0027/mathmode": "'",
"char/0x0028": "(",
"char/0x0029": ")",
"char/0x002a": "*",
"char/0x002b": "+",
"char/0x002c": ",",
"char/0x002d": "-",
"char/0x002e": ".",
"char/0x002f": "/",
"char/0x0030": "0",
"char/0x0031": "1",
"char/0x0032": "2",
"char/0x0033": "3",
"char/0x0034": "4",
"char/0x0035": "5",
"char/0x0036": "6",
"char/0x0037": "7",
"char/0x0038": "8",
"char/0x0039": "9",
"char/0x003a": ":",
"char/0x003b": ";",
"char/0x003c/mathmode": " < ",
"char/0x003d": "=",
"char/0x003e/mathmode": ">",
"char/0x003f": "?",
"char/0x0041": "A",
"char/0x0042": "B",
"char/0x0043": "C",
"char/0x0044": "D",
"char/0x0045": "E",
"char/0x0046": "F",
"char/0x0047": "G",
"char/0x0048": "H",
"char/0x0049": "I",
"char/0x004a": "J",
"char/0x004b": "K",
"char/0x004c": "L",
"char/0x004d": "M",
"char/0x004e": "N",
"char/0x004f": "O",
"char/0x0050": "P",
"char/0x0051": "Q",
"char/0x0052": "R",
"char/0x0053": "S",
"char/0x0054": "T",
"char/0x0055": "U",
"char/0x0056": "V",
"char/0x0057": "W",
"char/0x0058": "X",
"char/0x0059": "Y",
"char/0x005a": "Z",
"char/0x005b/mathmode": "[",
"char/0x005c/mathmode": "\\backslash ",
"char/0x005d/mathmode": "]",
"char/0x005e/mathmode": "\\hat{\\ }",
"char/0x005f/mathmode": "\\_",
"char/0x0060/mathmode": "\\grave{\\ }",
"char/0x0061": "a",
"char/0x0062": "b",
"char/0x0063": "c",
"char/0x0064": "d",
"char/0x0065": "e",
"char/0x0066": "f",
"char/0x0067": "g",
"char/0x0068": "h",
"char/0x0069": "i",
"char/0x006a": "j",
"char/0x006b": "k",
"char/0x006c": "l",
"char/0x006d": "m",
"char/0x006e": "n",
"char/0x006f": "o",
"char/0x0070": "p",
"char/0x0071": "q",
"char/0x0072": "r",
"char/0x0073": "s",
"char/0x0074": "t",
"char/0x0075": "u",
"char/0x0076": "v",
"char/0x0077": "w",
"char/0x0078": "x",
"char/0x0079": "y",
"char/0x007a": "z",
"char/0x007b/mathmode": "\\{",
"char/0x007c/mathmode": "|",
"char/0x007d/mathmode": "\\}",
"char/0x007e/mathmode": "\\tilde{\\ }",
"char/0x00a0/mathmode": "~",
"char/0x00a1/mathmode": "\\text{<7B>}",
"char/0x00a1/textmode": "<22>",
"char/0x00a2/mathmode": "\\text{<7B>}",
"char/0x00a2/textmode": "<22>",
"char/0x00a3/mathmode": "\\text{<7B>}",
"char/0x00a3/textmode": "<22>",
"char/0x00a4/mathmode": "\\text{<7B>}",
"char/0x00a4/textmode": "<22>",
"char/0x00a5/mathmode": "\\text{<7B>}",
"char/0x00a5/textmode": "<22>",
"char/0x00a6/mathmode": "\\text{<7B>}",
"char/0x00a6/textmode": "<22>",
"char/0x00a7/mathmode": "\\S ",
"char/0x00a8/mathmode": "\\ddot{\\ }",
"char/0x00aa/mathmode": "{}^\\text{a}",
"char/0x00ab/mathmode": "\\ll ",
"char/0x00ac/mathmode": "\\neg ",
"char/0x00af/mathmode": "\\bar{\\ }",
"char/0x00b0/mathmode": "{}^\\circ ",
"char/0x00b1/mathmode": "\\pm ",
"char/0x00b2/mathmode": "{}^\\text{2}",
"char/0x00b3/mathmode": "{}^\\text{3}",
"char/0x00b4/mathmode": "\\acute{\\ }",
"char/0x00b5/mathmode": "\\mu ",
"char/0x00b6/mathmode": "\\P ",
"char/0x00b7/mathmode": "\\cdot ",
"char/0x00b9/mathmode": "{}^\\text{1}",
"char/0x00ba/mathmode": "{}^\\text{o}",
"char/0x00bb/mathmode": "\\gg ",
"char/0x00bc/mathmode": "{\\scriptscriptstyle 1\\!/\\!{ }_4}",
"char/0x00bd/mathmode": "{\\scriptscriptstyle 1\\!/\\!{ }_2}",
"char/0x00be/mathmode": "{\\scriptscriptstyle 3\\!/\\!{ }_4}",
"char/0x00c0/mathmode": "\\grave{A}",
"char/0x00c1/mathmode": "\\acute{A}",
"char/0x00c2/mathmode": "\\hat{A}",
"char/0x00c3/mathmode": "\\tilde{A}",
"char/0x00c4/mathmode": "\\ddot{A}",
"char/0x00c5/mathmode": "{\\AA}",
"char/0x00c8/mathmode": "\\grave{E}",
"char/0x00c9/mathmode": "\\acute{E}",
"char/0x00ca/mathmode": "\\hat{E}",
"char/0x00cb/mathmode": "\\ddot{E}",
"char/0x00cc/mathmode": "\\grave{I}",
"char/0x00cd/mathmode": "\\acute{I}",
"char/0x00ce/mathmode": "\\hat{I}",
"char/0x00cf/mathmode": "\\ddot{I}",
"char/0x00d1/mathmode": "\\tilde{N}",
"char/0x00d2/mathmode": "\\grave{O}",
"char/0x00d3/mathmode": "\\acute{O}",
"char/0x00d4/mathmode": "\\hat{O}",
"char/0x00d5/mathmode": "\\tilde{O}",
"char/0x00d6/mathmode": "\\ddot{O}",
"char/0x00d7/mathmode": "\\times ",
"char/0x00d8/mathmode": "\\O ",
"char/0x00d9/mathmode": "\\grave{U}",
"char/0x00da/mathmode": "\\acute{U}",
"char/0x00db/mathmode": "\\hat{U}",
"char/0x00dc/mathmode": "\\ddot{U}",
"char/0x00dd/mathmode": "\\acute{Y}",
"char/0x00e0/mathmode": "\\grave{a}",
"char/0x00e1/mathmode": "\\acute{a}",
"char/0x00e2/mathmode": "\\hat{a}",
"char/0x00e3/mathmode": "\\tilde{a}",
"char/0x00e4/mathmode": "\\ddot{a}",
"char/0x00e8/mathmode": "\\grave{e}",
"char/0x00e9/mathmode": "\\acute{e}",
"char/0x00ea/mathmode": "\\hat{e}",
"char/0x00eb/mathmode": "\\ddot{e}",
"char/0x00ec/mathmode": "\\grave{i}",
"char/0x00ed/mathmode": "\\acute{i}",
"char/0x00ee/mathmode": "\\hat{i}",
"char/0x00ef/mathmode": "\\ddot{i}",
"char/0x00f0/mathmode": "\\eth ",
"char/0x00f1/mathmode": "\\tilde{n}",
"char/0x00f2/mathmode": "\\grave{o}",
"char/0x00f3/mathmode": "\\acute{o}",
"char/0x00f4/mathmode": "\\hat{o}",
"char/0x00f5/mathmode": "\\tilde{o}",
"char/0x00f6/mathmode": "\\ddot{o}",
"char/0x00f7/mathmode": "\\div ",
"char/0x00f9/mathmode": "\\grave{u}",
"char/0x00fa/mathmode": "\\acute{u}",
"char/0x00fb/mathmode": "\\hat{u}",
"char/0x00fc/mathmode": "\\ddot{u}",
"char/0x00fd/mathmode": "\\acute{y}",
"char/0x00ff/mathmode": "\\ddot{y}",
"char/0x0100/mathmode": "\\bar{A}",
"char/0x0101/mathmode": "\\bar{a}",
"char/0x0102/mathmode": "\\breve{A}",
"char/0x0103/mathmode": "\\breve{a}",
"char/0x0106/mathmode": "\\acute{C}",
"char/0x0107/mathmode": "\\acute{c}",
"char/0x0108/mathmode": "\\hat{C}",
"char/0x0109/mathmode": "\\hat{c}",
"char/0x010a/mathmode": "\\dot{C}",
"char/0x010b/mathmode": "\\dot{c}",
"char/0x010c/mathmode": "\\check{C}",
"char/0x010d/mathmode": "\\check{c}",
"char/0x010e/mathmode": "\\check{D}",
"char/0x010f/mathmode": "\\check{d}",
"char/0x0112/mathmode": "\\bar{E}",
"char/0x0113/mathmode": "\\bar{e}",
"char/0x0114/mathmode": "\\breve{E}",
"char/0x0115/mathmode": "\\breve{e}",
"char/0x0116/mathmode": "\\dot{E}",
"char/0x0117/mathmode": "\\dot{e}",
"char/0x011a/mathmode": "\\check{E}",
"char/0x011b/mathmode": "\\check{e}",
"char/0x011c/mathmode": "\\hat{G}",
"char/0x011d/mathmode": "\\hat{g}",
"char/0x011e/mathmode": "\\breve{G}",
"char/0x011f/mathmode": "\\breve{g}",
"char/0x0120/mathmode": "\\dot{G}",
"char/0x0121/mathmode": "\\dot{g}",
"char/0x0124/mathmode": "\\hat{H}",
"char/0x0125/mathmode": "\\hat{h}",
"char/0x0127/mathmode": "\\hbar ",
"char/0x0128/mathmode": "\\tilde{I}",
"char/0x0129/mathmode": "\\tilde{i}",
"char/0x012a/mathmode": "\\bar{I}",
"char/0x012b/mathmode": "\\bar{i}",
"char/0x012c/mathmode": "\\breve{I}",
"char/0x012d/mathmode": "\\breve{i}",
"char/0x0130/mathmode": "\\dot{I}",
"char/0x0131/mathmode": "\\imath ",
"char/0x0134/mathmode": "\\hat{J}",
"char/0x0135/mathmode": "\\hat{j}",
"char/0x0139/mathmode": "\\acute{L}",
"char/0x013a/mathmode": "\\acute{l}",
"char/0x013d/mathmode": "\\check{L}",
"char/0x013e/mathmode": "\\check{l}",
"char/0x013f/mathmode": "\\mathrm{L}\\!\\!\\cdot",
"char/0x0140/mathmode": "\\mathrm{l}\\cdot",
"char/0x0143/mathmode": "\\acute{N}",
"char/0x0144/mathmode": "\\acute{n}",
"char/0x0147/mathmode": "\\check{N}",
"char/0x0148/mathmode": "\\check{n}",
"char/0x014c/mathmode": "\\bar{O}",
"char/0x014d/mathmode": "\\bar{o}",
"char/0x014e/mathmode": "\\breve{O}",
"char/0x014f/mathmode": "\\breve{o}",
"char/0x0154/mathmode": "\\acute{R}",
"char/0x0155/mathmode": "\\acute{r}",
"char/0x0158/mathmode": "\\check{R}",
"char/0x0159/mathmode": "\\check{r}",
"char/0x015a/mathmode": "\\acute{S}",
"char/0x015b/mathmode": "\\acute{s}",
"char/0x015c/mathmode": "\\hat{S}",
"char/0x015d/mathmode": "\\hat{s}",
"char/0x0160/mathmode": "\\check{S}",
"char/0x0161/mathmode": "\\check{s}",
"char/0x0164/mathmode": "\\check{T}",
"char/0x0165/mathmode": "\\check{t}",
"char/0x0168/mathmode": "\\tilde{U}",
"char/0x0169/mathmode": "\\tilde{u}",
"char/0x016a/mathmode": "\\bar{U}",
"char/0x016b/mathmode": "\\bar{u}",
"char/0x016c/mathmode": "\\breve{U}",
"char/0x016d/mathmode": "\\breve{u}",
"char/0x016e/mathmode": "\\overset{\\circ}{U}",
"char/0x016f/mathmode": "\\overset{\\circ}{u}",
"char/0x0174/mathmode": "\\hat{W}",
"char/0x0175/mathmode": "\\hat{w}",
"char/0x0176/mathmode": "\\hat{Y}",
"char/0x0177/mathmode": "\\hat{y}",
"char/0x0178/mathmode": "\\ddot{Y}",
"char/0x0179/mathmode": "\\acute{Z}",
"char/0x017a/mathmode": "\\acute{z}",
"char/0x017b/mathmode": "\\dot{Z}",
"char/0x017c/mathmode": "\\dot{z}",
"char/0x017d/mathmode": "\\check{Z}",
"char/0x017e/mathmode": "\\check{z}",
"char/0x0391/mathmode": "\\Alpha ",
"char/0x0392/mathmode": "\\Beta ",
"char/0x0393/mathmode": "\\Gamma ",
"char/0x0394/mathmode": "\\Delta ",
"char/0x0395/mathmode": "\\Epsilon ",
"char/0x0396/mathmode": "\\Zeta ",
"char/0x0397/mathmode": "\\Eta ",
"char/0x0398/mathmode": "\\Theta ",
"char/0x0399/mathmode": "\\Iota ",
"char/0x039a/mathmode": "\\Kappa ",
"char/0x039b/mathmode": "\\Lambda ",
"char/0x039c/mathmode": "\\Mu ",
"char/0x039d/mathmode": "\\Nu ",
"char/0x039e/mathmode": "\\Xi ",
"char/0x039f/mathmode": "{\\mathrm O}",
"char/0x039f/textmode": "O",
"char/0x03a0/mathmode": "\\Pi ",
"char/0x03a1/mathmode": "\\Rho ",
"char/0x03a3/mathmode": "\\Sigma ",
"char/0x03a4/mathmode": "\\Tau ",
"char/0x03a5/mathmode": "\\Upsilon ",
"char/0x03a6/mathmode": "\\Phi ",
"char/0x03a7/mathmode": "\\Chi ",
"char/0x03a8/mathmode": "\\Psi ",
"char/0x03a9/mathmode": "\\Omega ",
"char/0x03b1/mathmode": "\\alpha ",
"char/0x03b2/mathmode": "\\beta ",
"char/0x03b3/mathmode": "\\gamma ",
"char/0x03b4/mathmode": "\\delta ",
"char/0x03b5/mathmode": "\\varepsilon ",
"char/0x03b6/mathmode": "\\zeta ",
"char/0x03b7/mathmode": "\\eta ",
"char/0x03b8/mathmode": "\\theta ",
"char/0x03b9/mathmode": "\\iota ",
"char/0x03ba/mathmode": "\\kappa ",
"char/0x03bb/mathmode": "\\lambda ",
"char/0x03bc/mathmode": "\\mu ",
"char/0x03bd/mathmode": "\\nu ",
"char/0x03be/mathmode": "\\xi ",
"char/0x03bf": "o",
"char/0x03c0/mathmode": "\\pi ",
"char/0x03c1/mathmode": "\\rho ",
"char/0x03c2/mathmode": "\\varsigma ",
"char/0x03c3/mathmode": "\\sigma ",
"char/0x03c4/mathmode": "\\tau ",
"char/0x03c5/mathmode": "\\upsilon ",
"char/0x03c6/mathmode": "\\varphi ",
"char/0x03c7/mathmode": "\\chi ",
"char/0x03c8/mathmode": "\\psi ",
"char/0x03c9/mathmode": "\\omega ",
"char/0x03d1/mathmode": "\\vartheta ",
"char/0x03d2/mathmode": "\\Upsilon ",
"char/0x03d5/mathmode": "\\phi ",
"char/0x03d6/mathmode": "\\varpi ",
"char/0x03db/mathmode": "\\varsigma ",
"char/0x03dc/mathmode": "\\digamma ",
"char/0x03f0/mathmode": "\\varkappa ",
"char/0x03f1/mathmode": "\\varrho ",
"char/0x03f5/mathmode": "\\epsilon ",
"char/0x03f6/mathmode": "\\backepsilon ",
"char/0x2010/textmode": "-",
"char/0x2013/textmode": "--",
"char/0x2014/textmode": "---",
"char/0x2016/mathmode": "\\|",
"char/0x2020/mathmode": "\\dagger ",
"char/0x2021/mathmode": "\\ddagger ",
"char/0x2022/mathmode": "\\bullet ",
"char/0x2026/mathmode": "\\ldots ",
"char/0x2032/mathmode": "\\prime ",
"char/0x2033/mathmode": "\\prime\\prime ",
"char/0x2034/mathmode": "\\prime\\prime\\prime ",
"char/0x2035/mathmode": "\\backprime ",
"char/0x2036/mathmode": "\\backprime\\backprime ",
"char/0x2037/mathmode": "\\backprime\\backprime\\backprime ",
"char/0x203e/mathmode": "\\bar{\\ }",
"char/0x203f/mathmode": "{}_\\smile ",
"char/0x2040/mathmode": "{}^\\frown ",
"char/0x2044": "/",
"char/0x20a1/mathmode": "\\Colon ",
"char/0x20a2/mathmode": "\\cruzeiro ",
"char/0x20a3/mathmode": "\\franc ",
"char/0x20a4/mathmode": "\\lira ",
"char/0x20a5/mathmode": "\\mill ",
"char/0x20a6/mathmode": "\\naira ",
"char/0x20a7/mathmode": "\\peseta ",
"char/0x20a8/mathmode": "\\rupee ",
"char/0x20a9/mathmode": "\\won ",
"char/0x20aa/mathmode": "\\newsheqel ",
"char/0x20ab/mathmode": "\\dong ",
"char/0x20ac/mathmode": "\\euro ",
"char/0x20ad/mathmode": "\\kip ",
"char/0x20ae/mathmode": "\\tugrik ",
"char/0x20af/mathmode": "\\drachma ",
"char/0x20b0/mathmode": "\\germanpenny ",
"char/0x20b1/mathmode": "\\peso ",
"char/0x20b2/mathmode": "\\guarani ",
"char/0x20b3/mathmode": "\\austral ",
"char/0x20b4/mathmode": "\\hryvnia ",
"char/0x20b5/mathmode": "\\cedi ",
"char/0x2102/mathmode": "\\mathbb{C}",
"char/0x2107/mathmode": "\\gamma ",
"char/0x210a": "g",
"char/0x210b/mathmode": "\\mathcal{H}",
"char/0x210c/mathmode": "\\mathfrak{H}",
"char/0x210d/mathmode": "\\mathbb{H}",
"char/0x210e/mathmode": "h",
"char/0x210f/mathmode": "\\hbar ",
"char/0x2110/mathmode": "\\mathcal{I}",
"char/0x2111/mathmode": "\\Im ",
"char/0x2112/mathmode": "\\mathcal{L}",
"char/0x2113/mathmode": "\\ell ",
"char/0x2115/mathmode": "\\mathbb{N}",
"char/0x2118/mathmode": "\\wp ",
"char/0x2119/mathmode": "\\mathbb{P}",
"char/0x211a/mathmode": "\\mathbb{Q}",
"char/0x211b/mathmode": "\\mathcal{R}",
"char/0x211c/mathmode": "\\Re ",
"char/0x211d/mathmode": "\\mathbb{R}",
"char/0x2124/mathmode": "\\mathbb{Z}",
"char/0x2126/mathmode": "\\Omega ",
"char/0x2127/mathmode": "\\mho ",
"char/0x2128/mathmode": "\\mathfrak{X}",
"char/0x212c/mathmode": "\\mathcal{B}",
"char/0x212d/mathmode": "\\mathfrak{C}",
"char/0x2130/mathmode": "\\mathcal{E}",
"char/0x2131/mathmode": "\\mathcal{F}",
"char/0x2132/mathmode": "\\Finv ",
"char/0x2133/mathmode": "\\mathcal{M}",
"char/0x2135/mathmode": "\\aleph ",
"char/0x2136/mathmode": "\\beth ",
"char/0x2137/mathmode": "\\gimel ",
"char/0x2138/mathmode": "\\daleth ",
"char/0x2190/mathmode": "\\leftarrow ",
"char/0x2191/mathmode": "\\uparrow ",
"char/0x2192/mathmode": "\\to ",
"char/0x2193/mathmode": "\\downarrow ",
"char/0x2194/mathmode": "\\leftrightarrow ",
"char/0x2195/mathmode": "\\updownarrow ",
"char/0x2196/mathmode": "\\nwarrow ",
"char/0x2197/mathmode": "\\nearrow ",
"char/0x2198/mathmode": "\\searrow ",
"char/0x2199/mathmode": "\\swarrow ",
"char/0x219a/mathmode": "\\nleftarrow ",
"char/0x219b/mathmode": "\\nrightarrow ",
"char/0x219d/mathmode": "\\rightsquigarrow ",
"char/0x219e/mathmode": "\\twoheadleftarrow ",
"char/0x21a0/mathmode": "\\twoheadrightarrow ",
"char/0x21a2/mathmode": "\\leftarrowtail ",
"char/0x21a3/mathmode": "\\rightarrowtail ",
"char/0x21a6/mathmode": "\\mapsto ",
"char/0x21a9/mathmode": "\\hookleftarrow ",
"char/0x21aa/mathmode": "\\hookrightarrow ",
"char/0x21ab/mathmode": "\\looparrowleft ",
"char/0x21ac/mathmode": "\\looparrowright ",
"char/0x21ad/mathmode": "\\leftrightsquigarrow ",
"char/0x21ae/mathmode": "\\nleftrightarrow ",
"char/0x21b0/mathmode": "\\Lsh ",
"char/0x21b1/mathmode": "\\Rsh ",
"char/0x21b6/mathmode": "\\curvearrowleft ",
"char/0x21b7/mathmode": "\\curvearrowright ",
"char/0x21ba/mathmode": "\\circlearrowleft ",
"char/0x21bb/mathmode": "\\circlearrowright ",
"char/0x21bc/mathmode": "\\leftharpoonup ",
"char/0x21bd/mathmode": "\\leftharpoondown ",
"char/0x21be/mathmode": "\\upharpoonright ",
"char/0x21bf/mathmode": "\\upharpoonleft ",
"char/0x21c0/mathmode": "\\rightharpoonup ",
"char/0x21c1/mathmode": "\\rightharpoondown ",
"char/0x21c2/mathmode": "\\downharpoonright ",
"char/0x21c3/mathmode": "\\downharpoonleft ",
"char/0x21c4/mathmode": "\\rightleftarrows ",
"char/0x21c5/mathmode": "\\uparrow\\!\\downarrow ",
"char/0x21c6/mathmode": "\\leftrightarrows ",
"char/0x21c7/mathmode": "\\leftleftarrows ",
"char/0x21c8/mathmode": "\\upuparrows ",
"char/0x21c9/mathmode": "\\rightrightarrows ",
"char/0x21ca/mathmode": "\\downdownarrows ",
"char/0x21cb/mathmode": "\\leftrightharpoons ",
"char/0x21cc/mathmode": "\\rightleftharpoons ",
"char/0x21cd/mathmode": "\\nLeftarrow ",
"char/0x21ce/mathmode": "\\nLeftrightarrow ",
"char/0x21cf/mathmode": "\\nRightarrow ",
"char/0x21d0/mathmode": "\\Leftarrow ",
"char/0x21d1/mathmode": "\\Uparrow ",
"char/0x21d2/mathmode": "\\Rightarrow ",
"char/0x21d3/mathmode": "\\Downarrow ",
"char/0x21d4/mathmode": "\\Leftrightarrow ",
"char/0x21d5/mathmode": "\\Updownarrow ",
"char/0x21da/mathmode": "\\Lleftarrow ",
"char/0x21db/mathmode": "\\Rrightarrow ",
"char/0x21dd/mathmode": "\\rightsquigarrow ",
"char/0x21e4/mathmode": "\\shortmid\\!\\leftarrow ",
"char/0x21e5/mathmode": "\\shortmid\\!\\rightarrow ",
"char/0x2200/mathmode": "\\forall ",
"char/0x2201/mathmode": "\\complement ",
"char/0x2202/mathmode": "\\partial ",
"char/0x2203/mathmode": "\\exists ",
"char/0x2204/mathmode": "\\nexists ",
"char/0x2205/mathmode": "\\varnothing ",
"char/0x2206/mathmode": "\\Delta ",
"char/0x2207/mathmode": "\\nabla ",
"char/0x2208/mathmode": "\\in ",
"char/0x2209/mathmode": "\\notin ",
"char/0x220b/mathmode": "\\ni ",
"char/0x220c/mathmode": "\\not\\ni ",
"char/0x220d/mathmode": "\\backepsilon ",
"char/0x220e/mathmode": "\\blacksquare ",
"char/0x220f/mathmode": "\\prod ",
"char/0x2210/mathmode": "\\coprod ",
"char/0x2211/mathmode": "\\sum ",
"char/0x2212": "-",
"char/0x2213/mathmode": "\\mp ",
"char/0x2214/mathmode": "\\dotplus ",
"char/0x2215": "/",
"char/0x2216/mathmode": "\\setminus ",
"char/0x2217": "*",
"char/0x2218/mathmode": "\\circ ",
"char/0x2219/mathmode": "\\bullet ",
"char/0x221a/mathmode": "\\surd ",
"char/0x221b/mathmode": "\\sqrt[3]{ } ",
"char/0x221c/mathmode": "\\sqrt[4]{ } ",
"char/0x221d/mathmode": "\\propto ",
"char/0x221e/mathmode": "\\infty ",
"char/0x221f/mathmode": "\\perp ",
"char/0x2220/mathmode": "\\angle ",
"char/0x2221/mathmode": "\\measuredangle ",
"char/0x2222/mathmode": "\\sphericalangle ",
"char/0x2223/mathmode": "\\mid ",
"char/0x2224/mathmode": "\\nmid ",
"char/0x2225/mathmode": "\\parallel ",
"char/0x2226/mathmode": "\\nparallel ",
"char/0x2227/mathmode": "\\wedge ",
"char/0x2228/mathmode": "\\vee ",
"char/0x2229/mathmode": "\\cap ",
"char/0x222a/mathmode": "\\cup ",
"char/0x222b/mathmode": "\\int ",
"char/0x222c/mathmode": "\\iint ",
"char/0x222d/mathmode": "\\iiint ",
"char/0x222e/mathmode": "\\oint ",
"char/0x222f/mathmode": "\\mathop{{\\int\\!\\!\\!\\!\\!\\int}\\!\\!\\!\\!\\!\\!\\!\\bigcirc}",
"char/0x2230/mathmode": "\\mathop{{\\int\\!\\!\\!\\!\\!\\int\\!\\!\\!\\!\\!\\int}\\!\\!\\!\\!\\!\\!\\!\\!\\bigcirc}",
"char/0x2231/mathmode": "\\mathop{\\int\\!\\!\\!\\!\\!\\!\\!\\curvearrowright}",
"char/0x2232/mathmode": "\\mathop{\\int\\!\\!\\!\\!\\!\\!\\!\\circlearrowright}",
"char/0x2233/mathmode": "\\mathop{\\int\\!\\!\\!\\!\\!\\!\\!\\circlearrowleft}",
"char/0x2234/mathmode": "\\therefore ",
"char/0x2235/mathmode": "\\because ",
"char/0x2236/mathmode": "\\,\\!:",
"char/0x2236/textmode": ":",
"char/0x2237/mathmode": "\\,\\!:\\,:",
"char/0x2237/textmode": "::",
"char/0x2238/mathmode": "\\dot-",
"char/0x2239/mathmode": "\\,-\\!:",
"char/0x223a/mathmode": ":\\!\\!\\!-\\!\\!\\!:",
"char/0x223b/mathmode": "\\sim\\!\\!\\!:\\,",
"char/0x223c/mathmode": "\\sim ",
"char/0x223d/mathmode": "\\backsim ",
"char/0x2240/mathmode": "\\wr ",
"char/0x2241/mathmode": "\\nsim ",
"char/0x2242/mathmode": "\\eqsim ",
"char/0x2243/mathmode": "\\simeq ",
"char/0x2245/mathmode": "\\cong ",
"char/0x2247/mathmode": "\\ncong ",
"char/0x2248/mathmode": "\\approx ",
"char/0x2249/mathmode": "\\not\\approx ",
"char/0x224a/mathmode": "\\approxeq ",
"char/0x224d/mathmode": "\\asymp ",
"char/0x224e/mathmode": "\\Bumpeq ",
"char/0x224f/mathmode": "\\bumpeq ",
"char/0x2250/mathmode": "\\doteq ",
"char/0x2251/mathmode": "\\doteqdot ",
"char/0x2252/mathmode": "\\fallingdotseq ",
"char/0x2253/mathmode": "\\risingdotseq ",
"char/0x2254/mathmode": ":=\\,\\!",
"char/0x2254/textmode": ":=",
"char/0x2255/mathmode": "=:\\,\\!",
"char/0x2255/textmode": "=:",
"char/0x2256/mathmode": "\\eqcirc ",
"char/0x2257/mathmode": "\\circeq ",
"char/0x2258/mathmode": "\\overset{\\frown}{=}",
"char/0x2259/mathmode": "\\overset{\\wedge}{=}",
"char/0x225a/mathmode": "\\overset{\\vee}{=}",
"char/0x225b/mathmode": "\\overset{\\star}{=}",
"char/0x225c/mathmode": "\\triangleq ",
"char/0x225d/mathmode": "\\overset{\\underset{\\mathrm{def}}{}}{=}",
"char/0x225e/mathmode": "\\overset{\\underset{\\mathrm{m}}{}}{=}",
"char/0x225f/mathmode": "\\overset{?}{=}",
"char/0x2260/mathmode": "\\ne ",
"char/0x2261/mathmode": "\\equiv ",
"char/0x2262/mathmode": "\\not\\equiv ",
"char/0x2264/mathmode": "\\le ",
"char/0x2265/mathmode": "\\ge ",
"char/0x2266/mathmode": "\\leqq ",
"char/0x2267/mathmode": "\\geqq ",
"char/0x2268/mathmode": "\\lneqq ",
"char/0x2269/mathmode": "\\gneqq ",
"char/0x226a/mathmode": "\\ll ",
"char/0x226b/mathmode": "\\gg ",
"char/0x226c/mathmode": "\\between ",
"char/0x226d/mathmode": "\\not\\asymp ",
"char/0x226e/mathmode": "\\nless ",
"char/0x226f/mathmode": "\\ngtr ",
"char/0x2270/mathmode": "\\nleqslant ",
"char/0x2271/mathmode": "\\ngeqslant ",
"char/0x2272/mathmode": "\\lesssim ",
"char/0x2273/mathmode": "\\gtrsim ",
"char/0x2274/mathmode": "\\not\\lesssim ",
"char/0x2275/mathmode": "\\not\\gtrsim ",
"char/0x2276/mathmode": "\\lessgtr ",
"char/0x2277/mathmode": "\\gtrless ",
"char/0x2278/mathmode": "\\not\\lessgtr ",
"char/0x2279/mathmode": "\\not\\gtrless ",
"char/0x227a/mathmode": "\\prec ",
"char/0x227b/mathmode": "\\succ ",
"char/0x227c/mathmode": "\\preccurlyeq ",
"char/0x227d/mathmode": "\\succcurlyeq ",
"char/0x227e/mathmode": "\\precsim ",
"char/0x227f/mathmode": "\\succsim ",
"char/0x2280/mathmode": "\\nprec ",
"char/0x2281/mathmode": "\\nsucc ",
"char/0x2282/mathmode": "\\subset ",
"char/0x2283/mathmode": "\\supset ",
"char/0x2284/mathmode": "\\not\\subset ",
"char/0x2285/mathmode": "\\not\\supset ",
"char/0x2286/mathmode": "\\subseteq ",
"char/0x2287/mathmode": "\\supseteq ",
"char/0x2288/mathmode": "\\nsubseteq ",
"char/0x2289/mathmode": "\\nsupseteq ",
"char/0x228a/mathmode": "\\subsetneq ",
"char/0x228b/mathmode": "\\supsetneq ",
"char/0x228e/mathmode": "\\uplus ",
"char/0x228f/mathmode": "\\sqsubset ",
"char/0x2290/mathmode": "\\sqsupset ",
"char/0x2291/mathmode": "\\sqsubseteq ",
"char/0x2292/mathmode": "\\sqsupseteq ",
"char/0x2293/mathmode": "\\sqcap ",
"char/0x2294/mathmode": "\\sqcup ",
"char/0x2295/mathmode": "\\oplus ",
"char/0x2296/mathmode": "\\ominus ",
"char/0x2297/mathmode": "\\otimes ",
"char/0x2298/mathmode": "\\oslash ",
"char/0x2299/mathmode": "\\odot ",
"char/0x229a/mathmode": "\\circledcirc ",
"char/0x229b/mathmode": "\\circledast ",
"char/0x229c/mathmode": "\\,\\bigcirc\\!\\!\\!\\!\\!\\!\\!=",
"char/0x229d/mathmode": "\\circleddash ",
"char/0x229e/mathmode": "\\boxplus ",
"char/0x229f/mathmode": "\\boxminus ",
"char/0x22a0/mathmode": "\\boxtimes ",
"char/0x22a1/mathmode": "\\boxdot ",
"char/0x22a2/mathmode": "\\vdash ",
"char/0x22a3/mathmode": "\\dashv ",
"char/0x22a4/mathmode": "\\top ",
"char/0x22a5/mathmode": "\\bot ",
"char/0x22a6/mathmode": "\\vdash ",
"char/0x22a7/mathmode": "\\models ",
"char/0x22a8/mathmode": "\\vDash ",
"char/0x22a9/mathmode": "\\Vdash ",
"char/0x22aa/mathmode": "\\Vvdash ",
"char/0x22ab/mathmode": "\\,\\|\\!\\!\\!=",
"char/0x22ac/mathmode": "\\nvdash ",
"char/0x22ad/mathmode": "\\nvDash ",
"char/0x22ae/mathmode": "\\nVdash ",
"char/0x22af/mathmode": "\\nVDash ",
"char/0x22b2/mathmode": "\\triangleleft ",
"char/0x22b3/mathmode": "\\triangleright ",
"char/0x22b4/mathmode": "\\trianglelefteq ",
"char/0x22b5/mathmode": "\\trianglerighteq ",
"char/0x22b8/mathmode": "\\multimap ",
"char/0x22ba/mathmode": "\\intercal ",
"char/0x22bb/mathmode": "\\veebar ",
"char/0x22bc/mathmode": "\\barwedge ",
"char/0x22bd/mathmode": "\\veebar ",
"char/0x22c0/mathmode": "\\bigwedge ",
"char/0x22c1/mathmode": "\\bigvee ",
"char/0x22c2/mathmode": "\\bigcap ",
"char/0x22c3/mathmode": "\\bigcup ",
"char/0x22c4/mathmode": "\\diamond ",
"char/0x22c5/mathmode": "\\cdot ",
"char/0x22c6/mathmode": "\\star ",
"char/0x22c7/mathmode": "\\divideontimes ",
"char/0x22c8/mathmode": "\\bowtie ",
"char/0x22c9/mathmode": "\\ltimes ",
"char/0x22ca/mathmode": "\\rtimes ",
"char/0x22cb/mathmode": "\\leftthreetimes ",
"char/0x22cc/mathmode": "\\rightthreetimes ",
"char/0x22ce/mathmode": "\\curlyvee ",
"char/0x22cf/mathmode": "\\curlywedge ",
"char/0x22d0/mathmode": "\\Subset ",
"char/0x22d1/mathmode": "\\Supset ",
"char/0x22d2/mathmode": "\\Cap ",
"char/0x22d3/mathmode": "\\Cup ",
"char/0x22d4/mathmode": "\\pitchfork ",
"char/0x22d6/mathmode": "\\lessdot ",
"char/0x22d7/mathmode": "\\gtrdot ",
"char/0x22d8/mathmode": "\\lll ",
"char/0x22d9/mathmode": "\\ggg ",
"char/0x22da/mathmode": "\\lesseqgtr ",
"char/0x22db/mathmode": "\\gtreqless ",
"char/0x22dc/mathmode": "\\eqslantless ",
"char/0x22dd/mathmode": "\\eqslantgtr ",
"char/0x22de/mathmode": "\\curlyeqprec ",
"char/0x22df/mathmode": "\\curlyeqsucc ",
"char/0x22e0/mathmode": "\\npreceq ",
"char/0x22e1/mathmode": "\\nsucceq ",
"char/0x22e6/mathmode": "\\lnsim ",
"char/0x22e7/mathmode": "\\gnsim ",
"char/0x22e8/mathmode": "\\precnsim ",
"char/0x22e9/mathmode": "\\succnsim ",
"char/0x22ea/mathmode": "\\ntriangleleft ",
"char/0x22eb/mathmode": "\\ntriangleright ",
"char/0x22ec/mathmode": "\\ntrianglelefteq ",
"char/0x22ed/mathmode": "\\ntrianglerighteq ",
"char/0x22ee/mathmode": "\\vdots ",
"char/0x22ef/mathmode": "\\cdots ",
"char/0x22f1/mathmode": "\\ddots ",
"char/0x2300/mathmode": "\\varnothing ",
"char/0x2306/mathmode": "\\doublebarwedge ",
"char/0x2308/mathmode": "\\lceil ",
"char/0x2309/mathmode": "\\rceil ",
"char/0x230a/mathmode": "\\lfloor ",
"char/0x230b/mathmode": "\\rfloor ",
"char/0x231c/mathmode": "\\ulcorner ",
"char/0x231d/mathmode": "\\urcorner ",
"char/0x231e/mathmode": "\\llcorner ",
"char/0x231f/mathmode": "\\lrcorner ",
"char/0x2322/mathmode": "\\frown ",
"char/0x2323/mathmode": "\\smile ",
"char/0x2329/mathmode": "\\langle ",
"char/0x232a/mathmode": "\\rangle ",
"char/0x2329": "\\langle ",
"char/0x232a": "\\rangle ",
"char/0x2353/mathmode": "\\Box\\!\\!\\!\\!\\wedge",
"char/0x2370/mathmode": "\\Box\\!\\!\\!\\!?",
"char/0x2423/mathmode": "\\textvisiblespace ",
"char/0x24c8/mathmode": "\\circledS ",
"char/0x25a0/mathmode": "\\blacksquare ",
"char/0x25a1/mathmode": "\\square ",
"char/0x25b2/mathmode": "\\blacktriangle ",
"char/0x25b3/mathmode": "\\vartriangle ",
"char/0x25b6/mathmode": "\\blacktriangleright ",
"char/0x25bc/mathmode": "\\blacktriangledown ",
"char/0x25bd/mathmode": "\\triangledown ",
"char/0x25c0/mathmode": "\\blacktriangleleft ",
"char/0x25ca/mathmode": "\\lozenge ",
"char/0x25cb/mathmode": "\\bigcirc ",
"char/0x2605/mathmode": "\\bigstar ",
"char/0x2660/mathmode": "\\spadesuit ",
"char/0x2661/mathmode": "\\heartsuit ",
"char/0x2662/mathmode": "\\diamondsuit ",
"char/0x2663/mathmode": "\\clubsuit ",
"char/0x2666/mathmode": "\\blacklozenge ",
"char/0x266d/mathmode": "\\flat ",
"char/0x266e/mathmode": "\\natural ",
"char/0x266f/mathmode": "\\sharp ",
"char/0x2713/mathmode": "\\checkmark ",
"char/0x2715/mathmode": "\\times ",
"char/0x27e6/mathmode": "[\\![",
"char/0x27e7/mathmode": "]\\!]",
"char/0x27e8/mathmode": "\\langle ",
"char/0x27e9/mathmode": "\\rangle ",
"char/0x27f5/mathmode": "\\longleftarrow ",
"char/0x27f6/mathmode": "\\longrightarrow ",
"char/0x27f7/mathmode": "\\longleftrightarrow ",
"char/0x27f8/mathmode": "\\Longleftarrow ",
"char/0x27f9/mathmode": "\\Longrightarrow ",
"char/0x27fa/mathmode": "\\Longleftrightarrow ",
"char/0x27fc/mathmode": "\\longmapsto ",
"char/0x29eb/mathmode": "\\blacklozenge ",
"char/0x29f8/mathmode": "\\Big /",
"char/0x29f9/mathmode": "\\Big\\backslash ",
"char/0x2a00/mathmode": "\\bigodot ",
"char/0x2a01/mathmode": "\\bigoplus ",
"char/0x2a02/mathmode": "\\bigotimes ",
"char/0x2a04/mathmode": "\\biguplus ",
"char/0x2a06/mathmode": "\\bigsqcup ",
"char/0x2a0c/mathmode": "\\iiiint ",
"char/0x3008/mathmode": "\\langle ",
"char/0x3009/mathmode": "\\rangle ",
"char/0x301a/mathmode": "[\\![",
"char/0x301b/mathmode": "]\\!]",
"char/0xe90b/mathmode": "\\supseteqq ",
"char/0xe90c/mathmode": "\\subseteqq ",
"char/0xe922/mathmode": "\\lesseqqgtr ",
"char/0xe92d/mathmode": "\\gtreqqless ",
"char/0xe92e/mathmode": "\\shortmid ",
"char/0xe92f/mathmode": "\\shortparallel ",
"char/0xe930/mathmode": "\\leqslant ",
"char/0xe931/mathmode": "\\geqslant ",
"char/0xe932/mathmode": "\\lessapprox ",
"char/0xe933/mathmode": "\\gtrapprox ",
"char/0xe938/mathmode": "\\preceq ",
"char/0xe939/mathmode": "\\succeq ",
"char/0xe93a/mathmode": "\\precapprox ",
"char/0xe93b/mathmode": "\\succapprox ",
"char/0xe981/mathmode": "\\circleddash ",
"char/0xe98f/mathmode": "\\centerdot ",
"char/0xea06/mathmode": "\\nleq ",
"char/0xea07/mathmode": "\\ngeq ",
"char/0xea0b/mathmode": "\\nsupseteqq ",
"char/0xea0c/mathmode": "\\nsubseteqq ",
"char/0xea0e/mathmode": "\\not\\eqslantgtr ",
"char/0xea0f/mathmode": "\\not\\eqsim ",
"char/0xea10/mathmode": "\\not\\eqslantless ",
"char/0xea11/mathmode": "\\nsim ",
"char/0xea2e/mathmode": "\\nshortmid ",
"char/0xea2f/mathmode": "\\nshortparallel ",
"char/0xea32/mathmode": "\\lnapprox ",
"char/0xea33/mathmode": "\\gnapprox ",
"char/0xea34/mathmode": "\\lneq ",
"char/0xea35/mathmode": "\\gneq ",
"char/0xea38/mathmode": "\\npreceq ",
"char/0xea39/mathmode": "\\nsucceq ",
"char/0xea3a/mathmode": "\\precnapprox ",
"char/0xea3b/mathmode": "\\succnapprox ",
"char/0xea40/mathmode": "\\precneqq ",
"char/0xea41/mathmode": "\\succneqq ",
"char/0xea42/mathmode": "\\varsubsetneq ",
"char/0xea43/mathmode": "\\varsupsetneq ",
"char/0xea44/mathmode": "\\subsetneqq ",
"char/0xea45/mathmode": "\\supsetneqq ",
"char/0xea46/mathmode": "\\varsubsetneqq ",
"char/0xea47/mathmode": "\\varsupsetneqq ",
"char/0xeb01/mathmode": "\\overrightarrow{\\scriptscriptstyle\\leftarrow}",
"char/0xeb02/mathmode": "\\stackrel{\\scriptscriptstyle\\to}{\\leftarrow}",
"char/0xed01/mathmode": "\\Game ",
"char/0xed02/mathmode": "\\jmath ",
"char/0xed10": " d ",
"char/0xed11": " e ",
"char/0xed12": " i ",
"char/0xed13": " j ",
"char/0xed16": " D ",
"char/0xef00/mathmode": " & ",
"char/0xef01": "",
"char/0x200b": "",
"char/0xef02/mathmode": "\\,",
"char/0x2009/mathmode": "\\,",
"char/0xef03/mathmode": "\\;",
"char/0x205f/mathmode": "\\;",
"char/0xef04/mathmode": "\\ ",
"char/0x2004/mathmode": "\\ ",
"char/0xef05/mathmode": "\\quad ",
"char/0x2003/mathmode": "\\quad ",
"char/0xef06/mathmode": "\\qquad ",
"char/0xef22/mathmode": "\\!",
"char/0xf000/mathmode": "\\mathfrak{A}",
"char/0xf001/mathmode": "\\mathfrak{B}",
"char/0xf002/mathmode": "\\mathfrak{C}",
"char/0xf003/mathmode": "\\mathfrak{D}",
"char/0xf004/mathmode": "\\mathfrak{E}",
"char/0xf005/mathmode": "\\mathfrak{F}",
"char/0xf006/mathmode": "\\mathfrak{G}",
"char/0xf007/mathmode": "\\mathfrak{H}",
"char/0xf008/mathmode": "\\mathfrak{I}",
"char/0xf009/mathmode": "\\mathfrak{J}",
"char/0xf00a/mathmode": "\\mathfrak{K}",
"char/0xf00b/mathmode": "\\mathfrak{L}",
"char/0xf00c/mathmode": "\\mathfrak{M}",
"char/0xf00d/mathmode": "\\mathfrak{N}",
"char/0xf00e/mathmode": "\\mathfrak{O}",
"char/0xf00f/mathmode": "\\mathfrak{P}",
"char/0xf010/mathmode": "\\mathfrak{Q}",
"char/0xf011/mathmode": "\\mathfrak{R}",
"char/0xf012/mathmode": "\\mathfrak{S}",
"char/0xf013/mathmode": "\\mathfrak{T}",
"char/0xf014/mathmode": "\\mathfrak{U}",
"char/0xf015/mathmode": "\\mathfrak{V}",
"char/0xf016/mathmode": "\\mathfrak{W}",
"char/0xf017/mathmode": "\\mathfrak{X}",
"char/0xf018/mathmode": "\\mathfrak{Y}",
"char/0xf019/mathmode": "\\mathfrak{Z}",
"char/0xf01a/mathmode": "\\mathfrak{a}",
"char/0xf01b/mathmode": "\\mathfrak{b}",
"char/0xf01c/mathmode": "\\mathfrak{c}",
"char/0xf01d/mathmode": "\\mathfrak{d}",
"char/0xf01e/mathmode": "\\mathfrak{e}",
"char/0xf01f/mathmode": "\\mathfrak{f}",
"char/0xf020/mathmode": "\\mathfrak{g}",
"char/0xf021/mathmode": "\\mathfrak{h}",
"char/0xf022/mathmode": "\\mathfrak{i}",
"char/0xf023/mathmode": "\\mathfrak{j}",
"char/0xf024/mathmode": "\\mathfrak{k}",
"char/0xf025/mathmode": "\\mathfrak{l}",
"char/0xf026/mathmode": "\\mathfrak{m}",
"char/0xf027/mathmode": "\\mathfrak{n}",
"char/0xf028/mathmode": "\\mathfrak{o}",
"char/0xf029/mathmode": "\\mathfrak{p}",
"char/0xf02a/mathmode": "\\mathfrak{q}",
"char/0xf02b/mathmode": "\\mathfrak{r}",
"char/0xf02c/mathmode": "\\mathfrak{s}",
"char/0xf02d/mathmode": "\\mathfrak{t}",
"char/0xf02e/mathmode": "\\mathfrak{u}",
"char/0xf02f/mathmode": "\\mathfrak{v}",
"char/0xf030/mathmode": "\\mathfrak{w}",
"char/0xf031/mathmode": "\\mathfrak{x}",
"char/0xf032/mathmode": "\\mathfrak{y}",
"char/0xf033/mathmode": "\\mathfrak{z}",
"char/0xf080/mathmode": "\\mathbb{A}",
"char/0xf081/mathmode": "\\mathbb{B}",
"char/0xf082/mathmode": "\\mathbb{C}",
"char/0xf083/mathmode": "\\mathbb{D}",
"char/0xf084/mathmode": "\\mathbb{E}",
"char/0xf085/mathmode": "\\mathbb{F}",
"char/0xf086/mathmode": "\\mathbb{G}",
"char/0xf087/mathmode": "\\mathbb{H}",
"char/0xf088/mathmode": "\\mathbb{I}",
"char/0xf089/mathmode": "\\mathbb{J}",
"char/0xf08a/mathmode": "\\mathbb{K}",
"char/0xf08b/mathmode": "\\mathbb{L}",
"char/0xf08c/mathmode": "\\mathbb{M}",
"char/0xf08d/mathmode": "\\mathbb{N}",
"char/0xf08e/mathmode": "\\mathbb{O}",
"char/0xf08f/mathmode": "\\mathbb{P}",
"char/0xf090/mathmode": "\\mathbb{Q}",
"char/0xf091/mathmode": "\\mathbb{R}",
"char/0xf092/mathmode": "\\mathbb{S}",
"char/0xf093/mathmode": "\\mathbb{T}",
"char/0xf094/mathmode": "\\mathbb{U}",
"char/0xf095/mathmode": "\\mathbb{V}",
"char/0xf096/mathmode": "\\mathbb{W}",
"char/0xf097/mathmode": "\\mathbb{X}",
"char/0xf098/mathmode": "\\mathbb{Y}",
"char/0xf099/mathmode": "\\mathbb{Z}",
"char/0xf0a4/mathmode": "\\Bbbk ",
"char/0xf100/mathmode": "\\mathcal{A}",
"char/0xf101/mathmode": "\\mathcal{B}",
"char/0xf102/mathmode": "\\mathcal{C}",
"char/0xf103/mathmode": "\\mathcal{D}",
"char/0xf104/mathmode": "\\mathcal{E}",
"char/0xf105/mathmode": "\\mathcal{F}",
"char/0xf106/mathmode": "\\mathcal{G}",
"char/0xf107/mathmode": "\\mathcal{H}",
"char/0xf108/mathmode": "\\mathcal{I}",
"char/0xf109/mathmode": "\\mathcal{J}",
"char/0xf10a/mathmode": "\\mathcal{K}",
"char/0xf10b/mathmode": "\\mathcal{L}",
"char/0xf10c/mathmode": "\\mathcal{M}",
"char/0xf10d/mathmode": "\\mathcal{N}",
"char/0xf10e/mathmode": "\\mathcal{O}",
"char/0xf10f/mathmode": "\\mathcal{P}",
"char/0xf110/mathmode": "\\mathcal{Q}",
"char/0xf111/mathmode": "\\mathcal{R}",
"char/0xf112/mathmode": "\\mathcal{S}",
"char/0xf113/mathmode": "\\mathcal{T}",
"char/0xf114/mathmode": "\\mathcal{U}",
"char/0xf115/mathmode": "\\mathcal{V}",
"char/0xf116/mathmode": "\\mathcal{W}",
"char/0xf117/mathmode": "\\mathcal{X}",
"char/0xf118/mathmode": "\\mathcal{Y}",
"char/0xf119/mathmode": "\\mathcal{Z}",
"char/0xec07": "|",
"char/0xec08": "|",
"char/0x003c": " < ",
"char/0x0302": "\\widehat ",
"char/0x86e0": "\\prime ",
}

@ -0,0 +1,23 @@
package eqn
import (
"bytes"
"fmt"
"io/ioutil"
)
func Convert(filepath string) string {
buffer, err := ioutil.ReadFile(filepath)
if err != nil {
fmt.Print(err)
}
reader := bytes.NewReader(buffer)
mtef, err := Open(reader)
if err != nil {
fmt.Println(err)
}
latex := mtef.Translate()
return latex
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,409 @@
package eqn
import "fmt"
type RecordType uint8
type OptionType uint8
const (
END RecordType = 0
LINE RecordType = 1
CHAR RecordType = 2
TMPL RecordType = 3
PILE RecordType = 4
MATRIX RecordType = 5
EMBELL RecordType = 6
RULER RecordType = 7
FONT_STYLE_DEF RecordType = 8
SIZE RecordType = 9
FULL RecordType = 10
SUB RecordType = 11
SUB2 RecordType = 12
SYM RecordType = 13
SUBSYM RecordType = 14
COLOR RecordType = 15
COLOR_DEF RecordType = 16
FONT_DEF RecordType = 17
EQN_PREFS RecordType = 18
ENCODING_DEF RecordType = 19
FUTURE RecordType = 100
ROOT RecordType = 255
)
const (
MtefOptNudge OptionType = 0x08
MtefOptCharEmbell OptionType = 0x01
MtefOptCharFuncStart OptionType = 0x02
MtefOptCharEncChar8 OptionType = 0x04
MtefOptCharEncChar16 OptionType = 0x10
MtefOptCharEncNoMtcode OptionType = 0x20
MtefOptLineNull OptionType = 0x01
mtefOPT_LP_RULER OptionType = 0x02
MtefOptLineLspace OptionType = 0x04
MtefOptLpRuler OptionType = 0x02
MtefColorCmyk OptionType = 0x01
MtefColorSpot OptionType = 0x02
MtefColorName OptionType = 0x04
mtefCOLOR_CMYK OptionType = 0x01
mtefCOLOR_SPOT OptionType = 0x02
mtefCOLOR_NAME OptionType = 0x04
)
const (
fnTEXT uint8 = 1
fnFUNCTION uint8 = 2
fnVARIABLE uint8 = 3
fnLCGREEK uint8 = 4
fnUCGREEK uint8 = 5
fnSYMBOL uint8 = 6
fnVECTOR uint8 = 7
fnNUMBER uint8 = 8
fnUSER1 uint8 = 9
fnUSER2 uint8 = 10
fnMTEXTRA uint8 = 11
fnTEXT_FE uint8 = 12
fnEXPAND uint8 = 22
fnMARKER uint8 = 23
fnSPACE uint8 = 24
)
type MtTabStop struct {
next *MtTabStop
_type int16
offset int16
}
type MtRuler struct {
nStops int16
tabStopList *MtTabStop
}
type MtLine struct {
nudgeX int16
nudgeY int16
lineSpace uint8
null bool
ruler *MtRuler
objectList *MtObjList
}
type MtEmbell struct {
next *MtEmbell
nudgeX int16
nudgeY int16
embell uint8
}
type MtChar struct {
nudgeX int16
nudgeY int16
options uint8
typeface uint8
//16-bit integer MTCode value
mtcode uint16
//8-bit font position
bits8 uint8
//16-bit integer font position
bits16 uint16
embellishments *MtEmbell
}
type MtEqnPrefs struct {
sizes []string
spaces []string
styles []byte
}
type MtSize struct {
lsize uint8
dsize uint8
}
type MtfontStyleDef struct {
fontDefIndex uint8
name string
}
type MtfontDef struct {
encDefIndex uint8
name string
}
type MtColorDefIndex struct {
index uint8
}
type MtColorDef struct {
values []uint8
name string
}
type MtObjList struct {
next *MtObjList
tag RecordType
objPtr []MtObject
}
type MtTmpl struct {
nudgeX int16
nudgeY int16
selector uint8
variation uint16
options uint8
objectList *MtObjList
}
type MtPile struct {
nudgeX int16
nudgeY int16
halign uint8
valign uint8
//ruler可以不读不影响后面字节错位因为这个是一个完整的额外record数据
ruler *MtRuler
//objectList可以不读不影响后面字节错位因为这个是一个完整的额外record数据
objectList *MtObjList
}
type MtMatrix struct {
nudgeX int16
nudgeY int16
valign uint8
h_just uint8
v_just uint8
rows uint8
cols uint8
//row_parts uint8
//col_parts uint8
//objectList可以不读不影响后面字节错位因为这个是一个完整的额外record数据
objectList *MtObjList
}
type MtEmbellRd struct {
options uint8
nudgeX int16
nudgeY int16
embellType uint8
}
type MtAST struct {
tag RecordType
value MtObject
children []*MtAST
}
type MtObject interface{}
func (ast *MtAST) debug(indent int) {
fmt.Printf("> %#v MtAST %#v\n", indent, ast)
indent += 1
for _, ele := range ast.children {
ele.debug(indent)
}
}
type SelectorType uint8
//Template selectors and variations:
const (
//Fences (parentheses, etc.):
//selector symbol description class
tmANGLE SelectorType = 0 // angle brackets ParBoxClass
tmPAREN SelectorType = 1 // parentheses ParBoxClass
tmBRACE SelectorType = 2 // braces (curly brackets) ParBoxClass
tmBRACK SelectorType = 3 // square brackets ParBoxClass
tmBAR SelectorType = 4 // vertical bars ParBoxClass
tmDBAR SelectorType = 5 // double vertical bars ParBoxClass
tmFLOOR SelectorType = 6 // floor brackets ParBoxClass
tmCEILING SelectorType = 7 // ceiling brackets ParBoxClass
tmOBRACK SelectorType = 8 // open (white) brackets ParBoxClass
//variations variation bits symbol description
//0×0001 tvFENCE_L left fence is present
//0×0002 tvFENCE_R right fence is present
//Intervals:
//selector symbol description class
tmINTERVAL SelectorType = 9 // unmatched brackets and parentheses ParBoxClass
//variations variation bits symbol description
//0×0000 tvINTV_LEFT_LP left fence is left parenthesis
//0×0001 tvINTV_LEFT_RP left fence is right parenthesis
//0×0002 tvINTV_LEFT_LB left fence is left bracket
//0×0003 tvINTV_LEFT_RB left fence is right bracket
//0×0000 tvINTV_RIGHT_LP right fence is left parenthesis
//0×0010 tvINTV_RIGHT_RP right fence is right parenthesis
//0×0020 tvINTV_RIGHT_LB right fence is left bracket
//0×0030 tvINTV_RIGHT_RB right fence is right bracket
//Radicals (square and nth roots):
//selector symbol description class
tmROOT SelectorType = 10 // radical RootBoxClass
//variations variation symbol description
//0 tvROOT_SQ square root
//1 tvROOT_NTH nth root
//Fractions:
//selector symbol description class
tmFRACT SelectorType = 11 // fractions
//variations variation bits symbol description
//0×0001 tvFR_SMALL subscript-size slots (piece fraction)
//0×0002 tvFR_SLASH fraction bar is a slash
//0×0004 tvFR_BASE num. and denom. are baseline aligned
//Over and Underbars:
//selector symbol description class
tmUBAR SelectorType = 12 // underbar BarBoxClass
tmOBAR SelectorType = 13 // overbar BarBoxClass
//variations variation bits symbol description
//0×0001 tvBAR_DOUBLE bar is doubled, else single
//Arrows:
//selector symbol description class
tmARROW SelectorType = 14 // arrow ArroBoxClass
//variations variation symbol description
//0×0000 tvAR_SINGLE single arrow
//0×0001 tvAR_DOUBLE double arrow
//0×0002 tvAR_HARPOON harpoon
//0×0004 tvAR_TOP top slot is present
//0×0008 tvAR_BOTTOM bottom slot is present
//0×0010 tvAR_LEFT if single, arrow points left
//0×0020 tvAR_RIGHT if single, arrow points right
//0×0010 tvAR_LOS if double or harpoon, large over small
//0×0020 tvAR_SOL if double or harpoon, small over large
//Integrals (see Limit Variations):
//selector symbol description class
tmINTEG SelectorType = 15 // integral BigOpBoxClass
//variations variation symbol description
//0×0001 tvINT_1 single integral sign
//0×0002 tvINT_2 double integral sign
//0×0003 tvINT_3 triple integral sign
//0×0004 tvINT_LOOP has loop w/o arrows
//0×0008 tvINT_CW_LOOP has clockwise loop
//0×000C tvINT_CCW_LOOP has counter-clockwise loop
//0×0100 tvINT_EXPAND integral signs expand
//Sums, products, coproducts, unions, intersections, etc. (see Limit Variations):
//selector symbol description class
tmSUM SelectorType = 16 // sum BigOpBoxClass
tmPROD SelectorType = 17 // product BigOpBoxClass
tmCOPROD SelectorType = 18 // coproduct BigOpBoxClass
tmUNION SelectorType = 19 // union BigOpBoxClass
tmINTER SelectorType = 20 // intersection BigOpBoxClass
tmINTOP SelectorType = 21 // integral-style big operator BigOpBoxClass
tmSUMOP SelectorType = 22 // summation-style big operator BigOpBoxClass
//Limits (see Limit Variations):
//selector symbol description class
tmLIM SelectorType = 23 // limits LimBoxClass
//variations variation symbol description
//0 tvSUBAR single underbar
//1 tvDUBAR double underbar
//Horizontal braces and brackets:
//selector symbol description class
tmHBRACE SelectorType = 24 // horizontal brace HFenceBoxClass
tmHBRACK SelectorType = 25 // horizontal bracket HFenceBoxClass
//variations variation symbol description
//0×0001 tvHB_TOP slot is on the top, else on the bottom
//Long division:
//selector symbol description class
tmLDIV SelectorType = 26 // long division LDivBoxClass
//variations variation symbol description
//0×0001 tvLD_UPPER upper slot is present
//Subscripts and superscripts:
//selector symbol description class
tmSUB SelectorType = 27 // subscript ScrBoxClass
tmSUP SelectorType = 28 // superscript ScrBoxClass
tmSUBSUP SelectorType = 29 // subscript and superscript ScrBoxClass
//variations variation symbol description
//0×0001 tvSU_PRECEDES script precedes scripted item,
//else follows
//Dirac bra-ket notation:
//selector symbol description class
tmDIRAC SelectorType = 30 // bra-ket notation DiracBoxClass
//variations variation symbol description
//0×0001 tvDI_LEFT left part is present
//0×0002 tvDI_RIGHT right part is present
//Vectors:
//selector symbol description class
tmVEC SelectorType = 31 // vector HatBoxClass
//variations variation symbol description
//0×0001 tvVE_LEFT arrow points left
//0×0002 tvVE_RIGHT arrow points right
//0×0004 tvVE_UNDER arrow under slot, else over slot
//0×0008 tvVE_HARPOON harpoon
//Hats, arcs, tilde, joint status:
//selector symbol description class
tmTILDE SelectorType = 32 // tilde over characters HatBoxClass
tmHAT SelectorType = 33 // hat over characters HatBoxClass
tmARC SelectorType = 34 // arc over characters HatBoxClass
tmJSTATUS SelectorType = 35 // joint status construct HatBoxClass
//Overstrikes (cross-outs):
//selector symbol description class
tmSTRIKE SelectorType = 36 // overstrike (cross-out) StrikeBoxClass
//variations variation symbol description
//0×0001 tvST_HORIZ line is horizontal, else slashes
//0×0002 tvST_UP if slashes, slash from lower-left to upper-right is present
//0×0004 tvST_DOWN if slashes, slash from upper-left to lower-right is present
//Boxes:
//selector symbol description class
tmBOX SelectorType = 37 // box TBoxBoxClass
//variations variation symbol description
//0×0001 tvBX_ROUND corners are round, else square
//0×0002 tvBX_LEFT left side is present
//0×0004 tvBX_RIGHT right side is present
//0×0008 tvBX_TOP top side is present
//0×0010 tvBX_BOTTOM bottom side is present
)
type EmbellType uint8
const (
emb1DOT EmbellType = 2
emb2DOT EmbellType = 3
emb3DOT EmbellType = 4
emb1PRIME EmbellType = 5
emb2PRIME EmbellType = 6
embBPRIME EmbellType = 7
embTILDE EmbellType = 8
embHAT EmbellType = 9
embNOT EmbellType = 10
embRARROW EmbellType = 11
embLARROW EmbellType = 12
embBARROW EmbellType = 13
embR1ARROW EmbellType = 14
embL1ARROW EmbellType = 15
embMBAR EmbellType = 16
embOBAR EmbellType = 17
emb3PRIME EmbellType = 18
embFROWN EmbellType = 19
embSMILE EmbellType = 20
embX_BARS EmbellType = 21
embUP_BAR EmbellType = 22
embDOWN_BAR EmbellType = 23
emb4DOT EmbellType = 24
embU_1DOT EmbellType = 25
embU_2DOT EmbellType = 26
embU_3DOT EmbellType = 27
embU_4DOT EmbellType = 28
embU_BAR EmbellType = 29
embU_TILDE EmbellType = 30
embU_FROWN EmbellType = 31
embU_SMILE EmbellType = 32
embU_RARROW EmbellType = 33
embU_LARROW EmbellType = 34
embU_BARROW EmbellType = 35
embU_R1ARROW EmbellType = 36
embU_L1ARROW EmbellType = 37
)

@ -0,0 +1,8 @@
module github.com/zhexiao/mtef-go
go 1.13
require (
github.com/extrame/ole2 v0.0.0-20160812065207-d69429661ad7
github.com/urfave/cli v1.22.1
)

@ -0,0 +1,15 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/extrame/ole2 v0.0.0-20160812065207-d69429661ad7 h1:n+nk0bNe2+gVbRI8WRbLFVwwcBQ0rr5p+gzkKb6ol8c=
github.com/extrame/ole2 v0.0.0-20160812065207-d69429661ad7/go.mod h1:GPpMrAfHdb8IdQ1/R2uIRBsNfnPnwsYE9YYI5WyY1zw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

@ -0,0 +1,83 @@
package main
import (
"fmt"
"github.com/urfave/cli"
"github.com/zhexiao/mtef-go/docx"
"github.com/zhexiao/mtef-go/eqn"
"log"
"os"
"time"
)
func main() {
var filepath, docxDocument, outputFile string
app := cli.NewApp()
app.Name = "Mtef"
app.Usage = "Convert MSDocx Mathtype Ole object to Latex code"
app.Version = "2.0"
app.EnableBashCompletion = true
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "filepath, f",
Usage: "Mathtype Ole object filepath",
Destination: &filepath,
},
cli.StringFlag{
Name: "wordDocx, w",
Usage: "Office word docx documents",
Destination: &docxDocument,
},
cli.StringFlag{
Name: "output, o",
Usage: "Output file path",
Destination: &outputFile,
},
}
app.Action = func(c *cli.Context) error {
var result string
var err error
if filepath != "" {
if _, err = os.Stat(filepath); os.IsNotExist(err) {
fmt.Println("File not exist!!!!")
return nil
}
result = eqn.Convert(filepath)
} else if docxDocument != "" {
if _, err = os.Stat(docxDocument); os.IsNotExist(err) {
fmt.Println("File not exist!!!!")
return nil
}
dw := docx.DocxWord{
Filename: docxDocument,
Target: fmt.Sprintf("/tmp/%v", time.Now().UnixNano()),
}
result, err = dw.ParseDocx()
if err != nil {
return err
}
}
if outputFile != "" {
err = os.WriteFile(outputFile, []byte(result), 0644)
if err != nil {
return fmt.Errorf("failed to write output: %v", err)
}
fmt.Printf("Output saved to %s\n", outputFile)
} else {
fmt.Println(result)
}
return nil
}
err := app.Run(os.Args)
if err != nil {
log.Panic(err)
}
}

Binary file not shown.

@ -0,0 +1,3 @@
pandoc -f docx -t markdown --extract-media ./ --mathjax 化学方程式_CHEMISTRY_1.docx.docx -o mixed.md
经测试无法转换为Latex格式

@ -0,0 +1,8 @@
# 使用国内镜像
go env -w GOPROXY=https://goproxy.cn,direct
# 编译
go build -o mtef-go.exe
# 处理.docx文件并保存结果
./mtef-go.exe -w "D:/dsWork/dsProject/dsRag/static/Txt/化学方程式_CHEMISTRY_1.docx" -o "d:/output.txt"

@ -0,0 +1 @@
https://github.com/zhexiao/mtef-go
Loading…
Cancel
Save