r

retrofit

@preview

Adds clickable backreferences to each bibliography entry, enabling custom formatting of all cited pages.

v0.2.0
MIT

Package Information

Last Updated
Minimum Typst Version
0.14.0
Categories
modelthesis

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/retrofit:0.2.0

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/retrofit:0.2.0": *

Version History

0.2.00.14.0
b4d15a1e8d44...
0.1.20.13.0
b0b53e57754f...
0.1.10.13.0
c992f8a6b227...
0.1.00.13.0
60ef9248ebc0...

retrofit

This package adds backreferences to each of your bibliography entries. More precisely, retrofit queries for all instances of a citation in your document, collects the page(s) it is on and formats them to your liking, while keeping them in the link element to the location.

In order to correctly associate each formatted backreference to the bibliography entry, retrofit uses Typst's own internal bibliography handling through hayagriva to ensure correct citation ordering (Typst still renders its own bibliography, we just append to its entries!).

Notice: Performance may be impacted somewhat due to the creation of an internal bibliography through WebAssembly! Use with caution and check for correctness!

Getting Started

To add this package to your project, use this:

#import "@preview/retrofit:0.2.0": backrefs

/*
  Default formatting wraps pages in parentheses and makes them bold.
  Change the formatting with `backrefs.with(format: l => ...)` to your liking.

  When reading in a relative path to a bibliography file, a special
  `read` function has to be provided, see the manual for details.
*/
#show: backrefs.with(
  format: links => text(gray)[(Cited on p. #links.join(", ", last: " and "))],
  read: path => read(path),
)

...

#bibliography("refs.bib")

An example of the cited pages for the IEEE style. An example of the cited pages for the APA style.

Usage

See the manual for details.