Mac上使用Sublime Text+Skim编译LaTeX

在Mac上配置LaTex + Sublime Text2,整个过程如下:

  • 下载安装 MacTex.pkg。文件大小2.4G,安装需要4G的空间。
  • 下载安装 Sublime Text 2
  • Sublime Text 2 中安装 Package Control。在 Sublime Text 2 中,使用 “Control+`” 打开 Console,输入如下代码

如果是在 Sublime Text 3 中安装 Package Control,则用

  • 安装LaTex Tools。在 Sublime Text 2 中输入 Command+Shift+P 打开 command pallet,输入 Install PackageEnter
  • 安装配置Skim。下载Skim,安装。打开Skim,按 Command+, 打开设置窗口,对 同步 做如下配置(如图):
  • 配置好后,如果编译的时候提示

则打开 Pallte(Command+Shift+P) 输入如下命令即可。

  • 现在,我们已经做完了所有的步骤,可以打开Sublime Textommand+N新建文件并在里面编写LaTeX代码了,完成编辑之后,Command+S保存文件,Command+B编译并运行,这时就可以在Skim里面看到PDF预览了。
  • 注意,用这种方式编译 tex 文件是不会自动保存文件的,所以记得保存文件,血淋淋的教训啊。。。
  • 升级 El Capitan‎ 后可能出现无法编译的问题,这是因为 /usr/texbin 文件夹被系统保护了。
  • MacTeX installs a symbolic link /usr/texbin pointing to the TeX binaries. GUI applications use this link to find the binaries. But in El Capitan, the location /usr is reserved for Apple, and even users with root access are not allowed to write to that location.

    The solution to this problem is to relocate the link to /Library/TeX/texbin, and reconfigure GUI applications to look in this location. Consequently, MacTeX-2015 and BasicTeX-2015 write two links, /usr/texbin and /Library/TeX/texbin, when installing on systems earlier than El Capitan, and write /Library/TeX/texbin when installing on El Capitan. These installations configure shell applications to look for TeX in both locations.

    Consequently, if you install MacTeX-2015 or BasicTeX-2015 after upgrading to El Capitan, or if you have already installed one of them before upgrading, then TeX will work as usual when accessed from the Terminal, and will work from GUI applications once these are reconfigured.

    The latest version of TeXShop automatically reconfigures itself. This version was released a month after MacTeX-2015 was released, so TeXShop users should use the menu item “Check for Updates” before using it on El Capitan.

    对于 Sublime+LaTeX tools, 解决这个问题只需要打开 Pallte(Command+Shift+P) 输入如下命令即可。



    电子邮件地址不会被公开。 必填项已用*标注