Home Page

Install VS Code

  1. Go to https://code.visualstudio.com/Download
  2. Download for your platform
  3. Install

Get a LaTeX Compiler

Either MikTeX or TeX Live is good, I use TeX Live. Follow the instructions on https://www.tug.org/texlive/ to install for your platform. If on Linux just use your package manager.

Install Git for version control

Grab git from https://git-scm.com/downloads. Again, package manager on Linux. On Windows the default settings are usually fine but you probably want to change your editor to VS Code rather than vim if you're not insane.

Make a Github account

VS Code isn't connected to the cloud like LaTeX is, so we need a way to sync our changes across devices. Github will allow us to connect with Git and save our code in a remote repository that we can clone onto other devices.

VS Code Setup

  1. Go to the extension store and grab LaTeX Workshop by James Yu. Gives syntax highlighting, snippets, easy compilation with your LaTeX compiler, etc.
  2. Go to File > Auto Save in order to make sure your files auto save as you type into them (note that this is not the same as pushing changes to our Github repo!)
  3. Sign in to your Github account to allow us to make repos on Github.
  4. Open an empty folder where you want your project. Usually I place mine in Documents/TeX/"project name here".
  5. Create a file called main.tex (this is where we'll write our TeX)
  6. Create a .gitignore file with the contents listed here (this is so git will ignore all the intermediate files and only track the main.tex file)
  7. Click the source control button on the left side of VS Code and initialize the repository
  8. Click Publish Branch in order to get your code on Github. You can make the repo public or private, I choose private so people can't access my stuff.

Ready to Go!

You are now ready to start writing LaTeX in VS Code! Whenever you are done making changes to your document, make sure to go to the source control tab on the left side of VS Code and commit and sync your changes. This will push whatever local changes you have made into your remote repo on Github. Whenever you go on a different computer to work on your document, be sure to pull any changes from the cloud first so you don't have to deal with merge conflicts.

Extra Credit

Sync with Overleaf

You can sync a Github project with Overleaf if you have Overleaf Premium. Go on Overleaf and click New Project and select import from Github to do so.

VS Code Themes

VS Code is very theme-able. Go to File > Preferences > Themes to choose a color theme. You can install extra themes from the Extensions Store. I like Catppuccin Mocha so I installed that one from there. You can also change the font in your settings as well.