# Notational Macros Are Local, Not Global

## Metadata
- Author: [[Jonathan Sterling]]
- Full Title: Notational Macros Are Local, Not Global
- Category: #articles
- URL: https://www.jonmsterling.com/forest/trees/tfmt-000h/
## Highlights
- Therefore, it is mandatory that the representation of mathematical notations be structured. ([View Highlight](https://read.readwise.io/read/01gp6b25vwpxdkv8dag2pzdxax))
## New highlights added January 9, 2023 at 6:49 AM
- Although diagramming may seem to non-mathematicians to be somewhat orthogonal to notational macro support, in **reality any solution to the diagramming problem must be tightly and natively integrated with the rendering of mathematical expressions** — simply because most diagrams involve mathematical expressions, and these invariably involve notational ([View Highlight](https://read.readwise.io/read/01gp6b6y4yhmdc4m26qdct2jcq))
- Note: Interesting for [[Mathematics]]
- Although diagramming may seem to non-mathematicians to be somewhat orthogonal to notational macro support, in **reality any solution to the diagramming problem must be tightly and natively integrated with the rendering of mathematical expressions** — simply because most diagrams involve mathematical expressions, and these invariably involve notational macros. The reason PGF/TikZ has been so successful is that it respects this tight coupling. ([View Highlight](https://read.readwise.io/read/01gp6b70bb2q9twwa3zsq7qc3x))
- macros. The reason PGF/TikZ has been so successful is that it respects this tight coupling. ([View Highlight](https://read.readwise.io/read/01gp6b6vzsq6y5jecwmw6t7typ))
- [KaTeX](https://katex.org/) has a very rudimentary support for commutative diagrams built-in, by emulating the `amscd` package. Unfortunately, this support is completely inadequate for usage by mathematicians today: ([View Highlight](https://read.readwise.io/read/01gp6b80mtn4zgfr2hv3wjaskd))
- Note: amscd is a [[Latex]] package useful for [[Category Theory]]
- On the other hand, there is a more advanced option available for users of MathJax: the [XyJax-v3 plugin](https://github.com/sonoisa/XyJax-v3), which adds support for the full gamut of `xypic` diagrams to MathJax. Notably, this plugin is used by the [Stacks Project](https://stacks.math.columbia.edu/). The only downside of the `xypic` support is that it interacts poorly with accessibility features (but no worse than any other solution to rendering non-trivial commutative diagrams), and diagrams created using `xypic` look considerably less professional than those created using `tikz` or [quiver](https://www.jonmsterling.com/forest/trees/tfmt-000i/). ([View Highlight](https://read.readwise.io/read/01gp6b91r2xg84y4s8mt48aq01))
- Note: There is another plugin for [[MathJax]] to render [[Category Theory]]'s [[Commutative Diagrams]]
- The [quiver](https://q.uiver.app/) application is an excellent graphical interface for interactively constructing commutative diagrams, with very high-quality rendering. ([View Highlight](https://read.readwise.io/read/01gp6b9vs47xn1cc1qv22kvwcs))
- Note: [[Quiver]] is a tool to create [[Commutative Diagrams]] for [[Category Theory]] in [[Latex]]
- Because of the [general](https://www.jonmsterling.com/forest/trees/tfmt-000j/) [inadequacy](https://www.jonmsterling.com/forest/trees/tfmt-000k/) [of](https://www.jonmsterling.com/forest/trees/tfmt-000i/) the other available tools, most authors of hypertext mathematics with diagramming needs tend to rely on the static generation of images from $\LaTeX$ code using a local $\LaTeX$ toolchain. It is not difficult to instrument [pandoc](https://www.pandoc.org/) with a [Lua filter to render tikz code to SVG images](https://pandoc.org/lua-filters.html). ([View Highlight](https://read.readwise.io/read/01gp6bb0mps098795rpp1kzc8q))
- Note: People use static [[Latex]] and [[pandoc]] rendering to create static images for [[Commutative Diagrams]]
- The basic architecture of such a tool is to scan for $\LaTeX$ blocks, and then identify them by a *hash* of their contents. This hash is used as a filename for `.tex` files, which are compiled to `.dvi` and thence to `.svg` using the `dvisvgm` tool. Alternatively, it is also possible to transclude the resulting `<svg>` element directly, but one must be careful to rename all identifiers in the `<svg>` element uniquely, as it is possible for two different `<svg>` elements on a single page to interfere with each other.
Both [antex](https://github.com/paolobrasolin/antex) and [forester](https://sr.ht/~jonsterling/forester/) support passing a macro library to be used when rendering. Both [jekyll-sheafy](https://github.com/paolobrasolin/jekyll-sheafy) and [forester](https://sr.ht/~jonsterling/forester/) set their macro libraries on a page-local basis through Markdown “[front](https://jekyllrb.com/docs/front-matter/) [matter](https://gohugo.io/content-management/front-matter/)”. ([View Highlight](https://read.readwise.io/read/01gp6bbyrywh25dgksmfm985f7))
- Note: There are quite a few tools to leverage [[Latex]] when doing [[Static Sites]] rendering of [[Mathematics]]
- SVG Is Not an Authoring Language ([View Highlight](https://read.readwise.io/read/01gp6bcvfzk9fn3f9b14evg764))
- Note: ZK
- MathML Is Not Yet an Authoring Language ([View Highlight](https://read.readwise.io/read/01gp6bd975a1fzn5yvg2mt9w4e))
- Note: ZK
- on. As a result, nearly all MathML that appears on the web today is actually the output of separate tools such as [MathJax](https://www.mathjax.org/) — ([View Highlight](https://read.readwise.io/read/01gp6be3fyb4dtcap1w8r9xd64))
- Note: [[MathML]] was never really successful and is currently mostly a backend for [[MathJax]]