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 内容无法换行导致窄屏浏览时内容溢出 #162

Closed
3 tasks done
Candinya opened this issue Oct 26, 2022 · 12 comments
Closed
3 tasks done
Assignees

Comments

@Candinya
Copy link
Owner

Candinya commented Oct 26, 2022

  1. 报告前须知
  • 我确认该Bug是可复现的,我会根据下面的模板提供完整详尽的复现步骤
  • 我确认已认真阅读 ReadMe.md 和文档,确认描述的内容有误或是不能解决我的问题
  • 我已知晓如果没有认真阅读且勾选这里所有的条目,或是没有使用此模板认真详细地描述问题,是对彼此时间的浪费,我的 issue 可能会被无解释关闭
  1. 对Bug的描述:

使用 hexo-math 插件
MathJax 生成的公式无法自动换行,主题样式现在针对长内容没有分段,导致窄屏浏览时内容溢出
KaTeX 生成的没有问题

  1. 复现Bug的方法:
  1. 期望的行为:

作为公式来讲随意换行也不太好,调整一下样式,让它可以像长代码块一样左右滑动

  1. 相关的截图:

image

  1. 运行环境(如果该Bug的产生和环境有关,例如浏览器不兼容导致):
  1. 您的配置文件:
  1. 补充内容:

来自评论区 https://candinya.com/posts/Kratos-Rebirth/ @FrozenLemonTee

@Candinya Candinya self-assigned this Oct 26, 2022
@ArcticLampyrid
Copy link
Collaborator

感觉应该是 math 类插件的锅?

@Candinya
Copy link
Owner Author

感觉应该是 math 类插件的锅?

有可能,如果有比较明显的格式的话可以专门优化一下样式,我明天具体看一看

@Candinya
Copy link
Owner Author

装了 hexo-math 插件,用 MathJax 生成的公式确实不会自动折行,加了一个块滚动代码让它能左右滚动,可以试一试效果(或者等下一个版本发布)
用 KaTeX 生成的是分散的字元,会自动折行,所以没做处理

@FrozenLemonTee
Copy link

第一时间测试了一下,发现还是存在问题,虽然通过横向滑块可以解决latex长公式的溢出问题,但是原来嵌入文字里的公式却被强制换行了:

image

而原来的效果应该是这样的:

image

可不可以让latex公式有两种显示方式,嵌入文段的短公式保持和修复前一样,而长公式可以通过横向滑块来查看呢?

Candinya added a commit that referenced this issue Oct 27, 2022
@Candinya
Copy link
Owner Author

新推了一个提交,可以试试这样会不会好一些哦

@ArcticLampyrid
Copy link
Collaborator

实在不行也可以来试试 katex?
https://github.com/ArcticLampyrid/hexo-filter-katex

@FrozenLemonTee
Copy link

这次改好以后直接部署了,然后用手机尝试了一下,除了长公式在显示上会被缩小以外,已经没有其他比较大的问题了。

Screenshot_20221027_182911_com UCMobile

至于这个长公式尺寸被缩小的问题,基本上不算太影响阅读,当然如果大大可以完善就更好了~

@Candinya
Copy link
Owner Author

缩小看起来也有点奇怪,我想想有没有其他什么办法再优化一下(挠头x

@Candinya
Copy link
Owner Author

Candinya commented Nov 3, 2022

换了一种 display ,不知道能不能优化一下样式的问题(也可能是劣化hhhh

@FrozenLemonTee
Copy link

这回看起来没有问题了,感谢!
顺便问一个题外话,我看了一下waline已经更新到2.13了,功能上新增了很多东西,咱们这边可以适配一下新版本吗?

@Candinya
Copy link
Owner Author

Candinya commented Nov 3, 2022

好的,我看看

@Candinya
Copy link
Owner Author

Waline 也已经更新了(暂时在开发代码,下一版就能用上啦)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants