Giter Club home page Giter Club logo

github-mathjax's Introduction

MathJax Plugin for Github (Chrome extesion)

This extension adds support for displaying LaTeX equations in GitHub repositories, rendering them with the open source MathJax library. For example, if you had it install you would see the following lovely equation: $e^{i \pi} + 1 = 0$

Right-Click on an equation to show MathJax's context menu with additional options, e.g. "Scale All Math..." to instantly scale all equations on a page, "TeX commands" to see the source TeX equation etc.

The extension is published under New BSD License with the source code available here. This extension is based on the wonderful wiki_mathjax extension by Boris Gromov, and its license is included as part of LICENSE.md in this repository.

For bug reports and feature requests, please use Issue tracker.

INSTALLATION:

Official release available at Chrome Web Store.

github-mathjax's People

Contributors

bgromov avatar orsharir avatar pkra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-mathjax's Issues

Incompatible with octotree

This extension is not compatible with the chrome extension octotree. The octotree provide a easy-to-navigate code tree and when I use octotree to switch between files, the math equations are not rendered.

Cannot show the math equation now.

Hi there,

Previously, I added the chrome extension "MathJax PlugIn for GitHub" and the math equations showed correctly. But for now, the equation can not be shown in the correct view after the first one. For example, I wrote “$\beta$ and $\alpha$” and it showed the correct beta symbol but $\alpha$. I am not sure what is the wrong of this issue.

Thank you very much for your help.
Xuewei

Missing or unrecognized delimiter for \left

Missing or unrecognized delimiter for \left .

For example,
$$
\phi_2(x,y)=\left{
\begin{array}{11}
1 & \textrm{if x contains 'stock' and y is 'sport'}\
0 & \textrm{otherwise}
\end{array}
\right..
$$

Alternative to \cancel

Hi, I am compiling a list of all the render errors i am experiencing with the extension gist. Do you know of any alternative to \cancel that could be rendered?

Please develop a counterpart in safari

I heard that the safari updated their extension system so it’s much easier now to transfer a chrome extension to safari platform so it won't waste you too much time I think

Equations processing on preview tab

I found it very uncomfortable that when you edit a markdown on a github, the equations previews are not processed by the extension, so you have to commit each time to look at the result. Is it possible to add this task to your backlog?

Opt-out for some file types

Scala's diffs are a mess with the plugin: when you have an interpolated srting, it is likely to have some $s in it, and those are treated as \LaTeX which is a bit strange in the context.

Is there a way to suppress MathJax processing for specific file types?

Extension support

Hi.
I love this extension but I need extension support for MathJax for example ams libraries. Is there a way to configure chrome extension to use these libraries when processing the math formulas.

Underscore conflict problem (fixed)

It recently happened to me that the plugin would not render some equations involving underscores, probably due to a conflict with GitHub's markdown renderer.

e.g., expressions of the form $\bar{x}_{i'}$ would not be rendered in GitHub issues, while $x_i$ would.

I found out that backslashing the troublesome underscores fixed the problem in this case, as it was suggested for related problems in mathjax/MathJax#329

e.g. $\bar{x}\_{i'}$

Matrix display error

$$ q^{cur} = \begin{bmatrix} 1\\ 1\\ 1\\ 1\\ \end{bmatrix} $$

Should be displayed vertically。
应该竖着显示,而不是横着。

my github page

`{}` escape problem with the plugin

When the mathjax expression is $\{...\}$ format, then the plugin will not render out {}. It requests a double escape format $\\{...\\}$ in order to render out the html content {} .

Can not show Curly brackets

I write it in markdown like $\Omega={\omega_1, ..., \omega_N}$
However, it does not show the curly bracket. Is there any trick?
Thanks in advance.

Problem with <em> block

Some of my equations won't be rendered by MathJax for a very simple reason.

I have the following latex formula:

$$n (D(\alpha^+) - D(\alpha)) 
\geq s_i \underbrace{ \big [ \phi(-A_i^Tw) + \phi^*(\alpha_i) + w^T A_i \alpha_i \big ] }_{ \textrm{Fenchel gap}} + s_i \bigg ( \frac{\gamma(1-s_i)}{2} - \frac{s_i \|A_i\|^2_{D\rightarrow D'} }{2 \lambda n} \bigg ) \| \beta_i - \alpha_i \|^2_D$$

It first gets rendered by Github Markdown creating the following HTML code

<p>
    $$n (D(\alpha^+) - D(\alpha)) \geq s_i \underbrace{ \big [ \phi(-A_i^Tw) + \phi^*(\alpha_i) + w^T A_i \alpha_i \big ] }
    <em>
        { \textrm{Fenchel gap}} + s_i \bigg ( \frac{\gamma(1-s_i)}{2} - \frac{s_i |A_i|^2
    </em>
    {D\rightarrow D'} }{2 \lambda n} \bigg ) | \beta_i - \alpha_i |^2_D$$
</p>

MathJax is then unable to process it because the original code has been broken in two parts by the <em> block. There are probably many more problems created by this separate processing of the markdown first and the latex code second. Any idea for a workaround?

Unable to render formula

This latex is correct

$$
\underbrace{E[Y_i|D_i=1]- E[Y_i|D_i=0]}_\text{Observed difference in average health} = 
\underbrace{E[Y_{1i}|D_i=1]- E[Y_{0i}|D_i=1]}_\text{Average treatment effect on the treated} + 
\underbrace{E[Y_{0i}|D_i=1]- E[Y_{0i}|D_i=0]}_\text{Selection Bias}
$$

Yet to make it work here in github, I must escape _\ to \_\

$$
\underbrace{E[Y_i|D_i=1]- E[Y_i|D_i=0]}\_\text{Observed difference in average health} = 
\underbrace{E[Y_{1i}|D_i=1]- E[Y_{0i}|D_i=1]}\_\text{Average treatment effect on the treated} +
\underbrace{E[Y_{0i}|D_i=1]- E[Y_{0i}|D_i=0]}\_\text{Selection Bias}
$$

After escaping the underscores it does work
$$
\underbrace{E[Y_i|D_i=1]- E[Y_i|D_i=0]}_\text{Observed difference in average health} = \underbrace{E[Y_{1i}|D_i=1]- E[Y_{0i}|D_i=1]}_\text{Average treatment effect on the treated} + \underbrace{E[Y_{0i}|_i=1]- E[_{0i}|_i=0]}_\text{Selection Bias}
$$

Any idea if this can be resolved as it appears to be similar in root cause to the issue when trying to render this

$$
\begin{aligned}
Y_i &= \left \{
\begin{array}{ll}
Y_{1i} & \text{if } D_i = 1 \\  
Y_{0i} & \text{if } D_i = 0 \\   
\end{array} 
\right. \\
&= Y_{0i} + (Y_{1i} - Y_{0i})D_{i*}
\end{aligned}
$$

Resulting in this error
$$
\begin{aligned}
Y_i &= \left {
\begin{array}{ll}
Y_{1i} & \text{if } D_i = 1 \
Y_{0i} & \text{if } D_i = 0 \
\end{array}
\right. \
&= Y_{0i} + (Y_{1i} - Y_{0i})D_{i*}
\end{aligned}
$$

Change the latex like this

$$
\begin{align}
Y_i &= \left \\{
\begin{array}{ll}
Y_{1i} & \text{if } D_i = 1 \\\\
Y_{0i} & \text{if } D_i = 0 \\\\
\end{array} 
\right. \\\\
&= Y_{0i} + (Y_{1i} - Y_{0i})D_{i*}
\end{align}
$$

Amending the original \{ to \\{ and the \\ to \\\\ resolves the issue

$$ \begin{align} Y_i &= \left \{ \begin{array}{ll} Y_{1i} & \text{if } D_i = 1 \\\ Y_{0i} & \text{if } D_i = 0 \\\ \end{array} \right. \\\ &= Y_{0i} + (Y_{1i} - Y_{0i})D_{i*} \end{align} $$

Mathjax correctly renders the latex and I can extract it for use elsewhere.

With thanks

Doesn't render in gists

Sometimes it would be nice to render LaTeX in gists. Currently it doesn't work (at least for me).

Is equation reference possible?

Thanks for the awesome extension. It make me quite convenient to write math in issues and other places on Github. However, I tested that equation reference is not correctly rendered. As an example:

In equation \eqref{eq:sample}, we find the value of an
interesting integral:

\begin{equation}
\int_0^\infty \frac{x^3}{e^x-1},dx = \frac{\pi^4}{15}
\label{eq:sample}
\end{equation}

I don't know if it's a bug or not supported feature.

Do the same for Firefox?

Well, everything is in the title: could you (try to) do a Firefox version of this extension? It seems interesting and well designed, but only for Chrome! 🦊 !

Could not load extension icon 'icon16.png'

I am trying to install the package from the Chrome Web Store, and I am getting the following error:

Package is invalid. Details: 'Could not load extension icon 'icon16.png'.'.

System: macOS High Serra 10.13.6
browser: Google Chrome Version 70.0.3538.77

This formula is not rendered

$\min _\Theta \sum {r\left(s, o\right)\in \Omega } \log(1+exp(-Y{rso}\phi (s,r, o; \Theta)) + \lambda\left | \Theta \right |_2^2 $

The formula is not rendered in my Github, but it renders well locally.

It seems that the formula is not rendered when there are images inserted in the markdown documents.

image

Multiple label definition

Hi @orsharir, I have an issue when I add the command \label{} to the environment equation.
In details when I create an equation as follows, I retrive the error Label 'eq:test' multiply defined.

\begin{equation}
\label{eq:test}
sin^2(x) + cos^2(x) = 1
\end{equation}

\begin{equation}
\label{eq:test}
sin^2(x) + cos^2(x) = 1
\end{equation}

Unfortunately, I notice that the problem happens when the equation is cited by using the command \eqref{} e.g. \eqref{eq:test}
Do you know why this is happening? Do you have any suggestions to fix the problem?

Many formulas are not rendered

$$J(\theta_0, \theta_1) = \dfrac {1}{2m} \displaystyle \sum {i=1}^m \left ( \hat{y}{i}- y_{i} \right)^2 = \dfrac {1}{2m} \displaystyle \sum {i=1}^m \left (h\theta (x_{i}) - y_{i} \right)^2$$

This formula could not be rendered in the following link, and there are much more formulas could not be rendered like this, although it can be rendered in this issue post.
https://github.com/scruel/ML-AndrewNg-Notes/blob/master/notes/week1.md#22-%E6%8D%9F%E5%A4%B1%E5%87%BD%E6%95%B0cost-function

snipaste20180107_200058

$ h_\theta(x) \geqslant 0.5 $
shows error "Undefined control sequence \geqslant"

Does not render after new/updated comment

After submitting a new comment, or updating a present one, the extension does not render the new / updated content.

As always, use refresh as a temporary workaround.

Failure to render inline equations in some cases

I can't seem to work out what might be causing this problem, but I can post a snippet of a .md file from one of my private repositories which fails to render correctly, despite having no issues in "enhanced" markdown editors like Remarkable.

* `Surface` class defining a cubic B-Spline surface on the $[0,1]$ interval.
    * $\mathbf{s}(u,v)$, partial derivatives $\mathbf{s}_{u,v,uu,uv,vv}(u,v)$ are self-explanatory, as is the surface normal $\mathbf{N}(u,v)$ and its partial derivatives $\mathbf{N}_{u,v}(u,v)$.
  • Surface class defining a cubic B-Spline surface on the $[0,1]$ interval.
    • $\mathbf{s}(u,v)$, partial derivatives $\mathbf{s}{u,v,uu,uv,vv}(u,v)$ are self-explanatory, as is the surface normal $\mathbf{N}(u,v)$ and its partial derivatives $\mathbf{N}{u,v}(u,v)$.

This bug also seems to be present in the Chrome extensions "BitBucket with MathJax" and "Math Anywhere" and I've already reported it to their trackers here and here respectively.

How do you install github with mathjax?

I have added github with mathjax to chrome.
The instruction says: Right-Click on equation to show MathJax's context menu with additional options, e.g. "Scale All Math..." to instantly scale all equations on a page, "TeX commands" to see the source TeX equation etc.
But nothing show up when I right click the equation.
And there is no change at all at the preview

Does it need any extra installation?

Subscription with parentheses does not render

\mathcal{L}_D\left(\theta_D \mid W\right) does work well but \mathcal{L}{D}\left(\theta{D} \mid W\right), the only different part is _D or _{D}

image

the console reported this error:

Refused to load the font 'data:font/woff;base64,d09GRgABAAAAAGVUABEAAAAAxuQAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABgAAAAC4AAAA0ArgC7UdQT1MAAAGwAAAQ6AAALgxKsqRTR1NVQgAAEpgAAAH3AAAELqI5y+RPUy8yAAAUkAAAAE8AAABgaGyBu2NtYXAAABTgAAABlAAAAkQkRATXY3Z0IAAAFnQAAABeAAAAugDsQf1mcGdtAAAW1AAABZcAAAvNb3/BHGdhc3AAABxsAAAACAAAAAgAAAAQZ2x5ZgAAHHQAAEApAAB3CtbiupxoZWFkAABcoAAAADYAAAA2BkubWWhoZWEAAFzYAAAAIAAAACQHFARfaG10eAAAXPgAAAI6AAAEEk4TN4Nsb2NhAABfNAAAAhIAAAISiLhpam1heHAAAGFIAAAAIAAAACACigzgbmFtZQAAYWgAAACUAAABHhQGLdJwb3N0AABh/AAAAq4AAASRk5y6n3ByZ...QxUajCCFt4p9HP4fzdSWs2XhWl5HvJazrIrFUyB0l5dpqcW10lV2wukjMLuAvyMHNiYpgPsrCVXZDKrkpll6UWkh7kABVAFVCDe7UFmxagDegA+hLHRPbqtMo7ZHCpKdT6tPGXybzo0+RXBLoPZt1tELcXxCmAAyZwYTJvdDFZKnDER44X2451rDqCyunIsRWvLSx6wnWqwPj/uX5/KuEy6DL0z6A/Fn79VihxMFJsrlAFy4DpZOcvNlMeNp+BRDLj0r+XFdRxdSNSNxiI/AL3ojKdAAB4AWPw3sFwIihiIyNjX+QGxp0cDBwMyQUbGdictkUwWDAwsDJogTgOPN4c9iz6bMos4iysHFChUDZXJnMWTSZZJrAQt9M+YQYBBh4GTgY2kEZOoJiA0z4GBxiEiDEzuGxUYewIjNjg0BGxkTnFZaMaiLeLo4GBkcWhIzkkAqQkEggceHw5HFkM2VRZJFlYebR2MP5v3cDSu5GJwWUDW9xG1hQXAFAmKZU=' because it violates the following Content Security Policy directive: "font-src github.githubassets.com".


Chrome: 75.0.3770.80
github-mathjax: 0.2.4

newline is ignored.

It seems that newline(\\) is ignored. For example:

$$
x\\
x^2
$$

Actual:

$$ x\\ x^2 $$

Enterprise github support?

Would it be possible to add a settings page that allows additional domains to be added (like github.company-name.com)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.