使用Mobile时MathJax方程不适合窗口的宽度 [英] MathJax equation does not fit the width of window when using mobile
问题描述
在我的博客文章(与Hugo编译)中,我本节
当在计算机屏幕上使用浏览器时,本节中的数学方程式会很好地呈现,但是,当我在移动设备上查看时,方程式在中间被剪切,没有滚动选项.
In my blog post (compiled with Hugo) I have this section
The math equations in this section are presented well when using a browser on a computer screen, however, when I view this on mobile the equations are being cut in the middle with no scrolling option.
我想只调整这些方程式的大小以适合在移动设备上访问时的窗口,或者在需要时添加滚动选项.我该如何实现?
I want to either resize only these equations to fit the window when accessed on mobile, or adding a scrolling option when it is needed. How can I achieve that?
我正在使用Markdown撰写我的帖子.我尝试了很多事情,包括将此代码添加到我的markdown文件中:
I am using Markdown to write my posts. I have tried a lot of things, including adding this code to my markdown file:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS": {linebreaks: { automatic: true }}
})
</script>
但这没用.
推荐答案
有问题的方程是表格环境,表不能换行.
The problematic equations are tabular environments and tables cannot linebreak.
要获得滚动效果,可以将以下CSS添加到页面中.
To gain scrolling, you can add the following CSS to your page.
.MathJax_Display, .MJXc-display, .MathJax_SVG_Display {
overflow-x: auto;
overflow-y: hidden;
}
顺便说一下,该页面使用的是MathJax的古老版本- cdn.mathjax.org在3年前已被有效关闭,并且不再获得更新.
By the way, the page is using an ancient version of MathJax -- cdn.mathjax.org was effectively shut down 3 years ago and no longer gets updates.
这篇关于使用Mobile时MathJax方程不适合窗口的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!