Org writer: Use LaTeX style maths deliminators (#7196)

Org works better with LaTeX-style delimiters.
This commit is contained in:
tecosaur 2021-04-02 05:36:02 +08:00 committed by GitHub
parent 40da6c402b
commit 4371223d13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View file

@ -404,8 +404,8 @@ inlineToOrg (Str str) = return . literal $ escapeString str
inlineToOrg (Math t str) = do
modify $ \st -> st{ stHasMath = True }
return $ if t == InlineMath
then "$" <> literal str <> "$"
else "$$" <> literal str <> "$$"
then "\\(" <> literal str <> "\\)"
else "\\[" <> literal str <> "\\]"
inlineToOrg il@(RawInline f str)
| isRawFormat f = return $ literal str
| otherwise = do

View file

@ -600,14 +600,14 @@ Ellipses...and...and....
:END:
- \cite[22-23]{smith.1899}
- $2+2=4$
- $x \in y$
- $\alpha \wedge \omega$
- $223$
- $p$-Tree
- \(2+2=4\)
- \(x \in y\)
- \(\alpha \wedge \omega\)
- \(223\)
- \(p\)-Tree
- Here's some display math:
$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
- Here's one that has a line break in it: $\alpha + \omega \times x^2$.
\[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
- Here's one that has a line break in it: \(\alpha + \omega \times x^2\).
These shouldn't be math: