
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Embed KaTeX and MathJax in Hexo post/page via tag plugins. Equations are rendered in Hexo (server-side), so browser-side javascript library is not needed and should be removed. CSS stylesheets are included by default but can be easily replaced.
$ npm i hexo-math --save
KaTeX
{% katex '{options}' %}
content
{% endkatex %}
{% katex %}
c = \pm\sqrt{a^2 + b^2}
{% endkatex %}
Override front-matter and global options for a particular content. Options must be specified in JSON format.
{% katex '{ "output": "mathml", "felqn": true, "minRuleThickness": 0.05, "throwOnError": true }' %}
c = \pm\sqrt{a^2 + b^2}
{% endkatex %}
MathJax
{% mathjax '{options}' %}
content
{% endmathjax %}
{% mathjax %}
\frac{1}{x^2-1}
{% endmathjax %}
Override front-matter and global options for a particular content. Options must be specified in JSON format.
{% mathjax '{ "conversion": { "em": 14 }, "tex": { "tags": "ams" }, "svg": { "exFactor": 0.03 } }' %}
\frac{1}{x^2-1}
{% endmathjax %}
Override the global options via the front-matter of an article (post/page) basis.
---
title: On the Electrodynamics of Moving Bodies
categories: Physics
date: 1905-06-30 12:00:00
katex: false
mathjax: false
---
Disable math renderer in an article:
---
katex: false
mathjax: false
---
Override global options:
---
katex:
output: 'mathml'
felqn: true
minRuleThickness: 0.05
throwOnError: true
mathjax:
conversion:
em: 14
tex:
tags: 'ams'
svg:
exFactor: 0.03
---
# _config.yml
math:
katex:
css: 'https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css'
options:
throwOnError: false
mathjax:
css: 'https://cdn.jsdelivr.net/npm/hexo-math@4.0.0/dist/style.css'
options:
conversion:
display: false
tex:
svg:
css: '/css/style.css'
refers to source/css/style.css
or themes/<theme-name>/source/css/style.css
.css: false
) if the installed theme has already included one.
katex:
options:
throwOnError: false
mathjax:
options:
conversion:
display: false
tex:
svg:
Unique options are combined, if there is any duplicate options, argument overrides front-matter, front-matter overrides global options.
Example:
{% katex '{ "output": "html", "felqn": true }' %}
content
{% endkatex %}
# front-matter
---
katex:
output: 'mathml'
minRuleThickness: 0.05
throwOnError: true
---
# _config.yml
math:
katex:
options:
minRuleThickness: 0.03
maxExpand: 900
Following options will be parsed as argument for that specific content:
{
output: 'html',
felqn: true,
minRuleThickness: 0.05,
throwOnError: true,
maxExpand: 900
}
{% %}
.
FAQs
Add KaTeX and MathJax support to Hexo
The npm package hexo-math receives a total of 429 weekly downloads. As such, hexo-math popularity was classified as not popular.
We found that hexo-math demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.