<< histo_ts Printings and graphs mpltseries >>

Grocer >> Printings and graphs > mat2latex

mat2latex

LaTex matrix or LaTex table representation of a scilab matrix

CALLING SEQUENCE

mtex = mat2latex(mat,arg1,...,argn)

PARAMETERS

Input

* mat = a (n x k) matrix

* arg1,...,argn = arguments which can be:

  - 'rowtit=xx' a n-dimension string vector of row titles

  - 'coltit=xx' a k-dimension string vector of columns titles

  - 'caption=xx' the table caption or title

  - 'digits=xx' with xx

      . a scalar indicating the number of digits to display in each column

      . a (k x 1) vector indicating the number of digits to display in each column

      . a (1 x k) vector indicating the number of digits to display in each row

  - 'align=xx' a scalar or a k-dimensional vector indicating the alignment of the corresponding columns (default = center for all)

      .'c': center

      .'l': left

      .'r': right

  - 'float=xx' a string indicating the position of table (default='!ht')

      . 'b': bottom of the page

      . 't': top of the page

      . 'h': at the very place in the text where it occurs

      . 'p': on a special page containing only floats

      . '!': without considering most of the internal parameters which could stop this float from being placed

  - 'label=xx' the LaTex anchor

  - 'path=xx' a path where the file has to be saved and the name of the file ex: c:\mypath\mybable.tex'

 

Output

* mtex = a string formed of LaTex represenation of the matrix

DESCRIPTION

Convert a matrix into matrix or a table in LaTex code.

EXAMPLE

caption='My beautiful LaTex table (\%)'
digits=[1,2,3];
rowtit='r'+string(1:n)
coltit='c'+string(1:k)
align=["l","c","c","r"];
float='!ht'
path='SCI\macros\grocer\db\mlatex.tex'
mlatex=mat2latex(mat,'caption=caption','rowtit=rowtit','coltit=coltit','align=align','digits=2','path=path');

// Example taken from function mat2latex()
// Note that the alignment vector contains more elements than the matrix to convert as the first element is
// used to specify the alignment of the row title columns. When no row titles, column titles, caption are
// specified then a simple matrix is created. If the label option is used then the converted matrix is
// be numbered by LaTex.

AUTHOR

Emmanuel Michaux 2009

Report an issue
<< histo_ts Printings and graphs mpltseries >>