Skip to content

Commit

Permalink
Render bib names as Lastname, Firstname Q.
Browse files Browse the repository at this point in the history
Did this to try to fix why the spacing was getting messed up
in some names, although this wasn't the problem (see next
commit)
  • Loading branch information
mpharrigan committed Jul 17, 2017
1 parent 02decda commit 85440f0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions gitbib/gitbib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 85440f0

Please sign in to comment.