职贝云数AI新零售门户

标题: 在微信公众号中插入数学公式 [打印本页]

作者: Z2A    时间: 2023-1-5 01:43
标题: 在微信公众号中插入数学公式
1. 阐明
腾讯至今没有在微信公众号原生编辑器中提供公式插入功能。由于微信公众号不支持引入外部 CSS 和 JS 脚本,所以无法引入 MathJax 来支持数学公式显示。处理方案为:运用mpMath阅读器插件可以在微信公众号原生编辑器中嵌入“公式”菜单,从而直接插入 运用 MathJax 渲染的 SVG 格式的 LATEX 公式。
2. 集成了mpMath插件的阅读器(基于Chromium的360极速阅读器)下载
  1. http://peakgrin.cn/~dchen/download/WeChatMath/360chrome-20230101.rar
复制代码
解紧缩后即可运用
3. 插入公式实例
(1) 网页登陆微信公众号,新的创作/写新图文
(2) 点击“音频”和“超链接”之间的“公式/插入公式”,输入:
  1. f\left({x}\right)=w_{1}x_{1}+w_{2}x_{2}+\ldots+w_{d}x_{d}+b
复制代码
效果如下:
f\left({x}\right)=w_{1}x_{1}+w_{2}x_{2}+\ldots+w_{d}x_{d}+b
输入:
  1. \mathbf{X}=\left(
  2. \begin{matrix}
  3. x_{11} & x_{12} & \cdots & x_{1d} & 1 \\
  4. x_{21} & x_{22} & \cdots & x_{2d} & 1 \\
  5. \vdots & \vdots & \ddots & \vdots & \vdots \\
  6. x_{m1} & x_{m2} & \cdots & x_{md} & 1
  7. \end{matrix}
  8. \right)
  9. =
  10. \left(
  11. \begin{matrix}
  12. {x}_{1}^{\rm{T}} & 1 \\
  13. {x}_{2}^{\rm{T}} & 1 \\
  14. \vdots & \vdots \\
  15. {x}_{m}^{\rm{T}} & 1 \\
  16. \end{matrix}
  17. \right)
复制代码
效果如下:
\mathbf{X}=\left( \begin{matrix} x_{11} & x_{12} & \cdots & x_{1d} & 1 \\ x_{21} & x_{22} & \cdots & x_{2d} & 1 \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ x_{m1} & x_{m2} & \cdots & x_{md} & 1 \end{matrix} \right) = \left( \begin{matrix} {x}_{1}^{\rm{T}} & 1 \\ {x}_{2}^{\rm{T}} & 1 \\ \vdots & \vdots \\ {x}_{m}^{\rm{T}} & 1 \\ \end{matrix} \right)
公式编辑器中勾选 “行间公式”,效果如下: \mathbf{X}=\left( \begin{matrix} x_{11} & x_{12} & \cdots & x_{1d} & 1 \\ x_{21} & x_{22} & \cdots & x_{2d} & 1 \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ x_{m1} & x_{m2} & \cdots & x_{md} & 1 \end{matrix} \right) = \left( \begin{matrix} {x}_{1}^{\rm{T}} & 1 \\ {x}_{2}^{\rm{T}} & 1 \\ \vdots & \vdots \\ {x}_{m}^{\rm{T}} & 1 \\ \end{matrix} \right) \\ 带指定编号的行间公式,代码如下:
  1. \begin{equation}\tag{2}
  2. \mathbf{X}=\left(
  3. \begin{matrix}
  4. x_{11} & x_{12} & \cdots & x_{1d} & 1 \\
  5. x_{21} & x_{22} & \cdots & x_{2d} & 1 \\
  6. \vdots & \vdots & \ddots & \vdots & \vdots \\
  7. x_{m1} & x_{m2} & \cdots & x_{md} & 1
  8. \end{matrix}
  9. \right)
  10. =
  11. \left(
  12. \begin{matrix}
  13. {x}_{1}^{\rm{T}} & 1 \\
  14. {x}_{2}^{\rm{T}} & 1 \\
  15. \vdots & \vdots \\
  16. {x}_{m}^{\rm{T}} & 1 \\
  17. \end{matrix}
  18. \right)
  19. \end{equation}
复制代码
效果如下: \begin{equation}\tag{2} \mathbf{X}=\left( \begin{matrix} x_{11} & x_{12} & \cdots & x_{1d} & 1 \\ x_{21} & x_{22} & \cdots & x_{2d} & 1 \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ x_{m1} & x_{m2} & \cdots & x_{md} & 1 \end{matrix} \right) = \left( \begin{matrix} {x}_{1}^{\rm{T}} & 1 \\ {x}_{2}^{\rm{T}} & 1 \\ \vdots & \vdots \\ {x}_{m}^{\rm{T}} & 1 \\ \end{matrix} \right) \end{equation}
原文链接:




欢迎光临 职贝云数AI新零售门户 (https://www.taojin168.com/cloud/) Powered by Discuz! X3.5