def _print_field(field_name, field_value, capitals=False):
    """
    Print a field in bib format if value is not none.
    :param field_name: name of the field
    :param field_value: value of the field
    :param capitals: whether to add
    :return: field in bib format or blank if field is None
    """
    if field_value:
        field_value = str(field_value).replace("_", "\_")
        field_value = str(field_value).replace("\\\\_", "\_")
        field_value = str(field_value).replace("#", "\#")
        field_value = str(field_value).replace("\\\\#", "\#")
        field_value = str(field_value).replace("$", "")
        if capitals:
            return "\t%s = {{%s}},\n" % (field_name, field_value)
        else:
            return "\t%s = {%s},\n" % (field_name, field_value)
    return ""