Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

jrandolf/codemirror-latex-hint

Repository files navigation

This hinter is no longer required in CodeMirror 6. Please see lezer-tex for a grammar plugin for CodeMirror 6. Since CodeMirror 6 is in beta, this repository is deprecated.

LaTeX Snippet Hinter for CodeMirror

This is a hinter function for use with CodeMirror's showHint.js plugin. This is based on TeXStudio's autocompletion mechanism.

Features

Pressing tab allows users to move to the next argument of a macro. It also highlights user input in the list of matched hints.

Installation

npm install codemirror-latex-hint codemirror

To Use

import LaTeXHint from "codemirror-latex-hint";
import macros from "codemirror-latex-hint/lib/macros.json";
import "codemirror-latex-hint/lib/index.css";

CodeMirror.registerHelper("hint", "stex", (cm) => LaTeXHint(cm, macros));

Customization

The list of macros in the package contains all MathJaX macros and environments. You can import your own list of macros (with the format given in macros.json) rather than the packaged one.

About

A hinter with snippeting for CodeMirror

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published