Open BryceWG opened 1 week ago
The issue with LaTeX formulas not rendering on your Dify conversation page might be related to the dependencies responsible for LaTeX rendering. Dify uses the following libraries for this purpose:
katex
: "^0.16.10"rehype-katex
: "^6.0.2"remark-math
: "^5.1.1" [1].Here are a few steps you can take to troubleshoot and potentially resolve the issue:
Check Dependencies: Ensure that these dependencies are correctly installed in your environment. You can verify this by checking your package.json
file and running npm install
or yarn install
to reinstall the dependencies.
Configuration: Verify if there are any specific configurations required for these libraries in your project. Sometimes, additional configuration might be needed to enable LaTeX rendering.
Inspect Logs: Although you mentioned there are no clear errors in the Docker logs, it might be helpful to increase the logging verbosity or check the browser console for any client-side errors related to LaTeX rendering.
Update Dify: Ensure you are using the latest version of Dify. Sometimes, issues are resolved in newer releases.
Custom Modifications: Since you mentioned modifying .env
and nginx
configurations, double-check these changes to ensure they do not interfere with the rendering process.
If the issue persists after these steps, it might be helpful to provide more detailed logs or error messages to further diagnose the problem.
To continue talking to Dosu, mention @dosu.
The issue with LaTeX formulas not rendering on your Dify conversation page might be related to the dependencies responsible for LaTeX rendering. Dify uses the following libraries for this purpose:
katex
: "^0.16.10"rehype-katex
: "^6.0.2"remark-math
: "^5.1.1" [1].Here are a few steps you can take to troubleshoot and potentially resolve the issue:
- Check Dependencies: Ensure that these dependencies are correctly installed in your environment. You can verify this by checking your
package.json
file and runningnpm install
oryarn install
to reinstall the dependencies.- Configuration: Verify if there are any specific configurations required for these libraries in your project. Sometimes, additional configuration might be needed to enable LaTeX rendering.
- Inspect Logs: Although you mentioned there are no clear errors in the Docker logs, it might be helpful to increase the logging verbosity or check the browser console for any client-side errors related to LaTeX rendering.
- Update Dify: Ensure you are using the latest version of Dify. Sometimes, issues are resolved in newer releases.
- Custom Modifications: Since you mentioned modifying
.env
andnginx
configurations, double-check these changes to ensure they do not interfere with the rendering process.If the issue persists after these steps, it might be helpful to provide more detailed logs or error messages to further diagnose the problem.
To continue talking to Dosu, mention @dosu.
I found that my node.js version is 16 and my os is centos 7. It's hard for me to upgrade node.js to 18
Self Checks
Dify version
0.8.2
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Recently, I found that my Dify conversation page cannot render latex formulas properly, but markdown format can be rendered normally. I am not sure if I changed any settings that caused this issue, and there are no clear errors in the docker logs. Below is the display situation of latex in my current conversation: I have been waiting for several versions to fix this issue, but I have not found any users with the same situation, and there is no clear relevant setting found in the env configuration. I should not have modified any files other than .env and nginx configuration.
✔️ Expected Behavior
In the conversation page, the latex formula can be rendered correctly
❌ Actual Behavior
The latex formula in the dialogue page is not rendered, but the markdown rendering seems fine: