


The latexindent requires a few Perl packages to be installed. export CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE Install Perl packages by cpan Thus, I set the CPATH environment as follows. On my Mac, EXTERN.h for this version was in /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/EXTERN.h. The version of Perl can be found by “perl -v”. In my case, the version of Perl was v5.18.4. There may be many versions you can choose the one that matches the version of Perl installed on Mac. find /Library/Developer/CommandLineTools/SDKs -name EXTERN.h -print To find this file, one can run the following command. Otherwise, there will be an error message saying “Fatal error: ‘EXTERN.h’ file not found”. In order to make some header files to be available for compilers, we need to set up the CPATH variable.
#Latex studio for mac mac os#
xcode-select -install Configure the CPATH environmentĭue to some weird reasons, some necessary files for compiling some packages are hidden on Mac OS Catalina.

In order to use C compilers or git on Mac, it is necessary to install command line tools. Here’s what I did in order to set up the latexindent on MacOS without using brew to install Perl again. To make it worse, this install isn’t trivial at all. However, the default installation does not work because it requires extra configuration on Perl. As most of us install the MacTeX, it should be easy to use latexindent. The “ latexindent” is a Perl script that indents a LaTeX file to make it easier to read, and is included in MacTeX.
