def tex_image_length(self, width_str: str) -> str:
    match = re.match('(\\d*\\.?\\d*)\\s*(\\S*)', width_str)
    if (not match):
        return width_str
    res = width_str
    (amount, unit) = match.groups()[:2]
    if ((not unit) or (unit == 'px')):
        return ''
    elif (unit == '%'):
        res = ('%d.0pt' % (float(amount) * 4.1825368))
    return res
def tex_image_length(self, width_str: str) -> str:
    match = re.match('(\\d*\\.?\\d*)\\s*(\\S*)', width_str)
    if (not match):
        return width_str
    res = width_str
    (amount, unit) = match.groups()[:2]
    if ((not unit) or (unit == 'px')):
        return 
    elif (unit == '%'):
        res = ('%d.0pt' % (float(amount) * 4.1825368))
    return res