Closed bsdz closed 1 year ago
Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
@bsdz , thank you for refreshing the package. By using your branch, I can use some of MathJax3 in my jupyterlab.
With the refreshed package, I happen to find \braket{a}
and \braket{a}{b}
are not displayed in proper way like \langle a \mid a \rangle
and \langle a \mid b \rangle
, unfortunately.
\innerproduct{a}{b}
works well as \langle a \mid b \rangle
I'd like to know if such situations are just in my environment. Hopefully, I want to know how we can fix it.
I think the issue is the mathjax core library. For example if I go to mathjax's demo page here and render the following html to compare your variations:
$\require{physics}$
<table>
<tr><th>physics</th><th>verbatim</th></tr>
<tr><td> $\braket{a}$</td><td>$\langle a \mid a \rangle$</td></tr>
<tr><td>$\braket{a}{b}$ </td><td>$\langle a \mid b \rangle$</td></tr>
<tr><td>$\innerproduct{a}{b}$</td><td>$\langle a \mid b \rangle$</td></tr>
</table>
It is rendered as:
tbh I have to admit I prefer the more compact version.
Edit: actually after writing this comment I notice perhaps \braket{a}{b} should be written as \braket{a|b}?
Thank you for analysing my comment.
As MathJax document says
The physics extension implements much of the LaTeX physics package,..
, so the physics extension is slightly different from the original.
~These rendering problems appear in KaTeX-physics as well.~ These renderings work in KaTeX-physics ..
... perhaps \braket{a}{b} should be written as \braket{a|b}?
Yes, it is possible.
I prefer \braket{a}{b}
because \bra{a}
is a dual space of \ket{b}
as in the original document
I'll analyse MathJax code related to Dirac bra-ket notation
Congrats on your first merged pull request in this project! :tada: Thank you for contributing, we are very proud of you! :heart:
This PR is primarily to add the require command so one can import the physics package only if needed.
So the following:
now renders as:
Also add some menu items to allow scaling / resetting scale and copying markdown to clipboard.
And here's how the 1.5 scale vs normal scale looks like:
Apologies in advance if I've missed something important as typescript is not my forte. Admittedly, some of these changes might need additional work to make robust. Happy for suggestions.