I am interested in building a wiki for my scientific computing code on gitlab which needs me to write equations and render them in the wiki in gitlab.
How to do this.
I tried to paste the mathjax rendering script but it doesn't work.
Can KaTeX be used anyhow ?
$$ \partial_t \int_{\Omega} \mathbf{q} d \Omega = \int_{\partial \Omega} \mathbf{f} ( \mathbf{q}) \cdot \mathbf{n}d \partial \Omega - \int_{\Omega} hg \nabla z_b $$
GitHub supports Latex/MathJax since May 2022.
GitLab uses "GitLab Flavored Markdown" (GFM). It extends the standard Markdown in a few significant ways to add some useful functionality. It was inspired by GitHub Flavored Markdown. You can also use other rich text files in GitLab.
Markdown can be included in LaTeX documents by means of the markdown package. To use this, simply include \usepackage{markdown} in the preamble of your document.
To insert images to your markdown file, use the markup ![ ALT](/path/image.
GitLab supports KaTex from GitLab CE 8.15 using code backticks.
Documentation is here and the Relevant discussion are on merge request 8003.
Here is the current way to use equations in GitLab
Update Feb. 2017: as documented in sfarzy's answer, this is now integrated (merge request 8003)
Original answer, Feb. 2016: Regarding Mathjax, there was a ticket requesting its integration in 2014 (also PR 5280)
If you have access to your own gitlab server, you could integrate Mathjax yourself (source Zhiyong Johnny Zhang)
Create the file
/home/git/gitlab/app/views/layouts/_mathjax.html.haml
, e.g.,
sudo -u git nano /home/git/gitlab/app/views/layouts/_mathjax.html.haml
with the following content:
:javascript (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'); var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
Then edit the file
_head.html.haml
and change to the following (the first line already existed and the second line was newly added:
= render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id') = render 'layouts/mathjax'
But if you want to publish it on gitlab.com, this integration is not yet active.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With