matplotlib.mathtext2
index
/astro-wise/AWEHOME/x86_64/AWBASE/common/lib/python2.5/site-packages/matplotlib/mathtext2.py

Supported commands:
-------------------
 * _, ^, to any depth
 * commands for typesetting functions (\sin, \cos etc.),
 * commands for changing the current font (\rm, \cal etc.),
 * Space/kern commands "\ ", \thinspace
 * \frac
 
Small TO-DO's:
--------------
 * Display braces etc. \} not working (displaying wierd characters) etc.
 * better placing of sub/superscripts. F_1^1y_{1_{2_{3_{4}^3}}3}1_23
 * implement crampedness (or is it smth. else?). y_1 vs. y_1^1
 * add better italic correction. F^1
 * implement other space/kern commands
 
TO-DO's:
--------
 * \over, \above, \choose etc.
 * Add support for other backends

 
Modules
       
os

 
Classes
       
__builtin__.dict(__builtin__.object)
Scriptfactors
exceptions.Exception(exceptions.BaseException)
TexParseError
Environment
Renderer
Char
Fraction
Hbox
Kern
Line
Scripted
Vbox

 
class Char(Renderer)
    A class that implements rendering of a single character.
 
  Methods defined here:
__init__(self, env, char, uniindex=None)
hrender(self, x, y)

Methods inherited from Renderer:
vrender(self, x, y)

 
class Environment
    Class used for representing the TeX environment variables
 
  Methods defined here:
__init__(self)
copy(self)

 
class Fraction(Renderer)
    A class for rendering a fraction.
 
  Methods defined here:
__init__(self, env, num, den)
hrender(self, x, y)

Methods inherited from Renderer:
vrender(self, x, y)

 
class Hbox(Renderer)
    A class that corresponds to a TeX hbox.
 
  Methods defined here:
__init__(self, env, texlist=[])
hrender(self, x, y)

Methods inherited from Renderer:
vrender(self, x, y)

 
class Kern(Renderer)
    Class that implements the rendering of a Kern.
 
  Methods defined here:
__init__(self, env, hadvance)
__repr__(self)

Methods inherited from Renderer:
hrender(self, x, y)
vrender(self, x, y)

 
class Line(Renderer)
    Class that implements the rendering of a line.
 
  Methods defined here:
__init__(self, env, width, height)
hrender(self, x, y)

Methods inherited from Renderer:
vrender(self, x, y)

 
class Renderer
    Abstract class that implements the rendering methods
 
  Methods defined here:
__init__(self, env)
hrender(self, x, y)
vrender(self, x, y)

 
class Scripted(Renderer)
    Used for creating elements that have sub/superscripts
 
  Methods defined here:
__init__(self, env, nuc=None, type='ord', sub=None, sup=None)
__repr__(self)
hrender(self, x, y)

Methods inherited from Renderer:
vrender(self, x, y)

 
class Scriptfactors(__builtin__.dict)
    Used for returning the factor with wich you should multiply the
fontsize to get the font size of the script
 
 
Method resolution order:
Scriptfactors
__builtin__.dict
__builtin__.object

Methods defined here:
__getitem__(self, key)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from __builtin__.dict:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
D.__contains__(k) -> True if D has a key k, else False
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
has_key(...)
D.has_key(k) -> True if D has a key k, else False
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(...)
D.update(E, **F) -> None.  Update D from E and F: for k in E: D[k] = E[k]
(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
values(...)
D.values() -> list of D's values

Data and other attributes inherited from __builtin__.dict:
__new__ = <built-in method __new__ of type object at 0x721760>
T.__new__(S, ...) -> a new object with type S, a subtype of T
fromkeys = <built-in method fromkeys of type object at 0x18636b0>
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.

 
class TexParseError(exceptions.Exception)
    Exception classes
 
 
Method resolution order:
TexParseError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x719220>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class Vbox(Renderer)
    A class representing a vertical box. ref is the index of the texlist
element whose origin will be used as the vbox origin. The default is
ref=-1. If ref is None, then ref is set to be the middle index (if the
number of items in the list is even, a new list element is inserted (as
Kern(0)) to make the list odd).
The box is rendered top down - the last element of the list is rendered
at the bottom.
 
  Methods defined here:
__init__(self, env, texlist=[], ref=None)
hrender(self, x, y)
vrender(self, x, y)

 
Functions
       
FT2Font(...)
FT2Font
break_up_commands(texstring)
Breaks up a string (mustn't contain any groupings) into a list
of commands and pure text.
ceil(...)
ceil(x)
 
Return the ceiling of x as a float.
This is the smallest integral value >= x.
fabs(...)
fabs(x)
 
Return the absolute value of the float x.
floor(...)
floor(x)
 
Return the floor of x as a float.
This is the largest integral value <= x.
get_args(command, texgroup, env, num_args)
Returns the arguments needed by a TeX command
get_first_word(texstring)
get_font(env)
get_frac_bar_height(env)
# Helper functions used by the renderer
get_kern(first, second)
get_space(env)
group_split(texstring)
Splits the string into three parts based on the grouping delimiters,
and returns them as a list.
handle_char(uniindex, env)
handle_command(command, texgroup, env, allowsetters=False)
Handles TeX commands that don't have backward propagation, and
aren't setting anything in the environment.
handle_scripts(firsttype, texgroup, env)
handle_tokens(texgroup, env, box=<class matplotlib.mathtext2.Hbox at 0x1821170>)
Scans the entire (tex)group to handle tokens. Tokens are other groups,
commands, characters, kerns etc. Used recursively.
infer_face(env, item)
is_command(item)
math_parse_s_ft2font(s, dpi, fontsize, angle=0, output='AGG')
This function is called by the backends
math_parse_s_ft2font1(s, dpi, fontsize, angle=0)
Used only for testing
math_parse_s_ft2font_svg(s, dpi, fontsize, angle=0)
normalize_tex(texstring)
Normalizes the whole TeX expression (that is: prepares it for
parsing)
parse_tex(texstring)
# Helper functions used by the parser
remove_comments(texstring)
split_command(texstring)
Splits a texstring into a command part and a pure text (as a list) part
to_list(texstring)
Parses the normalized tex string and returns a list. Used recursively.

 
Data
        KERNING_DEFAULT = 0
barefname = 'cmex10.ttf'
base = 'cmex10'
begin_group_char = '{'
dec_delim = '.'
end_group_char = '}'
environment = <matplotlib.mathtext2.Environment instance at 0x181d098>
esc_char = r'\'
ext = '.ttf'
face = 'nonascii'
faces = ('mit', 'rm', 'tt', 'cal', 'nonascii')
filenamesd = {'cal': '/astro-wise/AWEHOME/x86_64/AWBASE/common/lib/pyt...packages/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf', 'mit': '/astro-wise/AWEHOME/x86_64/AWBASE/common/lib/pyt...packages/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf', 'nonascii': '/astro-wise/AWEHOME/x86_64/AWBASE/common/lib/pyt...packages/matplotlib/mpl-data/fonts/ttf/cmex10.ttf', 'rm': '/astro-wise/AWEHOME/x86_64/AWBASE/common/lib/pyt...-packages/matplotlib/mpl-data/fonts/ttf/cmr10.ttf', 'tt': '/astro-wise/AWEHOME/x86_64/AWBASE/common/lib/pyt...packages/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf'}
fname = '/astro-wise/AWEHOME/x86_64/AWBASE/common/lib/pyt...packages/matplotlib/mpl-data/fonts/ttf/cmex10.ttf'
fontdir = '/astro-wise/AWEHOME/x86_64/AWBASE/common/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf'
fontdirs = ['/astro-wise/AWEHOME/x86_64/AWBASE/common/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/afm', '/astro-wise/AWEHOME/x86_64/AWBASE/common/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf']
fonts = {'cal': <FT2Font object at 0xf01cd8>, 'mit': <FT2Font object at 0xcc67f8>, 'nonascii': <FT2Font object at 0x16890e8>, 'rm': <FT2Font object at 0x14a7548>, 'tt': <FT2Font object at 0xa25228>}
functions = ('sin', 'tan', 'cos', 'exp', 'arctan', 'arccos', 'arcsin', 'cot', 'lim', 'log')
mathstyles = ['display', 'text', 'script', 'scriptscript']
max_depth = 10
modes = ['mathmode', 'displaymathmode']
rcParams = {'axes.axisbelow': False, 'axes.edgecolor': 'k', 'axes.facecolor': 'w', 'axes.formatter.limits': (-7, 7), 'axes.grid': False, 'axes.hold': True, 'axes.labelcolor': 'k', 'axes.labelsize': 12, 'axes.linewidth': 1.0, 'axes.titlesize': 14, ...}
reserved = ('{', '}', '%', '$', '#', '~')
scriptfactors = {}
scripts = ('_', '^')
setters = ('mit', 'rm', 'tt', 'cal', 'nonascii')
svg_elements = <matplotlib.cbook.Bunch instance at 0x1808fc8>
tex2uni = {'AA': 8491, 'AE': 198, 'BbbC': 8450, 'BbbN': 8469, 'BbbP': 8473, 'BbbQ': 8474, 'BbbR': 8477, 'BbbZ': 8484, 'Bumpeq': 8782, 'Cap': 8914, ...}
word_delim = ' '