Overview
YaTex is a LaTeX and notebook-based extension for VS Code, aiming to streamline the process of creating high-quality formatted PDF documents.
The content of notebooks is composed of YAML and Markdown cells. The YAML cells are used to generate .tex files for building LaTeX documents.
Environment Requirements
-
XeLaTeX compiler for building LaTeX documents
It is strongly recommended to install MikTeX with XeLaTeX compiler. MikTeX will automatically install missing LaTeX packages during the build process.
Quick Start
-
Open the Command Palette (
Cmd+Shift+Pon macOS orCtrl+Shift+Pon Windows and Linux) and run the commandYaTeX: Initialize Workspaceto set up a new YaTeX workspace with sample files. -
Open the Command Palette again and run
YaTeX: Build PDFto compile the LaTeX document and generate a PDF. -
Check the
buildfolder in your workspace for the generated PDF file.
Compose Your Document
-
See the
example.ytxfile generated in the workspace for an example of how to structure your notebook withYAMLandMarkdowncells. -
Add a
.ytxfile under the preferred language folder in thenotebooksfolder. -
Become a composer.
-
Register your
.ytxfile in thesections.ytx, which controls the order of sections of the output document. -
Build the PDF to see the result.
Development
Build & Compile
# Development build (with sourcemap)
npm run compile
# Watch mode (auto-rebuild on file changes)
npm run watch
# Production build (optimized & minified)
npm run package
Publishing to VS Code Marketplace
-
Install VSCE (one-time setup):
npm install -g @vscode/vsce -
Update version in
package.json:- Increment
versionfield (e.g.,0.0.6→0.0.7)
- Increment
-
Publish to the marketplace:
# Automatic patch version bump vsce publish patch # Or specify version explicitly vsce publish 0.0.7 # Major/minor version bumps vsce publish minor # 0.0.6 → 0.1.0 vsce publish major # 0.0.6 → 1.0.0Note: Requires authentication with GitHub/Microsoft account associated with the
BennettHupublisher account. -
Verify the published version at: