问题解决:VScode中LaTeX格式化 Formatting failed. Please refer to LaTeX Workshop Output for details.

一、问题描述 (Describe)

在VScode中安装LaTeX插件后,如果按cmd + S保存,会出现如下报错
问题解决:VScode中LaTeX格式化 Formatting failed. Please refer to LaTeX Workshop Output for details._第1张图片

二、解决方法(Solution)

法一:关闭LaTeX代码格式化功能

  "[latex]": {
        "editor.formatOnSave": false,
    }

法二:一劳永逸,自动格式化LaTeX代码(推荐)

在终端依次执行下面命令,然后就不会出现报错了,LaTeX代码也会在保存时自动格式化了

sudo cpan Log::Log4perl
sudo cpan Log::Dispatch
sudo cpan YAML::Tiny
sudo cpan File::HomeDir
sudo cpan Unicode::GCString

问题解决:VScode中LaTeX格式化 Formatting failed. Please refer to LaTeX Workshop Output for details._第2张图片


格式化前
问题解决:VScode中LaTeX格式化 Formatting failed. Please refer to LaTeX Workshop Output for details._第3张图片
格式化后
问题解决:VScode中LaTeX格式化 Formatting failed. Please refer to LaTeX Workshop Output for details._第4张图片

三、参考资料(Reference)

  • [1] https://github.com/James-Yu/LaTeX-Workshop/issues/376

你可能感兴趣的:(写作工具)