interface - Maple Help

interface

set or query user interface variables

 Calling Sequence interface(arg1, arg2, ... )

Parameters

 argN - either of the form name=val or simply name

Description

 • For information on the Maple worksheet interface, see Maple Versions.
 • The interface command serves as a mechanism of communication with the user interface. Specifically, this command is used to set and query all variables that affect the format of the output, but do not affect the computation.
 • Note that some interface options will be affected by the restart command. The interface options will be reset after the restart command is issued. For details, see restart.
 • If an argument has the form name=val, then this specifies the setting for the variable name. The interface command returns the old value of the variable name.
 If an argument is simply a name, then Maple returns the current value of the variable name.
 If a sequence of arguments is given, Maple sets the variable for any arguments of the form name=val and returns a sequence of values (according to the above descriptions) corresponding to the sequence of arguments.
 • The list of names is:

 ansi ansicolor ansiedit ansilprint autoassign compactdisplay displayprecision display_zero_complex_part echo echofile elisiondigitsafter elisiondigitsbefore elisiondigitsthreshold elisiontermsafter elisiontermsbefore elisiontermsthreshold errorbreak errorcursor format getansi helpbrowser historyfile historysize historytimestamp imaginaryunit indentamount labeling labelwidth longdelim max_record_depth numberlines paging patchlevel plotdevice plotoptions plotoutput postplot preplot prettyprint printbytes prompt quiet rtablesize scientificx screenheight screenwidth showassumed showcolors showtermcolors trailingsemicolon typesetting verboseproc version warnlevel worksheetdir

 • The interface variables, values, and description are given in the following table.

 Name Values Explanation Default ansi true or false For the command-line interface, tells the pretty printer to use ANSI escape sequences to highlight Maple keywords, error messages, etc. false (Windows); true (UNIX) ansicolor list of integers For the command-line interface, specifies colors to be used for different categories of output. ansiedit true or false For the command-line interface, specifies that highlighting or color should be used during user input. Effective only when interface(ansi) is true. true ansilprint true or false For the command-line interface, specifies that highlighting or color should be used for lprint output too. Effective only when interface(ansi) is true. true autoassign true, false, or For the Classic interface, tells the graphical user interface to automatically assign results to new names when using context-sensitive menus, and to reuse those names when constructing subsequent commands.  The default root name R can be changed to T (for example) by a command of the form interface('autoassign' = T). R compactdisplay true or false Controls the text mode pretty-printing of Maple procedures. When set to true, they are printed with multiple statements per line when they would fit (subject to interface(screenwidth)). When set to false, each new statement will start on a new line. true displayprecision -1 or integer 0..100 Controls the number of decimal places to be displayed. The default value is $-1$, representing full precision as determined by the Digits environment variable. This allows simplification of display without introducing round-off error. -1 display_zero_ boolean When set to false complex numbers of the true complex_part form a+0*I are displayed without the 0*I part. echo 0, 1, 2, 0 - Do not echo under any circumstance. 1 3, or 4 1 - Echo whenever the input or the output is not from or to the terminal, but do not echo as a result of a read statement (the default). 2 - Echo whenever the input or the output is not from or to the terminal. 3 - Echo only as a result of a read statement. 4 - Echo everything. The echo option is superseded by quiet, so if quiet=true, no echo will occur. echofile string When set to a filename, echoes a copy of the session (both input and output) to that file. If the filename ends in ".html" or ".htm", the session is written in HTML format, using "" elements to apply syntax highlighting corresponding to what is displayed in the session. Setting echofile to the empty string or the name none turns off echoing. (Command-line interface only.) none elisiondigitsafter positive integer Sets the number of digits displayed in the tail of the expression. The tail follows the hidden middle elements, which are enclosed in square brackets. (Standard interface only.) 100 elisiondigitsbefore positive integer Sets the number of digits displayed in the head of the expression. The head precedes the hidden middle elements, which are enclosed in square brackets. (Standard interface only.) 100 elisiondigitsthreshold positive Specifies the number of digits at which 10000 elisionthreshold integer or infinity Elision is applied. Infinity indicates that elision is off. Elision limits the number of digits of an expression that display in the worksheet. (Standard interface only.) To control the number of leading and trailing digits displayed, use elisiondigitsbefore and elisiondigitsafter. To control the maximum number of terms displayed, use elisiontermsthreshold. elisiontermsafter positive integer Sets the number of terms displayed in the tail of the expression. The tail follows the hidden middle elements, which are enclosed in square brackets.  (Standard interface only.) 100 elisiontermsbefore positive integer Sets the number of terms displayed in the head of the expression. The head precedes the hidden middle elements, which are enclosed in square brackets.  (Standard interface only.) 100 elisiontermsthreshold positive Specifies the number of terms at which 1000 termelisionthreshold integer Elision is applied. Infinity indicates that elision is off. Term elision limits the number of terms of an expression that display in the worksheet. (Standard interface only.) To control the number of leading and trailing terms displayed, use elisiontermsbefore and elisiontermsafter. To control the maximum number of digits displayed, use elisiondigitsthreshold. errorbreak 0, 1, 2, or 3 Controls Maple's behavior when an error occurs while reading Maple commands from a file or redirected standard input, as follows: 1 0 - continue with the next command in the file. 1 - stop reading only on syntax errors. 2 - stop reading on any error. 3 - stop reading on any error and show a stack trace (see tracelast). See the details on errorbeak settings below for more detailed information. errorcursor true or false For the Command-line interface, tells Maple to place the cursor on the location of a syntax error (if true), or to indicate the location with a pointer (if false). true format symbol Provides interface format information for the active Maple file: document or worksheet that is used by LaTeX export. This interace variable is read-only. (Standard interface only.) not settable getansi integer Returns the ANSI X3.64 (or extended) escape sequence string used for the specified output category with the current color scheme. If no integer is specified, returns a sequence of escape sequences for all colors in the current scheme. helpbrowser standard or text Specifies the browser to use for viewing help when using the Command-line or Classic interfaces of Maple.  When set to "standard", help pages will be displayed in the standard GUI's help browser.  When set to "text", help pages will be displayed as a stream of text. standard (Classic); text (Command-line) historyfile name or string Specifies the file to be used for persistent command-line history.  If the specified name is default, then history is written to the file .maple_history in the user's home directory.  If the specified name is none, then persistent command-line history is disabled. default historysize integer Specifies the number of lines of command-line history to retain. 5000 historytimestamp true or false Indicates whether timestamps should be inserted into the command history when a session begins. Must be set to true in the user's Maple initialization file to have any affect. false imaginaryunit symbol Specifies the symbol to be used to input the imaginary unit.  By default, this is I.  Any occurrences of the specified symbol in Maple input will be converted internally to Complex(1).  Any complex numbers displayed in Maple output will be displayed as specified by imaginaryunit.  The specified symbol must be a simple symbol that does not require left single quotes.  For example, I and _i are valid, whereas complex/sqrtm1 is not. I indentamount integer The number of spaces items are indented if they must be broken across lines. This is also used in formatting procedures. 4 labeling true or This flag enables the use of the %1, %2, true labelling false Labels for subexpressions on output. The default is true, however this feature is only available for some output formats.  In particular, it requires either a) prettyprint = 1 or b) prettyprint = 2 and typesetting = standard. labelwidth positive integer An item must be at least this many characters long to be considered for a %n label.  The measurement used is approximate. 20 longdelim true or false If true, Maple control structures such as if, do, proc, and so on are displayed with the newer-style long ending delimiters such as end if, end do, end proc, and so on. If false, ending delimiters are displayed as fi, od, end, and so on. true max_record_depth integer The maximum depth of nested Records that are displayed. (Standard interface only.) 1 numberlines true or false Controls whether echoed input lines are preceded by a line number comment (if true) or a prompt (if false, the default). Use interface(echo) to control when input lines are echoed. false paging true or false If set to true, causes the command-line interface to pause at the end of each screenful of output (as set by the screenheight interface variable). The user is then given the option to continue for another line, another screen, until a certain pattern is found, until the end, or to skip the remaining output. false patchlevel integer Normally zero, this read-only variable indicates that a patch library from Maplesoft has been installed to correct errors found after the product was released. The value returned is the patch number. 0 plotdevice string or symbol The name of the plotting device. inline For a list of known devices, see plot/device. plotoptions string A string containing device-specific options to be passed to the device driver.  For more information, see plotsetup and plot/device. empty string plotoutput string or symbol The name of a file where the plot output will be stored.  See plotsetup. "terminal" postplot list of integers A list of integers that encode the sequence to be sent after a plot is made to restore the output device.  Negative values specify a delay.  For values, see plotsetup. empty list preplot list of integers A list of integers that encode the sequence to be sent before a plot to initialize the output device.  Negative values specify a delay.  For values, see plotsetup. empty list prettyprint -2 to +3 The variable that controls the method used to render Maple results and the output of the print command in the user interface. Value 1 produces two-dimensional character-based output. Higher values use interface-specific rendering methods. In the worksheet interface, values of 2 and 3 produce typeset math. Note: One difference between prettyprint = 2 and 3 is subexpression labeling. See labeling for details. 3 (in Worksheet interface); 1 (in Command-line interface) Values less than or equal to zero produce various forms of output equivalent to that produced by lprint. Value 0 produces the same output as lprint, except that print preprocessing is still performed. Value -1 produces the same output as lprint (with no print preprocessing). Value -2 produces the same output as lprint[2]. printbytes true or false Print the "bytes used.." message after every garbage collection (Command-line interface). true prompt string or symbol The string that is printed when user input is expected. "> " quiet true or false An interface constant that will suppress all auxiliary printing (logo, garbage collection messages, bytes used messages, and prompt). false rtablesize [row_limit, column_limit] or integer between 0..2147483647 or infinity This setting controls the number of rows and columns to be displayed inline in a rtable (Array, Matrix, or Vector).  This can be set to a list with two integers, or a single integer. Column and row entries beyond the specified limit will be elided.  One-dimensional Arrays and row vectors will display up to row_limit * column_limit entries. If a single integer is specified instead of a list, that number will be used as the limit for rows, columns, and 1D entries. Setting rtablesize to 0 or [0,0] will cause all rtables to be displayed as placeholders.  A setting of infinity will cause all one- and two-dimensional rtables to be displayed inline.  Multi-dimensional rtables will be displayed as the first two-dimensional slice. [10, 10] scientificx true or false If set to true (the default), display of numbers in scientific notation in typeset math (extended typesetting only) will include a multiplication symbol between the mantissa and base of the exponent. The symbol used will be "×" in the standard GUI, or the letter "x" in the classic GUI or text interfaces. If set to false, the mantissa and base will be separated only by a space. true screenheight integer The height of the screen in characters. 24 screenwidth integer The width of the screen in characters. Must be greater than ten. 79 Note: The screenheight and screenwidth variables are valid but not generally meaningful for worksheet interfaces of Maple. For example, the screenheight and screenwidth options have nothing to do with the displayed size of a worksheet. However, some things, like the output of the latex, dismantle, or showstat commands, are affected by changing them. The character plot driver is also affected. In the Command-line interface, the screenheight and screenwidth interface variables are set automatically based on the terminal window size (screenwidth is set to one less than the actual terminal width), and updated when the terminal is resized. This does not happen when you change the size of a window in the worksheet. However, you can set them manually in the worksheet interface. If you do not change them, the defaults are used (24 lines and 79 columns). showassumed 0, 1, or 2 Indicates how variables with assumptions are displayed.  A setting of 0 hides assumptions.  A setting of 1 causes variables with assumptions to be displayed with a trailing tilde. A setting of 2 causes a list of assumed variables to be displayed at the end of the expression. 1 showcolors none Shows sample output using the current color scheme. showtermcolors none Shows all colors supported by the terminal. trailingsemicolon true or false When pretty-printing Maple procedures as text, controls whether a semicolon is printed after the last statement in a statement sequence (for example, just before the end of a procedure or control structure). When set to false (the default), they are not printed, as they are not strictly necessary (in Maple, the semicolon is a statement separator, not terminator). false typesetting standard or extended For the Standard interface, specifies which typesetting rules are used to display mathematical expressions. Extended typesetting uses a customizable set of rules for displaying expressions. To specify rules, use the Typesetting Assistant. To launch the Assistant, from the View menu, select Typesetting Rules, or run Typesetting[RuleAssistant](). For details, see Typesetting[RuleAssistant]. Standard typesetting uses default rules for displaying expressions (excluding modules, procedures, and procedural constructs). extended verboseproc 0, 1, 2, or 3 0 - Do not print the body of a procedure; print only a skeleton of the form proc(x) ... end. 1 1 - Print the body of user-defined procedures, but do not print the body of Maple library procedures (the default). 2 - Print the body of all procedures. 3 - Print the body and remember tables of all procedures. Note that verboseproc has no effect when prettyprint is 0. version symbol Provides interface version, release, platform, build date, and build ID information. For details on querying version information, see the version help topic. This interface variable is read-only. not settable warnlevel 0, 1, 2, 3, or 4 0 - Suppress all warnings. 3 1 - Print only library-generated warnings. 2 - Print library- and kernel-generated warnings. 3 - Print library-, kernel-, and parser-generated warnings (the default). 4 - Print library-, kernel-, parser-generated, and compatibility warnings (that is, all warnings). worksheetdir string The path to the directory of the active worksheet file.  Unlike currentdir, this cannot be set.  For a file that is not yet saved, the value will be the same as currentdir(). (Standard interface only.) not settable

 • Details on errorbreak settings:
 • interface(errorbreak=0)
 When reading from the user, reading and processing continues after any error.
 When reading a redirected file from stdin (UNIX), reading and processing of the file continues after any error.
 When reading from a file through the "read" command, reading and processing of the file continues after any error.
 • interface(errorbreak=1)
 When reading from the user, reading and processing continues after any error.
 When reading a redirected file from stdin, reading and processing of the file continues after any computation error, but stops after any syntax error.
 When reading from a file through the "read" command, reading and processing of the file continues after any computation error, but stops after any syntax error.
 • interface(errorbreak=2)
 When reading from the user, reading and processing continues after any error.
 When reading a redirected file from stdin, reading and processing of the file stops after any error.
 When reading from a file through the "read" command, reading and processing of the file stops after any error.
 • interface(errorbreak=3)
 The behavior is the same as for interface(errorbreak=2), except that a tracelast command is issued to display a trace of the Maple function stack.
 • For all of the above:
 Whenever reading and processing of a "read" file stops, the stack of all currently active "read" commands is unwound. In other words, reading and processing of all "read" files stops. For each file that is aborted, an error message  is generated that gives the file's name. This way, you know at which level in your nested reads the error actually occurred.
 Whenever a stack of "read"s unwinds, processing continues, with the next command being read from either the user, or from a redirected input file. In other words, an error in a "read" file will not stop processing of a redirected input file (and of course, no normal error will stop processing of user input).
 • In the Standard interface, you can also control many interface options using the Options dialog. For more information, see worksheet/managing/preferences.

Examples

Find out what plot device you are using.

 > $\mathrm{mydevice}≔\mathrm{interface}\left(\mathrm{plotdevice}\right)$
 ${\mathrm{mydevice}}{≔}{\mathrm{inline}}$ (1)

Generate Postscript output in a file. Note: The interface command returns the previous value assigned to a name, not the newly assigned value.

 > $\mathrm{interface}\left(\mathrm{plotdevice}=\mathrm{postscript},\mathrm{plotoutput}=\mathrm{myfile}\right)$
 ${"inline"}{,}{"terminal"}$ (2)

Reset the plot device to inline.

 > $\mathrm{interface}\left(\mathrm{plotdevice}=\mathrm{mydevice}\right)$
 ${"ps"}$ (3)

Store the current value of quiet and set it to true.

 > $\mathrm{oldquiet}≔\mathrm{interface}\left(\mathrm{quiet}=\mathrm{true}\right)$
 ${\mathrm{oldquiet}}{≔}{\mathrm{false}}$ (4)

Look at the Maple code in library routines.

 > $\mathrm{eval}\left(\mathrm{type/Matrix}\right)$
 ${\mathbf{proc}}\left({M}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (5)
 > $\mathrm{interface}\left(\mathrm{verboseproc}=2\right)$
 ${1}$ (6)
 > $\mathrm{eval}\left(\mathrm{type/Matrix}\right)$
 ${\mathbf{proc}}\left({M}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{Copyright \left(c\right) 1998 Waterloo Maple Inc. All rights reserved.}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{opts}}{,}{\mathrm{sizes}}{,}{\mathrm{rest}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{opts}}{≔}{\mathrm{map}}{}\left({x}{→}{\mathbf{if}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{type}}{}\left({x}{,}{\mathrm{identical}}{}\left({'}{\mathrm{shape}}{'}\right){=}{\mathrm{anything}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{if}}{}\left({\mathrm{type}}{}\left({\mathrm{rhs}}{}\left({x}\right){,}{'}{\mathrm{list}}{'}\right){,}{\mathrm{op}}{}\left({\mathrm{rhs}}{}\left({x}\right)\right){,}{\mathrm{rhs}}{}\left({x}\right)\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{else}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end if}}{,}\left[{\mathrm{args}}{[}{2}{..}{−}{1}{]}\right]\right){;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{sizes}}{,}{\mathrm{rest}}{≔}{\mathrm{selectremove}}{}\left({\mathrm{type}}{,}{\mathrm{opts}}{,}\left\{{\mathrm{integer}}{,}\left\{{\mathrm{integer}}{,}{\mathrm{identical}}{}\left({}\right)\right\}{..}\left\{{\mathrm{integer}}{,}{\mathrm{identical}}{}\left({}\right)\right\}\right\}\right){;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{if}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{numelems}}{}\left({\mathrm{sizes}}\right){=}{1}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{opts}}{≔}\left[{\mathrm{sizes}}{[}{1}{]}{,}{\mathrm{sizes}}{[}{1}{]}{,}{\mathrm{op}}{}\left({\mathrm{rest}}\right)\right]\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end if}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{op}}{}\left({0}{,}{M}\right){=}{'}{\mathrm{Matrix}}{'}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{and}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{type}}{}\left({M}{,}{'}{\mathrm{rtable}}{'}{}\left({\mathrm{op}}{}\left({\mathrm{opts}}\right)\right)\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (7)
 > $\mathrm{evalf}\left(\mathrm{\pi }\right)$
 ${3.141592654}$ (8)
 > $\mathrm{interface}\left(\mathrm{displayprecision}=5\right)$
 ${-1}$ (9)
 > $\mathrm{evalf}\left(\mathrm{\pi }\right)$
 ${3.14159}$ (10)
 > $\cdot 100$
 ${314.15927}$ (11)
 > $\mathrm{interface}\left(\mathrm{displayprecision}=-1\right)$
 ${5}$ (12)
 > $\mathrm{Digits}≔5$
 ${\mathrm{Digits}}{≔}{5}$ (13)
 > $\mathrm{evalf}\left(\frac{1}{3}\right)$
 ${0.33333}$ (14)
 > $\cdot 3$
 ${0.99999}$ (15)
 > $\mathrm{interface}\left(\mathrm{displayprecision}=5\right)$
 ${-1}$ (16)
 > $\mathrm{Digits}≔20$
 ${\mathrm{Digits}}{≔}{20}$ (17)
 > $\mathrm{evalf}\left(\frac{1}{3}\right)$
 ${0.33333}$ (18)
 > $\cdot 3$
 ${1.00000}$ (19)

The following examples demonstrate the elision options. These options are for the Standard interface only.  You can also control these options using the Options dialog. For more information, see worksheet/managing/preferences.

 > ${52}^{104}$
 ${29130486520243894529623053895593834890786414833841548364617732063716754081481379078028552440792926355704746836652054508584597185528433952366101529418011123632967861702261909487616}$ (20)

Set the elision threshold and the digits before and after.

 > $\mathrm{interface}\left(\mathrm{elisionthreshold}=100\right):$
 > $\mathrm{interface}\left(\mathrm{elisiondigitsbefore}=10\right):$
 > $\mathrm{interface}\left(\mathrm{elisiondigitsafter}=15\right):$
 > ${52}^{104}$
 ${2913048652\left[...154 ⅆigits...\right]702261909487616}$ (21)
 > 

Compatibility

 • The interface command was updated in Maple 2021.