* Bugs 16071+16072+16075 fixed: prettyprint() debugged & a bit improved
[scilab.git] / scilab / modules / string / help / en_US / prettyprint.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  *
4  * The initial version of this help file was generated from prettyprint.sci using help_from_sci().
5  * Following versions have been improved only here.
6  *
7  -->
8 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
9           xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml"
10           xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
11           xmlns:scilab="http://www.scilab.org" xml:id="prettyprint" xml:lang="en">
12     <refnamediv>
13         <refname>prettyprint</refname>
14         <refpurpose>
15           Converts a Scilab object into some corresponding LaTeX, TeX or MathML string(s)
16         </refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Syntax</title>
20         <synopsis>
21             str = prettyprint(a)
22             str = prettyprint(a, exportFormat)
23             str = prettyprint(a, exportFormat, delim)
24             str = prettyprint(a, exportFormat, delim, processByElement)
25             str = prettyprint(a, exportFormat, delim, processByElement, isWrapped)
26         </synopsis>
27     </refsynopsisdiv>
28     <refsection>
29         <title>Arguments</title>
30         <variablelist>
31             <varlistentry>
32                 <term>a</term>
33                 <listitem>
34                     <para>a Scilab object.
35                         <itemizedlist>
36                             <listitem>
37                                 Supported types: booleans, encoded integers, real or complex numbers,
38                                 polynomials and rationals with real or complex coefficients, texts,
39                                 cells, linear dynamical systems (as generated with syslin()),
40                                 other Tlists.
41                             </listitem>
42                             <listitem>
43                                 Supported sizes: scalar, vector, matrix. Hypermatrices are
44                                 not supported (only the first page is processed.)
45                             </listitem>
46                         </itemizedlist>
47                     </para>
48                 </listitem>
49             </varlistentry>
50             <varlistentry>
51                 <term>exportFormat</term>
52                 <listitem>
53                     <para>
54                       is the output format. Possible case-insensitive values are 'latex' (default),
55                       'tex', or 'mathml'.
56                     </para>
57                 </listitem>
58             </varlistentry>
59             <varlistentry>
60                 <term>delimiter</term>
61                 <listitem>
62                     <para> is a string indicating the delimiter to bracket the whole
63                        resulting matrix. It is used only if <varname>processByElement</varname> is
64                        false. It can be '(' (default), '{', '[', '|', '||', or '' if no bracketting
65                       is required.
66                     </para>
67                 </listitem>
68             </varlistentry>
69             <varlistentry>
70                 <term>processByElement</term>
71                 <listitem>
72                   <para> is a boolean: If set to <literal>%f</literal> (default), the result
73                     <varname>str</varname> is a single string representing the whole input
74                     matrix. Otherwise, <varname>str</varname> has as many elements as the input
75                     matrix <varname>a</varname>.
76                     </para>
77                 </listitem>
78             </varlistentry>
79             <varlistentry>
80                 <term>isWrapped</term>
81                 <listitem>
82                     <para> is a boolean to indicate if the result must be wrapped
83                         inside delimiters ('$' for latex and tex or nothing for
84                         mathml) to be used with xstring or xtitle. The default value is %T (true).
85                     </para>
86                 </listitem>
87             </varlistentry>
88             <varlistentry>
89                 <term>str</term>
90                 <listitem>
91                   <para> a single string (if <varname>processByElement</varname> is %F),
92                     or a matrix of strings otherwise (with size(str)==size(a)):
93                     the representation of the input <varname>a</varname>.
94                   </para>
95                 </listitem>
96             </varlistentry>
97         </variablelist>
98     </refsection>
99     <refsection>
100         <title>Description</title>
101         <para>
102             Taking a variable, the prettyprint function will provide a formatted representation of it.
103             Formats can be TeX, LaTeX or MathML.
104             They can be used in third party applications but also within Scilab with the most of the
105             <link linkend="math_rendering_features_in_graphic">Scilab graphic features</link>.
106         </para>
107     </refsection>
108     <refsection>
109         <title>Examples</title>
110         <programlisting role="example"><![CDATA[
111 str = prettyprint(rand(3,3)) // Return the LaTeX representation of a 3,3 matrix
112 xstring(0.2,0.2,str) // Show the representation in a graphic Windows
113
114 prettyprint(rand(3,4),"mathml") // Return the MathML representation of a 3,4 matrix
115 prettyprint(rand(3,4),"mathml","[") // Return the MathML representation of a 3,4 matrix with '[' as delimiter
116
117 s=poly(0,'s'); G=[1,s;1+s^2,3*s^3];
118 xstring(0.2,0.2,prettyprint(G*s-1)); // Show a polynomial through a LaTeX representation
119  ]]></programlisting>
120     </refsection>
121     <refsection role="see also">
122         <title>See also</title>
123         <simplelist type="inline">
124             <member>
125                 <link linkend="math_rendering_features_in_graphic">math_rendering_features_in_graphic</link>
126             </member>
127             <member>
128                 <link linkend="xnumb">xnumb</link>
129             </member>
130             <member>
131                 <link linkend="string">string</link>
132             </member>
133             <member>
134                 <link linkend="pol2str">pol2str</link>
135             </member>
136             <member>
137                 <link linkend="msprintf">msprintf</link>
138             </member>
139             <member>
140                 <link linkend="uicontrol">uicontrol(table)</link>
141             </member>
142             <member>
143                 <link linkend="sci2exp">sci2exp</link>
144             </member>
145         </simplelist>
146     </refsection>
147     <refsection role="history">
148         <title>History</title>
149         <revhistory>
150             <revision>
151                 <revnumber>5.2.0</revnumber>
152                 <revdescription>
153                     Function introduced.
154                 </revdescription>
155             </revision>
156         </revhistory>
157     </refsection>
158 </refentry>