Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Português - 日本語 - Русский
Aide de Scilab >> Chaînes de caractères > prettyprint

prettyprint

Converts a Scilab object into some corresponding LaTeX, TeX or MathML string(s)

Syntax

str = prettyprint(a)
str = prettyprint(a, exportFormat)
str = prettyprint(a, exportFormat, delim)
str = prettyprint(a, exportFormat, delim, processByElement)
str = prettyprint(a, exportFormat, delim, processByElement, isWrapped)

Arguments

a

is a Scilab variable

exportFormat

is the output format. Possible values are 'latex' (default), 'tex', or 'mathml'.

delimiter

is a string indicating the delimiter to bracket the whole resulting matrix. It's only used if processByElement is false. It can be '(' (default), '{', '[', '|', or '||'.

processByElement

is a boolean: If set to %f (default), the result str is a single single representing the whole input matrix. Otherwise, str has as many elements as the input matrix a.

isWrapped

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 default value is %T (true).

str

a single string (if processByElement is %F), or a matrix of strings otherwise (with size(str)==size(a)): the representation of the input a.

Description

Taking a variable, the prettyprint function will provide a formatted 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

Examples

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

  • math_rendering_features_in_graphic — Affiche les équations mathématiques dans le graphique Scilab grâce à MathML ou LaTeX.
  • xtitle — add titles on a graphics window
  • axes_properties — description of the axes entity properties
  • label_properties — description of the Label entity properties
  • legend_properties — description of the Legend entity properties.
  • sci2exp — returns a string able to generate a given Scilab object
  • text_properties — description of the Text entity properties
  • xstringb — dessine des chaînes de caractères dans une boîte
  • xstringl — calcule les dimensions d'une boîte entourant des chaînes de caractères
  • xstring — dessine des chaînes de caractères
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Feb 14 14:59:59 CET 2019