【发布时间】:2020-12-25 10:16:12
【问题描述】:
在 Windows 10 Home 上使用 TeXworks v0.6.5 (MiKTeX 20.7),我正在尝试将一行写入文本文件。
在排版这段代码时
\documentclass{article}
\newwrite\justafile
\begin{document}
% Write to text file:
\immediate\openout\justafile=exam.txt
\immediate\write\justafile{Chosen questions: bla, bla and bla.}
\immediate\closeout\justafile
\end{document}
控制台输出以下消息(编译日志的最后 5 行):
No pages of output.
Transcript written on example.log.
Sorry, but "MiKTeX Compiler Driver" did not succeed.
The log file hopefully contains the information to get MiKTeX going again:
C:\Users\Miriam Briskman\AppData\Local\MiKTeX\2.9\miktex\log\texify.log
日志文件包含以下错误信息:
2020-09-06 19:47:38,817-0400 INFO texify - this process (4764) started by 'miktex-texworks' with command line: "C:\Users\Miriam Briskman\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\texify.exe" --pdf --synctex=1 --clean example.tex
2020-09-06 19:47:38,880-0400 INFO texify.core - start process: pdflatex --synctex=1 "C:/Users/Miriam Briskman/OneDrive/Desktop/Brooklyn College/Fall 2020/CISC 1050/Tests/Test Pool/New folder\example.tex"
2020-09-06 19:47:39,249-0400 INFO texify.core - start process: pdflatex --synctex=1 "C:/Users/Miriam Briskman/OneDrive/Desktop/Brooklyn College/Fall 2020/CISC 1050/Tests/Test Pool/New folder\example.tex"
2020-09-06 19:47:39,587-0400 ERROR texify.core - The system cannot find the file specified.
2020-09-06 19:47:39,587-0400 ERROR texify.core - Function: CopyFileW
2020-09-06 19:47:39,587-0400 ERROR texify.core - Result: 2
2020-09-06 19:47:39,587-0400 ERROR texify.core - Data: existing="C:/Users/MIRIAM~1/AppData/Local/Temp/mik68959/_src\example.pdf", path="C:/Users/Miriam Briskman/OneDrive/Desktop/Brooklyn College/Fall 2020/CISC 1050/Tests/Test Pool/New folder\example.pdf"
2020-09-06 19:47:39,587-0400 ERROR texify.core - Source: Libraries\MiKTeX\Core\File\win\winFile.cpp:383
2020-09-06 19:47:39,592-0400 FATAL texify - Windows API error 2: The system cannot find the file specified.
2020-09-06 19:47:39,592-0400 FATAL texify - Info: existing="C:/Users/MIRIAM~1/AppData/Local/Temp/mik68959/_src\example.pdf", path="C:/Users/Miriam Briskman/OneDrive/Desktop/Brooklyn College/Fall 2020/CISC 1050/Tests/Test Pool/New folder\example.pdf"
2020-09-06 19:47:39,592-0400 FATAL texify - Source: Libraries\MiKTeX\Core\File\win\winFile.cpp
2020-09-06 19:47:39,592-0400 FATAL texify - Line: 383
下面是 TeXworks 控制台屏幕截图的链接,其中包含代码:
TeXworks console with the problematic code
我使用 MiKTeX 控制台安装了所有最近的更新,但这并没有解决问题。
错误的根源是什么,我应该如何解决?
【问题讨论】:
-
可以直接用pdflatex而不是texify编译吗? Texify 因丢弃所有有用的错误消息而臭名昭著....
-
@samcarter_is_at_topanswers.xyz,非常感谢!当我将处理工具从pdfLaTeX+MakeIndex+BibTeX更改为仅pdfLaTeX时,代码编译正常,输出文件创建修改成功。如果您特别怀疑 texify 出了什么问题,您想添加这个建议作为问题的答案吗?再次,非常感谢!
-
我不知道 texify 出了什么问题,这正是我建议远离它的问题所在。直接使用latex时,总会说出问题所在。这可能不是每个用户都能理解的,但至少有一个用户可以获取这些信息以获取在线帮助。
-
我明白了。非常感谢您的解决方案和建议,@samcarter_is_at_topanswers.xyz!
标签: windows io latex pdflatex miktex