我在Ubuntu (20.04 LTS) 系统下安装了TeXlive 2020 和 VS Code 按Ctrl+Shift+I (默认)格式化代码时报错...
参考了
和
https://github.com/James-Yu/LaTeX-Workshop/issues/376
问题并没有得到解决...
很有可能是latexindent的问题...
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\int_C \mathbf{F}\cdot\,d\mathbf{r}
\end{equation*}
\end{document}
LaTeX Workshop 输出:
[16:55:46] Found root file from active editor: /home/bang/文档/VS Code/LaTeX/test/test.tex
[16:55:46] Root file remains unchanged from: /home/bang/文档/VS Code/LaTeX/test/test.tex.
[16:55:49] Formatting with command latexindent -c,/home/bang/文档/VS Code/LaTeX/test/,/home/bang/文档/VS Code/LaTeX/test/__latexindent_temp.tex,-y=defaultIndent: ' '
[16:55:49] Formatting failed with exit code 2
[16:55:49] stderr: Can't locate Log/Dispatch/File.pm in @INC (you may need to install the Log::Dispatch::File module) (@INC contains: /usr/local/texlive/2020/texmf-dist/scripts/latexindent /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/local/texlive/2020/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm line 24.
BEGIN failed--compilation aborted at /usr/local/texlive/2020/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm line 24.
Compilation failed in require at /usr/local/texlive/2020/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 25.
BEGIN failed--compilation aborted at /usr/local/texlive/2020/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 25.
Compilation failed in require at /usr/local/texlive/2020/bin/x86_64-linux/latexindent line 27.
BEGIN failed--compilation aborted at /usr/local/texlive/2020/bin/x86_64-linux/latexindent line 27.