# HG changeset patch
# User William Laffin
# Date 1276816851 14400
# Node ID 3dd0e973ea45971c933ee6586f35ad6eb23f0d3e
# Parent 2cffe66bd64266c6a64d31ca37ad81d8d5390af8
#9252: documentation errors in tutorial and others
diff r 2cffe66bd642 r 3dd0e973ea45 doc/en/constructions/groups.rst
 a/doc/en/constructions/groups.rst Fri Jun 04 12:50:55 2010 0700
+++ b/doc/en/constructions/groups.rst Thu Jun 17 19:20:51 2010 0400
@@ 71,7 +71,7 @@
(41,43,48,46)(42,45,47,44)(14,22,30,38)(15,23,31,39)(16,24,32,40) )"
 Place the file in the subdirectory
 ``$SAGE_ROOT/local/lib/python2.4/sitepackages/sage`` of your Sage home
+ ``\$SAGE_ROOT/local/lib/python2.4/sitepackages/sage`` of your Sage home
directory.
 Read (i.e.,``{import``) it into Sage:
diff r 2cffe66bd642 r 3dd0e973ea45 doc/en/developer/conventions.rst
 a/doc/en/developer/conventions.rst Fri Jun 04 12:50:55 2010 0700
+++ b/doc/en/developer/conventions.rst Thu Jun 17 19:20:51 2010 0400
@@ 521,7 +521,7 @@
to be typeset. In Sage docstrings, unofficially you may use
dollar signs instead  "unofficially" means that it ought to
work, but might be a little buggy. Thus ```x^2 + y^2 = 1``` and
 ``$x^2 + y^2 = 1$`` should produce identical output, typeset in math
+ ``\$x^2 + y^2 = 1\$`` should produce identical output, typeset in math
mode.
LaTeX style: typeset standard rings and fields like the integers
@@ 556,7 +556,7 @@
manual. Other examples are "\\GF" and "\\Zmod", each of which
takes an argument: "\\GF{q}" is typeset as "\\Bold{F}_{q}" and
"\\Zmod{n}" is typeset as "\\Bold{Z}/n\\Bold{Z}". See the
 file ``$SAGE_ROOT/devel/sage/sage/misc/latex_macros.py`` for a
+ file ``\$SAGE_ROOT/devel/sage/sage/misc/latex_macros.py`` for a
full list and for details about how to add more macros.
 Liberally describe what the examples do. Note that there must be
diff r 2cffe66bd642 r 3dd0e973ea45 doc/en/developer/trac.rst
 a/doc/en/developer/trac.rst Fri Jun 04 12:50:55 2010 0700
+++ b/doc/en/developer/trac.rst Thu Jun 17 19:20:51 2010 0400
@@ 247,7 +247,7 @@
 Do all doctests pass without errors? You can test the Sage
library with ``make test`` or ``make ptest`` (edit the number
 of threads in ``$SAGE_ROOT/makefile`` before using ``ptest``). See
+ of threads in ``\$SAGE_ROOT/makefile`` before using ``ptest``). See
:ref:`chapterdoctesting` for more information on doctesting the
Sage library.
diff r 2cffe66bd642 r 3dd0e973ea45 doc/en/installation/binary.rst
 a/doc/en/installation/binary.rst Fri Jun 04 12:50:55 2010 0700
+++ b/doc/en/installation/binary.rst Thu Jun 17 19:20:51 2010 0400
@@ 34,14 +34,14 @@
``/usr/local/bin/``, but then you have to edit the
``SAGE_ROOT="....."`` line at the top of that file, replacing the dots
with the path to the Sage directory ``sagex.y.zx86_64Linux``. As
long as ``/usr/local/bin`` is in your ``$PATH``, you can then type
+long as ``/usr/local/bin`` is in your ``\$PATH``, you can then type
``sage`` from the command line to run Sage. Another approach is to
create a symbolic link from ``sagex.y.zx86_64Linux`` to, say,
``/usr/local/share/sage``::
ln s /.../path_to/.../sagex.y.zx86_64Linux /usr/local/share/sage
Then put ``/usr/local/share/sage`` in your ``$PATH``. If you do this,
+Then put ``/usr/local/share/sage`` in your ``\$PATH``. If you do this,
you can type ``sage`` from the command line to run Sage. Also, if you
install a different version of Sage, you just have to delete the old
link and create one from the new directory to
diff r 2cffe66bd642 r 3dd0e973ea45 doc/en/installation/source.rst
 a/doc/en/installation/source.rst Fri Jun 04 12:50:55 2010 0700
