Skip to content
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

Mathematical equations with bracket delimiters \[ \] are rendered inline instead of on display [LaTeX, KaTeX] #11292

Open
1 of 2 tasks
kauesena opened this issue May 5, 2024 · 2 comments
Labels
:type/feature-request Closed at will. Feature requests are in Logseq forum https://discuss.logseq.com/

Comments

@kauesena
Copy link

kauesena commented May 5, 2024

Search first

  • I searched and no similar issues were found

What Happened?

Equations placed in display delimiters \[ \] (which should be equivalent to $$ $$) are rendered as inline equations like if they had been placed inside $ $ or \( \).

Reproduce the Bug

  1. Inside a block, place some mathematical expression like \[ \sum_{n=1}^{\infty} \frac{1}{n(n+1)} \].
  2. Leave the block so that it gets rendered.
  3. Inside a block, place the same expression but enclosed by double dollar signs $$ \sum_{n=1}^{\infty} \frac{1}{n(n+1)} $$;
  4. Leave the block and compare how they were rendered.

Expected Behavior

Ones expect the mathematica formulas delimited by \[ \] to appear centred and big as they do when they are delimited by $$ $$.

Screenshots

No response

Desktop or Mobile Platform Information

No response

Additional Context

I use the org-mode markup format.

Are you willing to submit a PR? If you know how to fix the bug.

  • I'm willing to submit a PR (Thank you!)
@andelf andelf added feature :type/feature-request Closed at will. Feature requests are in Logseq forum https://discuss.logseq.com/ and removed feature labels May 6, 2024
@andelf
Copy link
Collaborator

andelf commented May 6, 2024

These are markdown extensions. So an implementation might choose any style for equations.

@kauesena
Copy link
Author

kauesena commented May 7, 2024

These are markdown extensions. So an implementation might choose any style for equations.

I don't know if I understand your meaning correctly, in which case, please forgive me. I will expand on what I meant in the "Expected Behavior" field, as I was terse there.

All of the math delimiting options \[ \], \( \), $$ $$ and $ $ are standard LaTeX and Org syntax. I may be wrong, but I think \[ \] and \( \) began with LaTeX, and in TeX there were only the dollar sign options. They were an improvement intended to clearly mark the beginning and the end with different character sequences (which must have parsing advantages). In LaTeX,

  • $$ $$ and \[ \] generate centred unnumbered display equations; and
  • $ $ and \( \) generate inline equations.

Org has replicated the LaTeX syntax (and many Markdown implementations did that too as an extension, like you said). In Emacs, using org-export to – say – HTML, one will get centred equations in their own lines. In a webpage, with KaTeX auto-render extension, the default is to render \[ \] in display mode. As the display mode is implemented for $$ $$, the behaviour I expected for equations such as \[ax^2 +b^2x +c =0\] was for them to be rendered on display mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:type/feature-request Closed at will. Feature requests are in Logseq forum https://discuss.logseq.com/
Projects
None yet
Development

No branches or pull requests

2 participants