-
Notifications
You must be signed in to change notification settings - Fork 536
Install
- LaTeX distribution in system PATH. For example, TeX Live.
- Please note MikTeX does not ship with SyncTeX. Please use built-in synctex functionality.
-
latexmk
is required for the default recipe for building LaTeX projects to work. Alternatively, you can set up your own LaTeX recipe. - Optional: Install ChkTeX to lint LaTeX projects.
- Optional: Install latexindent.pl for formatting support if it is not provided by your LaTeX distribution. You also have to install a few standard Perl modules. See the official document.
Installing LaTeX Workshop is simple. You can find it in Visual Studio Code Marketplace, or simply run ext install latex-workshop
in VS Code Quick Open (ctrl
/cmd
+ P
).
Usually, you do NOT have to set PATH environment variable. TeX distributions appropriately set the variable on your system. And, LaTeX Workshop never touches the variable. If VS Code cannot find executables of TeX, it means that the setting of your system is broken. For the ways of setting environment variables on Windows, see link or link. On macOS and Linux, see the documentation by the rbenv dev team. Very detailed information is also available on stackoverflow for macOS.
If you can not fix the setting of your system, you can also override PATH with the env
property of LaTeX recipes.
You can modify settings through the menu of VS Code, Preferences > Settings
.
You can also modify settings by directly editing settings.json
. See an official doc for the location of settings.json
.
You can also have different settings for each project with .vscode/settings.json
at the root of each project workspace. See an official doc.
The typical usage is to open a .tex
file and have a look at the TeX sidebar to access all the extension features. If you wish to use a keybinding to open the TeX sidebar, you just need to associate one with the command latex-workshop.actions
.
- Building
- Viewing and going from source to PDF back and forth
- Catching errors and warnings
- Navigating and selecting environments
- Navigating the document structure. The section names of LaTeX outline hierarchy are defined in
latex-workshop.view.outline.sections
. This property is an array of case-sensitive strings in the order of document structure hierarchy. For multiple tags in the same level, separate the tags with|
as delimiters, e.g.,section|alternative
. It is also used by the folding mechanism. - Miscellaneous actions
- Open citation browser, see also Intellisense for citations
If you prefer to access some of the most common actions through a right click menu, set latex-workshop.showContextMenu
to true
. Default is false
.
In addtions to LaTeX
, LaTeX-Expl3 is supported. You can change the language mode from LaTeX
to LaTeX-Expl3
clicking on the language indicator, LaTeX
, of the satus bar and selecting LaTeX-Expl3
from the drop-down. See an official document.
Sweave, knitr, and Weave.jl are also supported. See Building a .rnw file and Building a .jnw file for the details.
Starting with 1.35.0, VS Code supports Docker with Remote - Containers. LaTeX Workshop works well with the extension. Try the extension at first.
Starting with release 5.3.0, there is an experimental implementation on Docker support following the idea of @Arxisos. You can set latex-workshop.docker.enabled
to true
to use a docker based LaTeX distribution. The docker image to be used is defined by latex-workshop.docker.image.latex
, the default value is tianon/latex
. It is advised that the image is 'pre-'pulled.
@Arxisos created snippets for LaTeX binaries in docker, and @lippertmarkus had another short description on how to use Docker with LaTeX Workshop.
You can set up the advanced configuration of Docker through environment variables with the env
property of each recipe.
With the Docker support, compiling subfiles with the subfiles
package does not work. We recommend you to use Remote - Containers, which works well.
Starting with 1.35.0, VS Code supports WSL through Remote - WSL. LaTeX Workshop works well with the extension.