+++ b/doc/en/installation/source.rst Thu Jun 17 19:20:51 2010 0400
@@ 399,10 +399,10 @@
corresponding program by a particular name: Mathematica is invoked
by calling ``math``, Maple by calling ``maple``, et cetera. The
easiest way to change this name or perform other customizations is
 to create a redirection script in ``$SAGE_ROOT/local/bin``. Sage
+ to create a redirection script in ``\$SAGE_ROOT/local/bin``. Sage
inserts this directory at the front of your PATH, so your script
may need to use an absolute path to avoid calling itself; also,
 your script should use ``$*`` to pass along all of its arguments.
+ your script should use ``\$*`` to pass along all of its arguments.
For example, a ``maple`` script might look like:
::
@@ 415,7 +415,7 @@
easier:
  Copy ``$SAGE_ROOT/sage`` to a location in your ``PATH``. If you do
+  Copy ``\$SAGE_ROOT/sage`` to a location in your ``PATH``. If you do
this, make sure you edit the line with the ``....``'s at the top of
the ``sage`` script.
@@ 427,7 +427,7 @@
konsole T "sage" e /sage
which you make executable (``chmod a+x sage``) and put it somewhere in
 your path. (Note that you have to change ``$SAGE_ROOT`` above!) You
+ your path. (Note that you have to change ``\$SAGE_ROOT`` above!) You
can also make a KDE desktop icon with this as the command (under
the Application tab of the Properties of the icon, which you get my
right clicking the mouse on the icon).
@@ 446,7 +446,7 @@
this and logging out and in again, typing ``sage`` at a shell prompt
should start Sage.
  On Linux and OS X systems, you can make an alias to ``$SAGE_ROOT/sage``.
+  On Linux and OS X systems, you can make an alias to ``\$SAGE_ROOT/sage``.
For example, put something similar to the following line in your
``.bashrc`` file:
@@ 465,7 +465,7 @@
a long time, and those that depend on optional packages and
software, e.g., Mathematica or Magma. Some (optional) examples will
likely fail because they assume that a database is installed.
 Alternatively, from within ``$SAGE_ROOT``, you can type
+ Alternatively, from within ``\$SAGE_ROOT``, you can type
``make test`` to run all the standard test code. This can take
from 30 minutes to an hour or longer.
diff r 2cffe66bd642 r 3dd0e973ea45 doc/en/numerical_sage/installation_osx.rst
 a/doc/en/numerical_sage/installation_osx.rst Fri Jun 04 12:50:55 2010 0700
+++ b/doc/en/numerical_sage/installation_osx.rst Thu Jun 17 19:20:51 2010 0400
@@ 10,7 +10,7 @@
cd $SAGE_ROOT/local/lib
rm libpng*.dylib
where ``$SAGE_ROOT`` is the directory of your
+where ``\$SAGE_ROOT`` is the directory of your
Sage install. Next from within Sage,
.. skip
diff r 2cffe66bd642 r 3dd0e973ea45 doc/en/tutorial/interactive_shell.rst
 a/doc/en/tutorial/interactive_shell.rst Fri Jun 04 12:50:55 2010 0700
+++ b/doc/en/tutorial/interactive_shell.rst Thu Jun 17 19:20:51 2010 0400
@@ 7,13 +7,13 @@
using the ``sage`` command. This starts a customized version of the
IPython shell, and imports many functions and classes, so they are
ready to use from the command prompt. Further customization is
possible by editing the ``$SAGE_ROOT/ipythonrc`` file. Upon starting
+possible by editing the ``\$SAGE_ROOT/ipythonrc`` file. Upon starting
Sage, you get output similar to the following:
.. skip
::

+

 SAGE Version 3.1.1, Release Date: 20080524 
 Type notebook() for the GUI, and license() for information. 
@@ 28,7 +28,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: quit
Exiting SAGE (CPU time 0m0.00s, Wall time 0m0.89s)
@@ 39,7 +41,7 @@
(Avoid killing a Sage process with ``kill 9`` from a terminal,
since Sage might not kill child processes, e.g.,
Maple processes, or cleanup temporary files from
``$HOME/.sage/tmp``.)
+``\$HOME/.sage/tmp``.)
Your Sage Session
=================
@@ 50,20 +52,25 @@
notebook interface), then at any point you may type ``%hist`` to
get a listing of all input lines typed so far. You can type ``?`` at
the Sage prompt to find out more about IPython, e.g.,
"IPython offers numbered prompts ... with input and output caching. All input is saved and can be retrieved as variables (besides the usual arrow key recall). The following GLOBAL variables always exist (so don't overwrite them!)":
+"IPython offers numbered prompts ... with input and output caching.
+All input is saved and can be retrieved as variables (besides the
+usual arrow key recall). The following GLOBAL variables always exist
+(so don't overwrite them!)":
::

 _: previous input (interactive shell and notebook)
 __: next previous input (interactive shell only)
 _oh : list of all inputs (interactive shell only)
+
+ _: previous input (interactive shell and notebook)
+ __: next previous input (interactive shell only)
+ _oh : list of all inputs (interactive shell only)
Here is an example:
.. skip
::

+
+ (Interactive Shell)
+
sage: factor(100)
_1 = 2^2 * 5^2
sage: kronecker_symbol(3,5)
@@ 96,7 +103,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: E = EllipticCurve([1,2,3,4,5])
sage: M = ModularSymbols(37)
sage: %hist
@@ 105,12 +114,6 @@
3: %hist
sage: %macro em 12
Macro `em` created. To execute, type its name (without quotes).


.. skip

::

sage: E
Elliptic Curve defined by y^2 + x*y + 3*y = x^3 + 2*x^2 + 4*x + 5 over
Rational Field
@@ 129,7 +132,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: !ls
auto example.sage glossary.tex t tmp tut.log tut.tex
@@ 142,7 +147,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: !gp
Reading GPRC: /etc/gprc ...Done.
@@ 169,8 +176,8 @@
.. skip
::

 was@form:~$ sage
+
+ was@form:~\$ sage

 SAGE Version 3.0.2, Release Date: 20080524 
 Type notebook() for the GUI, and license() for information. 
@@ 189,7 +196,7 @@
sage: G = E.gens()
sage:
Exiting SAGE (CPU time 0m0.61s, Wall time 0m50.39s).
 was@form:~$ sage
+ was@form:~\$ sage

 SAGE Version 3.0.2, Release Date: 20080524 
 Type notebook() for the GUI, and license() for information. 
@@ 228,7 +235,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: 2^10
1024
sage: sage: sage: 2^10
@@ 249,7 +258,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: %time a = int(1938)^int(99484)
CPU times: user 0.66 s, sys: 0.00 s, total: 0.66 s
Wall time: 0.66
@@ 265,7 +276,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: %time a = 1938^99484
CPU times: user 0.04 s, sys: 0.00 s, total: 0.04 s
Wall time: 0.04
@@ 275,7 +288,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: %time a = pari(1938)^pari(99484)
CPU times: user 0.05 s, sys: 0.00 s, total: 0.05 s
Wall time: 0.05
@@ 284,10 +299,10 @@
PARI built for Sage uses GMP for integer arithmetic).
You can also time a block of commands using
the ``cputime`` command, as illustrated below:
+the ``cputime`` command, as illustrated below:S
::

+
sage: t = cputime()
sage: a = int(1938)^int(99484)
sage: b = 1938^99484
@@ 298,7 +313,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: cputime?
...
Return the time in CPU second since SAGE started, or with optional
@@ 321,7 +338,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: time 1938^99484;
CPU times: user 0.01 s, sys: 0.00 s, total: 0.01 s
Wall time: 0.01
@@ 373,7 +392,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: 3_2

File "", line 1
@@ 397,7 +418,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: %pdb
Automatic pdb calling has been turned ON
sage: EllipticCurve([1,infinity])
@@ 411,7 +434,7 @@
prompt:
::

+
ipdb> ?
Documented commands (type help ):
@@ 670,6 +693,7 @@
[ 69 90 111]
sage: save(A, 'A')
+(In the notebook, click on ``A.sobj`` to download the object.)
You should now quit Sage and restart. Then you can get ``A`` back:
.. skip
@@ 702,9 +726,9 @@
::
 ~/tmp$ ls l E.sobj
+ ~/tmp\$ ls l E.sobj
rwrr 1 was was 153500 20060128 19:23 E.sobj
 ~/tmp$ sage [...]
+ ~/tmp\$ sage [...]
sage: E = load('E')
sage: v = E.anlist(100000) # instant!
@@ 802,7 +826,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: E = EllipticCurve('11a')
sage: M = ModularSymbols(37)
sage: a = 389
@@ 815,14 +841,16 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: save_session('misc')
Saving a
Saving M
Saving t
Saving E
sage: quit
 was@form:~/tmp$ ls l misc.sobj
+ was@form:~/tmp\$ ls l misc.sobj
rwrr 1 was was 2979 20060128 19:47 misc.sobj
Finally we restart Sage, define an extra variable, and load our saved
@@ 831,7 +859,9 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: b = 19
sage: load_session('misc')
Loading a
@@ 845,6 +875,8 @@
.. skip
::
+
+ (Interactive Shell)
sage: M
Full Modular Symbols space for Gamma_0(37) of weight 2 with sign 0
@@ 869,29 +901,33 @@
.. skip
::
+
+ (Interactive Shell)
sage: notebook()
on the command line of Sage. This starts the Sage notebook and
opens your default web browser to view it. The server's state files
are stored in ``$HOME/.sage/sage\_notebook``.
+are stored in ``\$HOME/.sage/sage\_notebook``.
Other options include:
.. skip
::
+
+ (Interactive Shell)
sage: notebook("directory")
which starts a new notebook server using files in the given
directory, instead of the default directory
``$HOME/.sage/sage_notebook``. This can be useful if you want to
+``\$HOME/.sage/sage_notebook``. This can be useful if you want to
have a collection of worksheets associated with a specific project,
or run several separate notebook servers at the same time.
When you start the notebook, it first creates the following files
in ``$HOME/.sage/sage_notebook``:
+in ``\$HOME/.sage/sage_notebook``:
::
diff r 2cffe66bd642 r 3dd0e973ea45 doc/en/tutorial/interfaces.rst
 a/doc/en/tutorial/interfaces.rst Fri Jun 04 12:50:55 2010 0700
+++ b/doc/en/tutorial/interfaces.rst Thu Jun 17 19:20:51 2010 0400
@@ 114,7 +114,7 @@
In PARI, to create an elliptic curve we enter
``ellinit([1,2,3,4,5])``. Sage is similar, except that ``ellinit`` is a
method that can be called on any PARI object, e.g., our
``t\_VEC v``.
+``t_VEC v``.
.. link
@@ 188,7 +188,7 @@
for ``database\_gapx.y.z``.
Some nonGPL'd GAP packages may be installed by downloading them
from the GAP web site [GAPkg]_,
and unpacking them in ``$SAGE_ROOT/local/lib/gap4.4.10/pkg``.
+and unpacking them in ``\$SAGE_ROOT/local/lib/gap4.4.10/pkg``.
)
Singular
diff r 2cffe66bd642 r 3dd0e973ea45 doc/en/tutorial/introduction.rst
 a/doc/en/tutorial/introduction.rst Fri Jun 04 12:50:55 2010 0700
