TeXstudio + MikTex:“錯誤:命令崩潰:pdflatex.exe”

TeXstudio + MikTex:“錯誤:命令崩潰:pdflatex.exe”

我正在運行 Win10、MikTex 2.9 和 TeXstudio。我昨天嘗試更新我的軟體包,我認為更新被電腦進入睡眠狀態中斷了。儘管所有軟體包似乎都是最新的(MikTex Console 說「沒有更新」),但它似乎也損壞了我安裝中的某些內容。除了完全卸載/重新安裝 MikTeX 之外,還有其他修復建議嗎?

微量元素:

\documentclass{article}
\begin{document}
Hello world
\end{document}

TeXstudio 訊息:

Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "temp".tex

Error: Command crashed: pdflatex.exe -synctex=1 -interaction=nonstopmode "temp".tex

Process exited with error(s)

我下載並安裝了最新版本的 TeXstudio (2.12.22),然後當我打開 TeXstudio 並嘗試編譯時彈出此錯誤: 錯誤對話框:pdflatex.exe - 未找到入口點

下午 5 點新增:

從命令列執行“pdflatex temp.tex”和“texify temp.tex”會產生相同的結果:

C:\Temp>texify temp.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7300 64-bit)
_

它只是坐在那裡運行。我在任務管理器中找到了一個名為“Make a TeX .fmt file”的進程,然後在miktex-makefmt.log文件:

2020-03-20 16:42:32,481-0500 INFO  miktex-makefmt - starting with command line: miktex-makefmt.exe --engine=pdftex --dest-name=latex --no-dump latex.ini --engine-option=-tcx=cp227.tcx --miktex-disable-maintenance --miktex-disable-diagnose
2020-03-20 16:42:32,491-0500 INFO  makefmt - found input file: C:\Users\<name>\AppData\Local\Programs\MiKTeX 2.9\tex\latex\00miktex\latex.ini
2020-03-20 16:42:32,491-0500 INFO  makefmt - Creating the latex format file...
2020-03-20 16:42:32,511-0500 INFO  makefmt - Running miktex-pdftex.exe...
2020-03-20 16:42:32,511-0500 INFO  makefmt - running: miktex-pdftex.exe --miktex-disable-maintenance --miktex-disable-diagnose --initialize --interaction=nonstopmode --halt-on-error --alias=latex --job-name=latex -tcx=cp227.tcx --enable-etex latex.ini
2020-03-20 16:45:10,847-0500 FATAL miktex-makefmt - miktex-pdftex.exe failed on latex.ini.
2020-03-20 16:45:10,847-0500 FATAL miktex-makefmt - miktex-pdftex.exe failed on latex.ini.
2020-03-20 16:45:10,847-0500 FATAL miktex-makefmt - Info: 
2020-03-20 16:45:10,847-0500 FATAL miktex-makefmt - Source: 
2020-03-20 16:45:10,847-0500 FATAL miktex-makefmt - Line: 0

下午 6 點新增: 運行後

miktex-pdftex --initialize --enable-etex pdflatex.ini

我得到:

("C:\Users\<name>\AppData\Local\Programs\MiKTeX 2.9\tex/generic/dehyph\dehyph
t.tex"
German Traditional Hyphenation Patterns `dehypht' Version 3.2a <1999/03/03>
(Formerly known under the name `ghyph31' and `ghyphen'.)))
! I can't find file `dehypht-x-2018-03-31.tex'.

答案1

感謝@UlrikeFischer,解決方案是從命令列運行以下命令:

initexmf --force --mklinks
initexmf --mklangs

筆記:

  • 在我的情況下,第一行可能不是必需的。
  • 我將 MiKTeX 安裝為“個人”或“單用戶”。如果它是“適用於所有人”或“系統範圍”,那麼我需要添加--admin到這些命令的末尾。看 https://docs.miktex.org/manual/initexmf.html

相關內容