Comments (3)
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 \symbf
that could be used to get bold upright Greek letters:
<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 csMathchar0mi
function is overriden to not include an explicit mathvariant="italic"
that is in the original version, so that that mstyle
element's mathvariant
will be applied. This shouldn't hurt anything else, I think.
from mathjax.
Thanks! I am completely clueless about Mathjax, HTML, and JavaScript. But your codes run for me!
But how to set the default output as HTML-CSS so that I don't have to right-click on the formula and select it.
Really appreciated.
from mathjax.
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 TeX-AMS_SVG
to TeX-AMS_HTML
.
It looks like bookdown has TeX-MML-AM_CHTML
as the default in some of its templates (e.g., here, so you have to edit that to be TeX-AMS_HTML
. It also looks like there may be some sort of mathjax
variable that can be set to the URL of the MathJax you want to load. If you can change that value to
https://cdn.jsdelivr.net/npm/[email protected]/unpacked/MathJax.js?config=TeX-AMS_HTML
that should also do it.
from mathjax.
Related Issues (20)
- error while loading mathjax in react with vite HOT 4
- Display a highlight on part of the formula HOT 2
- Rendering bug when Chinese chars in \text block HOT 2
- can "reset to defaults" be hooked into? HOT 1
- [TeX] support for \hdotsfor (from amsmath) HOT 1
- Invalid SVG markup in MathJax 4.0.0-beta6 HOT 2
- Speech generation is on by default in MathJax 4 beta 6 HOT 5
- enableEnrichment: false HOT 1
- Line break in version 3 HOT 5
- Combining Right Arrow Above U+20D7 display issue HOT 2
- malignmark tag present with linebreaking on causes output error on v4.beta6 HOT 1
- [4 beta6] underline with prime renders as accent, not superscript HOT 1
- [v4 beta 6] overline + prime causing unexpected "double exponent" error HOT 1
- Spacing after a displayed equation in a narrow screen HOT 5
- report error HOT 3
- Parentheses are not displayed correctly HOT 3
- `\sqrt` with index of radical exceeds two digits display incorrect on v3.2.2 HOT 2
- [v4 beta.6] visual regression around (poor use of) \mid HOT 10
- bussproofs not correctly computed [Unicode kerning problem?] HOT 1
- CSS injection vulnerability in ```\unicode{}``` macro HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mathjax.