9ca65e9c42162046097303557a6ddec43d01419b
[scilab.git] / scilab / modules / string / help / en_US / prettyprint.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2009 - 2010 - Calixte DENIZET
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  * Copyright (C) 2019 - Samuel GOUGEON
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17           xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml"
18           xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19           xmlns:scilab="http://www.scilab.org" xml:id="prettyprint" xml:lang="en">
20     <refnamediv>
21         <refname>prettyprint</refname>
22         <refpurpose>
23           Converts a Scilab object into some corresponding LaTeX, TeX, MathML or HTML strings
24         </refpurpose>
25     </refnamediv>
26     <refsynopsisdiv>
27         <title>Syntax</title>
28         <synopsis>
29             str = prettyprint(a)
30             str = prettyprint(a, exportFormat)
31             str = prettyprint(a, exportFormat, delimiter)
32             str = prettyprint(a, exportFormat, delimiter, processByElement)
33             str = prettyprint(a, exportFormat, delimiter, processByElement, isWrapped)
34         </synopsis>
35     </refsynopsisdiv>
36     <refsection>
37         <title>Arguments</title>
38         <variablelist>
39             <varlistentry>
40                 <term>a</term>
41                 <listitem>
42                     <para>a Scilab object.
43                         <itemizedlist>
44                             <listitem>
45                                 Supported types: booleans, encoded integers, real or complex numbers,
46                                 polynomials and rationals with real or complex coefficients, texts,
47                                 cells, linear dynamical systems (as generated with syslin()),
48                                 other Tlists.
49                             </listitem>
50                             <listitem>
51                                 Supported sizes: scalar, vector, matrix. Hypermatrices are not
52                                 supported (only the first page is processed.)
53                             </listitem>
54                         </itemizedlist>
55                     </para>
56                 </listitem>
57             </varlistentry>
58             <varlistentry>
59                 <term>exportFormat</term>
60                 <listitem>
61                     <para>
62                       is the output format. Possible case-insensitive values are 'latex' (default),
63                       'tex', 'mathml', 'html', or 'html4'.
64                     </para>
65                 </listitem>
66             </varlistentry>
67             <varlistentry>
68                 <term>delimiter</term>
69                 <listitem>
70                     <para> is a string indicating the delimiter type to bracket the whole
71                        resulting matrix. It is only used if <varname>processByElement</varname> is
72                        false. It can be '(' (default), '{', '[', '|', '||', or '' if no bracketing
73                        is required.
74                     </para>
75                     <para>
76                         In HTML, the '_' delimiter value can be used to format the input matrix
77                         without delimiter but with cells borders.
78                     </para>
79                     <para>
80                         <warning>
81                             Delimiters used for the components defining a linear dynamical system
82                             are always "(" and ")", even with <varname>delimiter</varname>="",
83                             unless <varname>exportFormat</varname>="html4" is used: Then, "|"
84                             is imposed as inner syslin delimiter. This is useful when the result
85                             must be rendered in a Scilab GUI like <literal>messagebox()</literal>,
86                             that supports only a restricted version of HTML.4
87                         </warning>
88                     </para>
89                 </listitem>
90             </varlistentry>
91             <varlistentry>
92                 <term>processByElement</term>
93                 <listitem>
94                   <para> is a boolean: If set to <literal>%f</literal> (default), the result
95                     <varname>str</varname> is a single string representing the whole input
96                     matrix. Otherwise, <varname>str</varname> has as many elements as the input
97                     matrix <varname>a</varname>.
98                     </para>
99                 </listitem>
100             </varlistentry>
101             <varlistentry>
102                 <term>isWrapped</term>
103                 <listitem>
104                     <para>
105                         is a boolean to indicate if the result must be wrapped inside technical
106                         delimiters. The default value is %T (true).
107                         The delimiters depend on the export format. It is
108                         <itemizedlist>
109                             <listitem>
110                                 '$' for latex and tex
111                             </listitem>
112                             <listitem>
113                                 nothing for mathml
114                             </listitem>
115                             <listitem>
116                                 <para>
117                                     for HTML:
118                                     <itemizedlist>
119                                         <listitem>
120                                             nothing if <varname>processByElement</varname> is
121                                             <literal>%T</literal> ;
122                                         </listitem>
123                                         <listitem>
124                                             or the opening tag
125                                             <literal>&lt;table valign="middle" cellspacing="0" cellpadding="3" ..></literal>
126                                             otherwise. Note that the "&lt;/table>"
127                                             closure is then always included, even if
128                                             <varname>isWrapped</varname> is <literal>%F</literal>.
129                                             This allows to fully customize the table style and attributes,
130                                             instead of using the default ones.
131                                         </listitem>
132                                     </itemizedlist>
133                                 </para>
134                             </listitem>
135                         </itemizedlist>
136                     </para>
137                 </listitem>
138             </varlistentry>
139             <varlistentry>
140                 <term>str</term>
141                 <listitem>
142                   <para> a single string (if <varname>processByElement</varname> is %F),
143                     or a matrix of strings otherwise (with size(str)==size(a)):
144                     the representation of the input object <varname>a</varname>.
145                   </para>
146                 </listitem>
147             </varlistentry>
148         </variablelist>
149     </refsection>
150     <refsection>
151         <title>Description</title>
152         <para>
153             <literal>prettyprint()</literal> provides a formatted representation of a Scilab object.
154             The format can be TeX, LaTeX, MathML, or HTML.
155         </para>
156         <para>
157             The result can be used in third party applications, or within Scilab: Almost all graphic
158             functions requiring or accepting some text input support it as LaTeX expressions
159             (see <link linkend="math_rendering_features_in_graphic">Scilab graphic features</link>).
160         </para>
161         <para>
162             In addition, some GUI features accept and render HTML inputs. The special export format
163             'html4' must be used to display linear dynamical systems in a Scilab GUI like messagebox().
164         </para>
165         <warning>
166             When an array of cells includes some matrices or other arrays, the same chosen delimiters
167             are used for the cells array and for its elements that are also arrays.
168         </warning>
169         <note>
170             <para>
171             The output format of all decimal numbers included in the input object is driven by the
172             <literal>format()</literal> function.
173             </para>
174         </note>
175         <refsect3>
176             <title>Rendering some MathML or/and LaTeX codes in a HTML page:</title>
177             <para>
178                 Only the Firefox web browser supports natively the &lt;math> MathML tag,
179                 that can embed some mathML code, and renders it.
180             </para>
181             <para>
182                 To render MathML code in <emphasis>any</emphasis> web browser,
183                 <itemizedlist>
184                     <listitem>
185                         put the following HTML instruction only once before the first use of
186                         <literal>&lt;math></literal>:
187                         &lt;script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async/>.
188                         This is typically done in the <literal>&lt;head>..&lt;/head></literal>
189                         section of the HTML page.
190                     </listitem>
191                     <listitem>
192                         put every set of MathML instructions between <literal>&lt;math>..&lt;/math></literal>.
193                     </listitem>
194                 </itemizedlist>
195             </para>
196             <note>
197                 <para>
198                     The same <literal>&lt;script..></literal> instruction declaring the
199                     <emphasis>MathJax</emphasis> package can be used to parse and render
200                     LaTeX expressions directly written in the HTML code, embedded between
201                     <literal>\[ ..\]</literal> brackets instead of
202                     <literal>&lt;math>..&lt;/math></literal>.
203                 </para>
204                 <para>
205                     Hence, the HTML code of a page can mix some LaTeX and MathML instructions
206                     that will be parsed and rendered accordingly.
207                 </para>
208            </note>
209             <para>Please see examples provided in the dedicated section below.</para>
210         </refsect3>
211     </refsection>
212     <refsection>
213         <title>Examples</title>
214         <programlisting role="example"><![CDATA[
215 str = prettyprint(rand(3,3)) // Return the LaTeX representation of a 3,3 matrix
216 xstring(0.2,0.2,str) // Show the representation in a graphic Windows
217
218 prettyprint(rand(3,4),"mathml") // Return the MathML representation of a 3,4 matrix
219 prettyprint(rand(3,4),"mathml","[") // Return the MathML representation of a 3,4 matrix with '[' as delimiter
220
221 s=poly(0,'s'); G=[1,s;1+s^2,3*s^3];
222 xstring(0.2,0.2,prettyprint(G*s-1)); // Show a polynomial through a LaTeX representation
223  ]]></programlisting>
224     <para/>
225     <para>
226         <emphasis role="bold">
227             Set of objects to be defined before using them in all next examples:
228         </emphasis>
229     </para>
230         <programlisting role="example"><![CDATA[
231 bool = [ %t %t ; %f %t ]
232 i16 = int16([
233   26595  1212  4257 -4466  9784
234   -4226  3404  5743    3  10032
235   30471     6 14918  267     30 ])
236 num = [-123.45, %inf, 5.427e-123
237         %nan  ,  0  , -%inf ]
238 cx = [complex(1,%nan), complex(-1.25d-12, 2)
239       complex(%inf,6.1e167), complex(1,-%inf)]
240 p  = [[0*%z ; %z], (%i-%z).^[1 3;2 4]]; string(p)
241 text = ["André''s got 50% of 1430 $, & the ""remainder"" 1 month later."
242         "x=A\B is such that A*x=B, with A in {a<b, 1-a, ~a, ^a}. _#"]
243 ce = {["a b"; "cdefg"], %t, %z./[%z-1, %z^2+1] ; (1-%s)^3, %pi, int8(rand(2,3)*200)}
244
245 A = grand(3,3,"uin",-999,999)/100;
246 B = grand(3,2,"uin",-999,999)/100;
247 C = grand(2,3,"uin",-999,999)/100;
248 linsys = syslin("c", A, B, C);
249
250 L = list("Booleans:", bool, "int16:", i16, "Decimal numbers:", num, ..
251          "Complex numbers:", cx, "Polynomials:", p, "Text:", text, ..
252          "Cells array, embedding rationals:", ce, "Linear dynamical system:");
253  ]]></programlisting>
254     <screen><![CDATA[
255 --> bool = [ %t %t; %f %t ];
256  bool  =
257   T T
258   F T
259
260 --> i16 = int16([
261   >   26595  1212  4257 -4466  9784
262   >   -4226  3404  5743    3  10032
263   >   30471     6 14918  267     30 ])
264  i16  =
265   26595  1212  4257 -4466  9784
266  -4226  3404  5743    3  10032
267   30471    6  14918  267    30
268
269
270 --> num = [-123.45, %inf, 5.427e-123
271   >         %nan  ,  0  , -%inf ]
272  num  =
273   -123.45   Inf   0.
274    Nan      0.   -Inf
275
276
277 --> cx = [complex(1,%nan), complex(-1.25d-12, 2)
278   >       complex(%inf,6.1e167), complex(1,-%inf)]
279  cx  =
280    1. + Nani         -1.250D-12 + 2.i
281    Inf + 6.10D+167i   1. - Infi
282
283
284 --> p  = [[0*%z ; %z], (%i-%z).^[1 3;2 4]]; string(p)
285  ans  =
286 !                                 2   3      !
287 !0  i - z           - i + 3z + 3iz - z       !
288 !                                            !
289 !                2              2     3   4  !
290 !z  - 1 - 2iz + z   1 + 4iz - 6z - 4iz + z   !
291
292
293 --> text = ["André''s got 50% of 1430 $, & the ""remainder"" 1 month later."
294   >         "x=A\B is such that A*x=B, with A in {a<b, 1-a, ~a, ^a}. _#"]
295  text  =
296 !André's got 50% of 1430 $, & the "remainder" 1 month later.  !
297 !x=A\B is such that A*x=B, with A in {a<b, 1-a, ~a, ^a}. _#   !
298
299
300 --> ce = makecell([2 3],["a b"; "cdefg"], %t, %z./[%z-1, %z^2+1], ..
301                         (1-%s)^3, %pi, int8(rand(2,3)*200))
302  ce  =
303   [2x1 string    ]  [1x1 boolean ]  [    r   ]
304   [1x1 polynomial]  [1x1 constant]  [2x3 int8]
305 ]]></screen>
306     <para/>
307     <para>
308         <emphasis role="bold">Export to LaTeX format</emphasis>:
309     </para>
310     <programlisting role="example"><![CDATA[
311 // Please run the first example section to define objects to be converted,
312 // before executing this section.
313 prettyprint(bool, "latex")
314 prettyprint(i16, "latex")
315 prettyprint(num, "latex")
316 prettyprint(cx, "latex")
317 prettyprint(p, "latex")
318 prettyprint(text, "latex")
319 prettyprint(ce, "latex")
320 prettyprint(linsys, "latex", "")
321  ]]></programlisting>
322     <screen><![CDATA[
323 --> prettyprint(bool, "latex")
324  ans  =
325  ${\begin{pmatrix}T&T\cr F&T\cr \end{pmatrix}}$
326
327 --> prettyprint(i16, "latex")
328  ans  =
329  ${\begin{pmatrix}26595&1212&4257&-4466&9784\cr -4226&3404&5743&3&10032\cr 3047
330  1&6&14918&267&30\cr \end{pmatrix}}$
331
332 --> prettyprint(num, "latex")
333  ans  =
334  ${\begin{pmatrix}-123.45&{\infty}&5.43\!\times\!10^{-123}\cr {\mathrm{NaN}}&0&
335  {-\infty}\cr \end{pmatrix}}$
336
337 --> prettyprint(cx, "latex")
338  ans  =
339  ${\begin{pmatrix}1+{\mathrm{NaN}}i&-1.250\!\times\!10^{-12}+2i\cr {\infty}+6.1
340  0\!\times\!10^{167}i&1{-\infty}i\cr \end{pmatrix}}$
341
342 --> prettyprint(p, "latex")
343  ans  =
344  ${\begin{pmatrix}0z&i-z &-i+3z +3iz^{2} -z^{3} \cr z &-1-2iz +z^{2} &1+4iz -6z
345  ^{2} -4iz^{3} +z^{4} \cr \end{pmatrix}}$
346
347 --> prettyprint(text, "latex")
348  ans  =
349  ${\begin{pmatrix}\mathsf{\text{André's got 50\% of 1430 \$, \& the "remainder"
350   1 month later.}}\cr \mathsf{\text{x=A\backslash\!B is such that A*x=B, with A
351   in \{a\!<\!b, 1-a, \sim\!a, \^\;\,a\}. _#}}\cr \end{pmatrix}}$
352
353 --> prettyprint(ce, "latex")
354  ans  =
355  ${\begin{pmatrix}{\begin{pmatrix}\mathsf{\text{a b}}\cr \mathsf{\text{cdefg}}\
356  cr \end{pmatrix}}&T&{\begin{pmatrix}{\frac{z }{-1+z }}&{\frac{z }{1+z^{2} }}\c
357  r \end{pmatrix}}\cr 1-3s +3s^{2} -s^{3} &3.1415927&{\begin{pmatrix}51&23&-121\
358  cr 125&122&66\cr \end{pmatrix}}\cr \end{pmatrix}}$
359
360 --> prettyprint(linsys, "latex", "")
361  ans  =
362  ${\begin{matrix}{\left\{\begin{array}{rcl}\dot{X}(t)&=&{\begin{pmatrix}9.35&-5
363  .94&-1.21\cr 6.65&-6.92&2.83\cr 2.49&2.7&0.34\cr \end{pmatrix}} X(t)+{\begin{p
364  matrix}-0.11&-8.3\cr 1.84&7.45\cr -4.93&-1.35\cr \end{pmatrix}}U(t)\cr Y(t) &=
365  & {\begin{pmatrix}5.45&5.61&0.94\cr -5.82&5.41&0.14\cr \end{pmatrix}} X(t) \en
366  d{array}\right.}\cr \end{matrix}}$
367 ]]></screen>
368     <para/>
369     <para>
370         <emphasis role="bold">Export to LaTeX and rendering in a graphic figure</emphasis>:
371     </para>
372     <programlisting role="example"><![CDATA[
373 // Please run the first example section to define objects to be converted,
374 // before executing this section.
375 y = 1.;
376 clf
377 gcf().axes_size = [500 670];
378 gca().margins = 0.01*[1 1 1 1];
379 for obj = L
380     if type(obj)<>10 | part(obj,$)<>":"
381         obj = prettyprint(obj, "latex");
382     end
383     r = stringbox(obj, 0, 0);
384     y = y - strange(r(2,:))-0.015;
385     xstring(0.1, y, obj);
386 end
387 obj = prettyprint(linsys,"latex","")
388 y = y - strange(stringbox(obj, 0, 0)(2,:))-0.02;
389 xstring(0.1, y, obj);
390 set(gca().children, "fractional_font","on", "font_size",2.5);
391  ]]></programlisting>
392     <scilab:image><![CDATA[
393         bool = [ %t %t; %f %t ]
394         i16 = int16([
395           26595  1212  4257 -4466  9784
396           -4226  3404  5743    3  10032
397           30471     6 14918  267     30 ])
398         num = [-123.45, %inf, 5.427e-123
399                 %nan  ,  0  , -%inf ]
400         cx = [complex(1,%nan), complex(-1.25d-12, 2)
401               complex(%inf,6.1e167), complex(1,-%inf)]
402         p  = [[0*%z ; %z], (%i-%z).^[1 3;2 4]]; string(p)
403         text = ["André''s got 50% of 1430 $, & the ""remainder"" 1 month later."
404                 "x=A\B is such that A*x=B, with A in {a<b, 1-a, ~a, ^a}. _#"]
405         ce = {["a b"; "cdefg"], %t, %z./[%z-1, %z^2+1] ; (1-%s)^3, %pi, int8(rand(2,3)*200)}
406
407         A = grand(3,3,"uin",-999,999)/100;
408         B = grand(3,2,"uin",-999,999)/100;
409         C = grand(2,3,"uin",-999,999)/100;
410         linsys = syslin("c", A, B, C);
411
412         L = list("Booleans:", bool, "int16:", i16, "Decimal numbers:", num, ..
413                  "Complex numbers:", cx, "Polynomials:", p, "Text:", text, ..
414                  "Cells array, embedding rationals:", ce, "Linear dynamical system:");
415         y = 1.;
416         clf
417         gcf().axes_size = [500 670];
418         gca().margins = 0.01*[1 1 1 1];
419         for obj = L
420             if type(obj)<>10 | part(obj,$)<>":"
421                 obj = prettyprint(obj, "latex");
422             end
423             r = stringbox(obj, 0, 0);
424             y = y - strange(r(2,:))-0.015;
425             xstring(0.1, y, obj);
426         end
427         obj = prettyprint(linsys,"latex","")
428         y = y - strange(stringbox(obj, 0, 0)(2,:))-0.02;
429         xstring(0.1, y, obj);
430         set(gca().children, "fractional_font","on", "font_size",2.5);
431     ]]></scilab:image>
432     <para/>
433     <para>
434         <emphasis role="bold">Export to LaTeX and rendering in a HTML.5 page for any web browser</emphasis>,
435         using MathJax:
436     </para>
437     <programlisting role="example"><![CDATA[
438 // Please run the first example section to define objects to be converted,
439 // before executing this section.
440 //
441 // Header:
442 mathjaxURL = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"
443 html = ["<!doctype html>"
444         "<html>"
445         "<meta http-equiv=""Content-Type"" content=""text/html;charset=UTF-8"">"
446         "<script src=''" + mathjaxURL + "'' async></script>"
447         "<!-- then any LaTeX expression delimited with \[ .. \] will be rendered -->"
448         "<body>"
449         ];
450 // List of objects:
451 for obj = L
452     if type(obj)<>10 | part(obj,$)<>":"
453         obj = prettyprint(obj, "latex", "(", %f, %f);
454         html = [html ; "\[ "+ obj + "\]" ; "<br/>"];
455     else
456         html = [html ; obj + " <br/>"];
457     end
458 end
459 html = [html ; "\[ "+ prettyprint(linsys, "latex", "") + "\]<br/><br/>"];
460 // Footer:
461 html = [html ; "</body>" ; "</html>"];
462 File = TMPDIR + filesep() + "prettyprint_mathjax.html"
463 mputl(html, File);
464
465 edit(File)     // See the HTML code
466 winopen(File)  // Display the page in your browser
467  ]]></programlisting>
468     <para/>
469     <para>
470         Please note that for text input, the protection needed for some special LaTeX characters
471         is displayed as is by MathJax:
472     </para>
473     <inlinemediaobject>
474         <imageobject>
475             <imagedata fileref="../images/prettyprint_LaTeX_MathJax.png"/>
476         </imageobject>
477     </inlinemediaobject>
478     <para/>
479     <para/>
480     <para>
481         <emphasis role="bold">MathML:</emphasis> Exporting Scilab objects into MathML, and
482         rendering them in a HTML page using the &lt;math> tag.
483         We still use <emphasis>MathJax</emphasis> to render the code in any web browser:
484     </para>
485     <programlisting role="example"><![CDATA[
486 // Please run the first example section to define objects to be converted,
487 // before executing this section.
488 //
489 // Header:
490 mathjaxURL = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"
491 html = ["<!doctype html>"
492         "<html>"
493         "<head>"
494         "<meta http-equiv=""Content-Type"" content=""text/html;charset=UTF-8"">"
495         "<script src=''" + mathjaxURL + "'' async></script>"
496         "<!-- then any MathML expression embedded in <math>..</math> will be rendered -->"
497         "</head>"
498         "<body>"
499         ];
500 // List of objects:
501 for obj = L
502     if type(obj)<>10 | part(obj,$)<>":"
503         obj = prettyprint(obj, "mathml", "(", %f, %f);
504         html = [html ; "<math>" ; obj ; "</math><br/><br/>"];
505     else
506         html = [html ; obj + " <br/>"];
507     end
508 end
509 html = [html ; "<math>" ; prettyprint(linsys, "mathml", "") ; "</math>"];
510 // Footer:
511 html = [html ; "</body>" ; "</html>"];
512 File = TMPDIR + filesep() + "prettyprint_mathML.html"
513 mputl(html, File);
514
515 editor(File)   // See the HTML and MathML code
516 winopen(File)  // Render the page in your browser
517  ]]></programlisting>
518     <inlinemediaobject>
519         <imageobject>
520             <imagedata fileref="../images/prettyprint_MathML.png"/>
521         </imageobject>
522     </inlinemediaobject>
523     <para/>
524     <para/>
525     <para>
526         <emphasis role="bold">Export in HTML(4) for rendering in messagebox()</emphasis>:
527         Only the "|" or "||" delimiters can be used (or "" for no delimiter").
528         In addition, "_" is used in HTML mode to get any table with borders:
529     </para>
530     <programlisting role="example"><![CDATA[
531 // Please run the first example section to define objects to be converted,
532 // before executing this section.
533 //
534 // Header:
535 html = ["<!doctype html>"
536         "<html>"
537         "<meta http-equiv=""Content-Type"" content=""text/html;charset=UTF-8"">"
538         "<body>"
539         ];
540 // List of objects:
541 for obj = L
542     if type(obj)<>10 | part(obj,$)<>":"
543         obj = prettyprint(obj, "html", "|");
544         html = [html ; obj ; "<br/><br/>"];
545     else
546         html = [html ; obj + " <br/>"];
547     end
548 end
549 html = [html ; prettyprint(linsys, "html", "|4")];
550 // Footer:
551 html = [html ; "</body>" ; "</html>"];
552 File = TMPDIR + filesep() + "prettyprint_HTML.html"
553 mputl(html, File);
554
555 edit(File)     // See the HTML code
556 winopen(File)  // Display the page in your browser
557 messagebox(html, "prettyprint() test => messagebox(HTML.4)");
558  ]]></programlisting>
559     <para/>
560     <para>Rendering in a messagebox():</para>
561     <inlinemediaobject>
562         <imageobject>
563             <imagedata fileref="../images/prettyprint_HTML4_GUI.png"/>
564         </imageobject>
565     </inlinemediaobject>
566     <para/>
567     <para>
568         Still in HTML, using "_" to get table borders:
569     </para>
570     <programlisting role="example"><![CDATA[
571 // Please run the first example section to define i16, before executing this section.
572
573 messagebox(["The table is:" ; "<br>" ; prettyprint(i16,"html","_")])
574  ]]></programlisting>
575     <para/>
576     <inlinemediaobject>
577         <imageobject>
578             <imagedata fileref="../images/prettyprint_HTML_table_borders.png"/>
579         </imageobject>
580     </inlinemediaobject>
581
582     </refsection>
583     <refsection role="see also">
584         <title>See also</title>
585         <simplelist type="inline">
586             <member>
587                 <ulink url="https://www.mathjax.org">MathJax</ulink>
588             </member>
589             <member>
590                 <ulink url="http://www.w3.org/1998/Math/MathML">MathML namespace</ulink>
591             </member>
592             <member>
593                 <link linkend="math_rendering_features_in_graphic">math_rendering_features_in_graphic</link>
594             </member>
595             <member>
596                 <link linkend="format">format</link>
597             </member>
598             <member>
599                 <link linkend="xnumb">xnumb</link>
600             </member>
601             <member>
602                 <link linkend="string">string</link>
603             </member>
604             <member>
605                 <link linkend="pol2str">pol2str</link>
606             </member>
607             <member>
608                 <link linkend="msprintf">msprintf</link>
609             </member>
610             <member>
611                 <link linkend="uicontrol">uicontrol(table)</link>
612             </member>
613             <member>
614                 <link linkend="sci2exp">sci2exp</link>
615             </member>
616         </simplelist>
617     </refsection>
618     <refsection role="history">
619         <title>History</title>
620         <revhistory>
621             <revision>
622                 <revnumber>5.2.0</revnumber>
623                 <revdescription>
624                     Function introduced.
625                 </revdescription>
626             </revision>
627             <revision>
628                 <revnumber>6.1.0</revnumber>
629                 <revdescription>
630                     Export to HTML added.
631                 </revdescription>
632             </revision>
633         </revhistory>
634     </refsection>
635 </refentry>