{# macros to be available to all templates across arxiv #} {% macro compactsearch(alignstyle="level-right") -%} {# Creates an inline search widget with one input box, a dropdown for field selection, a button, and two tiny help/advanced links. Can be wrapped with Bulma's level element to align vertically with other elements in the same horizontal band. Parameter is a Bulma class that sets overall alignment within level wrapper, allowed values are level-left or level-right. #}
{%- endmacro %} {% macro pagination(current_page) -%} {# Creates a uniform paginator. Currently unfinished - needs parameters to define range, base URL, and current page. #} {%- endmacro %} {%- macro abs_date_line(arxiv_id, submitted_date, version = 1, submission_history = []) -%} {% set this_is_the_first_version = version == 1 %} {% set there_are_more_versions = submission_history and version < submission_history[-1].version %} {% set this_is_the_latest_version = not submission_history or version == submission_history[-1].version %} {% if this_is_the_first_version %} {% set first_version_submitted_date = submitted_date %} {% else %} {% set first_version_submitted_date = submission_history[0].submitted_date %} {% endif %} {% if this_is_the_latest_version %} {% set latest_version_submitted_date = submitted_date %} {% set latest_version = version %} {% else %} {% set latest_version_submitted_date = submission_history[-1].submitted_date %} {% set latest_version = submission_history[-1].version %} {% endif %} (Submitted on {{ first_version_submitted_date.strftime('%-d %b %Y') }} {%- if this_is_the_first_version and there_are_more_versions %} (this version){%- endif -%} {%- if not this_is_the_first_version %} (v1){%- endif %} {%- if not this_is_the_first_version and not this_is_the_latest_version -%} , revised {{ submitted_date.strftime('%-d %b %Y') }} (this version, v{{ version }}) {%- endif -%} {%- if not this_is_the_latest_version -%} , latest version {{ latest_version_submitted_date.strftime('%-d %b %Y') }} (v{{ latest_version }}) {%- elif not this_is_the_first_version and this_is_the_latest_version -%} , last revised {{ latest_version_submitted_date.strftime('%-d %b %Y') }} (this version, v{{ version }}) {%- endif -%} ) {%- endmacro -%} {%- macro version_atag(arxiv_id, version, primary_category) -%} {%- if version -%} {%- set vpart = 'v' ~ version -%} {%- else -%} {%- set vpart = '' -%} {% endif %} {%- if primary_category in arxiv_id -%} arXiv:{{ arxiv_id }}{{vpart}} {%- else -%} arXiv:{{ arxiv_id }}{{vpart}} [{{ primary_category }}] {%- endif -%} {%- endmacro -%} {% macro abs( arxiv_id, title, authors, abstract, submitted_date, primary_category, comments = None, msc_class = None, acm_class = None, journal_ref = None, doi = None, report_num = None, version = 1, submission_history = [], secondary_categories = []) -%}

Title:{{ title|tex2utf|urlize|safe }}

Authors:{{ authors }}
Abstract:{{ abstract|tex2utf|urlize|replace('\n\n', '
')|safe }}
{%- if comments %} {% endif -%} {%- if msc_class %} {% endif -%} {%- if acm_class %} {% endif -%} {%- if journal_ref %} {% endif -%} {%- if doi %} {% endif -%} {%- if report_num %} {% endif -%}
Comments: {{ comments|urlize|safe }}
Subjects: {{ primary_category|get_category_display }} {%- for category in secondary_categories -%}; {{ category|get_category_display }}{%- endfor -%}
MSC classes: {{ msc_class }}
ACM classes: {{ acm_class }}
Journal reference: {{ journal_ref }}
DOI: {{ doi }}
Report number: {{ report_num }}
Cite as: {{ version_atag(arxiv_id, 0, primary_category) }}
  (or {{ version_atag(arxiv_id, version, primary_category) }} for this version)
{%- endmacro -%}