+++ b/doc/en/tutorial/introduction.rst Thu Jun 17 19:20:51 2010 0400
@@ 93,9 +93,9 @@
will search.
The documentation for using SageTeX is located in
 ``$SAGE_ROOT/local/share/texmf/tex/generic/sagetex/``, where
 "``$SAGE_ROOT``" refers to the directory where you installed Sage 
 for example, ``/opt/sage4.2.1``.
+ ``\$SAGE_ROOT/local/share/texmf/tex/generic/sagetex/``, where
+ "``\$SAGE_ROOT``" refers to the directory where you installed Sage 
+ for example, ``/opt/sage4.4.3``.
Ways to Use Sage
================
diff r 2cffe66bd642 r 3dd0e973ea45 doc/en/tutorial/programming.rst
 a/doc/en/tutorial/programming.rst Fri Jun 04 12:50:55 2010 0700
+++ b/doc/en/tutorial/programming.rst Thu Jun 17 19:20:51 2010 0400
@@ 100,15 +100,17 @@
loading Cython code is not supported with the notebook interface).
The actual compilation is done "behind the scenes" without your
having to do anything explicit. See
``$SAGE_ROOT/examples/programming/sagex/factorial.spyx`` for an
+``\$SAGE_ROOT/examples/programming/sagex/factorial.spyx`` for an
example of a compiled implementation of the factorial function that
directly uses the GMP C library. To try this out for yourself, cd
to ``$SAGE_ROOT/examples/programming/sagex/``, then do the
+to ``\$SAGE_ROOT/examples/programming/sagex/``, then do the
following:
.. skip
::
+
+ (Interactive Shell)
sage: load "factorial.spyx"
***************************************************
@@ 125,7 +127,7 @@
Note that Sage will recompile ``factorial.spyx`` if you quit and restart Sage.
The compiled shared object library is stored under
``$HOME/.sage/temp/hostname/pid/spyx``. These files are deleted
+``\$HOME/.sage/temp/hostname/pid/spyx``. These files are deleted
when you exit Sage.
NO Sage preparsing is applied to spyx files, e.g., ``1/3`` will result in
@@ 207,9 +209,9 @@
::
 bash $ ./factor 2006
+ bash \$ ./factor 2006
2 * 17 * 59
 bash $ ./factor "32*x^51"
+ bash \$ ./factor "32*x^51"
(2*x  1) * (16*x^4 + 8*x^3 + 4*x^2 + 2*x + 1)
Data Types
@@ 752,15 +754,14 @@
version 1.0) matrix multiplication over finite fields, for example,
do:
::

 sage: k,a = GF(2**8, 'a').objgen()
 sage: A = Matrix(k,10,10,[k.random_element() for _ in range(10*10)])

.. skip
::
+ (Interactive Shell)
+
+ sage: k,a = GF(2**8, 'a').objgen()
+ sage: A = Matrix(k,10,10,[k.random_element() for _ in range(10*10)])
sage: %prun B = A*A
32893 function calls in 1.100 CPU seconds
@@ 798,6 +799,8 @@
::
+ (Interactive Shell)
+
sage: %prun r A*A
sage: stats = _
sage: stats?
@@ 814,17 +817,14 @@
.. skip
::

+
+ (Interactive Shell)
+
sage: k,a = GF(2**8, 'a').objgen()
sage: A = Matrix(k,10,10,[k.random_element() for _ in range(10*10)])
sage: import hotshot
sage: filename = "pythongrind.prof"
sage: prof = hotshot.Profile(filename, lineevents=1)

.. skip

::

sage: prof.run("A*A")
sage: prof.close()
diff r 2cffe66bd642 r 3dd0e973ea45 doc/en/tutorial/tour_help.rst
 a/doc/en/tutorial/tour_help.rst Fri Jun 04 12:50:55 2010 0700
+++ b/doc/en/tutorial/tour_help.rst Thu Jun 17 19:20:51 2010 0400
@@ 114,7 +114,6 @@
sage: def is_even(n):
... return n%2 == 0
 ...
sage: is_even(2)
True
sage: is_even(3)