Ask Your Question

Revision history [back]

Some of these come from IPython, and they are documented at https://ipython.readthedocs.io/en/stable/interactive/magics.html. I don't think there is a comprehensive list of all of them in Sage's documentation, though. If you type %[TAB], then a list will pop up. From the command line you can actually see the whole list, whereas in the notebook you have to scroll.

sage: % [then I hit the TAB key]
   %%!              %ed              %logstate        %polymake        %runfile        
   %%HTML           %edit            %logstop         %%polymake       %sage0          
   %%SVG            %env             %ls              %popd            %%sage0         
   %alias           %%file           %lsmagic         %pprint          %save           
   %alias_magic     %%fortran        %lx              %precision       %sc             
   %attach          %gap             %macro           %prun            %%script        
   %autoawait       %%gap            %magic           %%prun           %set_env        
   %autocall        %gp              %magma           %psearch         %%sh            
   %autoindent      %%gp             %%magma          %psource         %singular       
   %automagic       %gui             %man             %pushd           %%singular      
   %%bash           %hist            %%markdown       %pwd             %store          
   %bookmark        %history         %matplotlib      %pycat           %%svg           
   %%capture        %%html           %maxima          %pylab           %sx             
   %cat             %iload           %%maxima         %%pypy           %%sx            
   %cd              %%javascript     %mkdir           %%python         %system         
   %clear           %%js             %more            %%python2        %%system        
   %colors          %killbgscripts   %mv              %%python3        %tb             
   %conda           %%latex          %notebook        %quickref        %time           
   %config          %ldir            %page            %recall          %%time          
   %cp              %less            %paste           %rehashx         %timeit         
   %cpaste          %lf              %pastebin        %reload_ext      %%timeit        
   %crun            %lk              %pdb             %rep             %unalias        
   %%cython         %ll              %pdef            %rerun           %unload_ext     
   %debug           %load            %pdoc            %reset           %who            
   %%debug          %load_ext        %%perl           %reset_selective %who_ls         
   %dhist           %loadpy          %pfile           %rm              %whos           
   %dirs            %logoff          %pinfo           %rmdir           %%writefile     
   %display         %logon           %pinfo2          %%ruby           %xdel           
   %doctest_mode    %logstart        %pip             %run             %xmode

Similarly there is no collected list of their explanations, but you can evaluate %run? (for example) to see the documentation for the individual "magic" commands.