You are here

function mathjax_default in MathJax: LaTeX for Drupal 7.2

Default values for MathJax configuration. May be overridden in the config.

Parameters

string $parameter: Decides which default config to fetch. Either 'cdn url' or 'config string'.

Return value

string The default configuration.

4 calls to mathjax_default()
MathjaxWebTestCase::testAdmin in ./mathjax.test
Test the administration functions.
MathjaxWebTestCase::testDefaults in ./mathjax.test
Test the default configuration.
mathjax_global_settings in ./mathjax.module
Configure global settings for MathJax.
mathjax_page_alter in ./mathjax.module
Implements hook_page_alter().

File

./mathjax.module, line 44
MathJax module.

Code

function mathjax_default($parameter) {
  switch ($parameter) {
    case 'cdn url':
      return 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
    case 'config string':
      return "\nMathJax.Hub.Config({\n  extensions: ['tex2jax.js'],\n  jax: ['input/TeX','output/HTML-CSS'],\n  tex2jax: {\n    inlineMath: [ ['\$','\$'], ['\\\\(','\\\\)'] ],\n    processEscapes: true,\n    processClass: 'tex2jax',\n    ignoreClass: 'html'\n  },\n  showProcessingMessages: false,\n  messageStyle: 'none'\n});\n";
    default:
      return;
  }
}