-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
How to define \symrm in Mathjax 2.7 #3218
Comments
The default MathJax-TeX fonts in v2 don't include upright versions of the Greek letters, bold or otherwise, so in order to accomplish this, you would need to use one of the other fonts. The STIX font does include the needed characters, so you could use that. Because the v2 CommonHTML output only supports MathJax-TeX, you would need to use either the older HTML-CSS output, or the SVG output renderer. Here is a MathJax configuration that defines a version of <script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS": {
fonts: ["STIX-Web"]
},
SVG: {
font: "STIX-Web"
},
TeX: {Augment: {
Definitions: {macros: {symbf: 'Symbf'}},
Parse: {prototype: {
csMathchar0mi: function (name, mchar) {
var MML = MathJax.ElementJax.mml;
var def = {};
if (Array.isArray(mchar)) {def = mchar[1]; mchar = mchar[0]}
this.Push(this.mmlToken(MML.mi(MML.entity("#x"+mchar)).With(def)));
},
Symbf: function (name) {
var MML = MathJax.ElementJax.mml;
var math = this.ParseArg(name);
this.Push(MML.mstyle(math).With({mathvariant: "bold"}));
}
}}
}}
});
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/unpacked/MathJax.js?config=TeX-AMS_SVG"></script> The |
Thanks! I am completely clueless about Mathjax, HTML, and JavaScript. But your codes run for me! |
The example I have above uses SVG output, which should work for you. If you want to use HTML-CSS, then you have to change It looks like bookdown has
that should also do it. |
Hi guys, I want to write bold but non-Italic Greek letters in bookdown html (rendered by Mathjax 2.7). One solution may be the commond \symrm, but it is not supported in Mathjax 2.7. And new version of Mathjax is not well supported in bookdown, see this issue.
So my problem is how to define \symrm in Mathjax 2.7.
Thanks!
The text was updated successfully, but these errors were encountered: