ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
75.02k stars 58.99k forks source link

[Feature] Markdown不支持渲染\\text{det}(A) = \\sum_{j=1}^{n} a_{ij} C_{ij} \\公式 #3479

Closed youdianfan closed 9 months ago

youdianfan commented 9 months ago

Markdown不支持渲染\text{det}(A) = \sum{j=1}^{n} a{ij} C_{ij} \公式

Issues-translate-bot commented 9 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [Feature] Markdown does not support rendering \text{det}(A) = \sum{j=1}^{n} a{ij} C_{ij} \formula

Markdown does not support rendering \text{det}(A) = \sum{j=1}^{n} a{ij} C_{ij} \formula

H0llyW00dzZ commented 9 months ago

It's causing model issue

H0llyW00dzZ commented 9 months ago

Try using gpt-4 preview

youdianfan commented 9 months ago

image

I don't think so. gpt supports it

youdianfan commented 9 months ago

[ "拉普拉斯展开(Laplace expansion)是一种用于计算行列式的方法。给定一个n阶方阵,其行列式的拉普拉斯展开公式如下:\n\n\[ \det(A) = \sum{i=1}^{n} (-1)^{i+j} \cdot a{ij} \cdot \det(M{ij}) \]\n\n其中,\( a{ij} \) 是矩阵A的第i行第j列的元素,\( \det(M_{ij}) \) 是剩余矩阵,即去掉第i行和第j列后得到的(n-1)阶方阵的行列式。展开的求和是针对矩阵A的任意一行或一列进行的。\n\n这个公式的主要思想是将行列式的计算分解为对每个元素乘以其代数余子式的求和。这种展开方法在计算较大阶数的行列式时可能会比直接计算更为方便。" ]

Issues-translate-bot commented 9 months ago

Bot detected the issue body's language is not English, translate it automatically.


[ "Laplace expansion is a method for calculating determinants. Given an n-order square matrix, the Laplace expansion formula of its determinant is as follows:\n\n\[ \ det(A) = \sum{i=1}^{n} (-1)^{i+j} \cdot a{ij} \cdot \det(M{ij}) \]\ n\nAmong them, \( a{ij} \) is the element of the i-th row and j-th column of matrix A, \( \det(M_{ij}) \) is the remaining matrix, that is, after removing the The determinant of the (n-1) order square matrix obtained after row i and column j. The expanded summation is performed on any row or column of matrix A.\n\nThe main idea of ​​this formula is to convert the determinant The calculation of is decomposed into the sum of each element multiplied by its algebraic cofactor. This expansion method may be more convenient than direct calculation when calculating determinants of larger orders." ]

Issues-translate-bot commented 9 months ago

Bot detected the issue body's language is not English, translate it automatically.


[ "Laplace expansion is a method for calculating determinants. Given an n-order square matrix, the Laplace expansion formula of its determinant is as follows:\n\n\\[ \\ det(A) = \\sum_{i=1}^{n} (-1)^{i+j} \\cdot a_{ij} \\cdot \\det(M_{ij}) \\]\ n\nAmong them, \\( a_{ij} \\) is the element of the i-th row and j-th column of matrix A, \\( \\det(M_{ij}) \\) is the remaining matrix, that is, after removing the The determinant of the (n-1) order square matrix obtained after row i and column j. The expanded summation is performed on any row or column of matrix A.\n\nThe main idea of ​​this formula is to convert the determinant The calculation of is decomposed into the sum of each element multiplied by its algebraic cofactor. This expansion method may be more convenient than direct calculation when calculating determinants of larger orders." ]

youdianfan commented 9 months ago

Above is the data returned by gpt, placed on top of Markdown in the project, he will not render the formula

H0llyW00dzZ commented 9 months ago

image

I don't think so. gpt supports it

Its model issue, being bad hallucinated. you have to prompt it perfectly because sometimes its not returning ('$...$') or ('$$...$$') which is syntax's latex in text/markdown

H0llyW00dzZ commented 9 months ago

Check this my show off

https://github.com/Yidadaa/ChatGPT-Next-Web/discussions/3351

youdianfan commented 9 months ago

GPT officially does not use $, it can still be identified

youdianfan commented 9 months ago

I used chatgpt's default 3.5 model, which returned no $in the data, and it still recognized tex mathematical formulas

youdianfan commented 9 months ago

This is the answer data returned by the chatgpt web page

