Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get github to display inline math in README.org file

I have tried numerous HTML preambles such as the following minimal example:

  #+TITLE: Some math stuff
  #+BEGIN_HTML
         <script type="text/javascript"
            src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
        </script>
  #+END_HTML
  =(solve a b)= should return $X$, from $AX=B$

The inline math works on my desktop if I export to HTML and view in my browser, but does not seem to be rendered in Github where the dollar signs are just echoed in the output.

Any idea on how to get Github to render inline math? Please note the answer to this question on how to do the same with README.md doesn't help as markdown is dissimilar to the much more featureful org mode.

EDIT: I have now learned how Github processes the .org file using github/markup which in turn uses org-ruby to parse the file. It appears that code blocks with #+BeginSrc etc are parsed very well but not the preamble lines or the inline math---though I have not really confirmed this yet.

@david This is the partial but hopefully relevant source from my webpage:

README.org

    <article class="markdown-body entry-content" itemprop="mainContentOfPage"><h1><a id="user-content-some-math-stuff" class="anchor" href="#some-math-stuff" aria-hidden="true"><span class="octicon octicon-link"></span></a>Some math stuff</h1>

<p><code>(solve a b)</code> should return $X$, from $AX=B$</p>
</article>
  </div>
like image 938
mcheema Avatar asked Jul 21 '15 08:07

mcheema


People also ask

How do I write math equations in GitHub README?

From today, you can use the $ and $$ delimiters natively in Markdown on GitHub to insert math expressions in TeX and LaTeX style syntax. This content is then rendered using the highly popular MathJax library.

How do you show math in Markdown?

To insert in-line math use the $ symbol within a Markdown cell. For example, the text $this_{is}^{inline}$ will produce: t h i s i s i n l i n e .

Can I write math in Markdown?

Writing MathMath formulas are easy to write using Markdown, either using the inline mode or the displayed formulas mode. With the inline mode, formulas are inlined in the current paragraph whereas with the displayed mode, they appear as centered and emphasized.

How do I write math equations in GitHub?

Writing expressions as blocks To add a math expression as a block, start a new line and delimit the expression with two dollar symbols $$ . Alternatively, you can use the ```math code block syntax to display a math expression as a block. With this syntax, you don't need to use $$ delimiters.


1 Answers

https://github.com/github/markup/issues/274 seems to indicate that it's not currently possible. The issue was closed with no resolution.

like image 66
NickD Avatar answered Oct 28 '22 22:10

NickD