(MacTex/MiKTeX + VSCode + LaTeX Workshop)
All you need are MacTeX/MiKTeX and LaTex Workshop Extension
macOS
Install MacTeX, you can refer to the following link, or if you are a homebrew (highly recommended) user, you can simply use brew install mactex
to finish this.
Windows
Install MiKTeX
scoop bucket add main
scoop install main/latex
Linux
Refer to https://miktex.org/download
Configure the LaTeX Workshop. In fact this extension is out-of-box, but if you want better experience, you can add following code in settings.json
( press command + shift + P then type “open” to search for “Preference: Open User Settings (JSON)”
Now you can open a “.tex” file and build & preview it.
If you want to use external pdf viewer, search for “viewer” in extension settings, then choose “external”.
<aside> 💡
Some useful shortcut:
option + command + B: Build the tex file
option + command + J: Jump from the code to corresponding PDF part
command + mouse press: Jump from the PDF to corresponding code part
</aside>
echo 'export PATH="/usr/local/texlive/2024/bin/universal-darwin:$PATH"' >> ~/.zshrc
source ~/.zshrc
You don’t need to manually add path in config file.
Reboot your mac if your LaTex Workshop still not work properly.