Size: 22584
Comment:
|
Size: 22772
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 121: | Line 121: |
* Live Sage code for each chapter (except 7, 8, 12, 13 to be done later, especially 13) | * Live Sage code for each chapter (except 7, 8, 12, 13 will be done later - especially 13) |
Line 142: | Line 142: |
* [[attachment:aata-sage-experimental.zip|Worksheet Zip File]] | * [[attachment:aata-sage-experimental.zip|Worksheet Zip File]] - for Tom Judson's Spring 2011 course, includes new Sage code * [[attachment:aata-sage-worksheets-only.zip|Worksheet Zip File]] - for Sage 4.7.alpha3, references to text are broken |
Converting Latex Documents to Sage Worksheets
Introduction
Latex documents can be translated to jsMath, the tool used to render mathematics in the Sage notebook. This project is about automating the conversion process so that authors can easily use a single command to convert a book-length Latex document to a collection of Sage worksheets. These could have embedded Sage input cells, possibly containing interacts, and the cross-referencing features of Latex would be preserved in the collection of Sage worksheets.
Rob Beezer, [email protected], rbeezer on #sage-devel IRC
Supported by
- University Puget Sound Lantz Senior Fellowship (AY 2010-11)
National Science Foundation DUE-1022574 (2010-2013)
Conversion Software
Mercurial Repository @BitBucket
Clone using:
hg clone https://[email protected]/rbeezer/tex2sws/
Linear Algebra Patches
This table tracks patches meant to support the teaching of introductory linear algebra and the enhancement of Beezer's "A First Course in Linear Algebra."
Some tickets below that are available for review can be seen building and passing tests at the Sage PatchBot. Failures can be due to improper listing of necessary prerequisites, or builds not caught up with latest alpha version, so do not necessarily mean a ticket is not ready for review.
Ticket |
Description |
Status |
Acknowledgements |
trivial matrix kernels over non-fields |
4.4.alpha0 |
Martin Albrecht |
|
vector constructor documentation |
4.6.1.alpha3 |
Andrey Novoseltsev |
|
documentation fix on new_matrix constructor |
4.6.1.alpha3 |
Benjamin Jones |
|
additions to all-ones matrix constructor |
4.6.2.alpha0 |
Karl-Dieter Crisman, Robert Miller |
|
zero_vector constructor, vector constructor error-checking |
4.6.2.alpha0 |
Andrey Novoseltsev |
|
matrix augment accepts a vector |
4.6.2.alpha0 |
Joris Vankerschaver, Robert Bradshaw |
|
generic Smith form fails on integer matrices |
4.6.2.alpha2 |
Author: David Loeffler |
|
block matrix constructor |
4.6.2.alpha3 |
Author: Willem Jan Palenstijn |
|
latex printing for vectors |
4.6.2.alpha3 |
Author: Jason Grout |
|
add .is_singular() |
4.6.2.alpha3 |
Robert Bradshaw |
|
conjugate-transpose of a matrix |
4.6.2.alpha3 |
Robert Bradshaw |
|
documentation: matrix row/column linear combinations |
4.6.2.alpha3 |
Alyson Deines |
|
column-oriented matrix constructor |
4.6.2.alpha3 |
Dan Drake |
|
dictionary input to vector constructor |
4.6.2.alpha3 |
Dima Pasechnik |
|
route sparse integer matrices to specialized Smith form |
4.6.2.alpha3 |
David Loeffler |
|
matrix pretty-printing |
4.6.2.alpha3 |
Author: Ivan Andrus |
|
improved error messages for non-invertible matrices |
4.6.2.alpha4 |
Author: Andre Apitzsch |
|
row and column matrix from vector, deprecate transpose |
4.6.2.alpha4 |
Volker Braun, Marco Streng |
|
echelon form over QQ is mutable |
4.6.2.alpha4 |
Tom Coates |
|
diagonal matrix constructor rewrite |
4.6.2.alpha4 |
Joint with: Dan Drake |
|
diagonal elements of a matrix |
4.6.2.rc0 |
Tom Coates |
|
rows/columns of sparse matrices with zero rows/columns |
4.6.2.rc0 |
Jason Grout |
|
speed-up scalar multiples of sparse matrices |
4.7.alpha1 |
Author: Maarten Derickx |
|
matrix row and column swapping, returns new matrix |
4.7.alpha2 |
Alain Filbois |
|
matrix multiplication speedup |
4.7.alpha2 |
Author: Simon King |
|
random vector constructor |
4.7.alpha3 |
Felix Lawrence |
|
vector conjugation |
4.7.alpha3 |
Felix Lawrence |
|
outer product of vectors |
4.7.alpha3 |
Felix Lawrence, John Palmieri |
|
vector constructor fails with empty list |
4.7.alpha3 |
Joint: J. Palmieri, Review: D.Pasechnik |
|
document vector constructor |
4.7.alpha3 |
Martin Raum |
|
fix subdivision attribute |
4.7.alpha4 |
Author: John Palmieri |
|
listing infinite vector space just hangs |
4.7.alpha4 |
John Palmieri |
|
Hermitian inner product, doctests |
4.7.alpha4 |
Karl-Dieter Crisman |
|
extended echelon form |
4.7.alpha4 |
John Palmieri |
|
make matrix pivots immutable |
4.7.alpha4 |
Author: John Palmieri |
|
is_unitary() for matrices |
4.7.alpha4 |
Martin Raum |
|
constructor for elementary matrices |
4.7.alpha4 |
Karl-Dieter Crisman |
|
overhaul matrix stack, augment |
4.7.alpha4 |
Keshav Kini |
|
make subdivisions optional on tensor product |
4.7.alpha4 |
John Palmieri |
|
algebraic closure of CDF |
4.7.alpha4 |
Mike Hansen |
|
subspace decomposition, check optional |
4.7.alpha5 |
Author: Martin Raum |
|
QR matrix decomposition over exact rings |
4.7.alpha5 |
Simon Spicer |
|
is_diagonalizable() for matrices |
4.7.1.alpha0 |
Dan Drake |
|
|
|
|
|
|
|
|
|
Schur matrix decomposition |
positive review |
Martin Raum, John Palmieri |
|
|
|
|
|
|
|
|
|
solve systems over CDF |
with patch |
|
|
properties for matrices |
with patch |
Harald Schilly, Jason Grout |
|
refactor matrix kernels |
with patches |
|
|
fix and upgrade Gram-Schmidt |
with patches, dep. 10683, 10794 |
Martin Raum |
|
QR double dense matrix decomposition upgrade |
with patch |
|
|
singular values for matrices over CDF |
with patch |
Martin Raum |
|
LU decomposition for rectangular matrices |
with patch |
|
|
is_hermitian() for matrices |
with patch |
|
|
similarity check for matrices |
with patch |
|
|
is_normal() for matrices |
with patch |
|
|
|
|
|
|
|
|
|
|
LU decomposition for exact matrices |
in-progress |
|
|
matrix and vector norms, condition number over CDF |
needs work - numerical |
Simon Spicer |
|
remove solve-left-LU |
needs work |
|
|
rank for matrices over CDF |
new |
|
|
add double dense matrix file to documentation |
needs work |
|
|
adjoint meta-ticket |
information, dep. 10471, 8094, 10501 |
|
|
deprecate adjoint in favor of adjugate |
needs work |
|
|
LLL reduced bases for right kernels |
new |
|
|
obliterate sage/matrix/misc.pyx |
orphaned |
|
Group Theory Patches
Ticket |
Description |
Status |
Acknowledgements |
dicyclic groups |
4.2.1.alpha0 |
David Joyner |
|
Higman-Sims graph |
4.2.1.rc0 |
Nathann Cohen |
|
Cayley tables, operation tables |
4.4.alpha0 |
Nicolas M. Thiery, Jason Grout |
|
all subgroups of a permutation group |
4.6.2.alpha4 |
Dima Pasechnik |
|
all cosets of a permutation group |
4.6.2.alpha4 |
Dima Pasechnik |
|
intersections of permutation groups |
4.7.alpha3 |
Dima Pasechnik |
|
inverse of permutation group elements |
4.7.alpha3 |
Robert Bradshaw |
|
conjugates of permutation groups |
4.7.alpha3 |
Dima Pasechnik |
|
commutator subgroup for permutation groups |
4.7.alpha3 |
Dima Pasechnik, David Joyner |
|
|
|
|
|
|
|
|
|
finitely-generated abelian groups |
needs work |
|
Examples
To view a worksheet, click on the "worksheet" link, then in the resulting page find the big blue download box and use your browser's function to copy the link there. Then open your notebook, click the "Upload" link near the upper-left and then paste in the link into the URL field (the second one).
Note: If your version of Sage is 4.3.2 or older then some examples may not render quite right. See way below for how to edit older configurations.
- Sage-Enhancing an Abstract Algebra Textbook (Updated: 2011/04/22)
Tom Judson's free open-source Abstract Algebra; Theory and Applications
- Live Sage code for each chapter (except 7, 8, 12, 13 will be done later - especially 13)
- Requires Sage 4.7.alpha3 or newer (or else some commands will not run properly)
- 259 Sage examples, input/output for each tested on Sage 4.7.alpha3
- Upload the zip file using the notebook's "Upload Worksheet" function - the notebook will do the unzipping
- In the notebook, skip table-of-contents section, click on actual sections to bring up content
SageTeX can be used to render faithful PDF from the same source
Alpha quality: Worksheet Zip File
- Sage-Enhancing a Linear Algebra Textbook (Updated: 2011/02/28)
Rob Beezer's A First Course in Linear Algebra
- Live Sage code for first five chapters of eight (Chapters SLE, V, M, VS, D)
- "Read-Only" - some content is temporarily missing, Sage commands use new unofficial patches for linear algebra, some formatting needs improvements
- Upload the zip file using the notebook's "Upload Worksheet" function - the notebook will do the unzipping
- In the notebook, skip front matter sections, click on actual sections to bring up content
SageTeX is used to render faithful PDF from the same source
- Abstract Algebra Worksheets (2011/04/18)
Tom Judson's Abstract Algebra; Theory and Applications
- Outdated and replaced by the progress above, this is worksheets only
Worksheet Zip File - for Tom Judson's Spring 2011 course, includes new Sage code
Worksheet Zip File - for Sage 4.7.alpha3, references to text are broken
- An Entire Mathematics Textbook (2010/08/27)
Tom Judson's Abstract Algebra: Theory and Applications
- Outdated and replaced by the progress above, this is text only
- Approximating Polynomial Worksheet (2010/02/20)
- A classroom worksheet, with interacts
- Nice mix of mathematics and live demonstrations
- PDF could do something better with interacts (hide code, show screenshot?)
- SageTeX integration (Robert Marik, 2010/02/20)
Slightly modified version of the example.tex file from the SageTeX distribution
- All but three graphics coming through, understandably
- Missing 3D tachyon graphic is just a path problem and is fixable
Might be able to do something better with the sagesilent environment such as inserting a %hide at the start of the block
- To re-create this, run the following sequence of commands:
pdflatex example.tex sage example.sage htlatex example.tex "/path/to/tex4ht-sage.cfg" " -cunihtf -utf8" tex2sws
For fixed tex4ht-sage.cfg, tex2sws.py which allows to insert 3D graphics and vertex labels see this link.
- A Whole-Book Experiment (2010/02/07)
This is all of Beezer's First Course in Linear Algebra as a linked collection of Sage worksheets. It runs about 900 pages when printed, but as a tar archive is around 700K.
- See note below about jsMath configuration and matrix formatting.
- No Sage content yet - see other experiments for demonstrations.
- Installation: To rig worksheet numbers, and thus have cross-worksheet linking work properly, it is necessary to create a pristine user and insert the worksheets properly into the notebook storage area. In the following, you must use the new user "linear", but password and notebook location can be adjusted. But the notebook location needs to end with ".sagenb".
$ sage sage: from sagenb.notebook.notebook import Notebook sage: nb=Notebook("/tmp/fcla.sagenb") sage: nb.add_user('linear', 'algebra', '', account_type='user', force=True) sage: exit $ cd /tmp/fcla.sagenb/home $ tar -xvf /path/to/fcla-worksheets.tar.bz2 $ sage sage: notebook(directory="/tmp/fcla.sagenb")
- You will possibly be asked to create an admin password, just do it.
- Even if you see the right worksheets, sign-out right away.
- Sign-in as the user "linear" with password "algebra".
- Now you should be able to view the worksheets.
tikz graphics migration (2010/02/03, Updated: 2010/02/20)
- tikz graphics in latex source passing through to the worksheet
- combinatorial graphs in Sage creating tikz source, also included
- worksheet has graphics as SVG, live cells, graph editor
- Not all browsers render SVG? Tested in Firefox
Latex source, some generated by Sage
PDF, a faithful rendition
Worksheet, note SVG graphics, run code, experiment with graph editor
This experiment prompted by a mailing list discussion
Group Theory Primer (2010/01/28)
Lots of simple Sage code, some simple mathematics, one interact (search for "@interact")
Best working demo (though it lacks a title)
Worksheet SourceTextbook Section Experiment (2010/01/30, updated 2010/02/07)
This is a straight conversion of a math-heavy section from Beezer's linear algebra text.- See note above about jsMath and matrix formatting.
The original tex4ht output is at FCLA Section FS in jsMath which seems to render just fine for me.
- There is no embedded Sage code here yet, but that will be easy to add.
- Links go nowhere unless they are internal to this section.
Linked Worksheets (2010/01/30)
A simple manufactured example of cross-worksheet linking.- Fire up Sage, then create a new, temporary notebook with the user "link"
sage: from sagenb.notebook.notebook import Notebook sage: nb = Notebook('/tmp/test.sagenb') sage: nb.add_user('link', 'link', '', force=True) sage: nb.save() sage: exit
- At system command-line extract archive (below) to create the worksheets with numbers 0 and 1 in link's space.
$ cd /tmp/test.sagenb/home $ tar -xvf <path-to>/link-worksheets.tar.gz
- Fire up Sage to start a notebook session in the temporary notebook:
sage: notebook(directory="/tmp/test.sagenb")
- You may need to create an admin password (do it).
You may see the worksheets, but be logged in as admin.
If needed, be certain to login as "link" with password "link."
- Open worksheet 0, execute a cell or two, find link to worksheet 1.
- Follow link to worksheet 1, execute some cells here too.
- Fire up Sage, then create a new, temporary notebook with the user "link"
tex4ht
This is a list of known configurations of tex4ht that seem to work:
- "tex4ht is part of the standard mactex distribution" (Dana Ernst, 2010/01/29)
- "TeXLive 2009 (separate from Ubuntu package manager) includes its own little package manager ('tlmgr') and I used that to install tex4ht" (Dan Drake, 2010/01/30)
Ubuntu/Kubuntu/Debian: (K)Ubuntu Karmic 2009/05/21, Debian stable 2008/07/01, Debian testing 2009/06/11
From Jason B. Hill (2010/02/24)- "texlive-full" depends on tex4ht (and hence will install tex4ht) in Ubuntu/Xubuntu/Kubuntu 9.10.
- "tex4ht" may also be installed directly from the standard Ubuntu repositories via apt/aptitude on top of the smaller "texlive-base/texlive-base-bin". This is also true for Debian stable.
- In either case, tex4ht/htlatex/etc commands must be added manually at this point to Kile, or can be called directly from the terminal.
Related Project
sws2tex, Example
Anybody want to try for the round-trip, Latex -> SWS -> Latex?
jsMath Safe Boxes Edit
For Sage versions prior to 4.3.3.alpha0 (sagenb prior to 0.7.5) it is necessary to slightly tweak the jsMath configuration in Sage. It is a one-character edit. You can still view the sections, but "reasons" given in math displays (generally in proofs) won't render right and you will see lots of "@a()" stuff. This was fixed in Trac 8202 for Sage 4.3.3. Check your version of Sage with sage --version.
The file to edit is
SAGE_ROOT/local/lib/python/site-packages/sagenb-0.6-py2.6.egg/sagenb/data/sage/js/jsMath.js
where you might have to adjust the numbering on the sagenb package. Then at line 97 (or thereabouts) make the following change
jsMath.safeHBoxes=1 --> jsMath.safeHBoxes=0
Also, these examples have a bit of a formatting problem for larger matrices (more than two rows) on my setup, but I'm uncertain if that is my problem or more general. A report, either way, would be appreciated if you look at these.