(no title)
wangchow | 9 years ago
`' 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.
wangchow | 9 years ago
`' 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|9 years ago
pflats|9 years ago
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|9 years ago
wangchow|9 years ago
dunham|9 years ago
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.
wangchow|9 years ago
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 ??
rchowe|9 years ago
Mtinie|9 years ago
jostylr|9 years ago
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.
Mtinie|9 years ago
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.