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 offloat
values. 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 ofNone
indicates auto width. DefaultNone
.vlines (
Union
[Sequence
[int
],bool
]) – If a sequence of integers a line will be inserted before the specified columns.-1
indicates a line should be inserted after the last column. IfTrue
a line will be inserted before every column, and after the last column. IfFalse
no lines will be inserted. DefaultFalse
.hlines (
Union
[Sequence
[int
],bool
]) – If a sequence of integers a line will be inserted before the specified rows.-1
indicates a line should be inserted after the last row. IfTrue
a line will be inserted before every row, and after the last row. IfFalse
no lines will be inserted. DefaultFalse
.vspace (
Union
[Sequence
[int
],bool
]) – If a sequence of integers extra space will be inserted before the specified row.-1
indicates a space should be inserted after the last row. IfTrue
a space will be inserted before every row, and after the last row. IfFalse
no spaces will be inserted. DefaultFalse
.raw (bool) – Whether latex markup in
tabular_data
should be unescaped. DefaultFalse
. DefaultTrue
.footer (
Optional
[str
]) – Optional footer for the table. Inserted as raw LaTeX. DefaultNone
.
Add a caption to a longtable.
-
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
longtable
withbooktabs
formatting.- 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 offloat
values. 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 ofNone
indicates auto width. DefaultNone
.vlines (
Union
[Sequence
[int
],bool
]) – If a sequence of integers a line will be inserted before the specified columns.-1
indicates a line should be inserted after the last column. IfTrue
a line will be inserted before every column, and after the last column. IfFalse
no lines will be inserted. DefaultFalse
.hlines (
Union
[Sequence
[int
],bool
]) – If a sequence of integers a line will be inserted before the specified rows.-1
indicates a line should be inserted after the last row. IfTrue
a line will be inserted before every row, and after the last row. IfFalse
no lines will be inserted. DefaultFalse
.vspace (
Union
[Sequence
[int
],bool
]) – If a sequence of integers extra space will be inserted before the specified row.-1
indicates a space should be inserted after the last row. IfTrue
a space will be inserted before every row, and after the last row. IfFalse
no spaces will be inserted. DefaultFalse
.raw (bool) – Whether latex markup in
tabular_data
should 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
subtables
withbooktabs
formatting.- 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
table
withbooktabs
formatting.- 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 offloat
values. 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 ofNone
indicates auto width. DefaultNone
.vlines (
Union
[Sequence
[int
],bool
]) – If a sequence of integers a line will be inserted before the specified columns.-1
indicates a line should be inserted after the last column. IfTrue
a line will be inserted before every column, and after the last column. IfFalse
no lines will be inserted. DefaultFalse
.hlines (
Union
[Sequence
[int
],bool
]) – If a sequence of integers a line will be inserted before the specified rows.-1
indicates a line should be inserted after the last row. IfTrue
a line will be inserted before every row, and after the last row. IfFalse
no lines will be inserted. DefaultFalse
.vspace (
Union
[Sequence
[int
],bool
]) – If a sequence of integers extra space will be inserted before the specified row.-1
indicates a space should be inserted after the last row. IfTrue
a space will be inserted before every row, and after the last row. IfFalse
no spaces will be inserted. DefaultFalse
.raw (bool) – Whether latex markup in
tabular_data
should 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
tabular
environment withbooktabs
formatting.- Parameters
headers (
Sequence
[str
]) – A sequence of column headers. Default()
.floatfmt (
Union
[str
,Iterable
[str
]]) – The formatting offloat
values. 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 ofNone
indicates auto width. DefaultNone
.vlines (
Union
[Sequence
[int
],bool
]) – If a sequence of integers a line will be inserted before the specified columns.-1
indicates a line should be inserted after the last column. IfTrue
a line will be inserted before every column, and after the last column. IfFalse
no lines will be inserted. DefaultFalse
.hlines (
Union
[Sequence
[int
],bool
]) – If a sequence of integers a line will be inserted before the specified rows.-1
indicates a line should be inserted after the last row. IfTrue
a line will be inserted before every row, and after the last row. IfFalse
no lines will be inserted. DefaultFalse
.vspace (
Union
[Sequence
[int
],bool
]) – If a sequence of integers extra space will be inserted before the specified row.-1
indicates a space should be inserted after the last row. IfTrue
a space will be inserted before every row, and after the last row. IfFalse
no spaces will be inserted. DefaultFalse
.raw (bool) – Whether latex markup in
tabular_data
should 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