/usr/share/javascript/mathjax/test/sample-macros.html is in libjs-mathjax 2.6.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | <!DOCTYPE html>
<html>
<head>
<title>Example of defining a macro that autoloads an extension</title>
<!-- Copyright (c) 2012-2015 The MathJax Consortium -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--
|
| This page shows how to define macros in your configuration, or as part
| of the body of the page itself.
|
|-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
Macros: {
RR: '{\\bf R}', // a simple string replacement
bold: ['\\boldsymbol{#1}',1] // this macro has one parameter
}
}
});
</script>
<script type="text/javascript" src="../MathJax.js?config=TeX-AMS_HTML-full"></script>
</head>
<body>
<!--
|
| Here we use a math block that contains nothing but definitions in
| standard TeX format. It is enclosed in a DIV that doesn't display, so
| that there are no extra spaces generated by having the extra
| mathematics in the text.
|
| The first macro makes it easy to display vectors using \<x,y,z>
| the second uses \newcommand to create a macro
|
|-->
<div style="display:none">
\(
\def\<#1>{\left<#1\right>}
\newcommand{\CC}{\mathbf{C}}
\)
</div>
<p>
This page uses two different methods to define macros: either putting them
in JavaScript notation in the MathJax configuration, or in TeX notation in
the body of the document.
</p>
<p>Some math that used the definitions:
\[
f\colon\RR\to\RR^3 \hbox{ by } f(t)=\< t+1,{1\over 1+t^2}, \sqrt{t^2+1} >
\]
and
\[
\{\,z\in\CC \mid z^2 = \bold{\alpha}\,\}
\]
</body>
</html>
|