/latex-workspace-template

LaTeX Workspace Template for VSCode

Primary LanguagePerl

LaTeX Workspace Template

This template is VSCode Workspace for LaTeX installed with TeXLive.

Environment

The operation was confirmed in the following environments.

Ubuntu

Windows Subsystem for Linux, WSL2

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Windows

  • Edition: Windows 10 Pro
  • Version: 21H2

How to start LaTeX

  1. Install Visual Studio Code (VSCode).
  2. Install VSCode-extention: LaTeX Workshop.
  3. Run bash setup/setup.sh (WSL-Ubuntu or other Linux distributions users) or powershell setup\setup.ps1 (Windows users)

How to use for multi file projects

Add Magic comment to the first line of TeX files as follows.

% !TEX root = main.tex

How to add TeX-packages or style Files

Edit .vscode/settings.json and add the packages or style files settings. For example, when you use style/ directory for style files, add "-e", "$ENV{'TEXINPUTS'}='../style//;' . $ENV{'TEXINPUTS'}", as follows. ../style/ is the relative path from the TeX file which you compile.

"latex-workshop.latex.tools": [
    {
        "name": "latexmk",
        "command": "latexmk",
        "args": [
            "-silent",
            "-outdir=%OUTDIR%",
            // when TEXINPUTS is requrired
            "-e",
            "$ENV{'TEXINPUTS'}='../style//;' . $ENV{'TEXINPUTS'}",
            "%DOC%",
        ],
    },

Useful TeX-Package Repositories for this workspace template

How to clone submodules

git submodule add <Submodule Repository URL>
git commit

How to clone repositories with submodule

git clone <Main Repository URL>
git submodule update --init

or

git clone <Main Repository URL> --recursive

References