plot rendering in markdown - chunhualiao/public-docs GitHub Wiki
GitHub Wiki's Markdown supports mathematical formula rendering but does not natively support generating plots from math formulas. Here's a detailed breakdown:
1. Math Formula Support
GitHub now natively renders LaTeX math expressions using $
for inline and $$
for block equations[5][9]. For example:
The quadratic formula: $$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
Renders as:
The quadratic formula: $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$
However, complex LaTeX environments (e.g., \begin{figure}
, \tikz
) are not supported[5][9].
2. Generating Plots from Math Formulas
For plots, you have two options:
Option 1: Convert Formulas to Images
- Generate the plot using tools like:
- Python (
matplotlib
,sympy
) - R (
ggplot2
) - Wolfram Alpha
- Online LaTeX editors (e.g., Overleaf) with
pgfplots
ortikz
.
- Python (
- Upload the image to your repository or embed via URL.
- Embed in Markdown:

Option 2: Use GitHub’s Math Rendering Service
For simple 2D graphs, you can encode formulas into URLs using GitHub’s math renderer[1][2]:
<img src="https://render.githubusercontent.com/render/math?math=y%3Dx%5E2">
Renders as:
Limitations: This method only works for basic equations, not multi-axis plots or diagrams.
3. Mermaid Diagrams for Visualizations
While GitHub supports Mermaid diagrams for flowcharts and graphs[8], this is separate from mathematical plotting:
graph TD
A[Math Formula] --> B{Plot}
B --> C[Generate Image]
B --> D[Use Mermaid]
Renders as a flowchart, not a mathematical plot.
Key Takeaways
Feature | Support | Example/Tool |
---|---|---|
LaTeX Math | ✅ Native | $E=mc^2$ |
Plots from Formulas | ❌ Requires images | matplotlib , Overleaf, Wolfram |
Mermaid Diagrams | ✅ Native | Flowcharts, sequence diagrams |
For advanced plots, use external tools to generate images and embed them in your wiki[1][5][8].
Citations:
- [1] https://gist.github.com/modenaxe/e7debe3dcb727f99248139f7d31fac57
- [2] https://stackoverflow.com/questions/22236977/latex-math-in-github-wikis
- [3] https://forum.xwiki.org/t/how-to-support-math-in-markdown/11837
- [4] https://stackoverflow.com/questions/11256433/how-to-show-math-equations-in-general-githubs-markdownnot-githubs-blog
- [5] https://github.blog/news-insights/product-news/math-support-in-markdown/
- [6] https://news.ycombinator.com/item?id=31450597
- [7] https://github.com/orgs/community/discussions/41087
- [8] https://learn.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops
- [9] https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions
- [10] https://github.com/adam-p/markdown-here/wiki/Markdown-Here-Cheatsheet
- [11] https://github.com/doxygen/doxygen/issues/8009
- [12] https://github.com/BookStackApp/BookStack/issues/566
- [13] https://csrgxtu.github.io/2015/03/20/Writing-Mathematic-Fomulars-in-Markdown/
- [14] https://github.com/orgs/community/discussions/23083
- [15] https://github.com/github/markup/issues/897
- [16] https://learn.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops
- [17] https://github.blog/changelog/2022-05-19-render-mathematical-expressions-in-markdown/
- [18] https://news.ycombinator.com/item?id=31438864
- [19] https://github.com/atom/markdown-preview/issues/116
- [20] https://quarto.org/docs/output-formats/gfm.html
- [21] https://github.com/rstudio/rmarkdown/issues/2318
- [22] https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting
- [23] https://github.com/Kernix13/markdown-cheatsheet
- [24] https://docs.github.com/en/communities/documenting-your-project-with-wikis/editing-wiki-content
- [25] https://www.reddit.com/r/LaTeX/comments/uu29gu/github_markdown_and_latex/
- [26] https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams