如何使用MikTeX自備的cweave和ctangle程式?

如何使用MikTeX自備的cweave和ctangle程式?

我對在 Windows 上使用 CWEB 和 LaTeX 感興趣。今天我發現我的 MikTeX 安裝附帶了兩個有趣的程序,cweave 和 ctangle。他們是 Knuth 和 Levy 的 CWEB 嗎?當我嘗試運行它們時,出現以下問題:

%cweave.exe cwebsync.w_h
This is CWEAVE, Version 3.64 (MiKTeX 2.9.6960)
Sorry, but c:\emacs\miktex\texmfs\install\miktex\bin\cweave.exe did not succeed.
The log file hopefully contains the information to get MiKTeX going again:
  c:\emacs\miktex\texmfs\data\miktex\log\cweave.log
%

日誌檔案顯示以下內容:

%cat c:\emacs\miktex\texmfs\data\miktex\log\cweave.log
[...]
2019-02-18 21:44:44,561-0300 INFO  cweave - starting with command line: c:\emacs\miktex\texmfs\install\miktex\bin\cweave.exe cwebsync.w_h
2019-02-18 21:44:44,644-0300 FATAL cweave - MiKTeX encountered an internal error.
2019-02-18 21:44:44,645-0300 FATAL cweave - Info: path="."
2019-02-18 21:44:44,645-0300 FATAL cweave - Source: Libraries\MiKTeX\Core\Session\miktex.cpp
2019-02-18 21:44:44,646-0300 FATAL cweave - Line: 675
2019-02-18 21:44:44,656-0300 INFO  cweave - finishing with exit code 1
%

我以前見過這種類型的內部錯誤 --- 我的 MikTeX 是便攜式的,並不是所有東西都能在這個 MikTeX 便攜式版本中開箱即用。所以也許這也是同樣的問題。儘管如此:我應該為 MikTex 安裝中的這些程式煩惱嗎?

答案1

如果 miktex\bin 位於路徑上並且 texmf 結構良好,那麼運行便攜式版本應該不是問題,我知道,因為如果我從系統中的任何位置運行我的便攜式 USB 副本

ctangle C:\Users\myname\Desktop\cweb_tar\examples\wordtest.w
我正確地得到了 wordtest.c,如果我 cweave,我得到了 30k 的 wordtest.tex

我確實得到了當我沒有給出絕對地址時出現錯誤訊息並且明智地沒有從帶有空格等的路徑中運行。

除了 CTAN 文件之外,還有一個有趣的相關集合位於http://www.literateprogramming.com/cweb_download.html當然還有主站點https://www-cs-faculty.stanford.edu/~knuth/cweb.html

相關內容