r'''Assemble a string from the primary name and the given sub- and
    superscripts::

        >>> render_latex_sub_super(name='alpha', subs=['mu', 'nu'], supers=[2])
        '\\alpha_{\\mu,\\nu}^{2}'

        >>> render_latex_sub_super(
        ...     name='alpha', subs=['1', '2'], supers=['(1)'], sep='')
        '\\alpha_{12}^{(1)}'

    Args:
        name (str):  the string without the subscript/superscript
        subs (list or None): list of subscripts
        supers (list or None): list of superscripts
        translate_symbols (bool): If True, try to translate (Greek) symbols in
            `name, `subs`, and `supers` to unicode
        sep (str): Separator to use if there are multiple
            subscripts/superscripts

def render_latex_sub_super(
        name, subs=None, supers=None, translate_symbols=True, sep=','):
    r'''Assemble a string from the primary name and the given sub- and
    superscripts::

        >>> render_latex_sub_super(name='alpha', subs=['mu', 'nu'], supers=[2])
        '\\alpha_{\\mu,\\nu}^{2}'

        >>> render_latex_sub_super(
        ...     name='alpha', subs=['1', '2'], supers=['(1)'], sep='')
        '\\alpha_{12}^{(1)}'

    Args:
        name (str):  the string without the subscript/superscript
        subs (list or None): list of subscripts
        supers (list or None): list of superscripts
        translate_symbols (bool): If True, try to translate (Greek) symbols in
            `name, `subs`, and `supers` to unicode
        sep (str): Separator to use if there are multiple
            subscripts/superscripts
    '''
    if subs is None:
        subs = []
    if supers is None:
        supers = []
    if translate_symbols:
        supers = [_translate_symbols(str(sup)) for sup in supers]
        subs = [_translate_symbols(str(sub)) for sub in subs]
        name = _translate_symbols(name)
    res = name
    sub = sep.join(subs)
    sup = sep.join(supers)
    if len(sub) > 0:
        res += "_{%s}" % sub
    if len(sup) > 0:
        res += "^{%s}" % sup
    return res