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

Unable to use cases extension of MathJax #59

Open
raphaelsoul opened this issue Sep 2, 2021 · 6 comments
Open

Unable to use cases extension of MathJax #59

raphaelsoul opened this issue Sep 2, 2021 · 6 comments
Assignees
Labels
bug Something isn't working verified This issue was already verified

Comments

@raphaelsoul
Copy link

see https://docs.mathjax.org/en/latest/input/tex/extensions/cases.html

$$
\require{cases}
\begin{cases}
\text{if true} [] \\
\text{if false} []
\end{cases}
$$

this will not be compiled

@jeffreytse jeffreytse self-assigned this Sep 3, 2021
@jeffreytse jeffreytse added the help wanted Extra attention is needed label Sep 3, 2021
@jeffreytse
Copy link
Owner

jeffreytse commented Sep 3, 2021

Hi @raphaelsoul

Thanks for your issue, could you please try to change the mathjax-config according to document? I think it should be the config issue. According to your case, the config should be as below snippet:

jekyll-spaceship:
    mathjax-processor:
    src:
      - https://polyfill.io/v3/polyfill.min.js?features=es6
      - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
    config:
      tex:
        inlineMath:
          - ['$','$']
          - ['\(','\)']
        displayMath:
          - ['$$','$$']
          - ['\[','\]']
        autoload:
          cases:
            - []
            - ['numcases', 'subnumcases']
      svg:
        fontCache: 'global'

Thanks and Regards

@jeffreytse
Copy link
Owner

Hi @raphaelsoul

Has your issue been settled down? Don't hesitate to let me know if you were still stuck.

Thanks and Regards

@raphaelsoul
Copy link
Author

Hi @raphaelsoul

Has your issue been settled down? Don't hesitate to let me know if you were still stuck.

Thanks and Regards

sorry not working. See detail here
https://github.com/raphaelsoul/process/blob/master/_posts/2021-09-11-test-mathjax.markdown
http://www.geilcode.com/process/jekyll/update/2021/09/11/test-mathjax.html

@jeffreytse jeffreytse added bug Something isn't working verified This issue was already verified and removed help wanted Extra attention is needed labels Sep 22, 2021
@jeffreytse jeffreytse changed the title how to use cases extension of MathJax Unable to use cases extension of MathJax Sep 22, 2021
@jeffreytse
Copy link
Owner

jeffreytse commented Sep 22, 2021

Hi @raphaelsoul

Thanks for your patience, actually, this is a bug that it can not handle multiline Mathjax expression, and it has been addressed and fixed. Please update your plugin to the latest version with below code snippet:

# Use this in your Gemfile
gem 'jekyll-spaceship', git: 'https://github.com/jeffreytse/jekyll-spaceship'

After updating your plugin, you can use the below example to test:

$$
\begin{cases}
\text{if true}\ foo \\
\text{if false}\ bar
\end{cases}
$$

Welcome to star this project for further updates in the future. Also, hope you have a good day! : )

Thanks and Regards

@CharlieBailly
Copy link

Hi, thanks for your job @jeffreytse !
I'm using jekyll-spaceship with jekyll chirpy, and a similar issue happens to me.
However, I managed to solve it by ending each line with a double space, for example only this works for me:

$$  
\begin{cases}  
\text{if true}\ foo \\  
\text{if false}\ bar  
\end{cases}  
$$  

@ksyu0508
Copy link

@CharlieBailly

Your spacing method works for me!

I have similar problem in using multiline, and found that line break placed immediately after \\ cause the issue.
Indentation doens't help, but adding one space after '\' or writing in one line works correctly.

$$
\begin{cases}
\text{if true}\ foo \\
\text{if false}\ bar
\end{cases}
$$

$$
\begin{cases}
    \text{if true}\ foo \\
    \text{if false}\ bar
\end{cases}
$$

$$
\begin{cases}
\text{if true}\ foo \\ 
\text{if false}\ bar
\end{cases}
$$

$$
\begin{cases}
\text{if true}\ foo \\ \text{if false}\ bar
\end{cases}
$$

스크린샷 2023-07-25 175936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working verified This issue was already verified
Projects
None yet
Development

No branches or pull requests

4 participants