DEV Community

MrChoke
MrChoke

Posted on • Originally published at mrchoke.Medium on

3 2

Use latexindent on macOS Big Sur

ตัวช่วยจัด indent source ของ LaTeX คือ latexindent แต่บน macOS จะต้องติดตั้ง cpan modules เพิ่มเติมนิดหน่อย

Can't locate File/HomeDir.pm in [@INC](http://twitter.com/INC) (you may need to install the File::HomeDir module) ([@INC](http://twitter.com/INC) contains: /usr/local/texlive/2021/texmf-dist/scripts/latexindent /Library/Perl/5.30/darwin-thread-multi-2level /Library/Perl/5.30 /Network/Library/Perl/5.30/darwin-thread-multi-2level /Network/Library/Perl/5.30 /Library/Perl/Updates/5.30.2 /System/Library/Perl/5.30/darwin-thread-multi-2level /System/Library/Perl/5.30 /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level /System/Library/Perl/Extras/5.30) at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 22.
Enter fullscreen mode Exit fullscreen mode

ถ้าเจอ error นี้ให้ติดตั้ง modules ต่างๆ ดังนี้

เริ่มแรกให้กำหนด CPATH ให้ชี้ให้ถูกต้อง

export CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE:$CPATH
Enter fullscreen mode Exit fullscreen mode

หลังจากนั้นก็ให้ติดตั้ง CPAN Modules

cpan install File:HomeDir
cpan install Unicode::GCString
Enter fullscreen mode Exit fullscreen mode

ปล. ผมเลือก sudo ตอนที่ CPAN ถามนะครับ

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay