返回介绍

Configuration Objects

发布于 2019-07-04 19:44:32 字数 4474 浏览 929 评论 0 收藏 0

The various components of MathJax, including its input and output processors, its preprocessors, its extensions, and the MathJax core, all can be configured through the config/default.js file, or via a MathJax.Hub.Config() call (indeed, if you look closely, you will see that config/default.js is itself one big call to MathJax.Hub.Config()). Anything that is in config/default.js can be included in-line to configure MathJax.

The structure that you pass to MathJax.Hub.Config() is a JavaScript object that includes name:value pairs giving the names of parameters and their values, with pairs separated by commas. Be careful not to include a comma after the last value, however, as some browsers (namely Internet Explorer) will fail to process the configuration if you do.

The MathJax components, like the TeX input processor, have their own sections in the configuration object labeled by the component name, and using an object as its value. That object is itself a configuration object made up of name:value pairs that give the configuration options for the component.

For example,

MathJax.Hub.Config({
  showProcessingMessages: false,
  jax: ["input/TeX", "output/HTML-CSS"],
  TeX: {
    TagSide: "left",
    Macros: {
      RR: '{\\bf R}',
      bold: ['{\\bf #1}',1]
    }
  }
});

is a configuration that includes two settings for the MathJax Hub (one for showProcessingMessages and one for the jax array), and a configuration object for the TeX input processor. The latter includes a setting for the TeX input processor’s TagSide option (to set tags on the left rather than the right) and a setting for Macros, which defines new TeX macros (in this case, two macros, one called \RR that produces a bold “R”, and one called \bold that puts is argument in bold face).

The config/default.js file is another example that shows nearly all the configuration options for all of MathJax’s components.

Configuration Options by Component

The individual options are explained in the following sections, which are categorized by the component they affect.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文