Convert an object to special LaTeX for uncertainty tables.

    This conversion is meant for uncertain values in a table. The return value
    should span three columns. The first column ends just before the decimal
    point in the main number value, if it has one. It has no separation from
    the second column. The second column goes from the decimal point until
    just before the "plus-or-minus" indicator. The third column goes from the
    "plus-or-minus" until the end. If the item being formatted does not fit this
    schema, it can be wrapped in something like '\multicolumn{3}{c}{...}'.

def latexify_u3col(obj, **kwargs):
    """Convert an object to special LaTeX for uncertainty tables.

    This conversion is meant for uncertain values in a table. The return value
    should span three columns. The first column ends just before the decimal
    point in the main number value, if it has one. It has no separation from
    the second column. The second column goes from the decimal point until
    just before the "plus-or-minus" indicator. The third column goes from the
    "plus-or-minus" until the end. If the item being formatted does not fit this
    schema, it can be wrapped in something like '\multicolumn{3}{c}{...}'.

    """
    if hasattr(obj, '__pk_latex_u3col__'):
        return obj.__pk_latex_u3col__(**kwargs)

    # TODO: there are reasonable ways to format many basic types, but I'm not
    # going to implement them until I need to.

    raise ValueError('can\'t LaTeXify %r in 3-column uncertain format' % obj)