[IPython-dev] notebook %magic

Ralf Hemmecke hemmecke at gmail.com
Thu May 31 14:13:19 EDT 2012


I learnt about this "magic" first time from the sage-notebook. 
Sage-notebook has/had a way to allow fricas to be running natively.

It's now some time ago that I modified the underlying code in such a way 
that all cells would be of fricas type. In fact, the %magicword got into 
the way. In fricas %pi is an way to input a symbolic \pi. And that 
should not be considered something magic.

Since at that time the magic was unimportant for me, I changed the magic 
% into %%% and that allowed me to switch to a sage type cell by putting 
%%%sage at the beginning of a cell.

What I want to say by this is that sticking to % as the magic prefix is 
totally bad for my use case.

1) Is there a way to change the magic prefix from % to something user 
defined? It would be OK for me if this is done at startup of the 
notebook. I'm not sure for the ipython notebook, but I remember that in 
the sage-notebook the % prefix was actually stored inside the notebook 
itself without having a global setting at the beginning of the notebook 
to set this prefix character.

2) What the default cell type is could maybe set at start time of the 
notebook server and then have (similar to the sage-notebook (as I knew 
it)) a menu that allows to select the default cell type.

Ralf



More information about the IPython-dev mailing list