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

Math in marginnote (and change of MathJax id) #36

Closed
ekstroem opened this issue Mar 9, 2016 · 7 comments
Closed

Math in marginnote (and change of MathJax id) #36

ekstroem opened this issue Mar 9, 2016 · 7 comments

Comments

@ekstroem
Copy link

ekstroem commented Mar 9, 2016

Hi.

This may just be a liquid problem (or rather a user problem of not understanding the liquid tags) but I'd like to add a wee bit of inline math to a margin note with the following code

{% marginnote 'ID9' 'Yada yada yada. A {% m %} X^2 {% em %} test for this table yada yada yada' %}

However, that results in an error

Liquid Exception: Unmatched double quote:

and I'm guessing that I cannot nest liquid tags inside one another.

One option is to change the math start and end tags to $ (for inline) and $$ (for block) as is possible with other configurations of MathJax. Would doing that break a lot of things (and if no: can anyone point me in the right direction for this)?

@clayh53
Copy link
Owner

clayh53 commented Mar 9, 2016

let me look into it. The issue may be a 'tags within tags' thing. But if we can just use the default '$' and '$$' tags that are baked into Mathjax, that may be the way to go.

On Mar 9, 2016, at 10:44 AM, Claus Ekstrøm notifications@github.com wrote:

Hi.

This may just be a liquid problem (or rather a user problem of not understanding the liquid tags) but I'd like to add a wee bit of inline math to a margin note with the following code

{% marginnote 'ID9' 'Yada yada yada. A {% m %} X^2 {% em %} test for this table yada yada yada' %}
However, that results in an error

Liquid Exception: Unmatched double quote:

and I'm guessing that I cannot nest liquid tags inside one another.

One option is to change the math start and end tags to $ (for inline) and $$ (for block) as is possible with other configurations of MathJax. Would doing that break a lot of things (and if no: can anyone point me in the right direction for this)?


Reply to this email directly or view it on GitHub.

@ghost
Copy link

ghost commented Mar 10, 2016

So I hadn't looked into this before, but now that I do, it turns out Jekyll's default Markdown renderer has built-in MathJax support http://kramdown.gettalong.org/math_engine/mathjax.html

So @ekstroem either of these snippets work great!

{% marginnote 'ID9' 'Yada yada yada. A $$X^2$$ test for this table yada yada yada' %}
{% marginnote 'ID9' 'Yada yada yada. A \\(X^2\\) test for this table yada yada yada' %}

@clayh53 Apparently there is no need for the mathjaxtag.rb plugin.

So using $ and $$ for equations is easy to setup by how you load mathjax into the page. See http://docs.mathjax.org/en/latest/start.html#tex-and-latex-input

@clayh53
Copy link
Owner

clayh53 commented Mar 10, 2016

Oh, snap! I do remember reading some documentation about Kramdown having this ability. That makes it easy!

On Mar 10, 2016, at 4:04 AM, Nick notifications@github.com wrote:

So I hadn't looked into this before, but now that I do, it turns out Jekyll's default Markdown renderer has built-in MathJax support http://kramdown.gettalong.org/math_engine/mathjax.html

So @ekstroem either of these snippets work great!

{% marginnote 'ID9' 'Yada yada yada. A $X^2$ test for this table yada yada yada' %}
{% marginnote 'ID9' 'Yada yada yada. A (X^2) test for this table yada yada yada' %}
@clayh53 There is no need for the mathjaxtag.rb plugin! Using $ and $$ for equations is easy to setup by how you load mathjax into the page. See http://docs.mathjax.org/en/latest/start.html#tex-and-latex-input


Reply to this email directly or view it on GitHub.

@ekstroem
Copy link
Author

Great! I can confirm that

{% marginnote 'ID9' 'Yada yada yada. A $X^2$ test for this table yada yada yada' %}

works. I previously had some problems with $ signs in the main text (in the sense that they were rendered as dollar signs and not starting/ending math blocks) - I'll try to see if I can reproduce this. In any case: this works!

Cheers

@ghost
Copy link

ghost commented Mar 10, 2016

Using $ for inline equations is disabled by default in mathjax See #38 for how to enable it.

@ekstroem
Copy link
Author

Hmm. It works out of the box here at my end (what I really mean is that I cannot remember what I've tinkered with previously but I cannot see a change like fix #38 anywhere. In any case there's a good solution, and I'm happy :)

@ghost
Copy link

ghost commented Mar 11, 2016

Ok cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants