vscode-math-to-image

授权协议 MIT License
开发语言
所属分类 企业应用、 LaTeX排版系统
软件类型 开源软件
地区 不详
投 递 者 范侯林
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Math » Image

�� We can help you render LaTeX math equations in any Markdown file!

This is a VS Code extension to help you convert a standard LaTeX math equation like $E=mc^2$ to an image like (remote) or a local SVG which can be embedded inside Markdown files or websites that doesn't support rendering LaTeX yet. (That's you GitHub!)

Read more about Math to Image here:

Table of Contents

Demo

Features

There 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 remotely

This 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 Gaussian Normal Distribution...

$$
P(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{\frac{-(x-\mu)^2}{2\sigma^2}}
$$

... to a rendered image tag with the help of GitHub's math rendering server:

<div align="center"><img style="background: white;" src="https://render.githubusercontent.com/render/math?math=P(x)%20%3D%20%5Cfrac%7B1%7D%7B%5Csigma%5Csqrt%7B2%5Cpi%7D%7D%20e%5E%7B%5Cfrac%7B-(x-%5Cmu)%5E2%7D%7B2%5Csigma%5E2%7D%7D"></div>

In addition to GitHub's rendering server, we also newly added support for CodeCogs' rendering server:

<div align="center"><img style="background: white;" src="https://latex.codecogs.com/svg.latex?P(x)%20%3D%20%5Cfrac%7B1%7D%7B%5Csigma%5Csqrt%7B2%5Cpi%7D%7D%20e%5E%7B%5Cfrac%7B-(x-%5Cmu)%5E2%7D%7B2%5Csigma%5E2%7D%7D"></div>

Rendering locally

Not 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:

$$
P(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{\frac{-(x-\mu)^2}{2\sigma^2}}
$$

To a local SVG like: svg/e40qQ5G9jw.svg, which will be saved to a dedicate folder called svg, and sourced inside the Markdown file that requires math-embedding.

�� NOTE: There used to be a demo SVG here, but Visual Studio Marketplace won't allow us to add local SVGs inside their README.

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 Settings

You 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 Log

For version updates and bug fixes, please see: CHANGELOG.


�� Math » Image © TeamMeow. Released under the MIT License.

Authored and maintained by TeamMeow members.

�� We build things that go "meow" · @GitHub · @Members

  • 我在VisualStudio2013中运行python2.7。该代码曾经在Spyder中正常工作, 但是当我运行时: import numpy as np import scipy as sp import math as mt import matplotlib.pyplot as plt import Image import random # (0, 1) is N SCALE = 2.26

  • Posted on 2019-10-24 by howardlau 目录 [隐藏] 1 编译调试版 Linux 内核 1.1 Ubuntu 1.2 CentOS 1.3 Fedora 2 制作 initramfs 3 启动内核并调试 4 配置 VSCode 4.1 .vscode/c_cpp_properties.json 4.2 .vscode/tasks.json 4.3 .vscode/la

  • vscode常用快捷键 1.格式化(使代码格式变标准):shift+alt+f 2.移动代码:Alt+up/alt+down 3.快速复制一行:shift+alt+up/shift+alt+down 4.快速替换:ctrl+h html5基础骨架标签 1.<html> 2.<body> 3.<head> 4.<title> 5.<meta> 标题标签 <h1>-<h6>(大-小) 快捷生成1-6:

  • 精选!必备的 VSCode 插件 1、Chinese Language 简体中文汉化插件,和我一样英文不好的童鞋可以安装这个插件进行汉化。这个插件重载之后还没有汉化成功的话,把编辑器关闭重新打开就行了。 2、vscode-icons 让 vscode 资源树目录加上图标,有利于我们进行文件格式的判断。 3、HTML Boilerplate 通过使用 HTML 模版插件,你就摆脱了为 HTML 新文

  • vscode.workspace是 VS Code 中的一个命名空间,提供了一组与当前工作空间相关的 API。 可通过以下方式使用: 1. 获取当前工作空间的根文件夹路径 const rootPath = vscode.workspace.rootPath; 2. 获取当前所有已打开的编辑器对象 const textEditors = vscode.workspace.textEditors; 3

 相关资料
  • Attribute Name Type Required Default Description equation string Yes n/a the equation to execute format string No n/a the format of the result (sprintf) var numeric Yes n/a equation variable value ass

  • 在这一章,我们主要针对一些leetcode中出现的数学问题给出解析.这种问题一般都比较直接,但要求的是有一些数学功底.

  • Note: Functions taking Tensor arguments can also take anything accepted by tf.convert_to_tensor. Contents Math Arithmetic Operators tf.add(x, y, name=None) tf.sub(x, y, name=None) tf.mul(x, y, name=No

  • math – 数学函数 math 模块提供了对 C 标准定义的数学函数的访问。 注意:本模块需要带有硬件 FPU,精度是32位,这个模块需要浮点功能支持。 常数 math.e 自然对数的底数。 示例: >>>import math >>>print(math.e) 2.718282 math.pi 圆周长与直径的比值。 示例: >>> print(math.pi) 3.141593 函数 math

  • math对象为您提供数学常量和函数的属性和方法。 与其他全局对象不同, Math不是构造函数。 Math所有属性和方法都是静态的,可以使用Math作为对象来调用而不创建它。 因此,您将常量pi称为Math.PI ,并将sine函数称为Math.sin(x) ,其中x是方法的参数。 语法 (Syntax) 调用Math的属性和方法的语法如下 var pi_val = Math.PI; var sin

  • JavaScript的Math对象为数学常量和函数提供了属性和方法。 与其他全局对象不同, Math不是构造函数。 Math所有属性和方法都是静态的,可以使用Math作为对象来调用而不创建它。 因此,您将常量pi称为Math.PI ,并将正弦函数称为Math.sin(x) ,其中x是方法的参数。 我们可以在CoffeeScript代码中使用JavaScript的Math对象来执行数学运算。 数学常