How to install LaTeX in VSCode (Windows)
To install LaTeX on Visual Studio Code (VSCode) on a Windows machine, you can follow these steps:
- Install a LaTeX distribution: You will need a LaTeX distribution installed on your computer in order to typeset LaTeX documents. You can download and install a distribution such as MikTeX or TeX Live. I prefer MikTex. However, if you install MikTex, then you have to install pearl as well. You can download the MikTex from here. Once you download MikTex, check for updates and update all the packages. Then download the perl from here. Installing perl is straightforward.
- Install the LaTeX Workshop extension: The LaTeX Workshop extension for Visual Studio Code provides language support and the ability to build LaTeX projects within the editor. To install this extension, open the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the editor, or by using the Ctrl + Shift + X (Windows) or Cmd + Shift + X (macOS) keyboard shortcut. Then, search for "LaTeX Workshop" and click on the "Install" button to install the extension.
- Verify the installation: To verify that everything is working correctly, you can create a new LaTeX file with the .tex extension, and start typing your document. The LaTeX Workshop extension should provide syntax highlighting and other language features. You can also build your document by using the "Build LaTeX Project" command, which can be accessed through the Command Palette (Ctrl + Shift + P on Windows, or Cmd + Shift + P on macOS). Here is a latex project template: https://github.com/eitanlees/latex-project-template
- If you find that the latex is not working then configure the LaTeX compiler: Once you have the LaTeX Workshop extension installed, you need to configure the LaTeX compiler to be used by the extension. To do this, open the Settings editor by clicking on the gear icon in the lower left corner of the editor, or by using the Ctrl , (Windows) or Cmd , (macOS) keyboard shortcut. Then, search for "latex workshop" in the search bar and select the "LaTeX Workshop > TeX Path" option. Here, you should specify the path to the TeX distribution you installed in step 1.