A class for color coding the string printing going to a terminal.
An enhanced string printer that is galgebra-aware.
An enhanced LaTeX printer that is galgebra-aware.
The latex printer is turned on with the function (in ga.py) -
Format(Fmode=True,Dmode=True,ipy=False)
where Fmode is the function printing mode that surpresses printing arguments, Dmode is the derivative printing mode that does not use fractions, and ipy=True is the Ipython notebook mode that does not redirect the print output.
The latex output is post processed and displayed with the function (in GAPrint.py) -
xdvi(filename=’tmplatex.tex’,debug=False)
where filename is the name of the tex file one would keep for future inclusion in documents and debug=True would display the tex file immediately.
There are three options for printing multivectors in latex. They are acessed with the multivector member function -
A.Fmt(self,fmt=1,title=None)
where fmt=1, 2, or 3 determines whether the entire multivector A is printed entirely on one line, or one grade is printed per line, or one base is printed per line. If title is not None then the latex string generated is of the form -
title+’ = ‘+str(A)
where it is assumed that title is a latex math mode string. If title contains ‘%’ it is treated as a pure latex math mode string. If it does not contain ‘%’ then the following character mappings are applied -
- ‘grad’ replaced by ‘\bm{\nabla} ‘
- ‘*’ replaced by ‘’
- ‘^’ replaced by ‘\W ‘
- ‘|’ replaced by ‘\cdot ‘
- ‘>’ replaced by ‘\lfloor ‘
- ‘<’ replaced by ‘\rfloor ‘
In the case of a print statement of the form -
print(title,A)
everthing in the title processing still applies except that the multivector formatting is one multivector per line.
For print statements of the form -
print(title)
where no program variables are printed if title contains ‘#’ then title is printed as regular latex line. If title does not contain ‘#’ then title is printed in equation mode. ‘%’ has the same effect in title as in the Fmt() member function.
Try to find ‘executable’ in the directories listed in ‘path’ (a string listing directories separated by ‘os.pathsep’; defaults to os.environ[‘PATH’]). Returns the complete filename or None if not found
Return the LaTeX representation of the given expression.