plesty.lib.report.latex
A report as LaTeX, to paste into a paper or a thesis.
Tables are booktabs tables: \multicolumn and \multirow for the
spans, with the placeholder & a \multirow needs in the rows it covers,
and a \cmidrule under every header group. Figures are pgfplots axes
with the data inline. PREAMBLE lists the packages and the PLESTY colours
all of it uses.
Attributes
Functions
|
Return the packages and colour definitions a rendered report needs. |
|
Render a report, or one block of it, as LaTeX. |
|
Render one block. |
|
Return plain text with every LaTeX special character written as text. |
|
Render inline markup as LaTeX; math is passed through as it was written. |
|
Render parsed spans. |
|
Render a number, its uncertainty, and a shared power of ten, as math. |
|
Render what a cell says, with its note mark. |
|
Return each column's alignment: centred when every body value there is a number. |
|
Render one row: a cell where one starts, a placeholder under a |
|
Return a |
|
Render the footnotes and the defined terms below a table. |
|
Render a table inside a |
|
Return a trace's finite points as a pgfplots coordinate list. |
|
Render a figure as a |
Module Contents
- plesty.lib.report.latex._LEGEND_POS
- plesty.lib.report.latex._SPECIAL
- plesty.lib.report.latex._UNICODE
- plesty.lib.report.latex._TOKENS = ('cyan', 'violet', 'mint', 'amber', 'rose', 'blue')
- plesty.lib.report.latex._preamble() str
Return the packages and colour definitions a rendered report needs.
- Return type:
str
- plesty.lib.report.latex.PREAMBLE = Multiline-String
Show Value
"""\usepackage{booktabs} \usepackage{multirow} \usepackage{textcomp} \usepackage{xcolor} \usepackage{pgfplots} \pgfplotsset{compat=1.18} """
- plesty.lib.report.latex.to_latex(item: Any) str
Render a report, or one block of it, as LaTeX.
- plesty.lib.report.latex._block(block: Any) str
Render one block.
- Parameters:
block (Any)
- Return type:
str
- plesty.lib.report.latex.escape(text: str) str
Return plain text with every LaTeX special character written as text.
- Parameters:
text (str)
- Return type:
str
- plesty.lib.report.latex.inline(text: str) str
Render inline markup as LaTeX; math is passed through as it was written.
- Parameters:
text (str)
- Return type:
str
- plesty.lib.report.latex._spans(spans: list[plesty.lib.report.markup.Span]) str
Render parsed spans.
- Parameters:
spans (list[plesty.lib.report.markup.Span])
- Return type:
str
- plesty.lib.report.latex._value(cell: plesty.lib.report.blocks.Value) str
Render a number, its uncertainty, and a shared power of ten, as math.
- Parameters:
- Return type:
str
- plesty.lib.report.latex._content(cell: plesty.lib.report.blocks._Spanning) str
Render what a cell says, with its note mark.
- Parameters:
- Return type:
str
- plesty.lib.report.latex._column_spec(table: plesty.lib.report.blocks.Table) list[str]
Return each column’s alignment: centred when every body value there is a number.
- Parameters:
table (plesty.lib.report.blocks.Table)
- Return type:
list[str]
- plesty.lib.report.latex._row(row: list[Any], spec: list[str]) str
Render one row: a cell where one starts, a placeholder under a
\multirow.- Parameters:
row (list[Any])
spec (list[str])
- Return type:
str
- plesty.lib.report.latex._rules(row: list[Any]) str
Return a
\cmidruleunder every header cell spanning several columns.- Parameters:
row (list[Any])
- Return type:
str
- plesty.lib.report.latex._notes(table: plesty.lib.report.blocks.Table) str
Render the footnotes and the defined terms below a table.
- Parameters:
table (plesty.lib.report.blocks.Table)
- Return type:
str
- plesty.lib.report.latex._table(table: plesty.lib.report.blocks.Table) str
Render a table inside a
tableenvironment, title as its caption.- Parameters:
table (plesty.lib.report.blocks.Table)
- Return type:
str
- plesty.lib.report.latex._coordinates(item: plesty.lib.monitor.plots.Line | plesty.lib.monitor.plots.Scatter) str
Return a trace’s finite points as a pgfplots coordinate list.
- Parameters:
item (plesty.lib.monitor.plots.Line | plesty.lib.monitor.plots.Scatter)
- Return type:
str
- plesty.lib.report.latex._figure(figure: plesty.lib.report.blocks.Figure) str
Render a figure as a
pgfplotsaxis inside afigureenvironment.Lines and points are drawn; an image cannot be inlined as coordinates and is left out with a comment saying so; scalars and text marks go into the caption, which is where a printed figure says such things.
- Parameters:
figure (plesty.lib.report.blocks.Figure)
- Return type:
str