Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JUNCA24 RevealJS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PGI15-Teaching
JUNCA24 RevealJS
Commits
5890f602
Unverified
Commit
5890f602
authored
6 years ago
by
Hakim El Hattab
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2090 from bnjmnt4n/math
Allow users to customise MathJax options.
parents
e7a36525
b2d532ea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+2
-0
2 additions, 0 deletions
README.md
plugin/math/math.js
+28
-11
28 additions, 11 deletions
plugin/math/math.js
test/examples/math.html
+23
-1
23 additions, 1 deletion
test/examples/math.html
with
53 additions
and
12 deletions
README.md
+
2
−
0
View file @
5890f602
...
...
@@ -1286,6 +1286,8 @@ Reveal.initialize({
math
:
{
mathjax
:
'
https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js
'
,
config
:
'
TeX-AMS_HTML-full
'
// See http://docs.mathjax.org/en/latest/config-files.html
// pass other options into `MathJax.Hub.Config()`
TeX
:
{
Macros
:
macros
}
},
dependencies
:
[
...
...
This diff is collapsed.
Click to expand it.
plugin/math/math.js
+
28
−
11
View file @
5890f602
...
...
@@ -7,19 +7,26 @@
var
RevealMath
=
window
.
RevealMath
||
(
function
(){
var
options
=
Reveal
.
getConfig
().
math
||
{};
options
.
mathjax
=
options
.
mathjax
||
'
https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js
'
;
options
.
config
=
options
.
config
||
'
TeX-AMS_HTML-full
'
;
options
.
tex2jax
=
options
.
tex2jax
||
{
inlineMath
:
[[
'
$
'
,
'
$
'
],[
'
\\
(
'
,
'
\\
)
'
]]
,
skipTags
:
[
'
script
'
,
'
noscript
'
,
'
style
'
,
'
textarea
'
,
'
pre
'
]
};
var
mathjax
=
options
.
mathjax
||
'
https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js
'
;
var
config
=
options
.
config
||
'
TeX-AMS_HTML-full
'
;
var
url
=
mathjax
+
'
?config=
'
+
config
;
loadScript
(
options
.
mathjax
+
'
?config=
'
+
options
.
config
,
function
()
{
var
defaultOptions
=
{
messageStyle
:
'
none
'
,
tex2jax
:
{
inlineMath
:
[
[
'
$
'
,
'
$
'
],
[
'
\\
(
'
,
'
\\
)
'
]
],
skipTags
:
[
'
script
'
,
'
noscript
'
,
'
style
'
,
'
textarea
'
,
'
pre
'
]
},
skipStartupTypeset
:
true
};
MathJax
.
Hub
.
Config
({
messageStyle
:
'
none
'
,
tex2jax
:
options
.
tex2jax
,
skipStartupTypeset
:
true
});
defaults
(
options
,
defaultOptions
);
defaults
(
options
.
tex2jax
,
defaultOptions
.
tex2jax
);
options
.
mathjax
=
options
.
config
=
null
;
loadScript
(
url
,
function
()
{
MathJax
.
Hub
.
Config
(
options
);
// Typeset followed by an immediate reveal.js layout since
// the typesetting process could affect slide height
...
...
@@ -35,6 +42,16 @@ var RevealMath = window.RevealMath || (function(){
}
);
function
defaults
(
options
,
defaultOptions
)
{
for
(
var
i
in
defaultOptions
)
{
if
(
!
options
.
hasOwnProperty
(
i
)
)
{
options
[
i
]
=
defaultOptions
[
i
];
}
}
}
function
loadScript
(
url
,
callback
)
{
var
head
=
document
.
querySelector
(
'
head
'
);
...
...
This diff is collapsed.
Click to expand it.
test/examples/math.html
+
23
−
1
View file @
5890f602
...
...
@@ -82,6 +82,14 @@
\]
</section>
<section>
<h3>
TeX Macros
</h3>
Here is a common vector space:
\[L^2(\R) = \set{u : \R \to \R}{\int_\R |u|^2
<
+\infty}\]
used in functional analysis.
</section>
<section>
<section>
<h3>
The Lorenz Equations
</h3>
...
...
@@ -153,6 +161,14 @@
\]
</div>
</section>
<section>
<h3>
TeX Macros
</h3>
Here is a common vector space:
\[L^2(\R) = \set{u : \R \to \R}{\int_\R |u|^2
<
+\infty}\]
used in functional analysis.
</section>
</section>
</div>
...
...
@@ -169,7 +185,13 @@
math
:
{
// mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js',
config
:
'
TeX-AMS_HTML-full
'
config
:
'
TeX-AMS_HTML-full
'
,
TeX
:
{
Macros
:
{
R
:
'
\\
mathbb{R}
'
,
set
:
[
'
\\
left
\\
{#1
\\
; ;
\\
; #2
\\
right
\\
}
'
,
2
]
}
}
},
dependencies
:
[
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment