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

bug: LaTeX rendering issue #2865

Closed
thethinkmachine opened this issue May 4, 2024 · 4 comments
Closed

bug: LaTeX rendering issue #2865

thethinkmachine opened this issue May 4, 2024 · 4 comments
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@thethinkmachine
Copy link

thethinkmachine commented May 4, 2024

Describe the bug
Jan has issues with properly displaying mathematical content. When inline mathematical statements (enclosed within single $ delimiters) are used, the output duplicates the expression alongside the rendered LaTeX expression. Additionally, matrices enclosed within double $$ delimiters are not displayed correctly, with the application using small, fixed sized curved braces instead of the appropriate larger square brackets. Furthermore, rendering larger matrices, such as an n x n Jacobian (a matrix containing partials), is sometimes a hit or a miss, sometimes it fails to display the matrix completely.

Steps to reproduce

  1. Launch the Jan application and load a model (e.g., Llama 3 8B Q6).
  2. Ask it to print an inline mathematical expression (e.g., $E = mc^2$), it'll get duplicated next to the latex expression in the output.
  3. Ask it to print a matrix enclosed within $$ delimiters (e.g., $$\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$$), it uses small, curved braces instead of larger square braces to enclose the matrix.
  4. Ask it to print the following LaTeX syntax.
$$\frac{\partial \nabla\phi}{\partial \mathbf{x}} = \begin{bmatrix}
\frac{\partial \nabla_x \phi}{\partial x} & \frac{\partial \nabla_x \phi}{\partial y} & \frac{\partial \nabla_x \phi}{\partial z} \\
\frac{\partial \nabla_y \phi}{\partial x} & \frac{\partial \nabla_y \phi}{\partial y} & \frac{\partial \nabla_y \phi}{\partial z} \\
\frac{\partial \nabla_z \phi}{\partial x} & \frac{\partial \nabla_z \phi}{\partial y} & \frac{\partial \nabla_z \phi}{\partial z}
\end{bmatrix}$$

It renders the provided text as is.

Expected behavior
The expected behavior can be observed by copying and pasting the above LaTeX syntax into Obsidian, a note-taking application with proper LaTeX rendering capabilities. In Obsidian, the inline mathematical statements should be rendered correctly without duplication, and the matrices should be displayed using the appropriate square brackets and formatting. The larger, more complex matrices should also be rendered correctly, displaying the content in a visually appealing and mathematically accurate manner.

Screenshots

  • Not required (The bug is reproducible).

Environment details

  • Operating System: Windows 11
  • Jan Version: 0.4.12
  • Processor: AMD Ryzen 5 3600
  • RAM: 16GB
  • GPU: NVIDIA RTX 2070 Super (8 GB DDR6 VRAM)
  • System prompt: You are a helpful assistant designed to assist reasoning in mathematical tasks & subjects.
@thethinkmachine thethinkmachine added the type: bug Something isn't working label May 4, 2024
@thethinkmachine thethinkmachine changed the title bug: [DESCRIPTION] LaTeX rendering issue bug: LaTeX rendering issue May 4, 2024
@Van-QA
Copy link
Contributor

Van-QA commented May 6, 2024

The issue is reproducible ❌
image
image

@Van-QA Van-QA added this to the v.0.6.0 milestone Aug 22, 2024
@Van-QA
Copy link
Contributor

Van-QA commented Aug 29, 2024

The issue is resolved in Jan v0.5.2-619

@Van-QA
Copy link
Contributor

Van-QA commented Aug 30, 2024

Jan 0.5.3 is released to stable version of Jan app: https://github.com/janhq/jan/releases/tag/v0.5.3, feel free to get back to us if any concern

@Van-QA Van-QA closed this as completed Aug 30, 2024
@thethinkmachine
Copy link
Author

Sure, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants