def getCitationOrAlternative(bibtexer, bibtex_key):
    """Find the key in the library and convert to a citation, if it is not found,
    we return a footnote string for sphinx."""
    bibtex_key = bibtex_key.strip()

    if bibtex_key in bibtexer.library.entries:
        return u':cite:`{0}`'.format(bibtex_key)
    else:
        return u':raw-html:`<span title="{0}">Source</span>`'.format(bibtex_key)