Breaking Changes
Some options were renamed to be consistent. The old names are ignored, so update your config.toml and Lua scripts:
| Old | New |
|---|---|
window.menubar
| menubar.show
|
window.show_menu_icons
| menubar.icons
|
statusbar.visible
| statusbar.show
|
tabs.visible
| tabs.show
|
thumbnail.show_page_numbers
| thumbnail.page_numbers
|
outline.show_page_numbers
| outline.page_numbers
|
command_palette.show_shortcuts
| command_palette.shortcuts
|
llm_view.show_at_startup
| llm_view.at_startup
|
New Features
Lua scripting
- New Lua
Viewfunctions:history_stack()(the jump locations of a view),set_mark(char)andgoto_mark(char)(marks, like themark_setandmark_gotocommands),image_metadata()(size, format, resolution and EXIF of an image), andscene_to_page(x, y)/page_to_scene(pageno, x, y)(between a point of the canvas and a point of a page). - New
OnSynctexJumpRequestedLua event: called with the view, the source file, the line and the column when a SyncTeX jump from the PDF to its LaTeX source is requested. - New
OnPresentationStartedandOnPresentationEndedLua events, called when presentation mode is entered or left. - The Lua type stubs are now installed on Windows too (
share\lektra\luain the install folder), for completion when editinginit.lua.
Options
- New
behavior.keep_viewoption (on by default): going to the next or previous page keeps the same part of the page in view, e.g. when zoomed into a region, instead of centering on the new page. Turn it off for the old behavior. - New
laser_pointer.trailoption: with the laser pointer, drawing with the left button leaves a trail that fades from its oldest end, like Excalidraw (trail_fade_mssets the duration). - New
outline.preloadoption: load the outline in the background after a document opens, instead of the first time the outline picker is opened (the default). - The picker keys can now be set from Lua:
lektra.opt.picker.keys.down = {"Down", "Ctrl+N"}(the same actions as[picker.keys]). - Options of a view now work as in Vim:
lektra.opt.<section>.<key>is:set(the default and the current view), the newlektra.opt_globalis:setglobal(only the default),view:opt()is:setlocal(only that view), and the newview:opt_reset([section])is:setlocal opt<(back to what a new view would have). A new split still starts with a copy of the options of the view it was made from.
Presentation mode
- Presentation mode now works with clickers:
PgDown,Spaceand the arrow keys go to the next page,PgUpand the arrow keys to the previous one (the arrows still move the caret in caret mode),F5starts it andEscleaves it. All other keys are disabled while it is on. - New
[presentation]options:hide_cursor_ms,fullscreen,fit_mode,layout,show_statusbar,laser_on_startandallowed_actions. The fit mode is applied once the window is fullscreen.
Minimap
- New minimap: while zoomed in on a page (a document or an image), a small overview of that page appears in a corner of the view with the visible area marked; click or drag in it to move there. The new
[minimap]options setenabled,position(top_left,top_right,bottom_left,bottom_right),size,margin,opacity,border_color,border_width, the[minimap.viewport]table (color,width,fill,dim_color) for the box marking the visible area,render_pageandanimated(keep it updated while an animated image plays), and thetoggle_minimapcommand shows or hides it. - New
minimap.only_focusedoption: show the minimap only on the focused view, not on the other splits.
Images
- New
color_eyedropcommand: a small color circle follows the pointer and shows the color under it and its hex value; click to copy the hex,Escto cancel. - JPEG XL (
.jxl) images, including animated ones, can now be opened iflibjxlis installed on the system. - Optional libraries (
librsvg,libexif,djvulibre,libjxl) are now found under any installed version. If one isn't found, setLEKTRA_LIB_RSVG,LEKTRA_LIB_CAIRO,LEKTRA_LIB_EXIF,LEKTRA_LIB_DJVUorLEKTRA_LIB_JXLto its path.
Tabs and views
-
New
bibtexcommand copies the BibTeX entry of the paper you are reading to the clipboard. It finds the DOI in the PDF's metadata or first two pages (or an arXiv number) and fetches the entry with curl in the background. -
New text underline mode (
annot_underline_modecommand, key6, Tools → Mode → Text Underline): select text with the mouse and it is underlined when you release, like text highlight mode. The context menu of a selection has "Underline Text" too. -
New ellipse (
annot_ellipse_mode), polygon (annot_polygon_mode) and inline note (annot_note_mode) annotation modes (no default keys; the annotation edit mode is on7). Drag for an ellipse or an inline note (text written on the page); click the corners of a polygon and double click, or click the first corner, to finish. Rectangle annotations are now outlines instead of filled. -
Double clicking an annotation enters annotation edit mode with it selected (in the normal reading mode).
-
New image annotations: the
annot_imagecommand (annot_image [path], asks for the file if no path is given) places an image in the middle of the view, and "Insert Image Here..." in the right click menu places it at the pointer. In annotation edit mode an image can be moved, resized (corners keep the proportions, hold Shift to stretch) and turned with the handle above it (hold Shift to turn in steps of 15°). All of it can be undone and redone. -
In annotation edit mode a selected rectangle, ellipse, polygon, inline note or popup can now be moved by dragging it, and all but the popup resized by its handles (hold Shift on a corner to keep the proportions). It can be undone.
-
New text squiggly underline (
annot_squiggly_mode,squiggly_selection) and text strikeout (annot_strikeout_mode,strikeout_selection) annotations, made like highlights and underlines (Tools → Mode, or the context menu of a selection). They have no default keys; both are red unless you change the mode's color. -
New redaction:
annot_redact_mode(Tools → Mode, no default key) marks areas by dragging, andredact_applypermanently removes the text, images and drawings under the marks, after a confirmation. Applying cannot be undone, but nothing is written until you save; withannotations.redact.save_to_new_file(default on) you are asked where to save a redacted copy and the original file is left alone. Saving a redacted file always rewrites it completely, so the removed content is not kept in the file. -
New
behavior.save_modeoption:overwrite(default) saves into the open file as before;askasks for a new file on the first save, andsuffixsaves toname_annotated.extnext to the original (asking if that exists). The original is left alone, the view follows the new file and later saves go there. -
New
comment_selectioncommand highlights the selected text and asks for a comment to attach to it. -
New
underline_selectioncommand underlines the selected text. PDF has no setting for how an underline looks and MuPDF always draws it the same, so Lektra writes the underline's appearance itself:[annotations.underline]sets itscolor,thickness,offset(how far above the text) andstyle(solid,dashedordotted). Underlines made by other programs are now also shown with hover and comments like highlights. -
New grid layout: pages are laid out in rows of several columns (
layout.mode = "grid",--layout grid, thelayout_gridcommand or View → Layout → Grid).layout.grid_columns(default 3) sets the pages per row, and thegrid_columnscommand changes it (grid_columns 4,grid_columns +1). Fit width fits the whole row, and next/previous page move by row. -
New
behavior.drag_image_outoption (default on): set it to false to turn off dragging an image out of the page, if it gets in the way of selecting text. Text over an image (a scan with an OCR layer) can now be selected without turning it off. -
New
tabs.min_widthandtabs.max_widthoptions set the narrowest and widest a tab may be, in pixels (0: no limit); a longer title is shortened to fit. -
New
tabs.scroll_text_on_hoveroption: while the mouse is over a tab whose title does not fit, the title scrolls back and forth so all of it can be read (tabs at the top or bottom). -
New
split_to_windowsandsplit_to_tabscommands move the splits of a tab (or of the selected tabs) into windows or tabs of their own, keeping the first split in place; "Move Splits to Separate Windows" is also in the tab menu. Lua:lektra.tabs.split_to_windows(),lektra.tabs.split_to_tabs()and, for one split,view:detach_to_window()/view:detach_to_tab(). -
Tab indices in Lua are now 1-based everywhere, like pages and Lua tables (
Tab:index(),lektra.tabs.close/rename/select/selected/get_id, theindiceslists,lektra.view.list(tab));lektra.tabs.gotois nowlektra.tabs.switch, becausegotois a reserved word in Lua and could not be called aslektra.tabs.goto(...).
Documentation
- The documentation is now on Read the Docs: installation, an example
config.toml, and the commands, options and Lua API, generated from the sources so they match each release.
Bug Fixes
- In single-instance mode, the window is now flagged as needing attention (urgent) when a file is opened in it from the command line, since the window manager may not bring it to the front.
- In single-instance mode, dragging a tab out of the window (and the other "new window" actions) now opens a new window instead of reopening the file in the same one.
- In single-instance mode, files given with a relative path (and the
--synctex-forwardpaths) now open in the running instance. - Fit width going to the last page of the document
- Fix an image drifting up and to the left when zooming in or out, until the view settled.
- Color options set from Lua (
lektra.optandview:opt()) now accept a hex string such as"#1e1e2e", likeconfig.tomldoes; before, onlypage.bgandpage.fgdid and the others needed an integer. - Fix scrollbars that are turned off (
scrollbars.vertical/scrollbars.horizontal) showing up when zooming or resizing. - Scrolling no longer asks for a new render of pages that are already rendered on every small scrollbar movement.
- Statusbar layout: a mistyped module or key is reported with a suggestion, an all-invalid layout falls back to the default one, and items placed with
atno longer draw on top of each other. - Improved rendering performance when scrolling
- Pages render faster: a pass over every page that changed nothing with the default page colours is skipped, and page colours, dark mode and high contrast are applied in one pass.
- Fast scrolling and zooming waste less work: renders that are no longer needed stop early, pages are not preloaded while scrolling fast, and the page you land on is drawn first.
- Fix a small memory leak when a page was dropped from the cache while it was being rendered.
- Opening many files from the command line (
lektra ~/Downloads/*.pdf) now only loads the first one and the others when you switch to them, astabs.lazy_loadsays; before, every file was loaded at once. - Single-instance mode now works when it is turned on from
init.lua(lektra.opt.behavior.single_instance), not only fromconfig.tomlor--single-instance, and a second instance no longer takes the socket away from a running one. - Right-clicking an annotation now shows its own menu instead of "Insert Image Here...".
- Right-clicking a link now shows the link menu instead of "Insert Image Here...".
- Fix a crash when closing the window with a portal open.
- Fix the layout not updating after rotating or flipping a page, or toggling trimmed margins.
- Auto-reload now says when the file was moved, renamed or deleted, instead of a generic "Could not reload the document".
- Next/previous search match (with
search.absolute_jumpoff) now works like vim: after scrolling, it jumps to the first match below the top of the view, or the last one above it, instead of skipping matches on the current page.