
## 1 Commutative diagram in $\TeX$ revisited

### 1.1 xypic and xyJax

To my knowledge, the only way to type commutative diagram on the web is to use xyJax, a third-party extension of MathJax that render diagram using xypic. This is also how Stacks Project was set up.

The syntax of xypic is almost the same as tikz-cd, to a basic user the only difference is how arrows are typed. I learn xypic syntax by rewriting a GUI editor for tikzcd by Yichuan Shen to output xypic code. Here is the xypic version of the editor. I also host a copy of the tikz-cd editor here.

The configuration of xyJax or any third-party extension MathJax was not very easy for me, since it seems that MathJax CDN no longer hosts third-party extensions. So I have to host my own copy of xyJax and tell MathJax CDN to use it, as indicated in its documentation. Also, one also has to reconfig a path in xyJax.

To config MathJax in org-mode, apropos org-html-mathjax-template.

## 2 LaTeX in Inkscape: Incompatibility between ghostscript and pstoedit<2018-03-30 Fri>

Since Ghostscript 9.22, certain flags (e.g. dREALLYDEALYBIND) are deprecated and pstoedit, a piece of software that Inkscape uses to render LaTeX, remains unchanged since 2005. This makes Inkscape users unable use LaTeX. Textext developers claims that they will switch to pdf2svg frontend in their version 0.8 to avoid this trouble with pstoedit. Meanwhile, the only solution seems to be downgrade ghostscript to 9.21 each time one uses Inkscape. In ArchLinux, one can downgrade a package using pacman:

ls /var/cache/pacman/pkg/ | grep ghostscript
pacman -U /var/cache/pacman/pkg/package-old_version.pkg.tar.xz

or a AUR package called downgrade

I had good experience with both of them (pacman to downgrade php to be compatible with nextcloud, and downgrade for ghostscript)

The problem is well documented here and here.

## 3 LaTeX indentation in org-mode <2018-02-20 Tue>

I was told, in accordance with my experience, that we visually process text better if each line in a paragraph is approximately below 80 characters. This fact is also omnipresent on the internet, standardized tests, books, etc.. being among the fundamentals of web design (except wikipedia, that's why I use Wikiwand).

In Emacs, the key binding M-q will execute the fill-paragraph function that automatically shrinks text and insert "soft" newlines to shorten line below a certain threshold. This function however does not respect the LaTeX structure, e.g. it inserts line break inside inline equation and merge display equation. format paragraph.

This is a long long long long long long long long long paragraph with equation $1+1 = 2+0=3-1=4-2$ with an equation in display $1+ 1 = 2$.

The problem has been noticed around the Internet here and there.

Meanwhile AucTeX does not have this annoying problem. It turns out that AUCTeX maps the M-q key to a different function, called LaTeX-fill-paragraph. So the temporary fix is to load latex.el in org-mode and maps M-q to LaTeX-fill-paragraph