我正在尝试使用 比较两个 TeX 文件latexdiff
。我已经完成了所有必要的步骤,我正在比较的两个 TeX 文件都是有效的,并且编译没有任何问题,当我运行时会生成latexdiff
一个cmd.exe
新文件。diff.tex
但是,当我尝试diff.tex
在 TeXstudio 中编译该文件以获取 PDF 时,PDF 并未生成,我只收到一个带有错误的长日志文件,开头如下:
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (MiKTeX 21.8) (preloaded format=pdflatex 2021.9.29) 28 JAN 2023 11:31
entering extended mode
**./diff1.tex
(diff1.tex
LaTeX2e <2021-06-01> patch level 1
L3 programming layer <2021-08-27>
! Undefined control sequence.
l.1 \
d o c u m e n t c l a s s [ 1 2 p t , a 4 p a p e r , o p e n b i b ] ...
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 \ d
o c u m e n t c l a s s [ 1 2 p t , a 4 p a p e r , o p e n b i b ] ...
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
Missing character: There is no d in font nullfont!
! Text line contains an invalid character.
l.1 \ d
o c u m e n t c l a s s [ 1 2 p t , a 4 p a p e r , o p e n b i b ] ...
A funny symbol that I can't read has just been input.
Continue, and I'll forget that it ever happened. "
如果您能提供任何关于如何解决此问题的建议,我们将不胜感激。谢谢。
编辑:如果有帮助的话:我也尝试使用两个带有最少 LaTeX 代码的非常基本的文档来运行相同的过程,但遇到了相同的错误。
答案1
我遇到了类似的问题,diff.tex
每个字符之间都有空格,因此我无法编译。
当我使用 XeLaTeX 或 LuaLaTeX(而不是 pdfLaTeX)进行编译时,这似乎解决了这个问题,并且我能够毫无问题地进行编译。