# Difference between revisions of "SageMath"

Minimalmiser (talk | contribs) m (moved Sage to Sage-mathematics: sage mathematics is the actual name of the package) |
Minimalmiser (talk | contribs) |
||

Line 17: | Line 17: | ||

{{Note | will take about 10hrs to compile on 1.8GHz Celeron w/256MB ram}} | {{Note | will take about 10hrs to compile on 1.8GHz Celeron w/256MB ram}} | ||

− | + | ==Usage== | |

− | ==Sage-Commandline== | + | ===Sage-Commandline=== |

Once installed, users should be able to start the sage commandline in bash. | Once installed, users should be able to start the sage commandline in bash. | ||

$ sage | $ sage | ||

Line 28: | Line 28: | ||

− | ==Sage-Notebook== | + | ===Sage-Notebook=== |

To start the Sage-Notebook server from bash, without going thru Sage-Commandline: | To start the Sage-Notebook server from bash, without going thru Sage-Commandline: | ||

$ sage -n | $ sage -n | ||

Line 38: | Line 38: | ||

More detailed documentation can be read about the [http://www.sagemath.org/doc/reference/sagenb/notebook/notebook_object.html "notebook() command."] | More detailed documentation can be read about the [http://www.sagemath.org/doc/reference/sagenb/notebook/notebook_object.html "notebook() command."] | ||

+ | ===Documentation=== | ||

+ | For local Documentation, one can compile it into html or even pdfs. Apparently, this needs to be executed as root (perhaps unsafely): | ||

+ | # sage -docbuild reference html | ||

+ | This builds html docs for the whole tree "reference" (which is alot; Expect many many hours). An option is to build a smaller part of the documentation tree, but you would need to know what it is you want. Until then, you might consider just browsing reference online. | ||

+ | One place this can be found is at http://www.sagemath.org/doc/ . | ||

− | + | ==Optional additions== | |

− | ==SageTeX== | + | ===SageTeX=== |

If you have installed Texlive on your system, you may be interested in using SageTeX, a package that makes possible the inclusion of sage code in LaTeX files. The correct procedure for enabling SageTex system-wide is the following (do it as root, or with sudo): | If you have installed Texlive on your system, you may be interested in using SageTeX, a package that makes possible the inclusion of sage code in LaTeX files. The correct procedure for enabling SageTex system-wide is the following (do it as root, or with sudo): | ||

* Copy the files to the texmf directory: | * Copy the files to the texmf directory: | ||

Line 49: | Line 54: | ||

texhash: Done.|prompt=#}} | texhash: Done.|prompt=#}} | ||

− | ==Additional Packages== | + | ===Additional Packages=== |

If you need to compile your own custom packages in addition to the standard ones, you might need to install aur/sage-mathematics-spkgs so that you will have the spkgs of the original packages. | If you need to compile your own custom packages in addition to the standard ones, you might need to install aur/sage-mathematics-spkgs so that you will have the spkgs of the original packages. |

## Revision as of 08:26, 24 January 2011

Sage is a program for numerical and symbolic mathematical computation. It is meant to provide an alternative for commercial programs such as Maple, Matlab, and Mathematica. It is actually mantained in the community repository.

## Contents

## Installation

To install prebuilt binaries from community repository:

# pacman -S sage-mathematics

**Warning:**On January 23,2011 the binary package appeared to have problems installing... If this is no longer true, please correct this.

To instead download and compile using the Arch Build System:

$ abs $ cp -r /var/abs/community/sage-mathematics $HOME/abs $ cd $HOME/abs/sage-mathematics $ makepkg -s

A package should be produced in the directory. Install it as root (pacman only installs if root):

# pacman -U sage-mathematics-4.6.1-1-i686.pkg.tar.xz

**Note:**will take about 10hrs to compile on 1.8GHz Celeron w/256MB ram

## Usage

### Sage-Commandline

Once installed, users should be able to start the sage commandline in bash.

$ sage

Math can then be typed at this commandline.

sage: 2+2 4

As well as a command to start the notebook server if desired.

sage: notebook()

### Sage-Notebook

To start the Sage-Notebook server from bash, without going thru Sage-Commandline:

$ sage -n

The notebook will be accessable in the browser from http://localhost:8000 , and will require you to login. However, If you are only intending to run the server for personal use, and not across the internet, the login will be an annoyance.

You can instead start Sage notebook without requiring login, and have it automatically pop up in a browser.

$ BROWSER="chromium" sage -c "notebook(require_login=false,open_viewer=true)"

More detailed documentation can be read about the "notebook() command."

### Documentation

For local Documentation, one can compile it into html or even pdfs. Apparently, this needs to be executed as root (perhaps unsafely):

# sage -docbuild reference html

This builds html docs for the whole tree "reference" (which is alot; Expect many many hours). An option is to build a smaller part of the documentation tree, but you would need to know what it is you want. Until then, you might consider just browsing reference online. One place this can be found is at http://www.sagemath.org/doc/ .

## Optional additions

### SageTeX

If you have installed Texlive on your system, you may be interested in using SageTeX, a package that makes possible the inclusion of sage code in LaTeX files. The correct procedure for enabling SageTex system-wide is the following (do it as root, or with sudo):

- Copy the files to the texmf directory:

# cp /opt/sage/local/share/texmf/tex/* /usr/share/texmf/tex/

- Refresh Texlive:

### Additional Packages

If you need to compile your own custom packages in addition to the standard ones, you might need to install aur/sage-mathematics-spkgs so that you will have the spkgs of the original packages.