【问题标题】:element.style is increasing font size arbitrarilyelement.style 任意增加字体大小
【发布时间】:2019-03-04 05:44:50
【问题描述】:

This 页面是由 Emacs 的 org-mode HTML 导出自动生成的。我已经将它设置为使用 LaTeX 符号的 MathJax 渲染。在 There Exists 行的第三列中,我使用了由“$”包围的内联 LaTeX 符号

$\exists  x \mid x2>x$

这是正确的 LaTeX 嵌入,而上面和下面的行我没有,即 Emacs 只是拾取 LaTeX 标记并在不使用“$”的情况下插入它。如果您检查(我正在使用 Chrome)此代码,您会发现它仅针对这个 LaTeX 标记增加了字体大小,看似任意,使得这些符号与其他符号相比显得异常大。

<span style="display: inline-block; position: relative; width: 5.681em; height: 0px; font-size: 129%;">

如何阻止、阻止、覆盖这个 element.style 被插入并放大我的字体大小?

element.style {
    display: inline-block;
    position: relative;
    width: 5.713em;
    height: 0px;
    font-size: 129%;
}

更新:

我已将问题缩小到自定义 stylesheet.css 中的某些内容:

table {
    /* font-family: monospace; */
    font-family:'eulermedium_18';
    /* font-size: 1.05em; */
    margin-left:5%;
    margin-right:auto;
    margin-top:0.5em;
    margin-bottom:0.5em;
    line-height: 1.5em;
}

font-family。上面我已经注释掉了monospace,它给了我一个 129% 的任意大小。但是正如你所见,我尝试了 AMS Euler(由 Font Squirrel 转换的 ttf 版本,就像 Computer Modern 一样),它导致有问题的 org-mode 表的$...$ 部分将字体大小减小到 53%!疯狂。同样,table 中没有 font-family 大小在 LaTeX/MathJax 和常规文本中是正常的。有什么方法可以让 MathJax 的 org-mode HTML 导出正确使用我的字体?

【问题讨论】:

  • $...$ 引发了 MathJax 感叹词。其他两排没有得到那种待遇。您可能可以更改 MathJax 设置来更改大小,但字体也不同,因此除非您也更改它,否则它会很突出。为什么不一视同仁呢?全部$...$ 分隔或全部不分隔。
  • 是的,我将更改为适当的 LaTeX 封装,但这并不能解决我的问题。我想我需要了解为什么会调用 element.style 的东西。

标签: css emacs org-mode


【解决方案1】:

好像也和font-family有关。 There Exists 行的第 3 列似乎将font 用作STIXGeneral-Italic,而在其他地方使用的默认font 似乎是monospace。您可以在 stylesheet.css 中使用 !important 指令覆盖这些样式。

.mrow span{
    font-family: inherit!important;
    font-size: 100%;
}

【讨论】:

  • 我已经在这个问题上抛出了.mrow span { font-family: inherit !important; font-size: 100%; } .org-left { font-family: inherit !important; font-size: 100%; } .MathJax span { font-family: inherit !important; font-size: 100%; } #MathJax-Span-1 { font-family: inherit !important; font-size: 100%; },但没有任何效果。唉。
  • 很有趣,但是当我删除所有标题并只拥有裸表时,MathJax 仍然是默认设置,但有问题的 element.style 部分仅将字体增加到 104%。将尝试从这个向后工作....
  • 不幸的是,我已将其范围缩小到我的自定义 stylesheet.css。将通过它进行除草以找出导致此问题的原因。尽管如此,当我取出样式表时,element.style 从 129% 下降到 104% 还是很奇怪。
  • 奇怪。当我使用本地覆盖在您的网站上进行更改时,我可以看到字体样式和大小的变化,或多或少类似于其他地方的字体。
  • 通过从table { /* font-family: monospace; */ font-size: 1.05em; margin-left:5%; margin-right:auto; margin-top:0.5em; margin-bottom:0.5em; line-height: 1.5em; } 中取出font-family:monospace,我得到了正常、不乱的字体大小。但有了它,它就会引发element-style 字体的疯狂。
猜你喜欢
  • 2018-07-16
  • 2015-02-01
  • 1970-01-01
  • 1970-01-01
  • 2018-04-18
  • 2018-12-12
  • 2018-12-29
  • 2013-03-02
  • 2023-03-11
相关资源
最近更新 更多