Shortens a LaTeX paper's references until it fits a page count.
The tool compiles the paper with latexmk, then applies cleanups to the cited references —
recompiling after each step and stopping as soon as the target page count is reached:
location(and BibTeXaddress) → cleared — few styles print it, so it is the cheapest information to lose- DOIs → normalized (no
https://doi.org/prefixes) — a cleanup any nice paper wants anyway - URLs → cleaned up (redirect wrappers unwrapped, escapes decoded) — likewise
- Author lists → first author + "et al."
month→ removed- Journal names → standard abbreviations (JabRef's bundled list)
- DOIs → shortened to the
10/xxxform (via shortdoi.org) — the very last resort, since not everyone likes short DOIs
The referenced .bib file(s) are rewritten with the smallest set of cleanups that reaches the
target — a paper that already fits is left untouched.
Built on jablib, JabRef's core library.
- JBang
- A TeX distribution with
latexmk— or Docker (automatic fallback to the Island of TeXtexlive/texliveimage) - Network access is only needed for the last-resort DOI-shortening step (shortdoi.org); it is skipped gracefully when offline. Everything else runs without a network.
# one-off
jbang reference-shortener@koppor/reference-shortener paper.tex --pages 6
# or install as a command
jbang app install reference-shortener@koppor/reference-shortener
reference-shortener paper.tex --pages 6Without --pages, the target is one page fewer than the paper's current length.
--output shortened.bib writes the result elsewhere instead of overwriting (single-.bib papers
only).
This repository ships a SKILL.md, so a coding agent can install it as a skill from
skills.sh:
npx skills add koppor/reference-shortenerSee the skill page at skills.sh/koppor/reference-shortener.
Two independent knobs, both optional:
-
Native jbang launcher — run jbang itself as a native binary, skipping the JVM boot on every invocation. Enable once (add to your shell profile):
export JBANG_USE_NATIVE=truejbang downloads a native build of itself on the next run. This speeds up the
jbangcommand in general, not just this tool. -
Native build of this tool — the biggest win for repeated use; runs without a JVM at all:
jbang app install --native reference-shortener@koppor/reference-shortener
Building natively requires a GraalVM JDK with
native-image(e.g.JBANG_JDK_VENDOR=graalvm_community jbang jdk install 25).
Pre-built native binaries for Linux, macOS, and Windows are attached to each release and to every Binaries workflow run (as artifacts) — download one and run it directly, no JBang or JVM required.
To build one yourself from a checkout:
jbang export native --output reference-shortener ReferenceShortener.javaThis project adheres to Semantic Versioning; see CHANGELOG.md (kept in Keep a Changelog format, linted with heylogs).