简体   繁体   中英

Change font in Remote jupyter notebook

I am accessing a jupyter notebook via ssh tunnel as explained here: http://danielhnyk.cz/running-ipython-notebook-different-computer/

Unfortunately both chrome and firefox use the default font for the code cells of the remote notebook when I access it via http://localhost:8881/notebook.ipynb like in the attached screenshot Firefox的屏幕截图

This is bad, since I want the code cells to be displayed in a fixed-width font.

I tried fixing it using the Font Changer extension for chrome, but this changes the font of the whole notebook to fixed-width, including the markdown cells, and it messes up the symbols in the Toolbar.

Any help would be greatly appreciated.

Note: When I run a notebook on my computer with the command jupyter notebook the fonts look fine.

The code font which I used on the notebook server was not installed on my home computer. I simply adapted the custom.css file under

.jupyter/custom/custom.css

to use a font installed on both machines, ie DejaVu Sans Mono:

.CodeMirror pre {
    font-family: DejaVu Sans Mono;
    font-size: 10pt;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM