Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>code-to-latexNew to Visual Studio Code? Get it now.
code-to-latex

code-to-latex

Pharadas

|
268 installs
| (1) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Code to latex aims to allow users to visualize their math-dense code with latex notation image

It can use user-defined functions and variables which when recognized will be converted into the given latex notation Recognized functions should be added into the workspace's settings.json

E.g:

"code_to_latex.custom_functions": {
  "abs 1": "|$1|",
  "sqrt 1": "\\sqrt{$1}",
  "multiply 2": "(\\overrightarrow{$1}\\cdot\\overrightarrow{$2})",
  "cross 2": "(\\overrightarrow{$1}\\times\\overrightarrow{$2})",
}

This will evaluate any functions named cross with 2 paramaters as input into:

image

Given a variable, it will convert any matching variable token into the appropriate latex form E.g: (These are predefined)

"code_to_latex.custom_variables": {
  "theta": "\\theta",
  "pi": "\\pi",
  "phi": "\\phi",
  "alpha": "\\alpha",
  "nu": "\\nu",
  "beta": "\\beta",
  "xi": "\\xi",
  "Xi": "\\Xi",
  "gamma": "\\gamma",
  "Gamma": "\\Gamma",
  "delta": "\\delta",
  "Delta": "\\Delta",
  "Pi": "\\Pi",
  "epsilon": "\\epsilon",
  "varepsilon": "\\varepsilon",
  "rho": "\\rho",
  "varrho": "\\varrho",
  "zeta": "\\zeta",
  "sigma": "\\sigma",
  "Sigma": "\\Sigma",
  "eta": "\\eta",
  "tau": "\\tau",
  "vartheta": "\\vartheta",
  "upsilon": "\\upsilon",
  "iota": "\\iota",
  "varphi": "\\varphi",
  "kappa": "\\kappa",
  "chi": "\\chi",
  "psi": "\\psi",
  "mu": "\\mu",
  "omega": "\\omega",
  "Omega": "\\Omega",
}

image

image

This extension also allows visualizing n-d matrices

image

image

You can use the command "Line to Latex" when your cursor is over the line you want to convert

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft