module documentation

Routines for writing TeX for tables.

Class DataTable Undocumented
Exception Error Base class for errors.
Exception WrongInputSizeError Error if an array has the wrong size for the following operation.
Function color_to_latex Undocumented
Function marker_to_html Undocumented
Function marker_to_latex Undocumented
Function numtotext Returns a text from a positive integer.
Function tableLaTeX Generates a tabular from a sequence of sequence of strings.
Function tableLaTeXStar Generates a tabular* from a sequence of sequence of strings
Function tableXLaTeX Generates a tabular from a sequence of sequence of strings.
Function writeFEvals Returns string representation of a number of function evaluations.
Function writeFEvals2 Returns string representation of a number of function evaluations.
Function writeFEvalsMaxPrec Return a string representation of a number.
Function writeFEvalsMaxSymbols Return the smallest string representation of a number.
Function writeLabels Format text to be output by LaTeX.
Variable alphabet Undocumented
Variable html_marker_map Undocumented
Variable latex_color_map Undocumented
Variable latex_color_map_old Undocumented
Variable latex_marker_map Undocumented
def color_to_latex(color):

Undocumented

def marker_to_html(marker):

Undocumented

def marker_to_latex(marker):

Undocumented

def numtotext(n):

Returns a text from a positive integer.

Is to be used for generating command names: they cannot include number characters.

WARNING: n should not be larger than (53*52)-1 = 2755 for the moment

def tableLaTeX(table, spec, extra_eol=(), add_begin_tabular=True, add_end_tabular=True):

Generates a tabular from a sequence of sequence of strings.

Parameters
tableUndocumented
specUndocumented
extra_eolUndocumented
add_begin_tabularUndocumented
add_end_tabularUndocumented
seq tablesequence of sequence of strings
string specstring for table specification, see http://en.wikibooks.org/wiki/LaTeX/Tables#The_tabular_environment
seq extra_eolsequence of string the same length as the table (same number of lines) which are added at the end of each line.
bool add_begin_tabularbool value that specifies if begin tabular is added.
bool add_end_tabularbool value that specifies if end tabular is added.
Returns
sequence of strings of a LaTeX tabular.
def tableLaTeXStar(table, width, spec, extraeol=()):

Generates a tabular* from a sequence of sequence of strings

Parameters
tableUndocumented
widthUndocumented
specUndocumented
extraeolUndocumented
seq tablesequence of sequence of strings
string widthstring for the width of the table
strin specstring for table specification, see http://en.wikibooks.org/wiki/LaTeX/Tables#The_tabular_environment
seq extraeolsequence of string the same length as the table (same number of lines) which are added at the end of each line.
def tableXLaTeX(table, spec, extra_eol=(), add_begin_tabular=True, add_end_tabular=True):

Generates a tabular from a sequence of sequence of strings.

Parameters
tableUndocumented
specUndocumented
extra_eolUndocumented
add_begin_tabularUndocumented
add_end_tabularUndocumented
seq tablesequence of sequence of strings
string specstring for table specification, see http://en.wikibooks.org/wiki/LaTeX/Tables#The_tabular_environment
seq extra_eolsequence of string the same length as the table (same number of lines) which are added at the end of each line.
bool add_begin_tabularbool value that specifies if begin tabular is added.
bool add_end_tabularbool value that specifies if end tabular is added.
Returns
sequence of strings of a LaTeX tabular.
def writeFEvals(fevals, precision='.2'):

Returns string representation of a number of function evaluations.

def writeFEvals2(fevals, precision=2, maxdigits=None, isscientific=False):

Returns string representation of a number of function evaluations.

This method is supposed to be used for filling up a LaTeX tabular.

To address the eventual need to keep their string representation short, the method here proposes the shortest representation between the full representation and a modified scientific representation.

Examples:

Number Precision Output Representation
102345 2 digits 1.0e5
Parameters
fevalsUndocumented
precisionUndocumented
maxdigitsUndocumented
isscientificUndocumented
float fevals
int precisionnumber of significant digits
int maxdigits
bool isscientific
def writeFEvalsMaxPrec(entry, SIG, maxfloatrepr=100000.0):

Return a string representation of a number.

Two alternatives:

  1. float notation with a precision smaller or equal to SIG (if the entry is one, then the result is 1).
  2. if the number is larger or equal to maxfloatrepr, a modified scientific notation (without the trailing + and zero in the exponent)
Returns
string representation of a number of function evaluations or ERT.
def writeFEvalsMaxSymbols(fevals, maxsymbols, isscientific=False):

Return the smallest string representation of a number.

This method is only concerned with the maximum number of significant digits.

Two alternatives:

  1. modified scientific notation (without the trailing + and zero in the exponent)
  2. float notation
Returns
string representation of a number of function evaluations or ERT.
def writeLabels(label):

Format text to be output by LaTeX.

alphabet: str =

Undocumented

html_marker_map: dict[str, str] =

Undocumented

latex_color_map: dict[str, str] =

Undocumented

latex_color_map_old: dict[str, str] =

Undocumented

latex_marker_map: dict[str, str] =

Undocumented