Code to latex aims to allow users to visualize their math-dense code with latex notation
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:
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",
}
This extension also allows visualizing n-d matrices
You can use the command "Line to Latex" when your cursor is over the line you want to convert