1
0
Fork 0
mirror of https://github.com/requarks/wiki.git synced 2026-03-02 22:06:55 -05:00

Inline LaTeX rendering fails for certain commands if it's not surrounded by text #1130

Open
opened 2026-02-20 18:02:08 -05:00 by deekerman · 6 comments
Owner

Originally created by @mattiasJohnson on GitHub (Feb 10, 2020).

Originally assigned to: @NGPixel on GitHub.

Describe the bug
If a row in the markdown editor only is made up by some inline latex it will fail for certain commands.

A row consisting of only $\frac{1}{2}$ will fail and produce the output \frac{1}. If surrounded by text (text $\frac{1}{2}$ asdf) it will render succesfully. Interestingly enough both $\frac{1^{2}}{3^{4}}$ and $\frac{1}{3^{4}}$ will succeed while $\frac{1^{2}}{3}$ will fail which would lead me to believe it somehow is connected to the curly brackets?

The same goes for $\begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array}$ which will by itself produce the output \begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end.

The inline LaTeX doesn't always fail when not surrounded by any text, for example a row consisting of $\int_{-\infty}^\infty x^{ix} dx$ renders just fine.

To Reproduce
Steps to reproduce the behavior:

  1. Write a row in markdown editor consisting of only $\frac{1}{2}$.
  2. View the page.

Expected behavior
All LaTeX should render.

Screenshots
The code

## Inline LaTeX error

$\begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array}$

text $\begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array}$ text

$\frac{1}{3}$

text $\frac{1}{3}$ text

$\frac{1^{2}}{3^{4}}$

$\frac{1}{3^{4}}$

$\frac{1^{2}}{3}$

the output:

image

Host Info (please complete the following information):

  • OS: Ubuntu 18.04, Docker
  • Wiki.js version: 2.1.110
  • Database engine: postgres 11.6
Originally created by @mattiasJohnson on GitHub (Feb 10, 2020). Originally assigned to: @NGPixel on GitHub. **Describe the bug** If a row in the markdown editor only is made up by some inline latex it will fail for certain commands. A row consisting of only `$\frac{1}{2}$` will fail and produce the output `\frac{1}`. If surrounded by text (`text $\frac{1}{2}$ asdf`) it will render succesfully. Interestingly enough both `$\frac{1^{2}}{3^{4}}$` and `$\frac{1}{3^{4}}$` will succeed while `$\frac{1^{2}}{3}$` will fail which would lead me to believe it somehow is connected to the curly brackets? The same goes for `$\begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array}$` which will by itself produce the output `\begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end`. The inline LaTeX doesn't always fail when not surrounded by any text, for example a row consisting of `$\int_{-\infty}^\infty x^{ix} dx$` renders just fine. **To Reproduce** Steps to reproduce the behavior: 1. Write a row in markdown editor consisting of only `$\frac{1}{2}$`. 2. View the page. **Expected behavior** All LaTeX should render. **Screenshots** The code ``` ## Inline LaTeX error $\begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array}$ text $\begin{array}{lrc} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array}$ text $\frac{1}{3}$ text $\frac{1}{3}$ text $\frac{1^{2}}{3^{4}}$ $\frac{1}{3^{4}}$ $\frac{1^{2}}{3}$ ``` the output: ![image](https://user-images.githubusercontent.com/5561521/74194463-93946e00-4c59-11ea-8d71-01c4a716253c.png) **Host Info (please complete the following information):** - OS: Ubuntu 18.04, Docker - Wiki.js version: 2.1.110 - Database engine: postgres 11.6
Author
Owner

@jim-kirisame commented on GitHub (Aug 10, 2020):

When formular ends with right brace, and the inline formular does not surrounding by some (non-spacing) text, it would rendering fail.

图片
图片

I think issue #1952 is relevant.

@jim-kirisame commented on GitHub (Aug 10, 2020): When formular ends with right brace, and the inline formular does not surrounding by some (non-spacing) text, it would rendering fail. ![图片](https://user-images.githubusercontent.com/6049028/89760425-eecaee80-db1e-11ea-8bcf-29872bcb3929.png) ![图片](https://user-images.githubusercontent.com/6049028/89760430-f2f70c00-db1e-11ea-803f-32230e6f8e0d.png) I think issue #1952 is relevant.
Author
Owner

@LeLunZ commented on GitHub (Jan 27, 2021):

Is this still a issue? I have the same problems. and got to the same fixes as @jim-kirisame
Having the latest docker release image installed.

@LeLunZ commented on GitHub (Jan 27, 2021): Is this still a issue? I have the same problems. and got to the same fixes as @jim-kirisame Having the latest docker release image installed.
Author
Owner

@spartazhc commented on GitHub (Aug 26, 2021):

The issue still exists on latest Wiki.js 2.5.201

@spartazhc commented on GitHub (Aug 26, 2021): The issue still exists on latest Wiki.js 2.5.201
Author
Owner

@LexsionLee commented on GitHub (Sep 29, 2021):

This issue not exists on latest Wiki.js2.5.219 . But I find that unable to enter formulas after the Chinese period
Thank you for share.I am a beginner in formulas and encountered problem like you share, which caused me to be unable to enter formulas after the Chinese period . Based on what you wrote, I realized that I only need to add a space at both ends of the formula to evade this problem.

If someone encounters the same situation as me, just do this and it should be fine.

@LexsionLee commented on GitHub (Sep 29, 2021): This issue not exists on latest Wiki.js2.5.219 . But I find that unable to enter formulas after the Chinese period `。` Thank you for share.I am a beginner in formulas and encountered problem like you share, which caused me to be unable to enter formulas after the Chinese period `。` . Based on what you wrote, **I realized that I only need to add a space at both ends of the formula to evade this problem.** If someone encounters the same situation as me, just do this and it should be fine.
Author
Owner

@impdx commented on GitHub (May 5, 2022):

This problem still exists in version 2.5.280。
Expected behavior
All LaTeX should render.

@impdx commented on GitHub (May 5, 2022): This problem still exists in version 2.5.280。 Expected behavior All LaTeX should render.
Author
Owner

@ColdTeapot273K commented on GitHub (Oct 8, 2024):

This problem still exists in version 2.5.303. KaTeX renderer.

@ColdTeapot273K commented on GitHub (Oct 8, 2024): This problem still exists in version 2.5.303. KaTeX renderer.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wiki-requarks#1130
No description provided.