Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
Go to file
2017-03-27 14:03:21 +08:00
.vscode Changes in code for parser movement 2017-01-26 14:27:38 +08:00
src Delete temp files 2017-03-27 14:03:21 +08:00
syntax Rearrange syntax files 2017-03-26 10:05:22 +08:00
viewer Display disconnected info in web page title 2017-03-27 13:13:14 +08:00
.gitignore Update gitignore 2017-01-19 11:04:34 +08:00
.vscodeignore Initial commit 2016-12-26 16:05:30 +08:00
CHANGELOG.md Delete temp files 2017-03-27 14:03:21 +08:00
icon.png A clearer icon 2017-03-26 18:42:01 +08:00
LICENSE.txt Compose a README 2016-12-26 16:22:34 +08:00
package.json (#39) Linting feature 2017-03-27 10:11:08 +08:00
README.md Add some FAQs to readme 2017-03-27 12:14:51 +08:00
tsconfig.json Initial commit 2016-12-26 16:05:30 +08:00

Visual Studio Code LaTeX Workshop Extension

LaTeX Workshop is an extension for Visual Studio Code, aiming to provide all-in-one features and utilities for latex typesetting with Visual Studio Code.

Features

  • Build LaTeX with BibTeX to PDF
  • View PDF on-the-fly (in VSCode or browser)
  • Direct and reverse SyncTex
  • Intellisense
  • Colorize
  • Log parser
  • Linter

Requirements

Installation

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).

Alternatively, you can check out this repository and copy it to the VS Code local extensions folder:

  • Windows %USERPROFILE%\.vscode\extensions
  • Mac/Linux $HOME/.vscode/extensions

Usage

  • Open a .tex file, right click and many features have menu entries there.
  • For reverse SyncTeX from PDF to LaTeX, ctrl/cmd + mouse left click.
  • Alternatively, VS Code commands are provided as follows:
    • latex-workshop.build: Build LaTeX project to PDF using LaTeX toolchain.
    • latex-workshop.view: Open a web browser window to view the PDF file.
    • latex-workshop.tab: Open a VS Code tab to view the PDF file.
    • latex-workshop.synctex: Direct synctex from cursor position.

FAQ

LaTeX toolchain?

LaTeX toolchain refers to a sequence/array of commands which LaTeX Workshop will execute sequentially when building LaTeX projects. It is set in File>Preferences>Settings>latex-workshop.toolchain. By default latexmk is used. For non-perl users, the following texify toolchain may worth a try:

[ "texify --synctex --tex-option=\"-interaction=nonstopmode -file-line-error\" --pdf %DOC%" ]

LaTeX toolchain must always be defined as a JSON array, even if there is only one command to execute. For multiple commands, each one is represented by a string in the array.

The placeholder %DOC% in all strings will be replaced by the quoted LaTeX root file name on-the-fly. Alternatively, you can also set your commands without the placeholds, just like what you may input in a terminal.

Root file?

While it is fine to write all contents in one .tex file, it is possible to split things up for simplicity. For such LaTeX projects, the file with \begin{document} is considered as the root file, which serves as the entry point to the project. LaTeX Workshop intelligently finds the root file when a new document is opened, the active editor is changed, or any LaTeX Workshop command is executed. The extension will follow the below steps to find the root file, terminates whenever one is found:

  • Magic comment: % !TeX root = relative/or/absolute/path/to/root/file.tex. If such comments exist in the currently active editor, the referred file is set as root.
  • Self check. If current active editor contains \begin{document}, it is set as root.
  • Root directory check. LaTeX Workshop iterate through all .tex files in the root folder of the workspace. The first one with \begin{document} is set as root. If no root file is found, most of the features in LaTeX Workshop will not work.

Contributing

  • Fork it.
  • Do something.
  • Pull request.
  • Thank you and have some beer.

License

MIT