3 ms·
A source block type would have been a very natural fit, it’s surprising that isn’t how they chose to go. ```equation e^{i\pi}+1\eq0 ``` feels like what
by hprotagonist 4y ago
A source block type would have been a very natural fit, it’s surprising that isn’t how they chose to go.
```equation
e^{i\pi}+1\eq0
```
feels like what i’d try to do right off the bat.
- Hendrikto 4y agoEspecially since this approach has already been tried and proven by competitors like GitLab.
- ly 4y agoI prefer the $ $ way, as it makes it possible to do inline equations, while keeping the source easily readable.
- samwillis 4y agoThey suggest this for inline using combination of the code back tick and dollar syntaxes: Inline math: $`a^2 + b^2 = c^2`$.
- hprotagonist 4y agoyou can do both, the normal markdown way: `$a$` squared is `$a^2$`, which is good to know for the pythagorean theorem: ```equation a^2+b^2\eq c^2 ```
- IshKebab 4y agoThat doesn't work because then how do you display $a$ as literal inline code?
- runarberg 4y agoWhat about: Inline code is ` $a$ ` automatically trimmed But I think $`a+b`$ makes more sense (or even $$a+b$$; I mean this is markdown after all, not LaTeX).
- JadeNB 4y ago> But I think $`a+b`$ makes more sense (or even $$a+b$$; I mean this is markdown after all, not LaTeX). True, but it is TeX notation, and `$$ $$` for inline math goes deeply against the experienced TeXnician's intuition. Why intentionally use notation that violates some users' domain intuition when there's an alternative that's no worse?
- ly 4y agoAh yes, agreed, then that does indeed seem like to optimal solution here.
- deleted 4y ago[deleted]
- ajnin 4y agoA code block is used to display text literally, except adding syntax coloring. You would use it to display TeX source notation for example. A math block transforms TeX into something else, it's entirely different. I think it's correct that they did not use the code block syntax for this.
- edflsafoiewq 4y agoIt's how Github already handles Mermaid diagrams, so there's precedent, although you're correct that logically there should be a distinction between "display highlighted Mermaid source" and "render Mermaid diagram".
- ajnin 4y agoYes, and now they've reached a dead since they have no way to render mermaid source code except as plain text or by introducing a new name like mermaid-src. It's minor but it's unsatisfying conceptually. I'd rather have them introduce a new "run delimited text into external program and replace by output" tag.
- nschloe 4y agoAuthor here. The main idea of using code blocks for math is to protect its content from being messed with. Markdown parsers do that by default, so that's how it's "natural". As you mention, the drawback is that you can't have a codeblock with syntax highlighting for a language called "math" (should there ever be one), but that seems like a small price to pay.
- darkscape 4y agoYes, could use different tags for literal display and rendering eg ```tex and ```eq.