-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 math equations? #897
Comments
Also #274 was asking to go in this direction. No chance to have a supported way to render math in github README files? |
I've been doing a little analysis on imsky/PocketEuler#44 One simple and secure approach is to use the small mimetex (code mirrorred at https://github.com/icaoberg/mimetex) , which is a standalone renderrer, not using any other larger binaries like https://packages.debian.org/search?suite=jessie&searchon=names&keywords=mimetex No CVE since 20090713, which a batch of problems was found. See also https://www.debian.org/security/2009/dsa-1917.en.html Another approach is the use the MediaWiki approach, which is also battle tested, of texvccheck/texvc , an OCaml program , which has a small checker program (texvccheck) that checks the AMS-Latex before sending to a second program that using 0 CVE : https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=texvc |
@bkeepers , you closed #274 saying "can't be resolved by a change to the code in this project". So, which project(s) should this feature be added to? Each of the processors? Or a new project to do that math rendering only? Most people are interested in maths in markdown , which is https://github.com/vmg/redcarpet , but they have rejected that feature request : vmg/redcarpet#313 and a smaller version of it vmg/redcarpet#395 RST and docutils supports maths, but this has been disabled #83 asciidoctor supports MathJax (asciidoctor/asciidoctor#492) , but without MathJax JS loaded by github markup it wont work. And there is https://github.com/asciidoctor/asciidoctor-latex mediawiki has Is there a plan? What is the plan? What do you need? How can we help? |
Note related request for MathML : #551 |
Maybe a first step is for Github to treat typical math mode as non-markdown mode, similar to backticks ( Currently Github renders
with the "Let $\text{S}1(N) = \sum{p=1}^N \text{E}(p)$" The same thing happens with |
@bkeepers I have found a stop gap solution a site https://www.codecogs.com/latex/eqneditor.php that generates embedded links with TeX editor that then embeds a gif in GitHub :- double click on the equation to be taken to the editor ;) |
Hey @AaronNGray, that is pretty nifty! |
I'm wondering if the |
It would be very easy to make a similar webapp to codecogs https://www.codecogs.com/latex/eqneditor.php. This would give the security isolation that GitHub needs by having it as a separate web based application. It would be useful to attach persistant URL's to equations and use them for accessing the images and the editor rather than the long URL's codecogs uses. Also codecogs does not support many packages. It does not support the 'semantic' and 'maths-symbols' that I need in order to make this useful and I am sure others will want other packages. https://www.ctan.org/tex-archive/macros/latex/contrib/semantic The following should come out as an inference rule :- and codecogs does not support \usepackage{} |
I am putting together a Node.js solution for this. |
I taught that GitHub originally had MathJax on his pages, later on removed it to make sure everything was nice and responsive. Why would it be so difficult to have a "preview" button that enables mathjax on demand? Wikipedia seems to be doing math, yet maintain responsiveness, just fine! |
+1 |
How about opt-in MathJax on a per-repository basis? General GitHub responsiveness would not be impaired, but simple math would be there for people who need it. |
@allefeld anything really, but removing it cold-turkey creates a big problem. |
A workaround mentioned by @cyhsutw at github-education-resources/classroom#675 (comment) : Another hack is utilizing the Jupyter Notebook. GitHub has built-in support for rendering Here's a sample notebook file: https://gist.github.com/cyhsutw/d5983d166fb70ff651f027b2aa56ee4e |
+1 to this. I am thinking of hosting maths manuscripts on Github, where issues can be discussions about the papers. I'm OK with certain walkarounds mentioned here as long as they work. However in general maths people are not fans of hacky solutions, and without native maths rendering mathematicians are much less likely to use Github. Also, can anyone explain why mathoverflow can do it but not Github? |
@bkeepers is this something we can reasonably expect to be handled at some point, or does it fall in the category nevergonnahappen? Just wondering whether to stay subscribed to this issue. |
I guess the question falls in this category: By the way, this is how I did it: (sorry, I am part both of the classroom thread and the classic github thread) |
@ataiya no, the original question is about README files in regular repositories. The classroom question may be related, but this is about markup rendering on github in general. Hence the repository it was issued to. |
The technique to do this I simple just an embedding of a an image reference Anyone do node.js and/or Angular 2 can you contact me to work on this please ? |
having to embed images would be terrible, as you'd lose the ability to use the Markdown editor to change equations and you'd have to rely on something that might not be any longer supported in the future (external website) |
My solution would store the TeX formulae on the separate site or as Gists or in your repo and render to images that you can click on in the rendered GitHub markdown file taking you to the external site for editing of the TeX equation which updates the image. You could have the top 20, 50 or 100 public equations on the sites home page and support public and private and shared libraries of formulae. |
The most important advantage of markdown, that it can be read in source as well as rendered, is unfortunately lost in the gif approach @AaronNGray. @jayvdb had a very good point in an earlier comment. Even if the maths are not rendered, it would be very helpful to treat something delimited by @bkeepers You've mentioned two years ago that KaTeX was still in its infancy and thus not suitable. It seems they had a couple hundred commits since. Would you mind to comment on it in the light of its recent state? (KaTeX live demo) |
I'd like to add supplement the point @ycpei made because this issue is so important to us. We already use LaTeX extensively in our Issues and Markdown files to discuss algorithms and math. There's no good alternative, but LaTeX is admittedly hard for some users to read. |
If you are using Chrome or Firefox, this may help: It's an unpacked WebExtension loading KaTeX (plus its auto-renderer) on GitHub. |
@jan-matthis Awesome work! It seems to work, mostly (I'll file a bug report). |
Another hack: Pretend that it is supported and refer to this issue (if someone complains that your pages cannot be read properly. |
If you are reading this, consider yourself redirected to www.gitlab.org. |
@kivikakk I understand that GitHub developers are trying to make the best decisions about any new features, but this is important, please reconsider working on finding a way to render LaTeX equations on wiki pages. As a stop-gap solution I'm currently using the GitHub with MathJax Chrome extension. |
BTW, Github already supports math in 2 contexts, so the "security" argument doesn't hold.
P.S. if anyone in GitHub will actually look at implementing this, there is the problem of everybody choosing different syntax for math in markdown :-( I'm collecting known syntaxes in https://github.com/cben/mathdown/wiki/math-in-markdown |
Please do output native text when possible, and not images. Syntax-wise I would suggest the same as math.stackexchange. |
I prefer Gitlab's approach of using:
|
I dislike the the links-to-images option - not easily copyable-editable like Markdown - and would very much like to have even basic math support (such as different font and spacing for symbols, and allowing subscripts and superscripts.) |
I think an officially supported maths plugin in browser would over time would be best solution. The rendering and security problems would be limited to client (think flash updates). https://chrome.google.com/webstore/detail/github-with-mathjax/ioemnmodlmafdkllaclgeombjnmnbima https://gist.github.com/ivanlukianchuk/e74d0f786c1beae9c0c6 |
I have delt with the security problems. Basically you store the TeX in a
repo and only allow display of images generated from the TeX in markdown
files in that repo. The app can allow editing of the TeX via its web UI.
This will allow forks and will use GitHub OAuth2 authentification.
…On 12 May 2017 at 01:34, John Pope ***@***.***> wrote:
I think an officially supported maths 3rd party plugin in browser would
over time would be best solution. The rendering and security problems would
be limited to client (think flash updates).
It need not be drab - throw the kitchen sink at it. Allowing some maths
input. While the mathjax plugin works for rendering - it falls short in
input.
https://chrome.google.com/webstore/detail/github-with-mathjax/
ioemnmodlmafdkllaclgeombjnmnbima
[image: screen shot 2017-05-11 at 8 33 41 pm]
<https://cloud.githubusercontent.com/assets/289994/25977358/2a85c230-3689-11e7-8863-37d8b80208d1.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#897 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFOEzmI0lVq4N950KYgPC3aBMtssnqXks5r46khgaJpZM4IrWxc>
.
--
Aaron Gray
Independent Open Source Software Engineer, Computer Language Researcher,
Information Theorist, and amateur computer scientist.
|
Also on the server side the latex exec can be run in a sandbox'ed separate
user account possibly chroot'ed in its own small directory structure one
per GitHub user/organization account with symlink's to shared resource.
…On 12 May 2017 at 01:42, Aaron Gray ***@***.***> wrote:
I have delt with the security problems. Basically you store the TeX in a
repo and only allow display of images generated from the TeX in markdown
files in that repo. The app can allow editing of the TeX via its web UI.
This will allow forks and will use GitHub OAuth2 authentification.
On 12 May 2017 at 01:34, John Pope ***@***.***> wrote:
> I think an officially supported maths 3rd party plugin in browser would
> over time would be best solution. The rendering and security problems would
> be limited to client (think flash updates).
> It need not be drab - throw the kitchen sink at it. Allowing some maths
> input. While the mathjax plugin works for rendering - it falls short in
> input.
>
> https://chrome.google.com/webstore/detail/github-with-mathja
> x/ioemnmodlmafdkllaclgeombjnmnbima
>
> [image: screen shot 2017-05-11 at 8 33 41 pm]
> <https://cloud.githubusercontent.com/assets/289994/25977358/2a85c230-3689-11e7-8863-37d8b80208d1.png>
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#897 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAFOEzmI0lVq4N950KYgPC3aBMtssnqXks5r46khgaJpZM4IrWxc>
> .
>
--
Aaron Gray
Independent Open Source Software Engineer, Computer Language Researcher,
Information Theorist, and amateur computer scientist.
--
Aaron Gray
Independent Open Source Software Engineer, Computer Language Researcher,
Information Theorist, and amateur computer scientist.
|
Dear github / mergers and acquisition people - this issue hasn't shifted in 3 years. Be bold. Show some leadership to the scientific, mathematic and machine learning communities. potential acquisition |
This issue is definitely important, and it's really painful not to have support for equations. Image based workarounds are clunky at best, hard to edit, and generally don't meet accessibility requirements, which are a legal mandate for all publicly funded universities in the US. Individual browser plugin based workarounds don't help because they don't allow for someone else looking at the repo who doesn't have the plugin installed. Native support is needed here. If not this repo, then where? If it's code I can get to, I'm happy to work on it and do a PR if needed, but I'd want to know you all would merge once done before I dedicate the time. Let me know. |
Well - some good news - thanks to @goessner - and his markdown math plugin for Visual studio code - you can write / read maths equations quite elegantly by the look of it Dear Github - please roll out Markdown maths in gists. |
I think taking a leaf out of wikipedia's book - for anyone using Chrome extension - you may want to check out there is also this chrome plugin to spit out images of maths equations https://chrome.google.com/webstore/detail/equatio-math-made-digital/hjngolefdpdnooamgdldlkjgmdcmcjnc |
However, native mml should be supported as well. Wikipedia doesn't. |
MathML is not supported by most browsers its sort of been dropped AFAICS
dunno why ?
…On 1 July 2017 at 09:09, Torbjörn Rathsman ***@***.***> wrote:
However, native mml should be supported as well. Wikipedia doesn't.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#897 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFOEwEIQbYIbP1JZWm5_uvrxc-BUtCtks5sJf6pgaJpZM4IrWxc>
.
--
Aaron Gray
Independent Open Source Software Engineer, Computer Language Researcher,
Information Theorist, and amateur computer scientist.
|
Well here is a status report on that statement. There are four main browsers: Blink (WebKit fork for Chrome?), Edge, Gecko and WebKit. Gecko has complete MathML support and WebKit has experimental support. Safari (WebKit based) has it from 10.1. See also http://caniuse.com/#search=mathml. The Chrome and Edge teams have no plans to support it. Then one can observe that XML is PITA and TeX is nice (from a user point of view, see https://groups.google.com/forum/#!topic/mozilla.dev.platform/96dZw1jXTvM). But the important thing here is that there should be a way of displaying formulas natively, without falling back to images. For Gecko, MathML is the way of doing it, while the other engines has no stable way. Another point is that not all users are Pro(tm) users. If Chrome and Edge targets a consumer grade product, you may claim that math support is not needed. This is fine as long as there are browsers Pro(tm) users. Actually, one of the main reasons I use Firefox over Chrom* is that it supports math natively. |
I dont like things that dont render for all users as it can put people off
of your product/content
…On 1 July 2017 at 20:00, Torbjörn Rathsman ***@***.***> wrote:
Well here is a status report on that statement. There are four main
browsers: Blink (WebKit fork for Chrome?), Edge, Gecko and WebKit. Gecko
has complete MathML support and WebKit has experimental support. Safari
(WebKit based) has it from 10.1. See also http://caniuse.com/#search=
mathml. The Chrome and Edge teams have no plans to support it.
Then one can observe that XML is PITA and TeX is nice (from a user point
of view, see https://groups.google.com/forum/#!topic/mozilla.dev.
platform/96dZw1jXTvM). But the important thing here is that there should
be a way of displaying formulas natively, without falling back to images.
For Gecko, MathML is the way of doing it, while the other engines has no
stable way.
Another point is that not all users are Pro(tm) users. If Chrome and Edge
targets a consumer grade product, you may claim that math support is not
needed. This is fine as long as there are browsers Pro(tm) users. Actually,
one of the main reasons I use Firefox over Chrom* is that it supports math
natively.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#897 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFOE5mmiaySAYdSxja1Mlg3DeDv5OQhks5sJpdegaJpZM4IrWxc>
.
--
Aaron Gray
Independent Open Source Software Engineer, Computer Language Researcher,
Information Theorist, and amateur computer scientist.
|
@milasudril , @AaronNGray : Shouldn't this discussion separate the markup users enter when editing and the result of rendering the markup? I mean, as far as the result is concerned, it could be MathML for WebKit and Gecko, and images for Edge and Blink. And as for the markup - that can be chosen half-independently and certainly does not depend on which browser you use. |
@eyalroz That was the implied meaning of
|
GitHub has good expertise in storage are and bad one in math apparently. Guys, it's not a way how to help users. Math formulas are tighten to the software more than you (probably) think. |
Any chance to make GitHub reconsider this? Today many of the codes in GitHub deals with Data Analysis and Math documentation is essential for that. |
@kivikakk Since you have not replied by now, I assuming your decision is final. Gitlab it is. |
ping. Any update on this? I dont think anyone has given up on wanting math equations on their README's. |
I'll repeat my last point — this repository is not for feature requests. It's a gem for delegating markup rendering.
If you comment here, you don't reach the support team who can then direct your query appropriately, you reach me, and I'm not the person who decides what we implement in the GitHub product. |
Hi folks,
Any updates on this? Rendering math on README pages would be very very helpful.
I know it can be done using online tools like iTex2Img but it would be easier if the normal latex expressions can be digested.
Thanks a bunch!
-i
The text was updated successfully, but these errors were encountered: