chemreac.util.table

Convenience functions for presenting reaction systems in tables.

chemreac.util.table.rsys2pdf_table(rsys, substances, output_dir=None, doc_template=None, doc_template_dict=None, save=True, landscape=False, **kwargs)[source]

Convenience function to render a ReactionSystem as e.g. a pdf using e.g. pdflatex.

Parameters:

rsys: ReactionSystem

substances: sequence of Substance instances

output_dir: path to output directory

(default: system’s temporary folder)

doc_template: string

LaTeX boiler plate temlpate including preamble, document environment etc.

doc_template_dict: dict (string -> string)

dict used to render temlpate (excl. ‘table’)

longtable: bool

use longtable in defaults. (default: False)

**kwargs:

passed on to rsys2table

chemreac.util.table.rsys2table(rsys, substances, table_template=None, table_template_dict=None, **kwargs)[source]

Renders user provided table_template with table_template_dict which also has ‘body’ entry generated from rsys2tablines.

Defaults is LaTeX table requiring booktabs package to be used (add usepackage{booktabs} to preamble).

Parameters:

rsys: ReactionSystem

substances: sequence of Substance instances

table_template: string

table_tempalte_dict: dict used to render table_template (excl. “body”)

longtable: bool

use longtable in defaults. (default: False)

**kwargs:

passed onto rsys2tablines

chemreac.util.table.rsys2tablines(rsys, substances, rref0=1, coldelim=' & ', tex=True, rxnarrow='$\\rightarrow$', ref_fmt='{}', units=None, unit_fmt='{}')[source]

Generates a table representation of a ReactionSystem.

Parameters:

rsys: ReactionSystem

substances: sequence of Substance instances

rref0: integer

default start of index counter (default: 1)

coldelim: string

column delimiter (default: ‘ & ‘)

tex: bool

use latex formated output (default: True)

rxnarrow: string

default: ‘$rightarrow$’

ref_fmt: string or callable

format string of ref attribute of reactions

units: unit registry

optional (default: None)