我正在尝试使用Structure and Interpretation of Classical Mechanics的例子。这本书是基于麻省理工学院的方案。由于某些原因,mit-scheme安装不能使用图形:
MIT/GNU Scheme running under GNU/Linux
Type `^C' (control-C) followed by `H' to obtain information about interrupts.
Copyright (C) 2014 Massachusetts Institute of Technology
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Image saved on Saturday May 17, 2014 at 2:39:25 AM
Release 9.2 || Microcode 15.3 || Runtime 15.7 || SF 4.41 || LIAR/x86-64 4.118 || Edwin 3.116
1 ]=>(define win1 (frame 0 7 -2 2))
;Loading "/usr/lib/mit-scheme-x86-64/lib/prx11.so"... aborted
;No graphics types supported.发布于 2018-03-11 15:04:19
只是为了澄清一下(即使在OP中链接的github页面已经有了),你应该使用scmutils,而不是普通的麻省理工学院的方案。scmutils包括它自己的mit方案实现,以及书中专门为经典力学形式主义设计的大量附加内容。要在macos上安装scmutils,请确保将mechanics脚本复制到/usr/local/bin,并将scmutils文件夹复制到/usr/local。
此外,scmutils需要一个x-window系统来运行edwin,并且能够弹出xdvi来呈现latex方程。对于mac os,最好的选择可能是Xquartz,它可以与brew一起安装。
正确安装后,再加上一个可以正常工作的latex (适用于macos的BasicTex运行良好)和xdvi (可以通过执行brew install gv获得),假设您的xwindow系统是最新的,您应该能够输入mechanics并进入特殊的scmutils edwin程序,该程序将在一个新的X窗口中打开,而不是在当前终端中打开,您可以执行(show-expression '(+ x y))并让xdvi打开一个整齐打印的latex表达式"x+y“。此外,(frame 0 7 -2 2)也工作得很好。
我可以确认它可以在Mac上工作,并使用brew安装Xquartz、BasicTeX和xdvi。
注意Edwin明显不如Emacs,而且上述操作实际上可以在mac os上的Emacs中完成。请确保安装最新的Emacs,可以从brew cask或google "emacs for mac os“下载。然后,您需要在.emacs文件中添加以下内容:
(defun mechanics ()
(interactive)
(let ((root "/usr/local/scmutils/mit-scheme/"))
(run-scheme
(concat root "bin/scheme --library " root "lib"))))
(setenv "PATH"
(concat "/Library/TeX/texbin"
(getenv "PATH")))setenv是为了让emacs知道xdvi的位置;可以在终端中使用which dvi找到它。然后在emacs中执行M-x mechanics,您可以执行(show-expression 'x),这将弹出一个xdvi窗口,其中包含用latex呈现的表达式以及(frame 0 7 -2 2)。
https://stackoverflow.com/questions/45390946
复制相似问题