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.

解决方法
- 关闭 LaTeX Workshop 的代码格式化功能
在setting.json中将“editor.formatOnSave:”改为false
- 自动格式化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所在路径",
参照资料
本文来自博客园,作者:Tsunho12,转载请注明原文链接:https://www.cnblogs.com/tsunho12/p/16160662.html

浙公网安备 33010602011771号