I apologize if this isn't the right place to ask this question.

Two features of stackexchange would be very useful for a personal math blog -- Latex works great, and comments and replies can be voted upon.

Is there any way to use the stackexchange functionality in a personal math blog?

  • 2
    $\begingroup$ This isn't really about the environment that is math.stackexchange hosted here, but it sounds like an interesting question nonetheless. You could always try it with an open source "clone" of the StackExchange software installed on your own server (meta.stackexchange.com/questions/2267/stack-overflow-clones) and see how it goes.... $\endgroup$
    – user2055
    Nov 9, 2012 at 1:24
  • 13
    $\begingroup$ WordPress has both of these features. $\endgroup$ Nov 9, 2012 at 1:32
  • 9
    $\begingroup$ In my (somewhat limited) experience, using Latex on wordpress isn't nearly as easy as using Latex on math.stackexchange.com. Is that wrong? $\endgroup$
    – littleO
    Nov 9, 2012 at 1:38
  • 8
    $\begingroup$ There are instructions on how to install MathJax on a WordPress installation of your own (that is, if you're on a wordpress.com blog, you can't, AFAIK, install MathJax.) $\endgroup$ Nov 9, 2012 at 6:22
  • 5
    $\begingroup$ Blogger is a bit better with its LaTeX/MathJax support: see tex.stackexchange.com/questions/13865/… $\endgroup$ Nov 9, 2012 at 8:53
  • $\begingroup$ (I also vaguely remember answering a question exactly like this on another forum [which I am pretty sure is a StackExchange site]. I can't seem to find it, however, perhaps the question was deleted?) $\endgroup$ Nov 9, 2012 at 8:59
  • 3
    $\begingroup$ If it is good enough for Terry Tao... $\endgroup$
    – user1729
    Nov 9, 2012 at 10:07
  • 4
    $\begingroup$ You might be interested in LaTeX2WP lucatrevisan.wordpress.com/latex-to-wordpress , a piece of software which takes a LaTeX file and outputs something which is ready to be copy-pasted into the Wordpress text entry box. $\endgroup$ Nov 9, 2012 at 14:11
  • 1
    $\begingroup$ WordPress is an expensive solution due to the need of a database for comments. See my answer for a collection of open source technologies which bring about a static blog with comments. $\endgroup$ Dec 4, 2018 at 7:22

4 Answers 4


Short answer

View my profile for a quick start, and my minimal demo site (source).

Complete answer

I recommend a static blog powered by open-source technologies Beautiful Hugo with Staticman. The former provides a blogging theme with KaTeX, whereas the later provides commenting support for static sites.

To start writing math online using Beautiful Hugo without any installation, you may

Quick start

  1. Clone GitLab's sample
  2. Follow the README from GitLab User or Group Pages. (Skip the first two sections unless you want to preview your posts before publishing.)
  3. (Optional: commenting support) Clone my demo GitLab site instead, and follow my guide in my profile from step 2.

sample Hugo site
Figure 1: A data analysis blog showing math equations.

Technical specifications

Abstract comparisons

  1. Advantages of static sites over dynamic sites (e.g. WordPress): the former concentrates on content delivery (the case of a personal blog) without handling logic from clients' requests (counterexample: library catalog search). Unlike dynamic web servers, static ones won't slow down drastically upon massive requests. Therefore, many data analysts prefer static pages, say https://www.datascienceblog.net/post/other/staticman_comments/ Further reading: https://www.netlify.com/blog/2016/05/18/9-reasons-your-site-should-be-static/
  2. Advantages of static comments over dynamic comments (e.g. WordPress) and/or comments offload (e.g. Disqus): the former allows search engines to grasp the whole page as site content without an extra database. This boosts both load speed and SEO. A WordPress site requires a database, which bears a considerable maintenance cost (for the service provider and/or the end users). You may see IRZ's article about migration from WordPress (in French) for an estimate of the cost of a medium WordPress site.
  3. Advantages of free and open source softwares over proprietary technologies: there are plenty of discussions about this. Long story short, you can avoid being locked by proprietary licenses by switching to open source technologies. As a short example, imagine what you file would become if you saved your work in Microsoft Word ten years ago.
  4. Advantages of decentralized technologies over central ones: in some countries, some large web sites (e.g. Google) are banned. Despite my support of Ciro Santilli 新疆改造中心 六四事件 法轮功's attack on SE, one has to wait for an indefinitely long period for its victory. Therefore, technologies allowing the use of custom domains are preferred.

Specific comparisons

  1. Hugo vs Jekyll: Hugo is a static blog renderer written in Go, which is one of the fastest programming language developed by Google. I had been a Jekyll user for three years. As my old blog grew to over three hundred articles, it took me more than a minute for site regeneration due to the speed of Ruby.
  2. KaTeX vs MathJax: personally, speed is king 👑. To see this, load this site's MathJax tutorial. The former is less mature in terms of $\rm \LaTeX$ syntax support, but it should cover the majority of this site's $\rm \LaTeX$ code. (known exceptions: AMS-CD)
  3. Staticman vs Disqus: apart from point (2) in the previous section, the later has neither Markdown nor math support. Although the main Staticman API suffers from an error lasting for several months, this can be overcome by following the next point.
  4. GitLab vs GitHub: apart from point (3) in the above section, the former offers a convenient all-in-one CD/CI service. This allows users to remotely run scripts (i.e. build sites) without installation. Using the later, one either use other third-party CI/CD service or put the generated HTML code in a separate orphan branch. The first option is less convenient, whereas the second option implements a wrong Git model. Git only manages source code, not data, binaries nor generated code.


Since Staticman is an open-source API service converting HTML form data into Git commits to be pushed to the remote Git repository, users can incorporate it with any (or even none) static site generator.

Jekyll + Staticman v3

Despite Hugo's faster site regeneration, some users might want to stick with Jekyll. Here're two examples.

  1. GitHub Pages: https://github.com/daattali/beautiful-jekyll#features
  2. GitLab Pages: https://staticman-gitlab-pages.frama.io/jekyll/

Use Framagit instead of GitLab.com

Framagit generates pages in half of the time of GitLab.com.

Since Framagit is a self-hosted GitLab instance, the setup follows the same logic, except that you have to use a different GitLab bot, Heroku app name and specify your API parameter to be GITLAB_BASE_URL = "https://framagit.org/".

Note: It's suggested that every Staticman user use his/her own API instance.

  • $\begingroup$ Maybe I'm missing something. In my browser (Chromium for Linux) the inline $\LaTeX$ is not rendered (minimal demo site), but the display math in your second section is. $\endgroup$
    – hardmath
    Dec 19, 2018 at 0:35
  • 1
    $\begingroup$ @hardmath Thanks for your interest in my demo site. I intentionally left that broken for future reference of the limitations of the technology. This is caused by Hugo's Markdown parser which interpreted KaTeX code. (Changed double antislash to one single antislash) An easy workaround is to wrap a math equation by <div> to stop Hugo from parsing it. Hugo's official documentation has suggested a more elegant way to solve this problem, after adding dollar signs to KaTeX's delimiter, I'm satisfied with that. $\endgroup$ Dec 19, 2018 at 3:29

Thanks to GitHub's recent announcement of MathJax support in GitHub Markdown, you may setup a GitHub repo to write Markdown and LaTeX code to be stored in text files inside the repo. Others can give feedback through GitHub issues/discussions.

github markdown math support
Image copied from the linked GitHub blog post.


I use mathJax on plain old XHTML pages, and it displays math beautifully.

  • $\begingroup$ Similarly here: I integrated MathJax into my Blosxom-based blog with no trouble at all. The only real problem is that RSS/Atom syndication feeds don't have JavaScript executed, so I had to do something else for those. $\endgroup$
    – MJD
    Nov 15, 2012 at 4:14
  • 1
    $\begingroup$ Grim, but I guess that is for security reasons. $\endgroup$ Nov 15, 2012 at 13:46
  • $\begingroup$ Nonetheless, unlike [math], it's impossible to write in Markdown without loading extra Javascript. Writing in XHTML cancels much of the benefits of posting math online. Thanks to Hugo, it's possible to write blog in Markdown. $\endgroup$ Dec 4, 2018 at 7:19

Use $\rm\LaTeX$ on GitLab directly, thanks to GitLab's support for KaTeX.

Demo syntax:

This math is inline $`a^2+b^2=c^2`$.

This is on a separate line


GitLab math example
🔗: https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#math

❗ I'm using a screenshot here because I'm showing how the code gets interpreted by GitLab, not by SE.

⚠ KaTeX doesn't implement AMSCd, which is responsible for commutative diagrams. You may consider using other diagram technologies.

⚠ Restrictions: only part of $\rm\LaTeX$ is supported by KaTeX. Also cut long $\rm\LaTeX$ code into smaller blocks. I quote the system's message here.

The math in this entry is taking too long to render and may not be displayed as expected. For performance reasons, math blocks are also limited to 1000 characters. Consider splitting up large formulae, splitting math blocks among multiple entries, or using an image instead.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .