This is a VS Code extension to help you convert a standard LaTeX math equation like Read more about -
**少数派：**不支持 LaTeX 也能插入数学公式，这个小插件帮你实现「徒手渲染」。 -
**Medium:**VS Code Math to Image: Write LaTeX Math Equations in GitHub Markdown the Easy Way!
## Table of Contents## Demo## FeaturesThere are two modes in which we will render your math equations in Markdown: - Locally (with MathJax and sourcing relative SVG), and...
- Remotely (with GitHub's LaTeX rendering server).
## Rendering remotelyThis is actually a hack. GitHub won't render LaTeX equations inside normal places like GitHub README, but it can render them in Jupyter notebooks, so we took advantage of this feature, utilizing GitHub's equation rendering server to embed SVG equations in GitHub. (See here for details: A hack for showing LaTeX formulas in GitHub markdown.) Basically we can convert a standard LaTeX math equation like the
... to a rendered image tag with the help of GitHub's math rendering server:
In addition to GitHub's rendering server, we also newly added support for CodeCogs' rendering server:
## Rendering locallyNot everywhere accept external SVGs. To circumvent this type of scenario, we can render math equations directly to local SVGs (with MathJax), and embed these local SVGs into our Markdown as a workaround. We can convert the same LaTeX math equation:
To a local SVG like:
If you are reading this on GitHub, you can see that both of these methods work when we need to add math equations to READMEs or other Markdown files on GitHub. See examples for more math equation rendering scenarios, i.e, inline math, aligned environments... ## Extension SettingsYou can specify the path to save the locally rendered SVG image. The settings are self-explanatory. **vscode-math-to-image.svgSavePath**:`Current file directory` : Generated SVG files will be put in a folder under current file's directory.`Current workspace directory` : Generated SVG files will be put in a folder under current workspace directory.
**vscode-math-to-image.remoteRenderEngine**:`GitHub` : Equations will be rendered with GitHub's rendering engine remotely.`CodeCogs` : Equations will be rendered with CodeCogs' rendering engine remotely.
**vscode-math-to-image.inlineSvgStyle**: Optional style for rendered inline SVG equations. Defaults to`transform: translateY(0.1em); background: white;` .**vscode-math-to-image.displaySvgStyle**: Optional style for rendered display SVG equations. Defaults to`background: white;` .
## Change LogFor version updates and bug fixes, please see: CHANGELOG. 📐 Authored and maintained by TeamMeow members. |