-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improper syntax for LaTeX Equation Environment (and the related ones) #339
Comments
@abnerlee the issue you refer to is completely irrelevant. One is about alternative math delimiter, another is about wrong math delimiter. |
They are same/similar math delimiter issue -> make math delimiter configurable. From the link:
So, math delimiters should be used. And no "standard" math delimiter is given, and it is configurable for MathJax, so there's no "wrong" math delimiter. From https://github.com/ickc/mathjax-latex-md-mmd-pandoc
So, MultiMarkdown use |
It's not... configuring MathJax delimiters can be done natively in MathJax, and can be configured right now in typora if you are willing to dive into the contents of topora.app. The issue I was pointing out is that in a certain environments, no delimiters should be used. You can (use delimter) if you only want MathJax (in HTML) support, but if you want to export to LaTeX, it will throw an error. Again, the difference is
See? Completely different. You could always try to draw similarities, but in terms of fixing the issue, it requires a totally different "patch". Hence, a different issue. Edit: By the way, the section you quote from mine is not relevant to this issue... |
Forget the point I mentioned about it can be done through modifying the The other thing I said is still relevant, unless you want to allow But for typora, adding an extra math delimiter (which is already valid in typora) is easier. It just need a post-processor like this for LaTeX output. |
OK, so your requirement is that Typora should use same syntax as bare LaTeX regarding to LaTeX expressions? I'm not pro LaTeX user, so I checked https://en.wikibooks.org/wiki/LaTeX/Mathematics, one example it provide is Take $\sfrac{1}{2}$ cup of sugar, \dots
3\times\sfrac{1}{2}=1\sfrac{1}{2}
Take ${}^1/_2$ cup of sugar, \dots
3\times{}^1/_2=1{}^1/_2 It's just confusing to me that sometimes "$" is used, and sometimes it is not. So should typora also parse About export, Typora provide a wrapped method in |
The example over there might have some problems. The wikibook about LaTeX sometimes introduces wrong/poor habit. I'm not sure if this one is intentional or a mistake. But I tried to compiled it and it throws an error. The May be I didn't make the point clearer, so let me explain it again: There's a bunch of math environments that is not in math delimiters, e.g. So in LaTeX, they should be typed like this: Syntax 1: \begin{equation}
E=mc^2
\end{equation} In MathJax, it is more tolerate (and has historical reason) and allow both the above syntax, or Syntax 2: $$\begin{equation}
E=mc^2
\end{equation}$$ But the problem is this later one is not a correct LaTeX syntax. If it is left as is when export to LaTeX, The problem is how to solve this problem? Either the source use syntax 1, and the parsing engine need to understand such syntaxes (a bunch of them and only them. The newest patch in pandoc fixes the bug that it includes too much pandoc chose the 1st approach, since pandoc has long been parsing some LaTeX in the md source (e.g. The reason is that typora provides live-preview, if you choose the 1st approach, that your typora live-preview engine need to understand that syntax as well such that after the user hit enter after syntax 1, it will turns into math preview. This could create problems since typora also uses pandoc, and the suggestion seem to contradict with pandoc's dicision. The counter argument to this disadvantage are:
|
|
|
We will consider it a bug if "Export" -> "LaTeX" provided by typora would generate invalid latex output |
In new version, "Export" -> "LaTeX" operation will not include the unnecessary math delimiter. So exported LaTeX can be compiled. |
In a old, messy document I wrote in ickc/markdown-variants: Testing LaTeX Environments Usage in MathJax From Markdown Convertion (including mmd and pandoc), there's a bunch of LaTeX environments that MathJax also support are expected to be bare (without
$$
).Currently in typora, it has to be typed in
which will resulted in an error in LaTeX output.
The text was updated successfully, but these errors were encountered: