diff --git a/gitbib/gitbib.py b/gitbib/gitbib.py index 02c27a7..5717477 100644 --- a/gitbib/gitbib.py +++ b/gitbib/gitbib.py @@ -303,19 +303,25 @@ def internal_representation(all_my_meta, *, session, ulog): # can be expressed eloquently in the jinja2 templates. We set up some # jinja2 "filters" here to use to clean up the templates. -def name_from_dict(author): +def fnln_name_from_dict(author): if isinstance(author, dict): return "{given} {family}".format(**author) else: return author +def lnfn_name_from_dict(author): + if isinstance(author, dict): + return "{family}, {given}".format(**author) + else: + return author + def pretty_author_list(authors): - return "; ".join(name_from_dict(author) for author in authors) + return "; ".join(fnln_name_from_dict(author) for author in authors) def bibtex_author_list(authors): - return " and ".join(latex_escape(name_from_dict(author)) for author in authors) + return " and ".join(latex_escape(lnfn_name_from_dict(author)) for author in authors) def to_isodate(date):