Open sindzicat opened 5 years ago
Sorry, I found how to solve my problem.
In custom.js
you need to use
MathJax.Hub.Config({
tex2jax: {
inlineMath: [["$", "$"], ["\\(", "\\)"]],
displayMath: [["$$", "$$"], ["\\[", "\\]"]],
processEscapes: true,
},
TeX: {
Macros: {
Alpha: "\\mbox{A}",
Beta: "\\mbox{B}",
Epsilon: "\\mbox{E}",
Zeta: "\\mbox{Z}",
Eta: "\\mbox{H}",
Iota: "\\mbox{I}",
Kappa: "\\mbox{K}",
Mu: "\\mbox{M}",
Nu: "\\mbox{N}",
Omicron: "\\mbox{O}",
Rho: "\\mbox{P}",
Tau: "\\mbox{T}",
Chi: "\\mbox{X}",
and: "\\mbox{&}",
or: "\\lor",
exist: "\\exists",
empty: "\\emptyset",
P: "\\mbox{P}",
tan: "\\operatorname{tg}", // tangent
tg: "\\operatorname{tg}", // tangent
cot: "\\operatorname{ctg}", // cotangent
ctg: "\\operatorname{ctg}", // cotangent
csc: "\\operatorname{cosec}", // cosecant
cosec: "\\operatorname{cosec}", // cosecant
arctan: "\\operatorname{arctg}", // arctangent
arctg: "\\operatorname{arctg}", // arctangent
arccot: "\\operatorname{arcctg}", // arc cotangent
arcctg: "\\operatorname{arcctg}", // arc cotangent
arcsec: "\\operatorname{arcsec}", // arc secant
arccsc: "\\operatorname{arccosec}", // arc cosecant
arccosec: "\\operatorname{arccosec}", // arc cosecant
sh: "\\operatorname{sh}", // hyperbolic sine
ch: "\\operatorname{ch}", // hyperbolic cosine
th: "\\operatorname{th}", // hyperbolic tangent
cth: "\\operatorname{cth}", // hyperbolic cotangent
sinh: "\\operatorname{sh}", // hyperbolic синус
cosh: "\\operatorname{ch}", // hyperbolic cosine
tanh: "\\operatorname{th}", // hyperbolic tangent
coth: "\\operatorname{cth}", // hyperbolic cotangent
sgn: "\\operatorname{sgn}",
mod: "\\operatorname{mod}",
ge: "\\geqslant",
le: "\\leqslant",
geq: "\\geqslant",
leq: "\\leqslant",
N: "\\mathbb{N}",
R: "\\mathbb{R}",
Q: "\\mathbb{Q}",
Z: "\\mathbb{Z}",
C: "\\mathbb{C}",
H: "\\mathbb{H}",
P: "\\mathbb{P}",
dmtr: "\\unicode{x2300}", // diameter sign
deg: "\\unicode{xb0}", // degree sign
celdeg: "\\unicode{x2103}" // degree Celsius sign
},
// AutoNumbering of displayed formulas
equationNumbers: { autoNumber: "AMS" },
// All mathjax extensions:
// http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-extensions
// Source code for all extensions:
// https://github.com/mathjax/MathJax/tree/master/extensions/TeX
extensions: [
"color.js", // Color support in LaTeX
"autobold.js", // support for \boldsymbol{...}
"AMSmath.js",
"AMSsymbols.js",
"AMScd.js", // http://www.jmilne.org/not/Mamscd.pdf
"bbox.js", // support for \bbox[options]{math}
// "begingroup.js", // mainly for formulas localization
"cancel.js" // support for strikethrough formulas
// "HTML.js" // works by default
// "mhchem.js" // chemical formulas
// "uniconde.js" // works by default
]
}
});
// http://docs.mathjax.org/en/latest/configuration.html#configuring-mathjax-after-it-is-loaded
MathJax.Hub.Configured()
The last line MathJax.Hub.Configure()
must be presented. Now all works for me fine. The only I cannot understand — why this didn't work yesterday???
-- Andrey
Hm... After page reload doesn't work again...
I tried to add
TeX: {
Macros: {
tg: "\\operatorname{tg}"
}
}
to main.min.js
in MathJax.Hub.Config
. Now \tg(x)
works fine. But why only after that hack?
Is anybody here?
Hello!
I found recently that my settings for Mathjax stopped to work.
It seems to me I understand correctly why.
When the web page of Jupyter Notebook is loading we load Mathjax first:
I see
StartupUntil=configured
at the end. According documentation this means that Mathjax will wait instrtuctionMathJax.Hub.Configured()
.I found such instruction only in one file —
mathjaxutils.js
(code line).Then I found that
mathjaxutils.js
are called by scriptmain.min.js
at the end of<body>
. Filemathjaxutils.js
contains ownMathJax.Hub.Config
, that called after userMathJax.Hub.Config
fromcustom.js
. So user settings for Mathjax will be overriden.Of course I can change local
mathjaxutils.js
after installation and even write own python script that will watch this file... But it's not a good way. Please fix this.-- Andrey.