SVG输出处理器选项

下面的选项控制 SVG output processor 当你包括 'output/svg'load 数组 loader 块,或者加载包含CommonHTML输出JAX的组合组件。它们与默认值一起列出。要设置这些选项中的任何一个,请包括 svg 在你的章节 MathJax 全局对象。


配置块

MathJax = {
  svg: {
    scale: 1,                      // global scaling factor for all expressions
    minScale: .5,                  // smallest scaling factor to use
    mtextInheritFont: false,       // true to make mtext elements use surrounding font
    merrorInheritFont: true,       // true to make merror text use surrounding font
    mathmlSpacing: false,          // true for MathML spacing rules, false for TeX rules
    skipAttributes: {},            // RFDa and other attributes NOT to copy to the output
    exFactor: .5,                  // default size of ex in em units
    displayAlign: 'center',        // default for indentalign when set to 'auto'
    displayIndent: '0',            // default for indentshift when set to 'auto'
    fontCache: 'local',            // or 'global' or 'none'
    localID: null,                 // ID to use for local font cache (for single equation processing)
    internalSpeechTitles: true,    // insert <title> tags with speech content
    titleID: 0                     // initial id number to use for aria-labeledby titles
  }
};

选项说明

fontCache: 'local'

此设置确定svg输出jax如何管理在公式或页面上多次出现的字符。SVG处理器使用SVG路径来显示数学表达式中的字符,当一个字符被多次使用时,可以重用相同的路径描述;这可以节省SVG图像中的空间,因为路径可能非常复杂。当设置为 'local' ,mathjax将在express by表达式上缓存字体路径(每个表达式在svg图像本身中都有自己的缓存),这使得svg是自包含的,但如果重复使用字符,仍然可以节省一些开销。当设置为 'global' ,一个缓存用于页面上的所有路径;这样可以节省最多的空间,但会使图像依赖于页面的其他元素。当设置为 'none' ,不会进行缓存,并且表达式中的每个字符都使用显式路径。

internalSpeechTitles: true

这告诉svg输出jax是否将语音文本放入 <title> SVG中的元素(设置为 'true' ,或使用 aria-label 而是属性。这两种方法都不控制是否生成语音字符串(由 语义丰富扩展选项 settings);此设置仅在语音字符串作为属性生成或包含在根mathml元素中时告诉如何处理该字符串。

其余选项在 所有输出处理器通用的选项 部分。


开发人员选项

除了上面列出的选项外,面向开发人员的低级选项还包括:

localID: null

这将为存储在本地字体缓存中的路径提供id前缀,当 fontCache 设置为 'local' . 如果您需要手动处理多个方程,并且希望为每个方程生成唯一的id,即使在方程之间重新启动mathjax,这也是很有用的。如果设置为 null ,不使用前缀。

titleID: 0

这给出了用于使唯一 <title> IDS何时 internalSpeechTitlestrue . 如果您需要手动处理多个方程,并且希望为每个方程生成唯一的id,即使在方程之间重新启动mathjax,这也是很有用的。