set or query user interface variables
interface(arg1, arg2, ... )
either of the form name=val or simply name
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:
The interface variables, values, and description are given in the following table.
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)
list of integers
For the command-line interface, specifies colors to be used for different categories of output.
For the command-line interface, specifies that highlighting or color should be used during user input. Effective only when interface(ansi) is true.
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, false, or <name>
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).
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.
-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.
When set to false complex numbers of the
form a+0*I are displayed without the 0*I part.
0, 1, 2,
0 - Do not echo under any circumstance.
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.
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 "<span>" 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.)
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.)
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.)
Specifies the number of digits at which
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.
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.)
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.)
Specifies the number of terms at which
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.
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:
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.
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).
Provides interface format information for the active Maple file: document or worksheet that is used by LaTeX export. This interface variable is read-only. (Standard interface only.)
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.
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)
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.
Specifies the number of lines of command-line history to retain.
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.
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.
The number of spaces items are indented if they must be broken across lines. This is also used in formatting procedures.
This flag enables the use of the %1, %2,
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.
An item must be at least this many characters long to be considered for a %n label. The measurement used is approximate.
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.
The maximum depth of nested Records that are displayed. (Standard interface only.)
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.
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.
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.
string or symbol
The name of the plotting device.
For a list of known devices, see plot/device.
A string containing device-specific options to be passed to the device driver. For more information, see plotsetup and plot/device.
The name of a file where the plot output will be stored. See plotsetup.
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.
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.
-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.
Print the "bytes used.." message after every garbage collection (Command-line interface).
The string that is printed when user input is expected.
An interface constant that will suppress all auxiliary printing (logo, garbage collection messages, bytes used messages, and prompt).
[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.
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.
The height of the screen in characters.
The width of the screen in characters. Must be greater than ten.
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).
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.
Shows sample output using the current color scheme.
Shows all colors supported by the terminal.
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).
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).
0 - Do not print the body of a procedure; print only a skeleton of the form proc(x) ... end.
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.
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.
0, 1, 2, 3, or 4
0 - Suppress all warnings.
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).
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.)
Details on errorbreak settings:
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.
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.
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.
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.
Find out what plot device you are using.
mydevice ≔ interface⁡plotdevice
Generate Postscript output in a file. Note: The interface command returns the previous value assigned to a name, not the newly assigned value.
Reset the plot device to inline.
Store the current value of quiet and set it to true.
oldquiet ≔ interface⁡quiet=true
Look at the Maple code in library routines.
procMoptionCopyright (c) 1998 Waterloo Maple Inc. All rights reserved.;localopts,sizes,rest;opts ≔ map⁡x→iftype⁡x,identical⁡'shape'=anythingthenif⁡type⁡rhs⁡x,'list',op⁡rhs⁡x,rhs⁡xelsexend if,args[2..−1];sizes,rest ≔ selectremove⁡type,opts,integer,integer,identical⁡..integer,identical⁡;ifnumelems⁡sizes=1thenopts ≔ sizes,sizes,op⁡restend if;op⁡0,M='Matrix'andtype⁡M,'rtable'⁡op⁡optsend proc
Digits ≔ 5
Digits ≔ 20
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.
Set the elision threshold and the digits before and after.
The interface command was updated in Maple 2021.
Download Help Document
What kind of issue would you like to report? (Optional)