Skip to content
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

Enabling mathbbm or support mathbb for numbers #792

Open
Jerska opened this issue Apr 18, 2014 · 6 comments
Open

Enabling mathbbm or support mathbb for numbers #792

Jerska opened this issue Apr 18, 2014 · 6 comments

Comments

@Jerska
Copy link

Jerska commented Apr 18, 2014

Hi,

I would first like to thank you for this awesome work.
About my problem, \mathbb{1} (or any number) just displays as any other number.
As you can see in this thread, it is not specific to MathJax, but to the mathbb package.
But the only real workaround I found for this was to use the bbm package for numbers instead of the bb one.
Its usage would be for the indicator function, and as you can see in the wikipedia articles of different languages (like french), use tricks for the notation like 1\!\!1_A.

So would it be possible to either add support for numbers in mathbb, or add the bbm package ?

Thank you in advance !

Thanks in advance

@pkra
Copy link
Contributor

pkra commented Apr 25, 2014

Thanks for the feature request.

As with bbm, this is primarily a font issue. The default MathJax fonts do not contain characters for blackboard-bold numbers. So extending mathbb requires updating our fonts (which we're hesitant to do, at least until we move the picture fonts outside the MathJax core).

@Jerska
Copy link
Author

Jerska commented May 1, 2014

Well, I understand that technical difficulties would be around the corner, and this is far from a priority. I just wanted to let you know this would be cool to have.
Thanks for your awesome work once again. 👍

@pkra
Copy link
Contributor

pkra commented May 2, 2014

@jerskouille thanks for your kind words.

You could definitely write an extension if you want (and contribute it to our third party extension repository). That way, people can use it via our CDN.

A simple extension would just mapp to unicode characters (hoping that most systems will have a font with those characters, which is not too unlikely). An advanced extension could included its own font+fontdata, I suppose, and eventually find its way into the MathJax core.

@pkra pkra added this to the A future font release milestone Aug 23, 2014
@pkra pkra self-assigned this Aug 24, 2014
@pkra pkra removed their assignment Feb 26, 2015
@j-rahman
Copy link

Has there been any progress since two years? At least an extension?

@clvnkhr
Copy link

clvnkhr commented Jun 3, 2020

This has come up on meta.math.SE recently here

https://math.meta.stackexchange.com/questions/31832/how-can-i-typeset-blackboard-bold-numbers/31834#31834

and the short of it is that the unicode extension works: $\unicode{x1D7D8}\unicode{x1D7D9}\unicode{x1D7DA}\unicode{x1D7DB}\unicode{x1D7DC}\unicode{x1D7DD}\unicode{x1D7DE}\unicode{x1D7DF}\unicode{x1D7E0}\unicode{x1D7E1}$ gives the blackboard bold numbers 𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡, although it relies on system fonts so the output is not consistent across platforms. In addition, I have been getting away with putting unicode characters directly into my MathJax like $𝟘$, but I'm not sure why this works. In Safari on a Mac, $\mathbb{123456789}$ works, but only if the "HTML-CSS" math renderer is chosen. Screenshots are in the above link

@dpvc
Copy link
Member

dpvc commented Jun 4, 2020

In Safari on a Mac, $\mathbb{123456789}$ works, but only if the "HTML-CSS" math renderer is chosen.

The HTML-CSS output renderer tries to avoid downloading fonts over the web, so it detects whether you have the MathJax TeX fonts or STIX fonts installed locally and uses one of those if you do. MacOS comes with STIX fonts installed, so you will end with those being used unless you have taken steps to disable the STIX fonts. You can check which fonts are used by selecting the "About MathJax" item in the MathJax contextual menu.

The MathJax fonts are fairly limited (so that they are smaller for downloading), but the STIX fonts are more complete, and they do include the blackboard-bold numerals (while the MathJax TeX fonts do not). That means on your Mac, with the HTML-CSS output renderer, you will get properly rendered double-struck numerals.

Checking the local fonts for STIX fonts was a nice idea, but id did lead to the fact that different people would see different things, like in your case, so this idea was abandoned in the later output formats. The CommonHTML output only uses MathJax TeX fonts, and the SVG output doesn't use actual fonts at all (it uses SVG path elements). In theses formats, when a particular glyph is not available in the MathJax fonts, MathJax may try to substitute a different one in order to be sure that something is able to be presented, and so that it knows the size of the glyph. In the case of double-struck characters, MathJax will substitute bold characters if it doesn't have the double-struck ones. (Blackboard bold was originally the means of writing characters on the blackboard that should have been bold character if they were in print. So technically, blackboard bold should never appear in print, as they were just a convenience for writing bold characters with chalk. But mathematicians like having extra lattes, so they have migrated into print anyway).

So in MathJax \mathbb{1} will produce a bold 1 when the MathJax fonts are used, and \mathbb{a} will be a bold lower-case "a" (the MathJax fonts only include upper-case double-struck letters). But if you use the STIX fonts in HTML-CSS or SVG output, then you will get the double-struck versions.

In MathJax v3, the remapping of characters to other ones has been removed, so \mathbb{1} will generate the U+1D7D9 character, but (as you mention) the result will be dependent on the fonts installed on your system, and MathJax won't know how big the results actually are, so this can lead to lower-quality results.

This summer we are entering Phase II of the v3 rewrite, which involves updating the fonts that are available. This is a major undertaking, and will take some time, but a number of issues like this should be able to be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants