Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.2 - Français

Change language to:
English - 日本語 - Português

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Aide Scilab >> Sorties > prettyprint

prettyprint

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

Calling Sequence

str = prettyprint(a) // Show the variable a with the default format (LaTeX)
str = prettyprint(a,exportFormat) // Show the variable a 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

Arguments

a:

is a Scilab variable

exportFormat:

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

delimiter:

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 ')'

processByElement:

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

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

str:

the representation of the variable a

Description

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

  • Rationnal

  • 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 polynom 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 — converts an expression to a string
  • 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

Authors

  • Calixte Denizet
<< msprintf Sorties print >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu May 12 11:45:00 CEST 2011