MiKTeX 更新後 Latexmk 無法運作

MiKTeX 更新後 Latexmk 無法運作

我正在使用 MiKTeX/TeXworks 並latexmk在幾年前建立。直到昨天我更新 MiKTeX 為止,它一直運作得很好。

latexmk我使用的排版例程是:

在此輸入影像描述

但是,現在當我嘗試使用latexmk處理選項進行編譯時,我獲得以下日誌文件:

Latexmk: This is Latexmk, John Collins, 18 June 2019, version: 4.65.
Rule 'pdflatex': The following rules & subrules became out-of-date:
    'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex -synctex=1  -recorder  "DOCUMENT.tex"'
------------
Latexmk: applying rule 'pdflatex'...
Can't spawn "pdflatex -synctex=1  -recorder  "DOCUMENT.tex"": Inappropriate I/O control operation at C:\Program Files\MiKTeX 2.9\scripts/latexmk\latexmk.pl line 9732.
Latexmk: fls file doesn't appear to have been made.
Collected error summary (may duplicate other messages):
pdflatex: Command for 'pdflatex' gave return code 255
    Refer to 'DOCUMENT.log' for details
----------------------
This message may duplicate earlier message.
Latexmk: Failure in processing file 'DOCUMENT.tex':
(Pdf)LaTeX didn't generate the expected log file 'DOCUMENT.log'
----------------------
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs, or warnings treated as errors.
Latexmk: Errors, so I did not complete making targets

我嘗試過尋找該做什麼,但到目前為止還沒有發現任何有用的東西。有人可以提供一些指導嗎?如果我手動的話,一切都會編譯pdflatex + bibtex + pdflatex + pdflatex

TeXworks 版本為 0.6.3 版(MiKTeX 2.9.7140 64 位元)。

latexmk編輯:這是我從命令列運行得到的結果。錯誤訊息

在此輸入影像描述

和輸出

C:\Users\username\folder>latexmk
Latexmk: This is Latexmk, John Collins, 18 June 2019, version: 4.65.
Latexmk: Disallowing switch of output file as incompatible
    with file requests.
Latexmk: applying rule 'latex'...
Rule 'latex': The following rules & subrules became out-of-date:
      'latex'
------------
Run number 1 of rule 'latex'
------------
------------
Running 'latex  -recorder  "DOCUMENT.tex"'
------------
Can't spawn "latex  -recorder  "DOCUMENT.tex"": Inappropriate I/O control operati
on at C:\Program Files\MiKTeX 2.9\scripts/latexmk\latexmk.pl line 9732.
Latexmk: fls file doesn't appear to have been made.
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  latex: Command for 'latex' gave return code 255
      Refer to 'DOCUMENT.log' for details
----------------------
This message may duplicate earlier message.
Latexmk: Failure in processing file 'DOCUMENT.tex':
   (Pdf)LaTeX didn't generate the expected log file 'DOCUMENT.log'
----------------------
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs, or warnings treated as errors.

答案1

miktex bin 資料夾中的許多 exe 檔都非常小:它們只是包裝器。 「真正的」應用程式程式碼位於某些 dll(和/或某些腳本)中,且包裝器必須找到「入口點」。有時,更新後入口點會發生更改,必須重新建立包裝器。通常 miktex 會處理這個問題,但它可能會因任何原因而失敗。在這種情況下,可以使用以下命令重新建立包裝器

  initexmf --mklinks --admin --force

或者如果只有像 Latexmk 這樣的腳本受到影響

  initexmf --mklinks=scripts --admin --force

也可以看看https://docs.miktex.org/2.9/manual/initexmf.html

相關內容