Introducing annotex v1.0.0 — Pure-Lua, Zero --shell-escape

Precision PDF Annotation, Crafted for LaTeX

Annotate research papers, textbooks, and manuscripts directly in LaTeX. Combine a semi-transparent coordinate grid, adaptive sidebars or book-symmetric boxes, native vector sentence highlighting, and auto-fit margin notes.

LuaLaTeX ★ pdfLaTeX XeLaTeX LPPL 1.3c+
65+ Key-value options
0 External CLI tools
examples/demo-sidebar.pdf — compiled with lualatex Click any page to zoom
annotex sidebar demo page 1 showing multi-line highlight and embedded figure note Zoom
annotex sidebar demo page 2 showing automatic collision-free note floating Zoom
Live LaTeX Source
\begin{annotexpage}{1}
  \atxmemo{Page takeaway pinned to top.}
  \atxquote{hierarchical refinement}{Core idea!}
  \atxnote{45.5}{53.0}{Multi-paragraph + figure.}
\end{annotexpage}

1/4

Adaptive Sidebar or Book Boxes

Defaults to a 1/4-width right sidebar, or switch to in-page boxes with automatic odd/even book mirroring.

3+2

Note & Highlight Primitives

Coordinate notes, vector sentence search highlights, and pure memos — plus standalone text & box highlights.

100%

Strict Single-Page Fit

Every note stays strictly inside its box. Overflow automatically shrinks font size so pages stay 1-to-1.

Everything You Need to Annotate PDFs Cleanly

Keep source typography untouched while adding structured, version-controlled LaTeX commentary.

Semi-transparent coordinate positioning grid Zoom
Coordinate Positioning Layer

Locate Any Decimal Coordinate Instantly

Enabled by default at subtle 0.35 opacity: dense edge ticks, major lines every 10 units, inline R/C markers, and dashed frames around custom boxes — hide with one key (grid=false) for your final copy.

Automatic font-size fitting for 12 dense note cards Zoom
Auto-Fit & Clip Engine

Never Overflows, Never Spawns Extra Pages

Every container applies hard geometric clipping. When notes exceed one page height, auto-fit=true shrinks font size iteratively to fit everything; force a fixed note-font-size with auto-fit=false to clip cleanly at the box edge.

Vector PDF sentence highlighting and margin notes Zoom

Pure-Lua Vector PDF Parser

Highlight Exact Sentences Across Line Breaks Automatically

Under LuaLaTeX, annotex reads the PDF content stream directly via LuaTeX's built-in pdfe and pdfscanner libraries — zero external tools and zero --shell-escape required.

  • ✓Handles multi-line wraps, two-column layouts, ligatures, hyphenation, and CJK UTF-8
  • ✓Multiply-blended translucent yellow bar & badge preserve crisp underlying text
  • ✓Supports occurrence=1|2|all, ignore-case=true, underline, and strike styles
Learn how \atxquote works →
Odd book page with right margin annotation box Zoom
Even book page automatically mirrored to left margin Zoom

In-Page Boxes & Book Symmetry

Annotate Inside Existing Margins with Automatic Odd/Even Mirroring

Keep exact A4 or textbook page dimensions with sidebar=false. Declare your blank region once using grid coordinates, enable book=true, and even pages mirror horizontally across the page centerline.

  • ✓Define multiple regions per page — overflowing notes spill smoothly to the next box
  • ✓Semi-transparent dashed borders visualize your boxes during drafting
  • ✓page-parity-offset handles cover pages or frontmatter cleanly
See Book-Mode documentation →
Unnumbered mode showing glowing yellow lightbulb markers Zoom
Per-page inherit=false reset keeping continuous numbering Zoom

Flexible Numbering & Lightbulb Mode

Continuous, Per-Page Reset, or Unnumbered Lightbulb Icons

Number globally across the whole document, reset from any integer on every page, or disable numbers entirely — unnumbered in-page markers automatically switch to a crisp translucent yellow lightbulb vector icon.

  • ✓Customize shapes (circle, square, rounded, diamond, plain), bold, underline, colors, or marker-cmd
  • ✓Per-page inherit=false lets one page use its own layout while preserving continuous numbering
  • ✓Arabic, roman, Roman, alph, Alph formats with custom prefixes & suffixes
Explore numbering & marker styling →

Reproducible Examples

See the Exact LaTeX Behind Every Layout

Switch tabs to inspect minimal working snippets alongside their real LuaLaTeX-compiled PDF outputs.

Combine top-pinned \atxmemo, multi-line vector \atxquote, and figure-bearing \atxnote inside the default 1/4 right sidebar.

examples/demo-sidebar.tex
\documentclass{article}
\usepackage{annotex}

\annotexsetup{
  sidebar        = true,
  sidebar-width  = 0.25,
  grid           = false,
  note-style     = leftbar,
  connector      = true,
}

\begin{document}
\annotexload[pages=1-2]{sample-source.pdf}

