mplunitx.unit._unit_kw

class _unit_kw(inter_unit_product='\\\\,', per_mode='power', per_symbol='/', bracket_unit_denominator=True, per_symbol_script_correction='\\\\!', sticky_per=False, parse_units=True, unit_font_command='\\\\mathrm')

Bases: object

Handling of the options for the unit formatting.

This class is not intended to be used directly by the user. However, the user can change the options in sisetup.unit_kw by using the update method or setters.

Attributes:
inter_unit_productpython:str, default=r”\,”

Character used to separate units.

per_modepython:str, default=”power”

Mode for typesetting units with negative power. Must be one of {"power", "fraction", "symbol", "single-symbol", "power-positive-first"}. "power": Units are typeset with positive and negative powers. "fraction": Units are typeset as a fraction using \frac. "symbol": Units are typeset with a character between positive and negative powers (Default: "/", see per_symbol). "single-symbol": Units are typeset like "symbol" if there is only one unit with negative power. Otherwise powers are used. "power-positive-first": Units are typeset like "power" but positive powers are typeset left of negative powers.

per_symbolpython:str, default=”/”

Character between positive and negative powers when in "symbol" or "single-symbol" mode.

bracket_unit_denominatorbool, default=True

If True and in "symbol" mode encloses the units to the right of the symbol in brackets.

per_symbol_script_correctionpython:str, default=r”\!”

If the character before per_symbol is a power, the space between the power and the symbol is corrected using the given string.

sticky_perbool, default=False

Not implemented yet.

parse_unitsbool, default=True

If False the input string is returned as is.

unit_font_commandpython:str, default=r”\mathrm”

LaTeX command used to typeset units.

Methods

update(kw)

Update the unit_kw options with a dictionary.