我已经在 ConTeXt 邮件列表中问过这个问题,但我还把它放在这里,因为我更有可能得到快速的答复:
我正在使用将pandoc
名为 LaTeX 的文件转换为 ConTeXt 的文件test.tex
。以下是其内容test.tex
:
\documentclass{article}
\begin{document}
$\mathcal{A}$
\end{document}
使用以下命令可以成功编译该文件,并且可以看到生成的 pdf 文件:
latexmk -pdflatex test.tex
然后我尝试用 pandoc 进行转换:
pandoc -f latex -t context -o test_context.tex test.tex
Pandoc 似乎成功生成了一个包含以下内容的文件 test_context.tex:
\mathcal{A}
然后我尝试编译 test_context.tex 文件:
context test_context.tex
不幸的是这会导致错误:
resolvers | formats | executing runner 'run luametatex format': C:/context/tex/texmf-win64/bin/luametatex --jobname="./test_context.tex" --fmt=C:/context/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt --lua=C:/context/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui --c:currentrun=1 --c:fulljobname="./test_context.tex" --c:input="./test_context.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:texmfbinpath="C:/context/tex/texmf-win64/bin"
system > callbacks > not registering frozen 'local_box_filter'
system >
system > ConTeXt ver: 2021.11.02 10:03 LMTX fmt: 2021.11.4 int: english/english
system >
system > 'cont-new.mkxl' loaded
open source > level 1, order 1, name 'C:/context/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system > beware: some patches loaded from cont-new.mkiv
close source > level 1, order 1, name 'C:/context/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system > files > jobname './test_context', input './test_context.tex', result './test_context'
fonts > latin modern fonts are not preloaded
languages > language 'en' is active
open source > level 1, order 2, name './test_context.tex'
tex error > tex error on line 1 in file ./test_context.tex: \textfont0 is undefined in (text) char, font id 0, character 63)
<line 3.1>
$\mathcal{A}$
1 >> $\mathcal{A}$
2
Somewhere in the math formula just ended, you used the stated character from an
undefined font family. For example, plain TeX doesn't allow \it or \sl in
subscripts. Proceed, and I'll try to forget that I needed that character.
mtx-context | fatal error: return code: 1
为什么 ConTeXt 不接受 mathcal?为什么 pandoc 没有考虑到这一点?我该如何以合理的努力来解决这个问题?
答案1
我从邮件列表中得到了答案。关键是-s
在中包含一个标志pandoc
,否则它不会生成独立的 ConTeXt 文档:
pandoc -s -f latex -t context -o test_context.tex test.tex