def tex_label(varname):
    """
    Many variable names used in the Ridley Ionosphere Model look much better
    in LaTeX format with their proper Greek letters.  This function takes
    a variable name, and if it is recognized, returns a properly formatted
    string that uses MatPlotLib's MathText functionality to display the 
    proper characters.  If it is not recognized, the varname is returned.

    Parameters
    ==========
    varname : string
       The variable to convert to a LaTeX label.

    Examples
    ========
    >>>tex_label('n_phi')
    '\\Phi_{Ionosphere}'
    >>>tex_label('Not Recognized')
    'Not Recognized'

    """
    if varname[:2] == 'n_' or varname[:2] == 's_':
        varname = varname[2:]
    known = {'phi': '$\\Phi_{Ionosphere}$', 'sigmah': '$\\sigma_{Hall}$',
        'sigmap': '$\\sigma_{Peder}$', 'jr': '$J_{radial}$', 'mA/m^2':
        '$\\mu A/m^{2}$', 'W/m2': '$W/m^2$', 'eV': '$eV$'}
    if varname in known:
        label = known[varname]
    else:
        label = varname
    return label
