Ipython notebook: how to switch the title invisible by default

I want to save some space for my 14 inch screen. What should I write, for example? ipython_notebook_config.py to call this?

+7
ipython-notebook
source share
3 answers
  • If it does not already exist, create a file called custom.js in /Users/YOURUSERNAME/.ipython/profile_default/static/custom/
    (You may need to run ipython profile create if you have never run this command.)

  • In custom.js put the following lines of JavaScript

     $([IPython.events]).on("app_initialized.NotebookApp", function () { $('div#header').hide(); }); 
  • If you also want to hide the toolbar by default, use these JavaScript lines instead

     $([IPython.events]).on("app_initialized.NotebookApp", function () { $('div#header').hide(); $('div#maintoolbar').hide(); }); 
+11
source share

If you have recent IPython, for example v3.0.0 or higher, and you see only sporadic success of this method, you need to connect to the RequireJS dependency loader and put it in your common.js :

 require(['jquery'], function($) { $('#header-container').hide(); }); 

common.js loads at the bottom of the page, so there is no need to wait for the DOM ready event, i.e. $(function() { ... }) .

For further discussion, see my answer in Disable automatic closing brackets in ipython and its comments.

+2
source share

if you are using Anaconda3 , follow these steps:

  • update C:\Anaconda3\Lib\site-packages\notebook\static\custom\custom.css

     .container{ width:100% !important; } div#site{ height: 100% !important; } 
  • update your C:\Anaconda3\Lib\site-packages\notebook\static\custom\custom.js and we will add a shortcut ctrl+ to switch the header

     $([IPython.events]).on('notebook_loaded.Notebook',function(){ $('#header').hide(); IPython.keyboard_manager.command_shortcuts.add_shortcut('ctrl-`',function (event) { if (IPython.notebook.mode == 'command') { $('#header').toggle(); return false; } return true; }); }); 
+1
source share

All Articles