git.iko.soy/typeable/pandoc
on master help sign in
Org writer: Use LaTeX style maths deliminators (#7196)

Org works better with LaTeX-style delimiters.

commit4371223d132ef822cff0ddee6099a5fe295385cb authortecosaur <tec@tecosaur.com> dateFri 2 Apr 2021, 05:36 (6 years ago) parent40da6c4
2 files changed+9−9
src/Text/Pandoc/Writers/Org.hs+2−2 test/writer.org+7−7
src/Text/Pandoc/Writers/Org.hs+2−2
@@ -404,8 +404,8 @@ inlineToOrg (Str str) = return . literal $ escapeString str
404404inlineToOrg (Math t str) = do
405405 modify $ \st -> st{ stHasMath = True }
406406 return $ if t == InlineMath
407− then "$" <> literal str <> "$"
408− else "$$" <> literal str <> "$$"
407+ then "\\(" <> literal str <> "\\)"
408+ else "\\[" <> literal str <> "\\]"
409409inlineToOrg il@(RawInline f str)
410410 | isRawFormat f = return $ literal str
411411 | otherwise = do
test/writer.org+7−7
@@ -600,14 +600,14 @@ Ellipses...and...and....
600600 :END:
601601
602602- \cite[22-23]{smith.1899}
603−- $2+2=4$
604−- $x \in y$
605−- $\alpha \wedge \omega$
606−- $223$
607−- $p$-Tree
603+- \(2+2=4\)
604+- \(x \in y\)
605+- \(\alpha \wedge \omega\)
606+- \(223\)
607+- \(p\)-Tree
608608- Here's some display math:
609− $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
610−- Here's one that has a line break in it: $\alpha + \omega \times x^2$.
609+ \[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
610+- Here's one that has a line break in it: \(\alpha + \omega \times x^2\).
611611
612612These shouldn't be math:
613613