Jupyter-book: MyST bold not working

Created on 4 Jul 2020  路  29Comments  路  Source: executablebooks/jupyter-book

Hello, I have just started using Jupyter book and I tested it out with the sample mini book, "Scientific Python Quickstart". I then tried to make my own book and noticed that when I wrote text in bold, it was not rendering. I then went back to the sample mini book and noticed the same thing (e.g., python_by_example.md has a few bold items that do not render in html). The italic is working fine.

Not sure if this is a bug or whether I am missing an important package.

Thanks!

bug topisphinx-book-theme

Most helpful comment

Just to close the loop: pydata-sphinx-theme v0.4.0 (released this morning, thanks @jorisvandenbossche!) fixes this problem. Thanks very much, guys!

All 29 comments

Hi @kls2177, have a look at https://github.com/executablebooks/sphinx-book-theme/issues/122 and see if this is the same issue you are having?

Yes, this looks like the same issue. The bold font rendered when I used Safari.

Over to you @choldgraf 馃槵

so I don't think we ever got a follow-up on that issue about which fonts were causing the problems here (and it is hard for me to test this out because I'm running a windows machine). @kls2177 any chance that you can nail down which font seems to be the problem here, so that we can include or recommend others in the sphinx book theme?

Ok, thanks. I'm not exactly sure where to look for the SBT fonts, but in the .css file I found two font families: Roboto, sans serif and Font Awesome 5 Free. I installed these using:

pip install font-roboto
(https://pypi.org/project/font-roboto/)

and

pip install font-font-awesome
(https://pypi.org/project/font-font-awesome/)

Not sure if this is the right way to install these as it did not fix the problem.

@choldgraf i don鈥檛 know off-hand what the best practice for this is; but it feels not ideal to be relying on fonts installed on the local system?

Yeah I definitely agree. Mostly I just don't understand how fonts work at all lol and im trying to figure out what the problem is

That makes two of us. I'm not familiar at all with fonts.

Well, I opened up an issue to discuss this in the pydata theme, because I think that would be the place where a fix would happen (since we get our fonts directly from there): https://github.com/pandas-dev/pydata-sphinx-theme/issues/222

Hopefully somebody there that knows more about fonts will also be able to respond 馃槅

Thanks!

Hi, @choldgraf -- it looks like you guys figured everything out on pandas-dev/pydata-sphinx-theme#222 (which I read, and was some impressive sleuthing, BTW!), so does that mean it's possible to pull that fix in to solve this issue as well as executablebooks/sphinx-book-theme#122?

@nathancarter indeed I believe that this should be fixed in the "master" branch of both sphinx-book-theme and jupyter-book...does it work for you on those versions?

Is the correct procedure for upgrading this one?

pip install git+https://github.com/executablebooks/jupyter-book.git
pip install git+https://github.com/executablebooks/sphinx-book-theme.git

If so, I just did that and now have:

Jupyter Book: 0.7.3
MyST-NB: 0.8.1
Sphinx Book Theme: 0.0.33
MyST-Parser: 0.8.1
Jupyter-Cache: 0.2.1

I rebuilt the HTML version of my book and viewed it locally using Chrome 84.0.4147.89 for Mac and text that I marked bold in Jupyter (with ** before and after, and which is bolded in the notebook itself) is still not bolded in the HTML version of the built book.

can you try also upgrading pydata-sphinx-theme to see if that helps?

pip install --upgrade pydata-sphinx-theme moved me from v0.3.0 to v0.3.1, but rebuilding the book site and opening it in the browser still shows no bold parts.

gah this is so confusing! do you see any CSS errors like fonts being able to load or something?

It does look a bit "bolder" to me on Chrome, but it's not as bold as it looks on Safari. It would be nice if it looked "bolder", but not sure if this is possible with this particular font.

I have no errors on my Chrome Dev console. It does not look bolder to me. Here is a screenshot.

Screen Shot 2020-07-31 at 9 54 29 AM

Since it is not possible to tell, I will let you know that the text "Example 1" is supposed to be in bold (and shows up correctly in bold in Jupyter itself).

The element in question is a <strong>Example 1.</strong> and here is its styling:

Screen Shot 2020-07-31 at 9 58 39 AM

Note that my book's custom.css tries to make it bold using

b, strong {
    font-weight: bold;
}

to no avail. Furthermore, that styling is not the problem; removing it produces no change.

So the problem is that the theme is asking for a Lato font at a boldness level that doesn't exist in the ones that are packaged with the pydata-sphinx-theme (which this builds upon). We got that fixed in this PR, and I think it just hasn't been released yet (I thought it had but was wrong). So I think when a new pydata theme is released, this issue should be fixed.

Great, thanks! Sounds like we have the easy job on this one...just wait a bit. :)

Hah, whoops, just realized that you do the releases over there, too. So I get to just wait, but you still have to do the work. Whoops!

heh yep :-) well, me or somebody else in the pydata sphinx theme team

The text I've written with jupyter-book goes live to students next week. Any chance this can be published before then? Sorry to poke.

Could you open an issue in the pydata sphinx theme? that is the blocker here. I'm on paternity leave ATM so will be slow

Woohoo, congrats, @choldgraf ! I'll open the issue over there.

Just to close the loop: pydata-sphinx-theme v0.4.0 (released this morning, thanks @jorisvandenbossche!) fixes this problem. Thanks very much, guys!

thanks @nathancarter
@chrisjsewell @choldgraf is there anything we need to do to update sphinx-book-theme?

Just review and/or merge this PR: https://github.com/executablebooks/sphinx-book-theme/pull/203 (I think @chrisjsewell may have missed this?)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

choldgraf picture choldgraf  路  3Comments

utterances-bot picture utterances-bot  路  3Comments

abielr picture abielr  路  4Comments

darribas picture darribas  路  4Comments

nozebacle picture nozebacle  路  3Comments