-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Math using $ $ delimiter? #160
Comments
As you probably know, djot supports math, but in a more principled way:
Why not just |
As for |
Oh I see, indeed a problem I never thought of. How is pandoc handling it, having a complete TeX tokenizer? Maybe just do escape Since even for |
I think we skip content between matched
Well no. It works like regular verbatim backticks. There are no backslash escapes. Instead, if your content contains a |
Having spent quite a while thinking about how to integrate math into CommonMark because some Zulip users really want to use I wonder, though, if there might be room for a hybrid rule where |
I think a case could be made for using the block syntax, but this would make display math a block element instead of an inline element. In LaTeX display math is inline, in the sense that it can come in the middle of a paragraph -- though of course it displays set off in a block. You do sometimes see things like
and this will render fine in LaTeX. |
I pretty like the idea of @andersk about restricted mode. I could add two things:
```math
x^n + y^n = z^z
``` |
Compatibility with existing markdown variants isn't a goal of this project. |
But compatibility with LaTeX display math is? I'd say if it displays as a block then it is a block. |
If it looks like a block in djot that is, never mind what crazy embedding stuff you can do in TeX, in case that wasn't clear. |
@bpj I don't understand what you are getting at here. It is currently parsed as a block -- a code block. |
I think that @bpj means that if it is a code block, then the syntax of a code block should be used? |
Exactly! Sorry for the confusion! |
Is it possible to support
$ $
$$ $$
\( \)
,\[ \]
just like pandoc markdown? As an extension of some sort?I believe linear time parsing is still possible even if they are enabled. I just sampled one of my documents, there are 629 equations. More than 2% of the characters is
$
. I think this is true for many mathematical documents: math appears more often than every other construction (*
,_
, etc) combined! So optimize for math input is crucial for my use case.I do switch between writing markdown and latex a lot, so able to use
$ $
in djot would avoid having two sets of muscle memory.The text was updated successfully, but these errors were encountered: