Katex: Add support for \bm

Created on 13 Dec 2016  路  16Comments  路  Source: KaTeX/KaTeX

Hi there, recently we also find that there isn't a function can make the text both bold and italic in KaTeX. All the functions that make text bold will also make text no longer italic. The target effect is as bellow.
image
Do you have any plan to support italic bold text or any suggestion? Thank you!

enhancement fonts

Most helpful comment

This is still very much needed.

All 16 comments

We don't support it yet, but you would use \boldmath. We use fonts based on the MathJax fonts which has a Math-BoldItalic font which we could use.

It should be noted that \boldmath also makes the operators bold.

Thanks for reply! The \boldmath function is also not yet supported in release v0.6.0 right? Does it mean that you will support \boldmath in later version? Thank you!

I'm sure we will at some point.

Would love to help contribute. Been looking around the code for a bit and was wondering where I could start for this problem. Thanks!

@sunsheeppoplar: Thanks for that offer! 鉂わ笍

I'd start by looking at \mathrm and \mathbf, see how they are implemented. Feel free to ask if you get stuck following the flow of these commands through the engine.

As far as I know, \boldmath is a declaration, so it will make the whole formula bold until you \unboldmath. You must also include the math mode expressions within the scope of the declaration, which makes it quite impractical.

In my field we would normally use \boldsymbol from the amsmath package, although it seems that this has now been superseded by \bm.

@jeanm I just tested, and you're correct: Command \boldmath invalid in math mode. (Though maybe not terrible to add support for it within math mode...) AMSMath's \boldsymbol and/or \bm seem like reasonable goals too.

It looks like \bm can accept an atom or a group. I'm going to switch this issue to support \bm because it'll be less work and will still produce the desired output.

Apparently there is also fixmath's \mathbold. Here's a visual comparison. \bm is probably the right decision, given that AMS recommends it.

Sorry, y'all, got a bit caught up with transitioning at work. Is this still something y'all are looking at or has a PR been proposed elsewhere that encompasses this?

This is still very much needed.

I'm using Katex on my math-lessons website. Questions and answers are bolded and, naturally, these questions and answers commonly contain variables. It would be _really_ nice to be able to format bolded AND italicized letters. Is anybody working on this issue currently? Thank you!

@stapeleliz no one is currently working on this to my knowledge. I'd like to do #816 first. Since it's blocking this and a couple of other issues I'll take on that issue.

Okay; thank you!

Just wanted to comment that this feature is very badly wanted.

A note that both \boldsymbol and \mathbf are important - the former produces bold italic symbols, including bold greek letters, that often refer to vectors, whereas the latter produces bold non-italic symbols that often refer to matrices.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

msridhar picture msridhar  路  3Comments

mpolyak picture mpolyak  路  3Comments

ylemkimon picture ylemkimon  路  3Comments

asmeurer picture asmeurer  路  3Comments

janosh picture janosh  路  4Comments