Initializes pretty-printer depending on the environment.
Parameters : | pretty_print: boolean :
order: string or None :
use_unicode: boolean or None :
use_latex: string, boolean, or None :
wrap_line: boolean :
num_columns: int or None :
no_global: boolean :
ip: An interactive console :
euler: boolean, optional, default=False :
forecolor: string, optional, default=’Black’ :
backcolor: string, optional, default=’Transparent’ :
fontsize: string, optional, default=‘10pt’ :
latex_mode: string, optional, default=’equation*’ :
print_builtin: boolean, optional, default=True :
str_printer: function, optional, default=None :
pretty_printer: function, optional, default=None :
latex_printer: function, optional, default=None :
|
---|
Examples
>>> from sympy.interactive import init_printing
>>> from sympy import Symbol, sqrt
>>> from sympy.abc import x, y
>>> sqrt(5)
sqrt(5)
>>> init_printing(pretty_print=True)
>>> sqrt(5)
___
\/ 5
>>> theta = Symbol('theta')
>>> init_printing(use_unicode=True)
>>> theta
\u03b8
>>> init_printing(use_unicode=False)
>>> theta
theta
>>> init_printing(order='lex')
>>> str(y + x + y**2 + x**2)
x**2 + x + y**2 + y
>>> init_printing(order='grlex')
>>> str(y + x + y**2 + x**2)
x**2 + x + y**2 + y
>>> init_printing(order='grevlex')
>>> str(y * x**2 + x * y**2)
x**2*y + x*y**2
>>> init_printing(order='old')
>>> str(x**2 + y**2 + x + y)
x**2 + x + y**2 + y
>>> init_printing(num_columns=10)
>>> x**2 + x + y**2 + y
x + y +
x**2 + y**2
Function for printing of expressions generated in the sympy.physics vector package.
Extends SymPy’s StrPrinter, takes the same setting accepted by SymPy’s \(sstr()\), and is equivalent to \(print(sstr(foo))\).
Parameters : | expr : valid SymPy object
settings : args
|
---|
Examples
>>> from sympy.physics.vector import vprint, dynamicsymbols
>>> u1 = dynamicsymbols('u1')
>>> print(u1)
u1(t)
>>> vprint(u1)
u1
Function for pretty printing of expressions generated in the sympy.physics vector package.
Mainly used for expressions not inside a vector; the output of running scripts and generating equations of motion. Takes the same options as SymPy’s pretty_print(); see that function for more information.
Parameters : | expr : valid SymPy object
settings : args
|
---|
Function for printing latex representation of sympy.physics.vector objects.
For latex representation of Vectors, Dyadics, and dynamicsymbols. Takes the same options as SymPy’s latex(); see that function for more information;
Parameters : | expr : valid SymPy object
settings : args
|
---|
Examples
>>> from sympy.physics.vector import vlatex, ReferenceFrame, dynamicsymbols
>>> N = ReferenceFrame('N')
>>> q1, q2 = dynamicsymbols('q1 q2')
>>> q1d, q2d = dynamicsymbols('q1 q2', 1)
>>> q1dd, q2dd = dynamicsymbols('q1 q2', 2)
>>> vlatex(N.x + N.y)
'\\mathbf{\\hat{n}_x} + \\mathbf{\\hat{n}_y}'
>>> vlatex(q1 + q2)
'q_{1} + q_{2}'
>>> vlatex(q1d)
'\\dot{q}_{1}'
>>> vlatex(q1 * q2d)
'q_{1} \\dot{q}_{2}'
>>> vlatex(q1dd * q1 / q1d)
'\\frac{q_{1} \\ddot{q}_{1}}{\\dot{q}_{1}}'