7 ms·
Mdmath – LaTeX Math for Markdown inside of Visual Studio Code
- nerdponx 10y agoI wonder if Pandoc being written in Haskell is what's stopping it from being the default Markdown engine everywhere. Or am I misunderstanding the technical needs here?
- rntz 10y agoI tried to switch from markdown.pl to Pandoc and encountered some problems, one of which remains an open issue (https://github.com/jgm/pandoc/issues/1841 https://github.com/jgm/pandoc/issues/1841): https://twitter.com/arntzenius/status/745946799836381184 https://twitter.com/arntzenius/status/745946799836381184 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/ http://commonmark.org/ effort, which I applaud, but doesn't seem to have a 1.0 spec out yet.)
- geofft 10y agoThat's sort of convincing me that Markdown + arbitrary HTML is a fundamentally unstable idea. What's the use case for it? GitHub allows a subset of HTML tags; sites like Reddit allow none. 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.
- rntz 10y agoI use markdown for writing blog posts, and I need arbitrary HTML all the time. For tables; or for custom syntax highlighting; for drop-down menus that let readers choose what PL they want to see examples in (http://www.rntz.net/post/2016-06-06-not-everything-is-an-expression.html http://www.rntz.net/post/2016-06-06-not-everything-is-an-exp... ); to put the numbers on section headings into the left-margin; etc, etc. 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?
- geofft 10y agoBecause intermixing Markdown and HTML is ambiguous, and if you're authoring HTML, you clearly know HTML already? 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/ana1996090111.jpg https://support.novell.com/techcenter/articles/img/ana199609...) but with bonus ambiguity.
- tannhaeuser 10y agoAre you saying you shouldn't use HTML with markdown? Markdown was explicitly designed not to cover each and everything HTML, and so that you could fallback to HTML; it's kind of the entire point of markdown (or have I misunderstood you?).
- rntz 10y ago> 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. 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.
- alexbecker 10y agoThere's an easy compromise between (1) and (2): configurable bleaching. 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 https://github.com/alexbecker/blogdown) to fix this.
- nerdponx 10y agoAFAIK the author of Pandoc is also a CommonMark core contributor.
- jahewson 10y agoPandoc isn't used by this VSCode plugin, so I'm not sure why that's relevant? Generating a PDF from Pandoc depends on LaTeX, which is over 2GB. Definitely not a solution for "everywhere". Also there are some arguably nicer alternatives to just shoving LaTeX syntax into markdown, for example http://asciimath.org http://asciimath.org.
- widdma 10y agoLaTeX itself isn't over 2GB. The complete texlive distribution is about that large, but that's everything and the kitchen sink. You can install a small base which comes in ~150mb, then add packages as you need.
- hprotagonist 10y agoand then 90 seconds later you'll find yourself running `sudo apt-get texlive-full` because some mysterious font somewhere is wedging up the gears and it's not worth sorting out.
- widdma 10y agoYeah, fair enough. On MacTeX or texlive on Arch, it usually takes me a few iterations of `tlmgr install` runs before I have everything I need. "collection-fontsrecommended" is usually the (meta) package I install these days. I wish texlive would move to rolling updates, or at-least make distribution upgrades easier.
- ulrikrasmussen 10y agoArg, this reads like LaTeX without the backslashes and with minor inconsistencies. Why not just use a proper subset of LaTeX math notation instead of inventing yet another syntax?
- arve0 10y agoBecause, sometime you don't need all the whistles, but only a subset. Curious, what inconsistencies does asciimath have?
- saboot 10y agoOh man, this is PERFECT for me. Previously I would just run VS Code and periodically build my current markdown document while writing LaTeX in it, and have a browser window refresh on changes (using the LivePage addon for Chrome). This saves a lot of trouble for me, very excited!
- nickysielicki 10y agoNeovim users can do something similar: https://github.com/donRaphaco/neotex https://github.com/donRaphaco/neotex https://www.youtube.com/watch?v=zCdDgtlBaTU https://www.youtube.com/watch?v=zCdDgtlBaTU
- kevinwang 10y agoIs there a latex editor that can show the end product side by side while you're writing the document?
- teacup 10y agoTexmaker is pretty close. It doesn't update live, but I've never actually needed that capability. Tons of other useful features too. No affiliation, I just use it a lot. http://www.xm1math.net/texmaker/ http://www.xm1math.net/texmaker/
- mbreese 10y agoOverleaf.com is an online site that works that way.
- deleted 10y ago[deleted]
- nbz118 10y agoBoth http://sharelatex.com http://sharelatex.com and http://overleaf.com http://overleaf.com support that by re-rendering a pdf preview as you make changes. Overleaf also has a WYSIWYG editor with inline latex, although I find it doesn't work for everything.
- wje 10y agolyx + instant preview, perhaps?
- edgarvaldes 10y ago
- akvar 10y agoOh wow! Man this is so rad. This can help me kick my dependence on Typora / Dropbox Paper for class notes and continue the VSCode loving.
- smilekzs 10y agoNitpick: Title should indicate VSCode
- wangchow 10y agoVery awesome. However, the $ signs indicate financial stuff. It would be nice to have a different delimiter like the code blocks use back-tics. For example using back-ticks couple with single-quotes? It doesn't work since it clash with the code block just for example more legible: `' 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.
- stuffedBelly 10y ago"$" ("$$" to be exact) is actually used in TeX to indicate opening and closing of statements/mathematical expressions. I think the author of this project is trying to conform to TeX syntax as much as possible so that TeX users like me would feel at home :).
- pflats 10y ago>"$" ("$$" to be exact) is actually used in TeX to indicate opening and closing of statements/mathematical expressions. 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.
- widdma 10y agoThe story is that Knuth chose '$' to denote math mode because math typesetting at the time was prohibitively expensive.
- stuffedBelly 10y agoahaha, that's a good piece of anecdote.
- wangchow 10y agoAh, wasn't aware of that. Thanks. :)
- S4M 10y agoThat's neat, but I managed to do something similar (except for the graphics, I haven't tried that) with Markdown + Mathjax.
- verandaguy 10y agoAs I understand it, this is basically that; except with Khan Academy's KaTeX library instead (it's got ridiculously fast rendering compared to MathJax).
- mrcactu5 10y agoi would appreciate something like this for Atom.
- carlcortright 10y agoCan someone do this for atom?
- jwtadvice 10y agoThis is wonderful. However, I always loved markdown because of its being so simple and fast. Isn't Latex Turing-Complete?
- legulere 10y agoBeing turing-complete doesn't prevent you from emulating it. Also the subset of math expressions should be pretty simple.
- contravariant 10y agoTeX has \def which basically allows you to write lambda expressions, so yeah it's Turing complete. The basic math notation isn't though, and I'd be surprised if this extension allows you to use \def (or really any of the more powerful features of TeX).
- Mtinie 10y agoIf it's using the full selection of functions available to KaTeX, here's the list: https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX \def isn't included in the core set, from what I can see.
- legulere 10y agodoesn't understand \boldsymbol :/
- pflats 10y agoThis is really cool for quick things, but for anything short of quick notes, I don't want to have to manually number my equations. I generally don't write top-to-bottom, I write subsections at a time. 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.
- rkevingibson 10y agoSurprised I haven't seen anyone post Markdeep here yet: https://casual-effects.com/markdeep/ https://casual-effects.com/markdeep/ Seems to cover a lot of the same ground, though it's not restricted to visual studio code.
- now 10y agoCouldn’t you just write your “LaTeX Math” for LaTeX instead?
- KON_Air 10y agoAs I see it, it is more for "I just wrote/ended up with this code doing a complex math equation. But I just can't read it even with all these comments." cases.
- IshKebab 10y agoI have looked into markdown editors a lot, and the best I found was this plugin for Atom: https://github.com/shd101wyy/markdown-preview-enhanced 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.
- OJFord 10y ago> I know Atom kind of sucks 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.)
- karlding 10y agoI've been using the free-tier of Classeur [1] for taking notes during class, which I then export to a PDF. It's basically an online Math/Mardown editor with pretty much the same feature-set. Maybe I'll try this out and see how I like it. [1] http://classeur.io/ http://classeur.io/
- lenkite 10y agoI really wish the author had chosen asciidoc which has well defined semantics for latex math incorporation and also supports asciimath