Show a reference without losing the reader's place
A citation, a footnote or a cross-reference points somewhere else in a long text. Show what it points to where the reader is, and when they follow it, bring them back to the place they left.
Where it is used
- HTML papers: citations, footnotes, and cross-references to sections, equations, figures, tables and theorems.
- No other arXiv page has these yet. Any long text that refers to its own parts can use the same approach.
Citations and footnotes
A citation or footnote marker opens a popover that repeats the reference or the note, with a way to the full entry and back.
2 references
[46] A. Salvio. Quadratic gravity. Front. Phys. 6 (2018) 77. Jump to reference 46
[47] K. S. Stelle. Renormalization of higher-derivative quantum gravity. Phys. Rev. D 16 (1977) 953. Jump to reference 47
Relevant code
<div class="ds-popover" role="region" aria-label="2 references">
<div class="ds-popover-title">2 references</div>
<button type="button" class="ds-close"><svg aria-hidden="true">…</svg><span class="is-sr-only">Close references</span></button>
<p>[46] A. Salvio. Quadratic gravity. <em>Front. Phys.</em> 6 (2018) 77. <a href="#">Jump to reference<span class="is-sr-only"> 46</span></a></p>
<p>[47] K. S. Stelle. Renormalization of higher-derivative quantum gravity. <em>Phys. Rev. D</em> 16 (1977) 953. <a href="#">Jump to reference<span class="is-sr-only"> 47</span></a></p>
</div>
- .ds-popover
- One popover per citation cluster, built and placed as on Progressive disclosure. It opens on a click, Enter or a tap, never on hover or focus.
- .ds-popover-title
- “Reference 46” for one entry, “2 references” for more.
- <p>
- Each entry, copied whole from the bibliography, then its own Jump to reference link.
- .ds-close
- Closes the popover and returns focus to the number that was pressed.
Rules
Getting back after a jump
- A link that moves the reader to another part of the page gives them a way back, on any long page, not only a paper. For a citation and a cross-reference, the way back is the history entry and Back to your place in Citations and footnotes.
Citations and footnotes
- References are shown as the author wrote them. Each field formats references in its own way, and arXiv has no reference format. A bibliography entry, a citation popover and a citation's accessible name all repeat the author's entry unchanged. This is separate from Cite, which gives the formats for citing the paper itself.
- One popover per citation cluster, listing every reference in it, each with its own Jump to reference link.
- The popover comes straight after the number in the tab order. Tab moves from the number into the popover, and Tab past its last link goes on to the text after the citation. Opening it does not move focus.
- The popover repeats each entry as the bibliography shows it, never rebuilt, reordered or shortened. If the entry cannot be found, the citation stays a plain link to the reference list.
- It opens next to the citation and never covers it: below the line if it fits, else above, else just under the TOC bar.
- A cluster of seven or more may use two columns on a wide screen.
- Below 48rem a popover is a bottom sheet. The script and the CSS read the same threshold.
- Escape returns focus to the number that was pressed.
- Jump to reference lands on the entry, with the accent wash and keyboard focus, and the address gets its id. The entry is a
.ds-paper-elementwithtabindex="-1", and the wash is its:targetstyle, so the link changes the address itself:history.pushStatedoes not update:target. The scroll is smooth only when reduced motion is not set. - A cross-reference works the same way. A link to a section, equation, figure, table or theorem lands below the TOC bar, and a
.ds-paper-elementit lands on shows the wash. - Every jump adds an entry to the browser history, from a citation or a cross-reference, so the browser's Back button returns to the link. With JavaScript, Back also returns focus to the link.
- Back to your place shows only during a jump, from a citation or a cross-reference. It returns focus and scroll to the link the reader followed. It is an action in the element pill of the entry the reader landed on, and the pill stays shown while that entry is the target.
- Without JavaScript, a citation is LaTeXML's link to its entry. The entry shows the wash through
:target, and the browser's Back button returns to the citation. - A bibliography entry is highlighted as one box, number included, never line by line.
- A footnote stays where LaTeXML puts it: the marker, then the note itself, in one
.ltx_note. At wide widths the note is shown in the margin beside its marker, with CSS only, at the width of a margin note (--ds-marginalia-width) and at the same widths. Narrower, a script makes the marker a button that opens the note in a popover. The popover opens on a click, Enter or a tap, never on hover, and stays open while the reader uses the links in it. Without JavaScript the note shows after its marker. A footnote needs no Back to your place: it stays after its marker, so reading it moves the reader nowhere.