我想制作一个 HTML 文档,其中包含一个模拟\itemize
乳胶环境的数学公式列表(即标记应该像“1)、2)等”)并且我想要一个两列布局。
对于数学公式,我使用 MathJax,对于标记,我在https://stackoverflow.com/a/1636635/3025740使用 CSS 技巧,对于两列,我使用 CSS 属性column-count
添加特定于供应商的属性,如http:// www.w3schools.com/cssref/css3_pr_column-count.asp
这三种机制中的任何两种似乎都可以正常工作,但是当我混合使用这三种机制时,它就不行了:数学公式的字体大小(回忆,用 MathJax 渲染)太小了。
这是重现问题的最小代码(在 Ubuntu 16.04 LTS 和 Firefox 49.0.2 上测试)
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<style media="screen">
ol {
counter-reset: list;
}
ol > li {
list-style: none;
/*removing this property fixes MathJax size but breaks markers*/
position: relative;
}
ol > li:before {
counter-increment: list;
content: counter(list, decimal) ") ";
position: absolute;
left: -1.4em;
}
.twocolumns {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
}
</style>
</head>
<body>
<div class="twocolumns">
<ol>
<li>\(2 \times 5\)</li>
<li>\(4 \times (2 +11)\)</li>
<li>\(4 \times 5 - 2 \times 7\)</li>
<li>\(4 \times (87 - 45) + 5 \times 2\)</li>
</ol>
</div>
</body>
</html>
position: relative;
如在CSS中删除的片段所示,ol > li
修复了 MathJax 大小问题。可悲的是,它也打破了标记技巧(标记消失)
知道如何进行这项工作吗?