3 ms·
I read the post but I still don't understand: is it possible to define new commands using \def or \newcommand? At first I thought these are what the other mean
by jessriedel 9y ago
I read the post but I still don't understand: is it possible to define new commands using \def or \newcommand? At first I thought these are what the other meant by "macro", but later he says
> We are exploring ways for users to define non-default environment behaviors in the browser. The same goes for macros used outside the dollar and double-dollar fences.
But I can't use \def or \newcommend to define things that appear inside dollar signs either.
- jxxcarlson 9y agoHere is an example: $$ \newcommand{\bra}{\left<} \newcommand{\ket}{\right>} $$ $$ \bra a | b \ket $$ If you go to https://jxxcarlson.github.io/app/minilatex/src/index.html https://jxxcarlson.github.io/app/minilatex/src/index.html, press the "Clear" button, then paste the above text, then press "Render", you should see the macros \bra and \ket properly rendered.
- jessriedel 9y agoOh I see, thanks. For what it's worth, I would definitely include this example in the demo; it's basically the first thing I wanted to use. Given your pipeline, it makes sense that the \newcommand definitions themselves has to appear inside dollar signs (not just when they are used), but for people with a TeX background it's pretty unintuitive. Also, you should definitely use \lange and \rangle in place of < and > for bra-ket notation :)