py2latex.tables
Classes:
|
Functions:
|
Add a caption to a longtable. |
|
Create a |
|
|
|
|
|
|
|
|
|
Override the column widths (and also the column alignments) in a tabular environment, etc. |
|
Create a series of |
|
Create a |
|
Create a |
-
class
SubTable(tabular_data, *, caption, label=None, headers=(), floatfmt='g', numalign='decimal', stralign='left', missingval='', showindex='default', disable_numparse=False, colalign=None, colwidths=None, vlines=False, hlines=False, vspace=False, raw=True, footer=None)[source] Bases:
object- Parameters
caption (str) – The caption for the table
label (
Optional[str]) – The label for the table. If undefined the caption is used, in lowercase, with underscores replacing spaces DefaultNone.headers (
Sequence[str]) – A sequence of column headers. Default().floatfmt (
Union[str,Iterable[str]]) – The formatting offloatvalues. Default"g". Default'g'.showindex (
Union[str,bool,Iterable[Any]]) – Default'default'.disable_numparse (
Union[bool,Iterable[int]]) – DefaultFalse.colalign (
Optional[Sequence[Optional[str]]]) – DefaultNone.colwidths (
Optional[Sequence[Optional[str]]]) – Sequence of column widths, e.g.3cm. Values ofNoneindicates auto width. DefaultNone.vlines (
Union[Sequence[int],bool]) – If a sequence of integers a line will be inserted before the specified columns.-1indicates a line should be inserted after the last column. IfTruea line will be inserted before every column, and after the last column. IfFalseno lines will be inserted. DefaultFalse.hlines (
Union[Sequence[int],bool]) – If a sequence of integers a line will be inserted before the specified rows.-1indicates a line should be inserted after the last row. IfTruea line will be inserted before every row, and after the last row. IfFalseno lines will be inserted. DefaultFalse.vspace (
Union[Sequence[int],bool]) – If a sequence of integers extra space will be inserted before the specified row.-1indicates a space should be inserted after the last row. IfTruea space will be inserted before every row, and after the last row. IfFalseno spaces will be inserted. DefaultFalse.raw (bool) – Whether latex markup in
tabular_datashould be unescaped. DefaultFalse. DefaultTrue.footer (
Optional[str]) – Optional footer for the table. Inserted as raw LaTeX. DefaultNone.
-
longtable_from_template(tabular_data, *, caption, label=None, headers=(), pos='htpb', floatfmt='g', numalign='decimal', stralign='left', missingval='', showindex='default', disable_numparse=False, colalign=None, colwidths=None, vlines=False, hlines=False, vspace=False, raw=True, footer=None)[source] Create a
longtablewithbooktabsformatting.- Parameters
caption (str) – The caption for the table
label (
Optional[str]) – The label for the table. If undefined the caption is used, in lowercase, with underscores replacing spaces DefaultNone.headers (
Sequence[str]) – A sequence of column headers. Default().pos (str) – The positioning of the table, e.g.
"htp". Default'htpb'.floatfmt (
Union[str,Iterable[str]]) – The formatting offloatvalues. Default"g". Default'g'.showindex (
Union[str,bool,Iterable[Any]]) – Default'default'.disable_numparse (
Union[bool,Iterable[int]]) – DefaultFalse.colalign (
Optional[Sequence[Optional[str]]]) – DefaultNone.colwidths (
Optional[Sequence[Optional[str]]]) – Sequence of column widths, e.g.3cm. Values ofNoneindicates auto width. DefaultNone.vlines (
Union[Sequence[int],bool]) – If a sequence of integers a line will be inserted before the specified columns.-1indicates a line should be inserted after the last column. IfTruea line will be inserted before every column, and after the last column. IfFalseno lines will be inserted. DefaultFalse.hlines (
Union[Sequence[int],bool]) – If a sequence of integers a line will be inserted before the specified rows.-1indicates a line should be inserted after the last row. IfTruea line will be inserted before every row, and after the last row. IfFalseno lines will be inserted. DefaultFalse.vspace (
Union[Sequence[int],bool]) – If a sequence of integers extra space will be inserted before the specified row.-1indicates a space should be inserted after the last row. IfTruea space will be inserted before every row, and after the last row. IfFalseno spaces will be inserted. DefaultFalse.raw (bool) – Whether latex markup in
tabular_datashould be unescaped. DefaultFalse. DefaultTrue.footer (
Optional[str]) – Optional footer for the table. Inserted as raw LaTeX. DefaultNone.
- Returns
- Return type
-
set_table_widths(table, widths)[source] Override the column widths (and also the column alignments) in a tabular environment, etc.
-
subtables_from_template(subtables, *, caption, label=None, pos='htpb')[source] Create a series of
subtableswithbooktabsformatting.- Parameters
- Returns
- Return type
-
table_from_template(tabular_data, *, caption, label=None, headers=(), pos='htpb', floatfmt='g', numalign='decimal', stralign='left', missingval='', showindex='default', disable_numparse=False, colalign=None, colwidths=None, vlines=False, hlines=False, vspace=False, raw=True, footer=None)[source] Create a
tablewithbooktabsformatting.- Parameters
caption (str) – The caption for the table
label (
Optional[str]) – The label for the table. If undefined the caption is used, in lowercase, with underscores replacing spaces DefaultNone.headers (
Sequence[str]) – A sequence of column headers. Default().pos (str) – The positioning of the table, e.g.
"htp". Default'htpb'.floatfmt (
Union[str,Iterable[str]]) – The formatting offloatvalues. Default"g". Default'g'.showindex (
Union[str,bool,Iterable[Any]]) – Default'default'.disable_numparse (
Union[bool,Iterable[int]]) – DefaultFalse.colalign (
Optional[Sequence[Optional[str]]]) – DefaultNone.colwidths (
Optional[Sequence[Optional[str]]]) – Sequence of column widths, e.g.3cm. Values ofNoneindicates auto width. DefaultNone.vlines (
Union[Sequence[int],bool]) – If a sequence of integers a line will be inserted before the specified columns.-1indicates a line should be inserted after the last column. IfTruea line will be inserted before every column, and after the last column. IfFalseno lines will be inserted. DefaultFalse.hlines (
Union[Sequence[int],bool]) – If a sequence of integers a line will be inserted before the specified rows.-1indicates a line should be inserted after the last row. IfTruea line will be inserted before every row, and after the last row. IfFalseno lines will be inserted. DefaultFalse.vspace (
Union[Sequence[int],bool]) – If a sequence of integers extra space will be inserted before the specified row.-1indicates a space should be inserted after the last row. IfTruea space will be inserted before every row, and after the last row. IfFalseno spaces will be inserted. DefaultFalse.raw (bool) – Whether latex markup in
tabular_datashould be unescaped. DefaultFalse. DefaultTrue.footer (
Optional[str]) – Optional footer for the table. Inserted as raw LaTeX. DefaultNone.
- Returns
- Return type
-
tabular_from_template(tabular_data, *, headers=(), floatfmt='g', numalign='decimal', stralign='left', missingval='', showindex='default', disable_numparse=False, colalign=None, colwidths=None, vlines=False, hlines=False, vspace=False, raw=True, footer=None, no_lines=False, left_margin=True, right_margin=True)[source] Create a
tabularenvironment withbooktabsformatting.- Parameters
headers (
Sequence[str]) – A sequence of column headers. Default().floatfmt (
Union[str,Iterable[str]]) – The formatting offloatvalues. Default"g". Default'g'.showindex (
Union[str,bool,Iterable[Any]]) – Default'default'.disable_numparse (
Union[bool,Iterable[int]]) – DefaultFalse.colalign (
Optional[Sequence[Optional[str]]]) – DefaultNone.colwidths (
Optional[Sequence[Optional[str]]]) – Sequence of column widths, e.g.3cm. Values ofNoneindicates auto width. DefaultNone.vlines (
Union[Sequence[int],bool]) – If a sequence of integers a line will be inserted before the specified columns.-1indicates a line should be inserted after the last column. IfTruea line will be inserted before every column, and after the last column. IfFalseno lines will be inserted. DefaultFalse.hlines (
Union[Sequence[int],bool]) – If a sequence of integers a line will be inserted before the specified rows.-1indicates a line should be inserted after the last row. IfTruea line will be inserted before every row, and after the last row. IfFalseno lines will be inserted. DefaultFalse.vspace (
Union[Sequence[int],bool]) – If a sequence of integers extra space will be inserted before the specified row.-1indicates a space should be inserted after the last row. IfTruea space will be inserted before every row, and after the last row. IfFalseno spaces will be inserted. DefaultFalse.raw (bool) – Whether latex markup in
tabular_datashould be unescaped. DefaultFalse. DefaultTrue.footer (
Optional[str]) – Optional footer for the table. Inserted as raw LaTeX. DefaultNone.no_lines (
bool) – Whether to suppress horizontal lines in the table. DefaultFalse. DefaultFalse.left_margin (
bool) – Whether to include a margin to the left of the table. DefaultTrue. DefaultTrue.right_margin (
bool) – Whether to include a margin to the right of the table. DefaultTrue. DefaultTrue.
- Returns
- Return type