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格式的东西显示无转换 #2070

Closed
cnliucheng opened this issue Apr 17, 2024 · 14 comments · Fixed by lobehub/lobe-ui#168
Closed

[Bug] latex格式的东西显示无转换 #2070

cnliucheng opened this issue Apr 17, 2024 · 14 comments · Fixed by lobehub/lobe-ui#168
Labels
🐛 Bug Something isn't working | 缺陷 Inactive No response in 30 days | 超过 30 天未活跃

Comments

@cnliucheng
Copy link

💻 Operating System

Windows

📦 Environment

Official Preview

🌐 Browser

Chrome

🐛 Bug Description

latex格式的内容在chatgpt显示无转换,但是在其它模型可以正常转换

🚦 Expected Behavior

希望可以正常显示LaTeX在chatgpt

📷 Recurrence Steps

No response

📝 Additional Information

No response

@cnliucheng cnliucheng added the 🐛 Bug Something isn't working | 缺陷 label Apr 17, 2024
@lobehubbot
Copy link
Member

👀 @cnliucheng

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@Anivie
Copy link

Anivie commented Apr 17, 2024

see.

@cnliucheng
Copy link
Author

see.

同一个公式,使用gemini模型可以正常显示LaTex,用chatgpt模型就不行

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


see.

The same formula can be displayed normally in LaTex using the gemini model, but not using the chatgpt model.

@Anivie
Copy link

Anivie commented Apr 18, 2024

see.

同一个公式,使用gemini模型可以正常显示LaTex,用chatgpt模型就不行

这个是因为gemini和gpt使用的md方言不一致,lobe默认只适配gemini用的方言

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


see.

The same formula can be displayed normally in LaTex using the gemini model, but not using the chatgpt model.

This is because the md dialects used by gemini and gpt are inconsistent. By default, lobe only adapts to the dialect used by gemini.

@cnliucheng
Copy link
Author

see.

同一个公式,使用gemini模型可以正常显示LaTex,用chatgpt模型就不行

这个是因为gemini和gpt使用的md方言不一致,lobe默认只适配gemini用的方言

好的,目前使用chatg4模型的时候只能这样解决了,用其它的模型例如gemini、qwen都是正常的,谢谢。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


see.

For the same formula, LaTex can be displayed normally using the gemini model, but not using the chatgpt model.

This is because the md dialects used by gemini and gpt are inconsistent. By default, lobe only adapts to the dialect used by gemini.

Okay, this is the only solution when using the chatg4 model. It is normal to use other models such as gemini and qwen. Thank you.

@Haerbin23456
Copy link

差不多的问题。我这是 \( \)\[ \] 括起来的公式显示不了,如果手动改成 $ $$$ $$ 就正常了,改完之后后续 gpt-4-turbo-2024-04-09 的回答也会自动采用 $ $$$ $$
然而 gpt-4-turbo-2024-04-09 的默认回答似乎总是 \( \)\[ \] 的,如果没有前文语境并且没要求他用美元符号的话
问题截图

在数学和向量几何中,一个向量在另一个向量上的投影可以通过一定的公式计算得出。具体来说,如果我们想要计算向量 **b** 在向量 **a** 上的投影向量,我们可以使用以下公式:

设向量 **a** 和向量 **b** 分别为 \( \vec{a} \)\( \vec{b} \),则 **b****a** 上的投影向量 **proj_a(b)** 可以表示为:

\[ \text{proj}_{\vec{a}} (\vec{b}) = \frac{\vec{a} \cdot \vec{b}}{\vec{a} \cdot \vec{a}} \vec{a} \]

其中 "·" 表示向量的点积(内积),计算如下:

\[ \vec{a} \cdot \vec{b} = |\vec{a}| |\vec{b}| \cos \theta \]

这里 \( |\vec{a}| \)\( |\vec{b}| \) 分别是向量 **a****b** 的模(长度),而 \( \theta \) 是两向量之间的夹角。

这个公式的几何意义是:将 **b****a** 的方向投影,得到的向量在 **a** 上的分量。这个投影向量与 **a** 同向或反向,并且其长度是 **b****a** 方向上的分量的长度。

例如,如果我们有向量 \( \vec{a} = (3, 4) \)\( \vec{b} = (2, 1) \),那么我们首先计算点积:

