Size: 860
Comment: moving a tip from this page to FAQ.....
|
Size: 2194
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
* [http://www.geogebra.org/cms/ GeoGebra] is a free and multi-platform dynamic mathematics software for schools that joins geometry, algebra and calculus. Here's how you can embed it in the SAGE notebook. | * '''!GeoGebra''' [http://www.geogebra.org/cms/ GeoGebra] is a free and multi-platform dynamic mathematics software for schools that joins geometry, algebra and calculus. Here's how you can embed it in the SAGE notebook. |
Line 12: | Line 12: |
* '''Vim filetypes''' To get Vim to use Python syntax highlighting, indentation, and so on for {{{.sage}}} files, put the following in {{{$VIM/filetype.vim}}}: {{{augroup filetypedetect au! BufRead,BufNewFile *.sage,*.spyx,*.pyx setfiletype python augroup END }}} If you one of...''[http://www.gnu.org/software/emacs/ those people]'' you'll want to visit http://www.sagemath.org/emacs/. * '''Autocompletion for the bash shell''' So, you'd like bash to autocomplete Sage files, but you want to somehow exclude those {{{.py}}} files that have been autogenerated by Sage. Here's a snippet that will do that for you. Put this somewhere where it will get sourced, such as your {{{.bashrc}}}, {{{.bash_profile}}}, or whatever. Often bash is set up so that it will automatically pull in completions defined in {{{~/.bash_completion}}}. Here's the code: {{{_sagecomp() { local cur files COMPREPLY=() cur=" then COMPREPLY=( fi } complete -F _sagecomp sage }}} See [http://www.debian-administration.org/articles/317 this article] for more information. --DanDrake |
Tips for Using SAGE
GeoGebra [http://www.geogebra.org/cms/ GeoGebra] is a free and multi-platform dynamic mathematics software for schools that joins geometry, algebra and calculus. Here's how you can embed it in the SAGE notebook.
In GeoGebra: Create some geometric construction or plot an algebraic expression. See [http://www.geogebra.org/cms/index.php?option=com_content&task=blogcategory&id=69&Itemid=56 this page] for more details.
In GeoGebra: File> Export> Dynamic worksheet.
Open the .html just exported with a text editor and copy the <applet> section.
In SAGE notebook: Data> Upload the .jar and .ggb files just exported.
In SAGE notebook: Edit> Paste the <applet> section.
In the <applet> section, change codebase="./data/", you can also set some of the flags to true.
- Save changes, and you're done.
Vim filetypes To get Vim to use Python syntax highlighting, indentation, and so on for .sage files, put the following in $VIM/filetype.vim:
{{{augroup filetypedetect
au! BufRead,BufNewFile *.sage,*.spyx,*.pyx setfiletype python
augroup END }}}
If you one of...[http://www.gnu.org/software/emacs/ those people] you'll want to visit http://www.sagemath.org/emacs/.
Autocompletion for the bash shell So, you'd like bash to autocomplete Sage files, but you want to somehow exclude those .py files that have been autogenerated by Sage. Here's a snippet that will do that for you. Put this somewhere where it will get sourced, such as your .bashrc, .bash_profile, or whatever. Often bash is set up so that it will automatically pull in completions defined in ~/.bash_completion. Here's the code:
{{{_sagecomp() {
- local cur files
- COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}"
files="
(compgen−odirnames−X′!*.@(sage|?(s)pyx|py)′−f {cur})" if "$files" thenCOMPREPLY=(You can't use 'macro parameter character #' in math modefiles))
- COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}"
} complete -F _sagecomp sage }}}
See [http://www.debian-administration.org/articles/317 this article] for more information. --DanDrake