Mdmath – LaTeX Math for Markdown inside of Visual Studio Code
github.com
github.com
A telling comment on that github issue is "Actually, it's a bit unclear what the behavior should be." I think the real problem is the idea of "a default Markdown engine" is pretty impossible when Markdown doesn't even have a formal spec. Complex human-readable formats without a spec are never gonna be compatible between different implementations without extraordinary effort. (Hence the http://commonmark.org/ effort, which I applaud, but doesn't seem to have a 1.0 spec out yet.)
I mean, I use Pelican's Markdown support in my own blog, but I wouldn't be unhappy about having to use <i> instead of underscores.
Basically, markdown has (at least) two use-cases:
1. A safe (if you do HTML sanitization properly) way to let people mark-up their input on web comment sites like HN, StackOverflow, etc. This is probably the most common use-case.
2. A web authoring tool. This was the intended use-case.
Supporting arbitrary HTML is absolutely inadmissible for (1); not having arbitrary HTML is basically inexcusable for (2). And yeah, I could write the posts in straight HTML, but honestly that's a pain. Why shouldn't there be a tool that makes writing styled-text-with-lists-and-headings easy but lets me drop down to HTML when I need to?
I'm not actually sure I believe this yet. But I think I'd see a lot more use case for something that lets me do a very tiny amount of things, maybe just headings and bold and italic, and avoids not only ambiguity but any risk of ambiguity.
It just feels like we've reinvented HoTMetaL (https://support.novell.com/techcenter/articles/img/ana199609...) but with bonus ambiguity.
When you build that, let me know. Until then I'll be over here, using a Perl script from 2004 that still works just fine.
I also use markdown for writing blog posts, and have a lot of the same pain points. I have been working on an extended version of markdown (https://github.com/alexbecker/blogdown) to fix this.
Also there are some arguably nicer alternatives to just shoving LaTeX syntax into markdown, for example http://asciimath.org.
You can install a small base which comes in ~150mb, then add packages as you need.
I wish texlive would move to rolling updates, or at-least make distribution upgrades easier.
Curious, what inconsistencies does asciimath have?
Note that one of the advantages of asciimath is that it maps unambiguously to MathML.
`' x^2 + 4x + 4 '`
Remember: the whole idea behind markdown is it should be first and foremost* legible from plain-text. One idea behind typography is it shouldn't be noticed at all to the reader.
Both are used. A single $ is used for inline math, the double $$ begins an equation on its own line. For example:
The solution to $ax^2 + bx + c = 0$ will be $$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
The first block will be mid-sentence, while the second one will get its own line.
I find it a lot more readable than the \( and \[ that LaTeX and other markdown systems use.
I believe gitbook uses just "$$", but this looses the distinction between inline and display math. (And there is a subtle difference between display math within a paragraph and display math between paragraphs, so you can't tell from context.)
I understand that some people will want to talk about money and having to escape $ could be incredibly annoying, but for actually writing math documents, this is kinda essential. So, to me, it feels like something that needs to be an optional add-on.
Kind of interesting to see some alternatives and note the visual weight. The back-ticks are by far the best in my opinion. Too bad they are taken by the code blocks! Semicolons are nice though--kind of like a LISP comment.
@@ x^2 + 4x = 10 @@
%% x^2 + 4x = 10 %%
<< x^2 + 4x = 10 >>
$$ x^2 + 4x = 10 $$
`` x^2 + 4x = 10 ``
'' x^2 + 4x = 10 ''
"" x^2 + 4x = 10 ""
;; x^2 + 4x = 10 ;;
\\ x^2 + 4x = 10 //
?? x^2 + 4x = 10 ??
Originally we used the "standard" single $ delimiter but would run into problems when someone's content included a string like, "...between $190 and $200...". It wasn't elegant, but saved a lot of complicated parsing to look for whitespace or other implicit indications of what the author was trying to do.
The inline math syntax is `x^2 + 4x +4`$ so the dollar sign is outside the backticks, but the formula is encapsulated in the code.
For a display block, they use the code fences with either latex or $ as a math toggle:
```latex
\psi = \frac{5 \phi}{\omega}
```
or
```$
\psi = \frac{5 \phi}{\omega}
```
At some point soon, I intend to implement this for my own use. It should be pretty easy using a markdown parser assuming one can do a lookahead/gobbler to the next character after the inline backticks.
https://github.com/shd101wyy/markdown-preview-enhanced
I know Atom kind of sucks, but this plugin is amazing. Mostly because it supports PlantUML which is also amazing.
Highly recommended.
I've tried really hard to like Atom. It's a shame that 'modern open-source configurable' seems to mean 'Electron app' (cf. Hyper) - I'm convinced it's not the best in terms of potential, but since that's where the collective effort, it seems unfortunately the best available.
(I revert to vim after getting fed up with Atom, I just can't help feeling that better could be achieved by forgetting legacy platforms and backwards compatibility - I'll try Kakoune if it stops being called the author's "experiment" and gets versioned releases.)
Labels seem straightforward enough, but I'm at a loss for a markdown-y way to do a ref.
$$\exist 0 \in R \mathrm{s.t.} a + 0 = a \forall a \in R$$ (eqn:addid)
In addition to a zero as per (*eqn:addid), one must also show the existence of an inverse.
It's decent, but I don't love it. And further overloading the splat will be miserable.
Maybe I'll try this out and see how I like it.
Isn't Latex Turing-Complete?
https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX
\def isn't included in the core set, from what I can see.
Seems to cover a lot of the same ground, though it's not restricted to visual studio code.
look for the wysiwyg tag ( read note 1: https://en.wikipedia.org/wiki/Comparison_of_TeX_editors#cite...)
There is also the 'Integrated viewer' column with notes on live/instant updates.
https://github.com/shd101wyy/markdown-preview-enhanced
I have looked into markdown editors a lot, and this is the best by far. It supports Latex, PlantUML, images, Graphviz, and some more stuff.