\[ \vec{a} \cdot \vec{b} = 3 \times 2 + 4 \times 1 = 6 + 4 = 10 \]

然后计算 \( \vec{a} \cdot \vec{a} \)\[ \vec{a} \cdot \vec{a} = 3 \times 3 + 4 \times 4 = 9 + 16 = 25 \]

因此,投影向量为:

\[ \text{proj}_{\vec{a}} (\vec{b}) = \frac{10}{25} \vec{a} = \frac{2}{5} (3, 4) = \left( \frac{6}{5}, \frac{8}{5} \right) \]

这就是 **b****a** 上的投影向量的表示方法。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Pretty much the same question. For me, the formulas enclosed by \( \) and \[ \] cannot be displayed. If I manually change it to $ $ or $$ $$, it will be normal. After the change, subsequent answers to gpt-4-turbo-2024-04-09 will automatically use $ $ and $$ $$.
However, the default answer of gpt-4-turbo-2024-04-09 seems to always be \( \) and \[ \], if there is no previous context and he is not asked to use US dollars Symbol words
Screenshot of the problem

In mathematics and vector geometry, the projection of one vector onto another vector can be calculated using certain formulas. Specifically, if we want to calculate the projection vector of vector **b** on vector **a**, we can use the following formula:

Assume vector **a** and vector **b** are \( \vec{a} \) and \( \vec{b} \) respectively, then **b** is on **a** The projection vector **proj_a(b)** can be expressed as:

\[ \text{proj}_{\vec{a}} (\vec{b}) = \frac{\vec{a} \cdot \vec{b}}{\vec{a} \cdot \vec{ a}} \vec{a} \]

Where "·" represents the dot product (inner product) of vectors, calculated as follows:

\[ \vec{a} \cdot \vec{b} = |\vec{a}| |\vec{b}| \cos \theta \]

Here \( |\vec{a}| \) and \( |\vec{b}| \) are the modules (lengths) of vectors **a** and **b** respectively, and \( \theta \ ) is the angle between the two vectors.

The geometric meaning of this formula is: project **b** in the direction of **a** and get the component of the vector on **a**. This projection vector is in the same or opposite direction as **a** and its length is the length of the component of **b** in the **a** direction.

For example, if we have the vectors \( \vec{a} = (3, 4) \) and \( \vec{b} = (2, 1) \), then we first compute the dot product:

\[ \vec{a} \cdot \vec{b} = 3 \times 2 + 4 \times 1 = 6 + 4 = 10 \]

Then calculate \( \vec{a} \cdot \vec{a} \):

\[ \vec{a} \cdot \vec{a} = 3 \times 3 + 4 \times 4 = 9 + 16 = 25 \]

Therefore, the projection vector is:

\[ \text{proj}_{\vec{a}} (\vec{b}) = \frac{10}{25} \vec{a} = \frac{2}{5} (3, 4) = \left( \frac{6}{5}, \frac{8}{5} \right) \]

This is how the projection vector of **b** onto **a** is represented.

@Anivie
Copy link

Anivie commented Apr 18, 2024

差不多的问题。我这是 \( \)\[ \] 括起来的公式显示不了,如果手动改成 $ $$$ $$ 就正常了,改完之后后续 gpt-4-turbo-2024-04-09 的回答也会自动采用 $ $$$ $$。 然而 gpt-4-turbo-2024-04-09 的默认回答似乎总是 \( \)\[ \] 的,如果没有前文语境并且没要求他用美元符号的话 问题截图

在数学和向量几何中,一个向量在另一个向量上的投影可以通过一定的公式计算得出。具体来说,如果我们想要计算向量 **b** 在向量 **a** 上的投影向量,我们可以使用以下公式:

设向量 **a** 和向量 **b** 分别为 \( \vec{a} \) 和 \( \vec{b} \),则 **b** 在 **a** 上的投影向量 **proj_a(b)** 可以表示为:

\[ \text{proj}_{\vec{a}} (\vec{b}) = \frac{\vec{a} \cdot \vec{b}}{\vec{a} \cdot \vec{a}} \vec{a} \]

其中 "·" 表示向量的点积(内积),计算如下:

\[ \vec{a} \cdot \vec{b} = |\vec{a}| |\vec{b}| \cos \theta \]

