Hacker News new | past | comments | ask | show | jobs | submit login

Very 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.




"$" ("$$" 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 :).


>"$" ("$$" 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.


The story is that Knuth chose '$' to denote math mode because math typesetting at the time was prohibitively expensive.


ahaha, that's a good piece of anecdote.


Ah, wasn't aware of that. Thanks. :)


Using $ and $$ is most legible for me. Having spent many years using TeX. Pandoc seems to do the same thing - I suspect for the same reasons. I usually patch this into markdown systems that I use. This is especially useful when you have have to talk about things like $x$ and $y$ and how $x^2+y^2=z^2$. In actual math documents, every third or forth word will be surrounded by $, it is almost like italics to mathematicians, and would be nice to be able to express it just as easily as italics.

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.


To the contrary, as someone who hasn't used TeX at all I find it somewhat hard to read the plain-text. The $$$ have more visual weight than the actual formulas.

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 ??


MathJax by default doesn't use $ as a delimiter for inline equations, but instead uses \( and \) to avoid confusion with monetary quantities. Perhaps a similar thing could be done.


Off the top of my head, I feel that using that syntax would increase the chances that you would run into issues trying to differentiate between escaped characters and expressions, though it's an interesting recommendation (and if MathJax has been able to make it work, I'm sure it's feasible).


I am theoretically a big fan of the (not yet existing) Markua math format from leanpub: https://leanpub.com/markua/read#math

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.


For exactly that reason, we used $$(inline expression) and $$$(block expression) for the KaTeX delimiters in a web-based Markdown editor that I worked on.

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: