Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MathJax): Add support for MathJax extension, e.g. physics package #1663

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions _includes/js-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
<script>
/* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */
MathJax = {
/* load package */
loader: {load: ['[tex]/physics']},
/* More extensions can be found: https://docs.mathjax.org/en/latest/input/tex/extensions/index.html*/
tex: {
/* start/end delimiter pairs for in-line math */
inlineMath: [
Expand All @@ -86,6 +89,8 @@
['$$', '$$'],
['\\[', '\\]']
],
/* load package */
packages: {'[+]': ['physics']},
/* equation numbering */
tags: 'ams'
}
Expand Down
6 changes: 6 additions & 0 deletions _posts/2019-08-08-text-and-typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are

$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$

We can also use the physics package in MathJax to render mathematical expressions:

$$
i G_{\alpha\beta}(\vb{x}t,\vb{x}'t') = \frac{\mel{\Psi_0}{\hat{\mathsf{T}}[\hat{\psi}_{H\alpha}(\vb{x}t)\hat{\psi}_{H\beta}^\dagger(\vb{x}'t')]}{\Psi_0}}{\braket{\Psi_0}{\Psi_0}}
$$

## Mermaid SVG

```mermaid
Expand Down
Loading