Setting Up a Local LaTeX Environment: Build Your Own Overleaf with TeX Live and VS Code

The cover image was created by the author and features the $\LaTeX$, TeX Live, and VS Code logos.
Have you ever been frustrated by Overleaf’s compilation timeouts? Or encountered network issues that prevented you from compiling online? Maybe you’re a beginner learning to typeset with $\LaTeX$? This article will guide you step by step through installing TeX Live on your own computer and using VS Code as your $\LaTeX$ editor.
What is $\LaTeX$?
$\LaTeX$ is a typesetting system based on $\TeX$. Unlike common word processors such as Microsoft Word or Google Docs, $\LaTeX$ does not use a graphical interface for formatting. Instead, users write documents through lines of commands.
The first version of $\LaTeX$ was released in 1984 by American computer scientist Leslie Lamport, whose goal was to “free users from the hassle of typesetting.” Even users without background knowledge in design or programming can easily produce well-formatted documents with $\LaTeX$.
$\LaTeX$ supports not only mathematical equations, figures, and tables, common in mathematics, physics, and engineering, but also offers packages for music notation, chess, and other typesetting tasks. It features convenient tools such as cross-referencing, bibliographic citation, and automatic table of contents generation. Because of these strengths, $\LaTeX$ is widely used in academia and publishing.
Unlike visual editors, $\LaTeX$ follows a content–format separation principle. This means users cannot immediately preview their formatted results, they must compile the .tex file with a $\LaTeX$ compiler first. The benefit of this approach is that .tex files are lightweight, version-control friendly, and ensure consistent formatting across platforms.
As mentioned above, $\LaTeX$ is particularly suited for academic papers, reports, and technical documentation. For general users, graphical editors might still be more convenient. However, beginners who need to format academic reports can try free online tools such as Overleaf, which lowers the learning curve and avoids setup issues with local compilers.
In the following sections, we’ll start by installing TeX Live, and then set up VS Code as our $\LaTeX$ text editor.
Installing TeX Live
First, visit https://tug.org/texlive/acquire-iso.html to download the required software.
Step 1: Click installing TeX Live over the Internet.
Step 2: Download the installer corresponding to your operating system. Here, using Windows 11 as an example, click install-tl-windows.exe.
Step 3: Open the TeX Live installer you just downloaded. If prompted by security warnings, click More info.
Step 5: Click Install.
Wait for the installer to initialize.
Once the installer interface appears, you can begin the installation.
Step 9: Choose the installation root directory; modification is not required.
Step 11: Select the languages you will use when writing $\LaTeX$, then click OK.
Typically, at minimum, choose Chinese, CJK (Chinese/Japanese/Korean - basic), and English.
Step 12: If no other adjustments are needed, click Install.
Wait for the installation to complete. The installer will download the necessary files from the internet and install them.
Make sure your internet connection remains stable during this process. The installation does not consume much bandwidth, so you can continue using your computer normally.
Note that the installation can take a long time, depending on your chosen options, it may take 3 to 5 hours.
When you see running package-specific postactions and the installation screen no longer updates, the installation is likely complete.
At this point, you can check the installation directory for the log files to confirm that the installation has finished.
Step 13: Navigate to the installation folder, typically located at installation-root/texlive/2025/.
Step 14: Open the install-tl.log file.
Step 15: Check for messages indicating the installation is complete and a welcome message.
Step 16: Click Close to exit the TeX Live installer.
Step 18: Open a terminal, such as Command Prompt, and enter:
| |
Check that information about the LaTeX compiler is displayed. If nothing appears, you may need to set up environment variables. See Steps 19 to 27 for instructions.
Step 19: Open Settings by clicking the icon or using the shortcut Win + i, then navigate to System > About.
Step 20: Click Advanced system settings.
Step 21: Click Environment Variables.
Step 22: Under System variables, select Path.
Step 23: Click Edit.
Step 24: Check whether the TeX Live installation directory is listed, which should look like installation-root\texlive\2025\bin\windows.
If it is not present, click New and add the path manually.
Step 25: Click OK.
Step 26: Click OK.
Editing in VS Code
Before you start editing .tex files in VS Code, you need to install the necessary extensions to use the LaTeX compiler you just installed.
Step 1: Click Extensions.
Step 2: In the search box, type LaTeX.
Step 3: Click the LaTeX Workshop extension.
Step 5: Click Trust the publisher and install.
After the extension is installed, you still need to configure it to use the compiler you just installed.
Step 6: Click Manage.
Step 7: Click Settings.
Step 8: Click Open Settings (JSON).
This is VS Code’s JSON settings file.
Add a comma at the end of the second-to-last line, then on a new line, add the following content:
| |
Step 9: Modify the build target.
In principle, you can simply enter xelatex, pdflatex, or latexmk, but sometimes the compiler may fail to launch. In such cases, you need to specify its absolute path.
Also update the related VS Code paths accordingly.
Now you can start editing your documents.
Step 10: Create and open a .tex file. A $\TeX$ icon will appear on the left sidebar.
Once you have finished writing your $\LaTeX$ document, you can start compiling.
Step 11: Click the $\TeX$ icon.
Step 12: In Build LaTeX project, select the compilation method you want to use.
During compilation, you can also monitor the progress in the lower-left corner.
If you encounter issues during compilation, you can check for errors and warnings.
Step 13: Click Warnings and Info in the lower-left corner.
Step 14: View the Warnings and Info under the Problems tab.
After successful compilation, you can view the output.
Step 15: Click View LaTeX PDF and choose either View in VS Code tab or View in browser.
The compiled PDF file will be located in the same directory as the .tex file.
Conclusion
$\LaTeX$ is a powerful and convenient typesetting system for academic documents. It not only produces aesthetically pleasing and consistent formatting across different platforms, but also greatly simplifies issues commonly encountered with equation formatting in other editors.
Although you may encounter various challenges during the installation process, having a local environment allows unlimited compilation time, offering greater flexibility and convenience compared to using Overleaf alone.
References
- $\textit \LaTeX$. (June 30, 2025). Wikipedia, The Free Encyclopedia. Retrieved November 3, 2025, from https://zh.wikipedia.org/zh-tw/LaTeX
- 學術排版工具:LaTeX是什麼?從基礎教學、中文排版、符號資源到線上工具推薦. (May 9, 2025). AsiaEdit. Retrieved November 3, 2025, from https://asiaedit.com/zh-hant/blog/what-is-latex
- 慕ゞ笙. (August 8, 2025). 2025 TexLive+VScode排版IEEE TGRS论文. CSDN. Retrieved November 3, 2025, from https://blog.csdn.net/qq_53182191/article/details/150058750










![[NCHC Exploration] #2 Getting Started with TWCC](https://raw.githubusercontent.com/Josh-test-lab/website-assets-repository/refs/heads/main/posts/NCHC%20Exploration%20EP.2%20Getting%20Started%20with%20TWCC/cover%20image.png)