This repository shows how to use latex
on Visual Studio Code
. I used a custom simple latex template
You can find a more extended documentation here
Tested on Linux (Ubuntu
20.04
,18.04
) andWindows 10
. Just download the righttexlive
file on https://ctan.javinator9889.com/systems/texlive/tlnet/ depending on your OS and then set the path properly.
-
Download
tex live
--> http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -
Unzip -->
tar zxvf install-tl-unx.tar.gz
-
Install
sudo ./install-tl
(While installing select optionI
)
This may take some time (around 45min in my case)
- Add the following to
~/.bashrc
:
#==============
# Latex
#==============
export MANPATH="/usr/local/texlive/2021/texmf-dist/doc/man:$MANPATH"
export INFOPATH="/usr/local/texlive/2021/texmf-dist/doc/info:$INFOPATH"
export PATH="/usr/local/texlive/2021/bin/x86_64-linux:$PATH"
- [VSC] Install extension
LaTeX Workshop
in VSC
-
Download
tex live
--> https://ctan.javinator9889.com/systems/texlive/tlnet/install-tl-windows.exe -
Install using executable
This may take some time
- Install
Miktek
--> https://miktex.org/download
This is only necessary in case you want to use latex
from terminal and compile changes that way. In that case you can make use of the Makefile
created for that purpose.
Go to ~/path_to_this_project/latex_vsc
on terminal:
- Compile
make
This will generate all files inside out/
folder
- In case you want to remove all files in
out
folder
make clean-linux
Windows cannot use make
but in case you have Visual Studio
you can use nmake
.
-
Find where inside the
Visual Studio
folder you have place thenmake
-
Copy that path in the Windows Global environment path
-
Go to the project and Compile:
nmake
- In case you want to remove all files in
out
folder
make clean-windows
This is the simplest case scenario. In this case, you can totally work with your latex project using Latex-workshop
extension.
Open Visual Studio Code and go to Latex Workshop
settings, modify Out Dir
option:
- This is the default state
- This is how it should be
This is the only settings you need to change. Once this is done you can work on your project and test your changes live using the following buttons:
Example:
From now on, every time you save your changes you will see that automatically applied on the pdf
on your right