latex-command-finder
Shows the LaTeX command for a Unicode character on hover.
Hovering over → gives "→ — LaTeX: \rightarrow or \to"; hovering over
ℝ gives "ℝ — LaTeX: \mathbb{R} · Requires amssymb". (Package
requirements are a toggleable setting). Works in any file, so it's handy for
Rocq/Coq (.v), Lean, Agda, Markdown, or plain notes full of math symbols.
Unlike input-method tables (e.g. Lean's \all → ∀), this reports the LaTeX command
(\forall), falling back to the unicode-math command
(tagged (unicode-math)) when no classic command exists.
Settings
| Setting |
Default |
Description |
latex-command-finder.languages |
["*"] |
Language ids to enable hover for. * = all files. e.g. ["coq", "lean4", "markdown"]. |
latex-command-finder.showAliases |
true |
Also show equivalent commands (e.g. \to for →). |
latex-command-finder.showRequires |
true |
Show the package a command needs (e.g. amssymb). |
Development
npm install
npm run build # bundle to dist/extension.js (esbuild)
npm run compile # type-check only
Press F5 to launch the Extension Development Host, then hover a Unicode symbol.
Regenerating the symbol table
src/latex-symbols.json is generated from data/unimathsymbols.txt:
npm run build:data
Credits & licensing
- The symbol data in
data/unimathsymbols.txt is unimathsymbols.txt by Günter Milde,
distributed under the LaTeX Project Public License.
src/latex-symbols.json is a derived reverse map.
- The hover approach is adapted from
vscode-lean4 (Apache-2.0).
This extension is licensed under MIT (see LICENSE).