Commit bf5dc65c authored by Henrik Tramberend's avatar Henrik Tramberend
Browse files

Add AMSmath to handouts

parent ca23175b
import $ from 'jquery';
require('@fortawesome/fontawesome-free/css/all.css');
require('@fortawesome/fontawesome-free/js/all');
require('bootstrap/dist/css/bootstrap.css');
require('./handout.scss');
import $ from "jquery";
require("@fortawesome/fontawesome-free/css/all.css");
require("@fortawesome/fontawesome-free/js/all");
require("bootstrap/dist/css/bootstrap.css");
require("./handout.scss");
document.addEventListener('load', () => {
$('table').addClass("table table-striped table-bordered table-hover table-condensed table-responsive");
document.addEventListener("load", () => {
$("table").addClass(
"table table-striped table-bordered table-hover table-condensed table-responsive"
);
});
// Webpack handling of MathJax copied from
// https://github.com/mathjax/mathjax-v3/wiki/A-first-usable-demo-(using-webpack)
// the MathJax core
const MathJax = require("mathjax3/mathjax3/mathjax.js").MathJax
const MathJax = require("mathjax3/mathjax3/mathjax.js").MathJax;
// MathML input
const TeX = require("mathjax3/mathjax3/input/tex.js").TeX;
// HTML output
......@@ -20,23 +22,51 @@ const CHTML = require("mathjax3/mathjax3/output/chtml.js").CHTML;
const adaptor = require("mathjax3/mathjax3/adaptors/browserAdaptor").browserAdaptor();
// Register the HTML document handler
require("mathjax3/mathjax3/handlers/html.js").RegisterHTMLHandler(adaptor);
require("mathjax3/mathjax3/input/tex/ams/AmsConfiguration.js");
require("mathjax3/mathjax3/input/tex/base/BaseConfiguration.js");
require("mathjax3/mathjax3/input/tex/ams/AmsConfiguration.js");
require("mathjax3/mathjax3/input/tex/noundefined/NoUndefinedConfiguration.js");
require("mathjax3/mathjax3/input/tex/newcommand/NewcommandConfiguration.js");
require("mathjax3/mathjax3/input/tex/boldsymbol/BoldsymbolConfiguration.js");
require("mathjax3/mathjax3/input/tex/braket/BraketConfiguration.js");
require("mathjax3/mathjax3/input/tex/mhchem/MhchemConfiguration.js");
require("mathjax3/mathjax3/input/tex/physics/PhysicsConfiguration.js");
require("mathjax3/mathjax3/input/tex/verb/VerbConfiguration.js");
require("mathjax3/mathjax3/input/tex/cancel/CancelConfiguration.js");
require("mathjax3/mathjax3/input/tex/enclose/EncloseConfiguration.js");
// initialize mathjax with with the browser DOM document; other documents are possible
const html = MathJax.document(document, {
InputJax: new TeX(),
OutputJax: new CHTML({
fontURL: 'https://cdn.rawgit.com/mathjax/mathjax-v3/3.0.0-alpha.4/mathjax2/css/'
})
InputJax: new TeX({
inlineMath: [["$", "$"], ["\\(", "\\)"]],
packages: [
"base",
"ams",
"noundefined",
"newcommand",
"boldsymbol",
"braket",
"mhchem",
"physics",
"verb",
"cancel",
"enclose"
]
}),
OutputJax: new CHTML({
fontURL:
"https://cdn.rawgit.com/mathjax/mathjax-v3/3.0.0-alpha.4/mathjax2/css/"
})
});
window.addEventListener("load", function () {
console.time('wrapper');
// process the document
html.findMath()
.compile()
.getMetrics()
.typeset()
.updateDocument();
console.timeEnd('wrapper');
window.addEventListener("load", function() {
console.time("wrapper");
// process the document
html
.findMath()
.compile()
.getMetrics()
.typeset()
.updateDocument();
console.timeEnd("wrapper");
});
......@@ -4,13 +4,15 @@ history: True
# Background Images
## Four slides with background image
## Some slides with background image
1. RevealJS style with `data-background-image` attribute
2. decker style with image and title text header
3. decker style with attributes `size`, `repeat`, `color`
4. decker style with attributes `position`, `size`, `repeat`, `color`
5. decker style with attributes `position`, `size`, `repeat`, `color`
3. decker style with attribute `size=contain`
4. decker style with attribute `size=cover`
5. decker style with attributes `size`, `repeat`, `color`
6. decker style with attributes `position`, `size`, `repeat`, `color`
7. decker style with attributes `position`, `size`, `repeat`, `color`
# RevealJs Style {data-background-image="include/06-metal.png"}
......@@ -24,6 +26,18 @@ history: True
# Image in Title 1 ![](include/06-metal.png)
# Image in Title 1 ![](include/06-metal.png){size="contain"}
## Source
# Image in Title 1 ![](include/06-metal.png){size="contain"}
# Image in Title 1 ![](include/06-metal.png){size="cover"}
## Source
# Image in Title 1 ![](include/06-metal.png){size="cover"}
# Image in Title 2 ![](include/06-metal.png){size="30%" repeat="repeat"}
## Source
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment