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

[ch_intro] Not compatible with Google Colab #61

Open
mmcky opened this issue Mar 20, 2024 · 1 comment
Open

[ch_intro] Not compatible with Google Colab #61

mmcky opened this issue Mar 20, 2024 · 1 comment

Comments

@mmcky
Copy link
Contributor

mmcky commented Mar 20, 2024

The Chapter 1 code is not compatible with Google Colab as it request access to latex to render some of the network plots.

PastedGraphic-4

Thanks to a reader for reporting this issue.

@mmcky
Copy link
Contributor Author

mmcky commented Mar 21, 2024

This fixes to this include installing the latex subsystem

!sudo apt-get install texlive-latex-recommended 
!sudo apt-get install dvipng texlive-latex-extra texlive-fonts-recommended
!sudo apt-get install cm-super

ensuring cm-super is installed as the font used by matplotlib

another option is to switch of tex from matplotlib rendering

from matplotlib import rc
rc('text', usetex=False) 

Idea: We may want to add the ability to specify a colab builder as an output in sphinx-tojupyter such as

````{colab}
```{code-cell}
from matplotlib import rc
rc('text', usetex=False) 
```
````

that would include

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

No branches or pull requests

1 participant