我使用textmate制作latex中的pdf文件.macOS Monterey版本12.3更新后,python的最低版本(/usr/bin/python)消失了:编译现在无法工作.

错误提示我更改编译命令,如下所示:

 #!/usr/bin/env ruby18
# coding: utf-8

require ENV["TM_SUPPORT_PATH"] + "/lib/tm/process"
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/htmloutput"
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document"

# To enable the typesetting of unsaved documents, you must change the “Save” setting of
# this command to “Current File” and add the variable TM_LATEX_AUTOSAVE to TextMate's
# Shell Variables preferences. Be warned that your document must be encoded as UTF-8 if
# you exercise this option — becauseTextMate.save_current_document cannot know the file 
# encoding you prefer.

TextMate.save_current_document unless ENV["TM_LATEX_AUTOSAVE"].nil?

texmate = ENV["TM_BUNDLE_SUPPORT"] + "/bin/texmate.py"
engine_version = TextMate::Process.run(texmate, "version")
TextMate::HTMLOutput.show(:title => "Typesetting “#{ENV["TM_DISPLAYNAME"] || File.basename(ENV["TM_FILEPATH"])}”…", :sub_title => engine_version) do |io|
  TextMate::Process.run(texmate, 'latex', :interactive_input => false) do |line|
    io << line
  end
end
::Process.exit($?.exitstatus || 0) # exitstatus is nil if our process is prematurely terminated (SIGINT)

非常感谢你的帮助.

推荐答案

TextMate的LaTeXBundle 包没有及时更新到MacOS 12.3的发布.您可以按如下方式修复它:

  1. 下载并安装Python 3(https://www.python.org/downloads/)
  2. /usr/bin/python3-m pip安装pyobjc——用户
  3. cd~/Library/Application\Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/bin
  4. 将all标题中的"python"改为"python3".py文件(configure.py、btexdoc.py、texmate.py、texparser.py)

Python相关问答推荐

如何将桌子刮成带有Se的筷子/要求/Beautiful Soup ?

如何使用SubProcess/Shell从Python脚本中调用具有几个带有html标签的参数的Perl脚本?

在Python中对分层父/子列表进行排序

ModuleNotFound错误:没有名为flags.State的模块; flags不是包

如何记录脚本输出

如何创建一个缓冲区周围的一行与manim?

在vscode上使用Python虚拟环境时((env))

移动条情节旁边的半小提琴情节在海运

使用Python从URL下载Excel文件

Polars asof在下一个可用日期加入

Pandas Data Wrangling/Dataframe Assignment

使用Python从rotowire中抓取MLB每日阵容

搜索按钮不工作,Python tkinter

Gunicorn无法启动Flask应用,因为无法将应用解析为属性名或函数调用.'"'' "

在Docker容器(Alpine)上运行的Python应用程序中读取. accdb数据库

Odoo16:模板中使用的docs变量在哪里定义?

并行编程:同步进程

获取PANDA GROUP BY转换中的组的名称

如何设置nan值为numpy数组多条件

PySpark:如何最有效地读取不同列位置的多个CSV文件