IRIS Toolbox Reference Manual

array

Insert array with user data

Syntax

P.array(Caption,Data)

Input arguments

Options

Generic options

See help on generic options in report objects.

Description

The input cell array Data can contain either strings or numeric values, or horizontal rules. Numeric values are printed using the standard sprintf function and formatted using the 'format=' option. Horizontal rules must be entered as a string of five (or more) dashes, '-----', in the first cell of the respective row, with all other cells empty in that row. If you wish to include a  command or a piece of  code, you must enclose it in curly brackets.

Titles and subtitles

The input argument Caption can be either a text string, or a 1-by-2 cell array of strings. In the latter case, the first cell will be printed as a title, and the second cell will be printed as a subtitle.

To split the title or subtitle into multiple lines, use the following LaTeX commands wrapped in curly brackets: {\\} or {\\[Xpt]}, where X is the width of an extra vertical space (in points) added between the respective lines.

Example

These commands create a table with two rows separated by a horizontal rule, and three columns in each of them. The middle columns will have Greek letters printed in  math mode.

x = report.new();

A = { ...
    'First row','{$\alpha$}',10000; ...
    '-----','',''; ...
    'Second row','{$\beta$}',20000; ...
};

x.array('My Table',A);

x.publish('test1.pdf');

open test1.pdf;

Example

Use the option 'inputFormat=' to change the way the input strings are interpreted. Compare the two tables in the resulting PDF.

x = report.new();

A = { ...
    1,2,3; ...
    '$\alpha$','b','c', ...
    };

x.array('Table with Plain Input Format (Default)',A, ...
    'heading=',{'A','B','$\Gamma$';'-----','',''});

x.array('Table with LaTeX Input Format',A, ...
    'heading=',{'A','B','$\Gamma$';'-----','',''}, ...
    'inputFormat=','latex');

x.publish('test2.pdf');

open test2.pdf;