这里 \( |\vec{a}| \) 和 \( |\vec{b}| \) 分别是向量 **a** 和 **b** 的模(长度),而 \( \theta \) 是两向量之间的夹角。

这个公式的几何意义是:将 **b** 向 **a** 的方向投影,得到的向量在 **a** 上的分量。这个投影向量与 **a** 同向或反向,并且其长度是 **b** 在 **a** 方向上的分量的长度。

例如,如果我们有向量 \( \vec{a} = (3, 4) \) 和 \( \vec{b} = (2, 1) \),那么我们首先计算点积:

\[ \vec{a} \cdot \vec{b} = 3 \times 2 + 4 \times 1 = 6 + 4 = 10 \]

然后计算 \( \vec{a} \cdot \vec{a} \):

\[ \vec{a} \cdot \vec{a} = 3 \times 3 + 4 \times 4 = 9 + 16 = 25 \]

因此,投影向量为:

\[ \text{proj}_{\vec{a}} (\vec{b}) = \frac{10}{25} \vec{a} = \frac{2}{5} (3, 4) = \left( \frac{6}{5}, \frac{8}{5} \right) \]

这就是 **b** 在 **a** 上的投影向量的表示方法。

具体讨论在这个issue中有,目前只能通过加prompt的方式解决,我也希望能支持gpt使用的方言

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Pretty much the same question. For me, the formulas enclosed by \( \) and \[ \] cannot be displayed. If I manually change it to $ $ or $$ $$, it will be normal. After the change, subsequent answers to gpt-4-turbo-2024-04-09 will automatically use $ $ and $$ $$. However, the default answer of gpt-4-turbo-2024-04-09 seems to always be \( \) and \[ \], if there is no previous context and he is not asked to use US dollars Symbols! [Screenshot of question](https://private-user-images.githubusercontent.com/60066765/323482079-bf8 568f0-66fc-4e0a-a5b7-86e4231ef85c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..LLlH 44NDiS83pG1t1PiEaxEyU-KBSXgJ1iyAU_Xd1og)

In mathematics and vector geometry, the projection of one vector onto another vector can be calculated using certain formulas. Specifically, if we want to calculate the projection vector of vector **b** on vector **a**, we can use the following formula:

Assume vector **a** and vector **b** are \( \vec{a} \) and \( \vec{b} \) respectively, then **b** is on **a** The projection vector **proj_a(b)** can be expressed as:

\[ \text{proj}_{\vec{a}} (\vec{b}) = \frac{\vec{a} \cdot \vec{b}}{\vec{a} \cdot \vec {a}} \vec{a} \]

Where "·" represents the dot product (inner product) of vectors, calculated as follows:

\[ \vec{a} \cdot \vec{b} = |\vec{a}| |\vec{b}| \cos \theta \]

Here \( |\vec{a}| \) and \( |\vec{b}| \) are the modules (lengths) of vectors **a** and **b** respectively, and \( \theta \) is the angle between the two vectors.

The geometric meaning of this formula is: project **b** in the direction of **a**, and get the component of the vector on **a**. This projection vector is in the same or opposite direction as **a** and its length is the length of the component of **b** in the **a** direction.

For example, if we have vectors \( \vec{a} = (3, 4) \) and \( \vec{b} = (2, 1) \), then we first calculate the dot product:

\[ \vec{a} \cdot \vec{b} = 3 \times 2 + 4 \times 1 = 6 + 4 = 10 \]

Then calculate \( \vec{a} \cdot \vec{a} \):

\[ \vec{a} \cdot \vec{a} = 3 \times 3 + 4 \times 4 = 9 + 16 = 25 \]

Therefore, the projection vector is:

\[ \text{proj}_{\vec{a}} (\vec{b}) = \frac{10}{25} \vec{a} = \frac{2}{5} (3, 4 ) = \left( \frac{6}{5}, \frac{8}{5} \right) \]

This is how the projection vector of **b** on **a** is represented.

The specific discussion is in this issue. Currently it can only be solved by adding prompt. I also hope to support the dialect used by gpt.

@lobehubbot
Copy link
Member

@cnliucheng

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

1 similar comment
@lobehubbot
Copy link
Member

@cnliucheng

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷 Inactive No response in 30 days | 超过 30 天未活跃
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants