Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New option in math object to define TeX macros #1856

Closed
wants to merge 1 commit into from
Closed

New option in math object to define TeX macros #1856

wants to merge 1 commit into from

Conversation

JeremyHeleine
Copy link

With this small edit, the math object we can define in the options can use the attribute macros. This attribute can be used to define TeX macros that will be available in all the slides. The syntax to use to define macros can be found in MathJax's documentation.

For example we define here a macro without argument and a macro with two arguments:

Reveal.initialize({
	math: {
		macros: {
			R: '\\mathbb{R}',
			set: ['\\left\\{#1 \\; ; \\; #2\\right\\}', 2]
		}
	},

	dependencies: [
		{src: 'plugin/math/math.js', async: true}
	]
});

These macros can then be used in any slide:

<section>
	Here is a common vector space:
	\[L^2(\R) = \set{u : \R \to \R}{\int_\R |u|^2 &lt; +\infty}\]
	used in functional analysis.
</section>

@JeremyHeleine JeremyHeleine deleted the macros-math branch October 18, 2017 19:54
bnjmnt4n added a commit to bnjmnt4n/reveal.js that referenced this pull request Feb 8, 2018
Ref. hakimel#1856, hakimel#2006, hakimel#2045.

This is a more open approach to allow customisation of all MathJax options instead of select options only.
R0bes pushed a commit to R0bes/Terraform-Presentation that referenced this pull request Jun 7, 2021
Ref. hakimel#1856, hakimel#2006, hakimel#2045.

This is a more open approach to allow customisation of all MathJax options instead of select options only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants