I faced some difficulties in configuring and I decided to do this tutorial. In fact, it would be easier to download MacTex, which is the full version; however, I was not in the mood to occupy 4GB of my SSD with this.
The tutorial is pretty basic anyway, so have patience.
Important: I assume that: (1) BasicTex is already installed on your Mac and LaTex Workshop is installed in the VS Code, and (2) there are not any of the required packages.
Download Packages
Configuring TeX Live Manager
We will use TeX Live Manager to install the packages. It is accessible via tlmgr
command
1) Open Terminal on your Mac
2) Type sudo tlmgr update --self
to update the TeX Live Manager itself
3) Once the process is complete, we will update all packages already installed by BasicTex. To do so, type sudo tlmgr update --all
Installing Packages
Now we will install the necessary packages. They are: latexmk, latexindent, synctext, chktex and texcount. I will not show the installation of all the packages because the process is exactly identical, having only to substitute the name of what I am going to use of example (the chktex) by the others.
1) At the Terminal, type sudo tlmgr install chktex
. Wait for the installation to be completed. Usually the dynamic is as follows:
MacBook-Pro: ~ gabriel $ sudo tlmgr install chktex
Password:
tlmgr: package repository http://ctan.dcc.uchile.cl/systems/texlive/tlnet (not verified: gpg unavailable)
[1/2, ??: ?? / ??: ??] install: chktex.x86_64-darwin [54k]
[2/2, 00: 01/00: 01] install: chktex [10k]
running mktexlsr ...
done running mktexlsr.
tlmgr: package log updated: /usr/local/texlive/2018basic/texmf-var/web2c/tlmgr.log
2) Repeat this for all packages
3) To check where each package is installed, use the which [package_name]
command, for example which chktex
. In my case, the answer comes:
MacBook-Pro-of-Gabriel: ~ gabrielsalgueiro $ which chktex
/Library/TeX/texbin/chktex
Configuring in VS Code
Configuring the paths
1) Open your VS Code and go to the Commands tab (Cmd + Shift + P generally), and open the settings by typing Preference: Open Settings
2) In the window that appears, locate the Extensions
tab. Click and find LaTex
3) Fill in the required fields with the paths discovered in the previous step. Just go down the page you will see where it should fill with the paths. The default is [Package_name]: Path
Generating Files
1) Configured all, go test. Open the .tex file.
2) Build (Cmd + Option + B, by default).
3) View the result (Cmd + Option + V, by default)
3.1) If all goes well, it will ask where you want to view the PDF (browser, in a new tab, or even in an external viewer). Select your option and be happy.
Q. Remember to use a folder that does not have restricted characters. Defining the workspace inside the "Documents" folder solves this problem, for example.