Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - 日本語 - Русский

Please note that the recommended version of Scilab is 6.1.1. This page might be outdated.
However, this page did not exist in the previous stable version.

Ajuda do Scilab >> Cadeias de Caracteres (Strings) > prettyprint


From any Scilab datatype and provide a representation to the TeX, LaTeX or MathML formats


str = prettyprint(a) // Show the variable a with the default format (LaTeX)
str = prettyprint(a, exportFormat) // Show the variable a with the specified format
str = prettyprint(a, exportFormat, delim) // As above but change the delimiter
str = prettyprint(a, exportFormat, delim, processByElement) // As above but process each element independently
str = prettyprint(a,exportFormat, delim, processByElement, isWrapped) // As above Add the special keyword of Tex or LaTeX export



is a Scilab variable


is the format, if omitted 'latex' is used by default, it can be 'latex', 'tex' or 'mathml'.


is a string indicating the delimiter to use for the resulting matrix, it's only used if isWrapped is true. The delimiter can be '(', '{', '[', '|', '||' or ')'


is a boolean to indicate if the resulting matrix must be converted into a single string.


is a boolean to indicate if the result must be wrapped inside delimiters ('$' for latex and tex or nothing for mathml) to be used with xstring or xtitle


the representation of the variable a


Taking a variable, the prettyprint function will provide a formated representation of it. Formats can be TeX, LaTeX or MathML. They can be used in third party applications but also within Scilab with the most of the Scilab graphic features. The following types are handled by this function:

  • Real / Complex matrices

  • Polynomial types

  • Boolean

  • Integer

  • String

  • Tlist

  • Rational

  • Cell


str = prettyprint(rand(3,3)) // Return the LaTeX representation of a 3,3 matrix
xstring(0.2,0.2,str) // Show the representation in a graphic Windows

prettyprint(rand(3,4),"mathml") // Return the MathML representation of a 3,4 matrix
prettyprint(rand(3,4),"mathml","[") // Return the MathML representation of a 3,4 matrix with '[' as delimiter

s=poly(0,'s'); G=[1,s;1+s^2,3*s^3];
xstring(0.2,0.2,prettyprint(G*s-1)); // Show a polynomial through a LaTeX representation

See also

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 19:58:38 CET 2018