{% set ae = pub.get('author', pub.get('editor', [])) %}
{% for a in ae[:-1] %}
{% if a in names %}{% endif %}{{a}}{% if a in names %}{% endif %},
{% endfor %}
{% if len(ae) > 1 %}
and
{% endif %}
{% set a = ae[-1] %}
{% if a in names %}{% endif %}{{a}}{% if a in names %}{% endif %}.
"{{pub.get('title', '')}}".
{{pub.get('version', '')}}
{{pub.get('journal', '')}}
{{pub.get('booktitle', '')}}.
{{pub.get('volume', '')}}
{%- if pub['pages'] %}
{{'p. ' + pub['pages']}}
{%- else %}
{{''}}
{%- endif %}
{{pub.get('address', '')}}
{% if 'month' in pub and 'year' in pub %}
{{pub['month'].capitalize()}} {{pub['year']}}
{% elif 'year' in pub %}
({{pub['year']}})
{% endif %}
{% if 'link' in pub %}link{% endif %}
{% if 'url' in pub %}download{% endif %}
{% if 'doi' in pub %}doi{% endif %}
{% endfor %}
{%if 'teaching' in p and len(p['teaching']) > 0%}