đ LaTeX Docs on Windows through WSL
Learn how to get started with writing LaTeX on Windows. This guide assumes a Windows 10 or 11 and a Visual Studio Code installation.
â¨ď¸ Visual Studio Code #
We will be using Visual Studio Code, the most popular code editor out today, along with some extensions:
Python: Support extension for Python
Remote - WSL: Virtual environment integration with WSL
LaTeX Workshop: Support extension for LaTeX
đŞ WSL #
As per the official Microsoft description, âThe Windows Subsystem for Linux lets developers run a GNU/Linux environment.â Put into simple terms, you can use a Linux environment without waiting an hour for your dual-boot or VM configuration to load. Still confused? Check out this video.
â¤ľď¸ Install #
Weâll be using version 2 since itâs supposedly faster. You can check out the official Microsoft Comparison here. Install and configure with:
wsl --install
wsl --set-default-version 2
đĄ Enable #
A simple installation isnât enough, so youâll need to enable a feature to use WSL.
Navigate to
Task Managerthrough đŞ or with Ctrl+Shift+Esc.Make sure
Virtualizationis enabled in theCPUsection of your task managerâsPerformancepage
Navigate to
Turn Windows features on or offthrough the Windows search barEnable
Windows Subsystem for Linuxif it isnât already
Now go ahead and reboot your computer.
đ§ Ubuntu #
The most popular and beginner-friendly Linux distribution out there, Ubuntu has collaborated with Microsoft to make WSL possible. This is the Linux distribution that weâll be running atop WSL.
â¤ľď¸ Install #
Install Ubuntu from the Microsoft Store. Once finished, enter Ubuntu through the đŞ, and itâll bring up a window and start installing the distribution.
Once finished, launch the app and run its installation course. Then youâll be prompted to enter a username, which you can just set to your Windows username, or whatever you like. Same goes for your password, although itâs advisable to keep this the same as your Windows password so you donât have to reach for a sticky note or use your brain every time. Your keyboard wonât output to the screen while you type out your password, as this is an intentional feature to keep your credentials secure.
â ď¸ If you canât type out a username, or itâs automatically set as root, run the following in PowerShell (retrieved from issue) to briefly reinstall and re-enter a username.
wsl --unregister Ubuntu
ubuntu install --ui=none
đď¸ LaTeX #
â¤ľď¸ Install #
Install the tools to compile LaTeX locally with:
sudo apt update
sudo apt install texlive-full -y
Now start a LaTeX project with:
mkdir ~/proj && cd $_
touch main.tex && code .
Edit your main.tex file with a template from Overleaf, and simply save for the LaTeX Workshop extension to compile it into a PDF. Check out autoCV to set up CI/CD to push edits to your online portfolio/site.