\begin{annotexpage}{1}
  \atxmemo{Top-pinned page takeaway (no body mark).}
  \atxquote{introduce a hierarchical refinement workflow}{
    Core contribution highlighted across lines!}
  \atxnote{45.5}{53.0}{Multi-paragraph note with figure:

    \includegraphics[width=\linewidth]{sample-chart.pdf}}
\end{annotexpage}
\end{document}
demo-sidebar output Zoom

Customize coordinate density, minor dotted lines, 4-edge labels, color, and global overlay transparency globally or on a single page.

examples/demo-grid.tex
\documentclass{article}
\usepackage{annotex}
% Page 1 uses defaults: opacity=0.35, 100x100, step=10

\begin{document}
\annotexload[pages=1-2]{sample-source.pdf}

\begin{annotexpage}[
  opacity        = 0.42,
  grid-color     = teal!75!black,
  grid-edges     = all,
  minor-grid     = true,
  row-label-step = 5,
  col-label-step = 5,
]{2}
\end{annotexpage}
\end{document}
demo-grid customized output Zoom

Disable the sidebar, declare one annotation box for odd pages, and let book=true mirror it automatically onto even pages.

examples/demo-book-boxes.tex
\documentclass{article}
\usepackage{annotex}

\annotexsetup{
  sidebar        = false,
  book           = true,     % mirror on even pages
  grid           = true,
  opacity        = 0.32,
  note-font-size = 7.5pt,
}
\annotexarea[label={Outer Margin}]{8}{70}{92}{96}

\begin{document}
\annotexload[pages=3-4]{sample-source.pdf}
\begin{annotexpage}{4}
  \atxquote{becomes a Banach algebra}{Mirrored automatically!}
\end{annotexpage}
\end{document}
demo-book-boxes even page mirrored output Zoom

Switch a page to numbering=none for glowing yellow vector lightbulb markers (with no enclosing circle), or use inherit=false while keeping numbering continuous.

examples/demo-styles-bulb.tex
% Page 2: Unnumbered pure glowing yellow lightbulb icon
\begin{annotexpage}[numbering=none, sidebar-side=right]{2}
  \atxquote{three benchmark problems}{Lightbulb beside highlight!}
  \atxnote{42.5}{52.0}{Pure vector lightbulb at (42.5, 52.0).}
\end{annotexpage}

% Page 3: Reset visual layout, keep continuous numbering!
\begin{annotexpage}[inherit=false]{3}
  \annotexsetup{sidebar-width=0.26, note-style=leftbar}
  \atxnote{25.0}{40.0}{Continues seamlessly from page 1!}
\end{annotexpage}
demo-styles-bulb lightbulb output Zoom

Compare default auto-fit=true (12 cards auto-shrunk onto 1 page) against forced note-font-size=12pt with auto-fit=false (clean edge clipping).

examples/demo-overflow.tex
% Page 1: Default auto-fit=true shrinks font to fit all 12 cards
\begin{annotexpage}[note-font-size=8.5pt, auto-fit=true]{1}
  \atxmemo{Note 1 ...}  % 12 dense notes + chart fit on 1 page!
\end{annotexpage}

% Page 2: Forced 12pt size clips cleanly at bottom box edge
\begin{annotexpage}[note-font-size=12pt, auto-fit=false]{2}
  \atxnote{18}{40}{Forced 12pt note (never spawns extra page).}
\end{annotexpage}
demo-overflow auto-fit page 1 Zoom
demo-overflow forced clip page 2 Zoom

Frequently Asked Questions

Quick answers on engines, vector text search, Chinese PDFs, and layout control.

No. Under LuaLaTeX, annotex.lua uses LuaTeX's built-in pdfe and pdfscanner libraries directly in memory. No --shell-escape flag and no external command-line utilities are ever needed.

Yes! All core features — sidebar, in-page book boxes, semi-transparent coordinate grid, \atxnote, \atxmemo, \atxrect, auto-fit font scaling, and the unnumbered lightbulb icon — work identically on LuaLaTeX, pdfLaTeX, and XeLaTeX. Only automatic vector text search (\atxquote / \atxhl) requires LuaLaTeX and degrades gracefully with a clear warning on other engines.

Yes. The Lua parser decodes CID/Type0 /ToUnicode CMaps natively, handles full UTF-8 CJK strings across line breaks, normalizes English ligatures (fi/fl) and end-of-line hyphenation, and produces per-line highlight bars automatically.

annotex never spawns extra continuation pages. By default (auto-fit=true), it iteratively shrinks the font size of all notes on that page (down to min-note-font-size) until every note fits inside the sidebar or box. If you disable auto-fit (auto-fit=false or overflow=clip) to lock a custom note-font-size, excess content is clipped cleanly right at the container edge.

Simply set grid=false inside \annotexsetup{...}. Because box-frame defaults to auto, both the coordinate overlay and the dashed annotation box frames disappear automatically in one step.

Ready to Annotate Your Next PDF?

Dive into the complete interactive reference with copyable templates, every option key, and real rendered examples.