yoavram / markx

Markdown editor for scientific writing. Batteries included.
Other
319 stars 41 forks source link

\\(..\\) and \\[..\\] not supported in LaTeX export? #46

Open cben opened 10 years ago

cben commented 10 years ago

This might belong under #43 but that seems to discuss HTML/PDF exports.

In https://markx.herokuapp.com/ preview both $, $$ math and \\(, \\[ math gets rendered (but not \(, \[). So far good, as documented.

- dollar mode $e=mc^2$
- NON Inline mode \(e=mc^2\)
- Inline mode \\(e=mc^2\\)
- double dollar mode: $$\frac{df(x)}{dt}=lim_{x \to 0}{\frac{f(x+h)-f(x)}{h}}$$
- NON Display mode: \[\frac{df(x)}{dt}=lim_{x \to 0}{\frac{f(x+h)-f(x)}{h}}\]
- Display mode: \\[\frac{df(x)}{dt}=lim_{x \to 0}{\frac{f(x+h)-f(x)}{h}}\\]

But when I download exported LaTeX, both in D and P modes, I'm seeing only dollars forms exported as math; all backslash forms are treated as text (this portion exactly same in D and P outputs):

\item
  dollar mode $e=mc^2$
\item
  NON Inline mode (e=mc\^{}2)
\item
  Inline mode \textbackslash{}(e=mc\^{}2\textbackslash{})
\item
  double dollar mode:
  \[\frac{df(x)}{dt}=lim_{x \to 0}{\frac{f(x+h)-f(x)}{h}}\]
\item
  NON Display mode: {[}\frac{df(x)}{dt}=lim\_\{x
  \to 0\}\{\frac{f(x+h)-f(x)}{h}\}{]}
\item
  Display mode: \textbackslash{}{[}\frac{df(x)}{dt}=lim\_\{x
  \to 0\}\{\frac{f(x+h)-f(x)}{h}\}\textbackslash{}{]}

For P mode it should be enough to pass -f markdown+tex_math_double_backslash to pandoc.

Docverter's markdown only alludes to math support but doesn't document the exact syntax. It doesn't seem to pass tex_math_single_backslash nor tex_math_double_backslash to pandoc so I guess it uses pandoc default which is only dollars...

yoavram commented 10 years ago

I'm currently not working on any issues. Hopefully someone else will try to fix it.