macOS下Vscode中LaTeX格式化错误

! https://zhuanlan.zhihu.com/p/451898704

macOS 下 vscode 中 LaTeX 格式化错误

问题描述

在 VS Code 中安装 LaTeX Workshop 插件后,如果按command + s保存,会出现如下报错。

Formatting failed. Please refer to LaTeX Workshop Output for details.

错误提示

解决方法

  1. 关闭 LaTeX Workshop 的代码格式化功能

setting.json中将“editor.formatOnSave:”改为false

  1. 自动格式化LaTeX代码(推荐)

在终端依次执行以下命令

sudo /usr/bin/cpan5.18 Unicode::GCString
sudo /usr/bin/cpan5.18 App::cpanminus
sudo /usr/bin/cpan5.18 YAML::Tiny
sudo /usr/bin/perl5.18 -MCPAN -e 'install "File::HomeDir"'
sudo cpan Log::Log4perl
sudo cpan Log::Dispatch

在终端中使用which latexindent查看所在位置,打开setting.json添加配置,指明latexindent的安装路径。

"latex-workshop.latexindent.path": "latexindent所在路径",

参照资料

posted @   Tsunho12  阅读(252)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
🔑
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.