{# macros to be available to all templates across arxiv #} {% macro alerts(messages=[]) %} {% if messages -%} {%- endif %} {% endmacro %} {% 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 = [], include_stylesheet = 1, embed_stylesheet = 0, download_button_markup = None) -%} {% if include_stylesheet and not embed_stylesheet %} {% endif %} {% if embed_stylesheet %} {% endif %}

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

Authors:{{ authors }}
{#- optionally include markup for the download button -#} {% if download_button_markup %} {{ download_button_markup }} {% endif %}
Abstract:{{ abstract|tex2utf_no_symbols|abstract_lf_to_br|urlize|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|tex2utf|urlize|safe }}
Subjects: {{ primary_category|get_category_display }} {%- for category in secondary_categories|sort(attribute='id') -%}; {{ category|get_category_display }}{%- endfor -%}
MSC classes: {{ msc_class }}
ACM classes: {{ acm_class }}
Journal reference: {{ journal_ref|tex2utf }}
DOI: {{ doi|escape|abs_doi_to_urls|safe }}
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 -%} {% macro abs_plaintext( arxiv_id, title, authors, abstract, submitted_date, primary_category, submitter_name, submitter_email, submission_size_bytes, license_uri, comments = None, msc_class = None, acm_class = None, journal_ref = None, doi = None, report_num = None, version = 1, submission_history = [], secondary_categories = []) -%} \\ arXiv:{{ arxiv_id }} From: {{ submitter_name }} <{{ submitter_email }}> Date: {{ (submitted_date|as_eastern).strftime("%a, %-d %b %Y %H:%M:%S ET") }} ({{ submission_size_bytes|tidy_filesize }}) Title: {{ title }} Authors: {{ authors }} Categories: {{ primary_category }}{%- for category in secondary_categories|sort(attribute='id') -%} {{ category }}{%- endfor %} {% if comments -%}{{ ("Comments: " + comments)|wordwrap(77, wrapstring="\n ") }}{%- endif %} {% if msc_class -%}MSC classes: {{ msc_class }}{%- endif %} {% if acm_class -%}ACM classes: {{ acm_class }}{%- endif %} {% if journal_ref -%}Journal reference: {{ journal_ref }}{%- endif %} {% if doi -%}DOI: {{ doi }}{%- endif -%} {% if report_num -%}Report number: {{ report_num }}{%- endif %} License: {{ license_uri }} \\ {{ abstract|wordwrap(77) }} \\ {% endmacro %}