Command line and editors
onon paper.pdf # open a documentonon --goto 20 paper.pdf # start on page 20onon --config my.lua paper.pdfonon --no-config paper.pdf # built-in defaults onlyonon --no-plugins paper.pdf # skip pluginsonon -v # print the versiononon -V # verbose logs, for bug reportsOne window per document
Section titled “One window per document”Each window is reachable by anything that opens the same file. --unique hands the request to the window already showing the document, and exits:
onon --unique paper.pdf # bring up the window showing paper.pdfonon --unique --goto 42 paper.pdf # and go to page 42onon --unique --goto 42:100:250 paper.pdf # to a point on page 42onon --unique --command "reload-config" paper.pdfWith no window showing the document, --unique opens one and applies --goto and --command as it starts. Without --unique, onon always opens a new window. A window that opens another file becomes reachable under the new one.
X and Y in --goto PAGE:X:Y are points from the page’s top-left corner, which is the convention SyncTeX uses. --command takes anything you could type after :, including commands from plugins. It exits non-zero if onon does not recognise the command.
Editors
Section titled “Editors”Point your editor’s PDF viewer at onon --unique, so rebuilding a document reuses its window, and onon reloads the file when it changes.
With VimTeX in Neovim:
vim.g.vimtex_view_method = "general"vim.g.vimtex_view_general_viewer = "onon"vim.g.vimtex_view_general_options = "--unique @pdf"For forward search, have the editor ask SyncTeX where a line lands, then send onon there:
synctex view -i "142:1:chapter1.tex" -o paper.pdf# then, with the Page, x and y it prints:onon --unique --goto 7:72.0:340.5 paper.pdfA plugin can do the SyncTeX lookup inside onon and register a command for it, so the editor only runs onon --unique --command "…" paper.pdf.
Where windows listen
Section titled “Where windows listen”Sockets live under $XDG_RUNTIME_DIR/onon on Linux, the per-user temporary directory on macOS, and %LOCALAPPDATA%\onon on Windows. They are readable only by you and are named by a hash of the document’s path. A socket left by a crash is reclaimed on the next start.