ExprArray

class proveit.ExprArray(*rows_or_columns, styles=None)[source]

Bases: proveit.ExprTuple

An ExprArray represents a 2-dimensional array. It is simply an ExprTuple of ExprTuples (or Expressions representing ExprTuples). By default, each inner ExprTuple is a row of the array (row-major order). For the opposite orientation (column-major order), use VertExprArray.

Methods Summary

flat(self)

Returns the contents of the array as a flattened ExprTuple. For example, instead of returning [[A, B, C}, [D, E, F]] - which displays as A B C D E F it would return [A, B, C, D, E, F].

formatted(self, format_type, \*\*kwargs)

Returns a formatted version of the expression for the given format_type (‘string’ or ‘latex’).

latex(self[, orientation, fence])

Return a latex-formatted representation of the Expression.

remake_with_style_calls(self)

In order to reconstruct this Expression to have the same styles, what “with…” method calls are most appropriate? Return a tuple of strings with the calls to make.

string(self, \*\*kwargs)

Return a string representation of the Expression.

style_options(self)

Return the StyleOptions object for this ExprArray.

with_justification(self, justification)

Methods Documentation

flat(self)[source]

Returns the contents of the array as a flattened ExprTuple. For example, instead of returning [[A, B, C}, [D, E, F]] - which displays as

A B C D E F

it would return [A, B, C, D, E, F]

formatted(self, format_type, \*\*kwargs)[source]

Returns a formatted version of the expression for the given format_type (‘string’ or ‘latex’). In the keyword arguments, fence=True indicates that parenthesis around the sub-expression may be necessary to avoid ambiguity.

latex(self, orientation='horizontal', fence=False, \*\*kwargs)[source]

Return a latex-formatted representation of the Expression. The kwargs can contain formatting directives (such as ‘fence’ used to indicate when a sub-expression should be wrapped in parentheses if there can be ambiguity in the order of operations).

remake_with_style_calls(self)[source]

In order to reconstruct this Expression to have the same styles, what “with…” method calls are most appropriate? Return a tuple of strings with the calls to make. The default for the Operation class is to include appropriate ‘with_wrapping_at’ and ‘with_justification’ calls.

string(self, \*\*kwargs)[source]

Return a string representation of the Expression. The kwargs can contain formatting directives (such as ‘fence’ used to indicate when a sub-expression should be wrapped in parentheses if there can be ambiguity in the order of operations).

style_options(self)[source]

Return the StyleOptions object for this ExprArray.

with_justification(self, justification)[source]