5

I want to write some of my notes in blog format.

I want to use my own domain with an github.io-provided static website. I don't know whether I can setup Wordpress there, so Trevisan's latex2wp is maybe not the right choice. Also, Wordpress LaTeX is quirky sometimes. I would want to use Hugo, Jekyll or Nikola for the blog layout.

The look of the blogpost I'm targeting is similar to this blog or this one. But anything goes if it's easy to setup and use.

My ideal work process would be as follows: write the LaTeX in emacs, copy the file to some git repo, git push, and the blog appears on my website.

Has anyone set something similar up, or has an idea how to do this?

  • Also, I'm open to links to personal websites which have obviously done something similar - I can ask the owners directly. – Daniel Paleka Sep 21 '20 at 14:10
  • 1
    Which parts of LaTeX do you need? Also, from emacs org-mode export for websites is great, including TeX-like math. – TeXnician Sep 21 '20 at 14:33
  • I don't need commutative diagrams, I just want to write equations and be able to use \newenvironment, \newcommand and \DeclareMathOperator. I am actually an org-mode user (but only a beginner), but didn't think of using it instead of plain LaTeX for writing mathematics texts. – Daniel Paleka Sep 21 '20 at 21:10
  • 3
    My website, https://loopspace.mathforge.org , is completely written in LaTeX and compiled to HTML before being uploaded to a VPS. I use https://github.com/loopspace/latex-to-internet to achieve this. – Andrew Stacey Sep 21 '20 at 21:11
  • The first blog you linked to uses KaTeX for the equations; i.e. the page HTML contains stuff like Alice and Bob hold vectors <span class="wp-katex-eq" data-display="false">x,y \in \{0,1\}^n</span> respectively, and they would like to check whether <span class="wp-katex-eq" data-display="false">x=y</span> or not and Javascript running on the user's browser typesets the equations. This is the standard way with static blogs. You can do a web search for "KaTeX" or "MathJax" along with the static site generator you use (Hugo, Jekyll, whatever) to find examples of how others are using it. – ShreevatsaR Nov 17 '20 at 19:32
  • @ShreevatsaR: but the first blog I linked to uses latex2wp with Wordpress. I'm looking for a standard workflow that does not use Wordpress. – Daniel Paleka Nov 17 '20 at 21:34
  • @DanielPaleka I meant this one—you're right that it's a WordPress blog but it's not using latex2wp. Anyway, as I said, you can search for one of the terms [hugo mathjax] or [hugo katex] or [jekyll mathjax] or [jekyll katex] or… or see e.g. pages like this one. – ShreevatsaR Nov 17 '20 at 21:57
  • 1
    My blog (https://tensortime.sticksandshadows.net/) uses the QuickLaTeX plugin, which processes LaTeX code natively on a remote server. See this page https://tensortime.sticksandshadows.net/archives/4142 in which all the math is native LaTeX. – LaTeXereXeTaL Dec 31 '20 at 17:04

1 Answers1

1

For both Hugo or Jekyll you can follow this guide http://flennerhag.com/2017-01-14-latex/#mjx-eqn-label .

It tells you how to use mathJax to render LaTeX in markdown files.

  • If you are using hugo, the file where you have to add the snippet is the footer.html or site-footer.html under layouts/partials of your theme.
  • If you are using Jekyll then it is under _layout as specified by the guide.

For commutative diagrams, it is going to be tricky, as mathJax does not support commdiag or Tikz natively (as far as I am aware, and of today). The only solution I could find is to create an image out of the commutative diagram, and then post the image directly in the blog.

SeF
  • 111