def linetitle(txt, style="-", return_str=False):
    """Simple line under text.

    Parameters
    ----------
    txt : string
        Text to be displayed.

    style : string
        Style for the title. Options are: 'line', 'double', 'line_hang'
        'line' or '-': single line under text
        'double' or '=': double line under text
        'line_hang': simple line with a hanger

        If any other value is passed, it will be converted to string and
        used as character for the line. For example:

        >>> linetitle("Title with custom style", style="%")
        Title with custom style
        %%%%%%%%%%%%%%%%%%%%%%%

    return_str : Bool, default: False
        If True, returns a string instead of printing.

    Returns
    -------
    string
        Only returns in case 'return_str = True', otherwise None


    """
    # Start outputstring
    outputstring = ""

    txt = str(txt)
    txt_size = len(txt)
    style = str(style)

    # bl = bottom left
    # lh = line horizontal
    if style in ["line", "-"]:
        bl = "─"
        lh = "─"
        space = ""

    if style in ["=", "double"]:
        bl = "═"
        lh = "═"
        space = ""

    elif style in ["line_hang", "hanging", "hang"]:
        bl = "╭"
        lh = "─"
        space = " "
    else:
        bl = str(style)[0]
        lh = str(style)[0]
        space = ""

    # Build string
    outputstring += f"{space}{txt}\n"
    outputstring += f"{bl}{lh*(txt_size-1)}{lh*len(space)}"

    if return_str:
        return outputstring
    else:
        print(outputstring)