Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

cgkineo/adapt-mathJax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MathJax

An extension to load MathJax into Adapt.

Installation

  • In this extension the default configuration for MathJax is as follows:
"_mathJax": {
	"_inlineConfig": {
		"extensions": [
			"tex2jax.js"
		],
		"jax": [
			"input/TeX",
			"output/HTML-CSS"
		]
	},
	"_src": "//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js"
}
  • If this needs to be overridden, add the above to config.json and modify where required.
  • With Adapt CLI installed, run adapt install mathJax. Alternatively, download the ZIP and extract into the src > extensions directory.
  • Run an appropriate Grunt task.

Usage

  • With the default configuation, equations are processed in LaTeX format.
  • In JSON, surround LaTeX equations with \\( and \\) for inline mode or \\[ and \\] for display mode.
  • Example of inline mode:
\\(x^n + y^n = z^n\\)
  • Example of display mode (rendered in a separate block):
\\[f(x) = \\frac{1}{1+x}\\]
  • When directly editing in the authoring tool, backslashes do not have to be escaped with an additional backslash (\). The above 'inline mode' example would therefore be entered as:
\(x^n + y^n = z^n\)
  • The Adapt loading screen is shown while MathJax is processing.

Attributes

Attribute Type Description Default
_inlineConfig Object In-line configuration for MathJax { "extensions": [ "tex2jax.js" ], "jax": [ "input/TeX", "output/HTML-CSS" ] }
_src String The URL to the copy of MathJax which should be loaded "//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js"

About

An extension to load MathJax into Adapt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •