背景:公式(OMML/MathType/EQ)已转 LaTeX,但正文里的裸 Unicode 符号 (⊆ ∈ ∪ ≤ × → ∅ ∞ ∑ √ …)docx4j 只原样输出,靠系统字体渲染,字形/字号 与公式不一致;且 EqToLatexUtil 未覆盖的符号会以裸字符留在公式 LaTeX 内部。 实现 UnicodeSymbolLatex: - 53 条映射,取自 jby omml_mathml2latex/data/symbols.py,保证与公式内转换一致 (⊆→\subseteq、∈→\in、≤→\leqslant、×→\times、→→\rightarrow、∅→\emptyset …) - 文本节点内:符号 → \( … \)(MathJax 渲染) - 已在 \(…\)/\[…\] 内的片段:只换命令不加包裹(修 LaTeX 内部裸字符) - 跳过 <script>/<style>/<textarea> 与所有标签属性 - 开关 wordparse.convert-unicode-symbols(默认 true) 效果:46 份教辅重新生成后,正文裸 Unicode 符号 0 处,公式片段 5394 处
25 lines
561 B
Plaintext
25 lines
561 B
Plaintext
spring:
|
|
application:
|
|
name: word-file-parse
|
|
servlet:
|
|
multipart:
|
|
max-file-size: 100MB
|
|
max-request-size: 100MB
|
|
|
|
server:
|
|
port: 8080
|
|
|
|
wordparse:
|
|
tmp-path: ${java.io.tmpdir}
|
|
image-scaling-factor: 2.0
|
|
transform-scripts-path: /opt/transform
|
|
python-command: python3
|
|
symbol-base-url: https://fs.code-lab.cn/temp/wordparse-symbols/
|
|
convert-unicode-symbols: true
|
|
oss:
|
|
endpoint: https://fs.code-lab.cn
|
|
access-key: ${WORDPARSE_OSS_AK:}
|
|
secret-key: ${WORDPARSE_OSS_SK:}
|
|
bucket: word-parse
|
|
prefix: office/file/parse/
|