Latex Module¶
You might read the user guide introduction of this module.
-
class
maabara.latex.
Table
[source]¶ Generating Latex Tables
-
add_column
(data, function=False, title='', dataformat='sigceil', precision=-1, exp='TRUE')[source]¶ Add a column to table
- data : array_like
- Data set
- function : mixed
If False
data
will be added unchanged.If String it sets instructions how to render
data
into each cell, e.g.example($0,1)
.$x
will link to x. column of dataset.Available functions:
num(value, deviation, dataformat, precision)
: Number formating for Latex-outputnum($0)
– Format first column in data as numbernum($0,0.1)
– Format numbers with constant uncertainty 0.1num($0,$1)
– Dynamic uncertainty from second column of datanum($0,$1,{:L})
– Optional format for ufloat printinguc(ufloat, format)
: Number formating alias- Like
num
function but with ufloat argument lit(reference, value, deviation)
: Compare to literature value, seeliterature_value()
lit(3.141, $0)
– Compare with literature value of pilit(3.141, $0,$1)
– Compare including deviationrnd(value, digits)
: roundingrnd($0,3)
– round numbers in 3 digits
from uncertainty:
``ceiling(value, digit) same as math.round, but rounding to higher bound
from uncertainties:
uc.PDG_precision(value) uc.first_digit(value)
uc.PNG Note that
num
will be default if no function name was specified:$0,$1
will be interpreted asnum($0,$1)
- title : string, optional
- Sets a column caption
-
c
(data, function=False, title='')[source]¶ Alias of
add_column()
-
dimensions
(array_return=False)[source]¶ Returns a the dimensions of the current table data
- array_return : boolean, optional
- If True method will return and empty row and column array
- out : mixed
- By default method will return row and col count, if array_return two empty arrays with the corresponding dimensions are returned.
-
environment
()[source]¶ Get Latex table environment markup
- out : string header, string footer
- Latex table environment header and footer
-
export
(file)[source]¶ Saves Latex table markup to file
- file : string
- Filename
- out : mixed
- Latex
\input
command orFalse
on failure
-