lprint - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

lprint

linear printing of expressions

 Calling Sequence lprint(expr1, expr2, ...) lprint[2](expr1, expr2, ...)

Parameters

 expr1, expr2, ... - any expressions

Description

 • The procedure lprint returns NULL and prints its arguments in a one-dimensional format.
 • The expressions expr1, expr2, ..., each separated from the others by a comma and a space, are printed on a single line.
 • Like most procedures in Maple, the arguments to lprint are evaluated before being passed to the procedure.
 • In general, the printed form produced by lprint is valid Maple input.
 • Maple will print all expressions after normal evaluation using lprint if the interface variable prettyprint is set to $0$.
 • Because lprint displays output as a side effect, and returns NULL as the procedure value, the ditto commands, %, %%, and %%%, will not recall the output from lprint.
 • The procedure lprint is intended for device independent printing and makes no use of special features of the user interface. For pretty-printing, using a two-dimensional output format, see print. For formatted output, see printf and fprintf.
 • Calling lprint[2] instead of lprint produces line-broken and indented output for procedures, but the same output as lprint for all other expressions.

 • The lprint command is thread-safe as of Maple 15.

Examples

 > $\mathrm{lprint}\left(3{x}^{2},x,{∫}\frac{\mathrm{sin}\left(x+y\right)}{x-y}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}x\right)$
 3*x^2, x, Int(sin(x+y)/(x-y),x)

Arguments are evaluated before printing.

 > $\mathrm{lprint}\left(∫\frac{\mathrm{sin}\left(x+y\right)}{x-y}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx\right)$
 Si(x-y)*cos(2*y)+Ci(x-y)*sin(2*y)

Note: In command-line Maple, the output of lprint can be cut and pasted into a Maple session while pretty-printed output cannot be.

 > $g≔\frac{{x}^{4}-y}{{y}^{2}-3x}:$
 > $\mathrm{lprint}\left(g\right)$
 (x^4-y)/(y^2-3*x)
 > $\mathrm{print}\left(g\right)$
 $\frac{{{x}}^{{4}}{-}{y}}{{{y}}^{{2}}{-}{3}{}{x}}$ (1)

The interface setting of prettyprint determines whether line printing or pretty-printing is used to display the results of normal evaluation.

 > $g$
 $\frac{{{x}}^{{4}}{-}{y}}{{{y}}^{{2}}{-}{3}{}{x}}$ (2)
 > $\mathrm{interface}\left('\mathrm{prettyprint}'=0\right):$
 > $g$
 (x^4-y)/(y^2-3*x)

lprint[2] line breaks and indents procedures, but prints other expressions in one-dimensional form.

 > lprint(proc(x) if x < 0 then x else sqrt(x) end if end proc);
 proc (x) if x < 0 then x; else sqrt(x); end if; end proc
 > lprint[2](proc(x) if x < 0 then x else sqrt(x) end if end proc);
 proc( x )     if x < 0 then         x;     else         sqrt(x);     end if; end proc
 > ${\mathrm{lprint}}_{2}\left(g\right)$
 (x^4-y)/(y^2-3*x)

Compatibility

 • The lprint[2] command is new in Maple 2021.