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

rendering latex? #6

Open
cbernet opened this issue Feb 5, 2019 · 8 comments
Open

rendering latex? #6

cbernet opened this issue Feb 5, 2019 · 8 comments

Comments

@cbernet
Copy link

cbernet commented Feb 5, 2019

Hello, first of all I'd like to thank you very, very much for this plugin!

Your solution is the only one that seems to work for properly integrating notebooks into blog posts.

But now I'm a bit stuck. I see that all latex math equations are not rendered, please see here:
https://thedatafrog.com/the-logistic-regression/
All maths appear between dollars, as I typed them.

From the code, you're using nbviewer to render the notebook, and I checked that on https://nbviewer.jupyter.org/github/cbernet/maldives/blob/master/one_neuron/logistic_regression_1d.ipynb
the equations are rendered properly.

Would you have an idea of what could be tried to enable the rendering of latex equations?

Any help or pointer would be greatly appreciated, and I will send you a PR if I manage to sort this out.

Cheers!
Colin

@ghandic
Copy link
Owner

ghandic commented Mar 31, 2019

Apologies, I have just gotten around to investigating this. It looks like nbviewer passes the file thorugh mathjax. Adding this into the header will be a quick fix for now.

<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script>

However, it would be better to grab all of the formatting, links etc that nbviewer uses, that way it will be an encapsulated version of nbviewer on your page. Pull requests welcome, I will give it a go if I get around to it.

@ccgarant
Copy link

ccgarant commented Sep 5, 2019

Hi. I also wanted to say thank you, this is definitely the best solution i've seen so far. Adding the code clip into the header did work, but curiously enough the characters in the equation are showing up green. Any way I can fix this, or point me in the right direction. Thanks! See picture below.

Screen Shot 2019-09-04 at 9 34 25 PM

@ghandic
Copy link
Owner

ghandic commented Sep 5, 2019

Hey @ccgarant could you send me a link to the webpage? I'll be able to inspect it then. It seems too be something to do with the css selector

@saenzac
Copy link

saenzac commented Sep 5, 2020

Hi, thanks for the plugin
just to mention that for the inline "$" to work I need to add in the header:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\(","\)"] ],
processEscapes: true
}
});
</script>

There is a fix for the green color problem?
Thanks!

@ghandic
Copy link
Owner

ghandic commented Sep 5, 2020

Hey, this will be a css issue, if you use your browser and right click on it and inspect the element what class does it show on the node? And what css attributes are attributed to it?

@saenzac
Copy link

saenzac commented Sep 5, 2020

Hey, this will be a css issue, if you use your browser and right click on it and inspect the element what class does it show on the node? And what css attributes are attributed to it?

In the following picture the inspection of a latex block, \begin{align}..

image

Thanks!

@ghandic
Copy link
Owner

ghandic commented Sep 6, 2020

Do you have a webpage with it on that I could view to help debug? Would need to see the dev tools in the browser

@saenzac
Copy link

saenzac commented Sep 7, 2020

Do you have a webpage with it on that I could view to help debug? Would need to see the dev tools in the browser

Hello,
This page:
http://www.johsac.com/2020/09/05/test4/

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

4 participants