[ "拉普拉斯展开(拉普拉斯展开)是一种用于计算行列式的方法。给定一个阶方阵,其行列式的拉普拉斯展开公式如下:\n\n[ \det (A) = \sum{i=1}^{n} (-1)^{i+j} \cdot a{ij} \cdot \det(M{ij}) ]\n\n其中,\ ( a{ij} ) 是矩阵A的第i行第j列的元素,( \det(M_{ij}) ) 是剩余矩阵,即去掉第i行和第j列后得到的(n -1)阶方阵的行列式。展开的求和是针对矩阵A的任意一行或一列进行的。\n\n这个公式的主要思想是行列式的计算架构,为每个元素乘习得代数余子式的求和。这种展开方法在计算增量阶数的行列式时可能会比直接计算更加方便。" ]

Issues-translate-bot commented 9 months ago

Bot detected the issue body's language is not English, translate it automatically.


This is the answer data returned by the chatgpt web page

[ "Laplacian expansion (Laplacian expansion) is a method used to calculate determinants. Given a square matrix of order 1, the Laplace expansion formula of its determinant is as follows:\n\n[ \ det (A) = \sum{i=1}^{n} (-1)^{i+j} \cdot a{ij} \cdot \det(M{ij}) ]\n\nWhere, \ ( a{ij} ) is the element in the i-th row and j-th column of matrix A, ( \det(M_{ij}) ) is the remaining matrix, which is obtained after removing the i-th row and j-th column ( Determinant of a square matrix of order n -1). The expanded summation is performed on any row or column of matrix A.\n\nThe main idea of ​​this formula is the calculation structure of the determinant, which is learned for each element multiplication Summation of algebraic cofactors. This expansion method may be more convenient than direct calculation when computing determinants of increasing order." ]

H0llyW00dzZ commented 9 months ago

GPT officially does not use $, it can still be identified

Api and gpt officially it's different Might they're improving it

youdianfan commented 9 months ago

The Markdown component of the current project does not support the rendering of mathematical formulas in text format

H0llyW00dzZ commented 9 months ago

The Markdown component of the current project does not support the rendering of mathematical formulas in text format

It's supported the syntax its $...$ and $$...$$

H0llyW00dzZ commented 9 months ago

Its model issue if not returning with syntax $...$ or $$...$$ (this officially syntax latex in text/markdown)

youdianfan commented 9 months ago

It is not supported, you can write this data to the Markdown component to test

H0llyW00dzZ commented 9 months ago

It is not supported, you can write this data to the Markdown component to test

do you think this not supported ? be honest

image

youdianfan commented 9 months ago

Do not add $$I said very detailed on the Tex format

H0llyW00dzZ commented 9 months ago

Do not add $$I said very detailed on the Tex format

that's format for latext in markdown

youdianfan commented 9 months ago

image

Issues-translate-bot commented 9 months ago

Bot detected the issue body's language is not English, translate it automatically.


image

H0llyW00dzZ commented 9 months ago

image

your format is incorrect

youdianfan commented 9 months ago

I'm talking about latext, of course I know that the $$format is recognized, so I'm saying that the Markdown component of the current project is not supported

youdianfan commented 9 months ago

I don't know how to render mathematical formulas in latext format

H0llyW00dzZ commented 9 months ago

I don't know how to render mathematical formulas in latext format

it's same ($...$) ($$...$$)

H0llyW00dzZ commented 9 months ago

I'm talking about latext, of course I know that the $$format is recognized, so I'm saying that the Markdown component of the current project is not supported

yeah I know format like that are bad, even ($...$) ($$...$$) still returning that format btw in models

H0llyW00dzZ commented 9 months ago

try like this

$$
\text{det}(A) = \\\sum_{j=1}^{n} a_{ij} C_{ij}
$$

image

Issues-translate-bot commented 9 months ago

Bot detected the issue body's language is not English, translate it automatically.


try like this

$$
\text{det}(A) = \\\sum_{j=1}^{n} a_{ij} C_{ij}
$$

image

youdianfan commented 9 months ago

Thank you for your answer, but I need to solve that it supports Latext format instead of adding $$, adding $$can be identified, this function I know

H0llyW00dzZ commented 9 months ago

Thank you for your answer, but I need to solve that it supports Latext format instead of adding $$, adding $$can be identified, this function I know

if supports Latext format like this \text{det}(A) = \sum_{j=1}^{n} a_{ij} C_{ij} \ it can possibly potential lead to XSS in javascript/typescript, so its not good even for ai as well, format $$ its better more safe

youdianfan commented 9 months ago

But the official chatgpt is supported

H0llyW00dzZ commented 9 months ago

But the official chatgpt is supported

they using different package for their nextjs + custom react, about this repo are using this which is safe already

https://www.npmjs.com/package/react-markdown

Yidadaa commented 9 months ago

之后会改。

Issues-translate-bot commented 9 months ago

Bot detected the issue body's language is not English, translate it automatically.


Will change later.