2021-07-11 23:20:48 +00:00
#+TITLE : djvu layer
2021-09-11 22:58:39 +00:00
2021-07-11 23:20:48 +00:00
#+TAGS : layer|reader
2021-09-11 22:57:22 +00:00
[[file:img/djvu-logo.svg ]]
2021-07-11 23:20:48 +00:00
2021-09-11 22:58:39 +00:00
* Table of Contents :TOC_5_gh:noexport:
2021-07-11 23:20:48 +00:00
- [[#description ][Description ]]
- [[#features ][Features: ]]
- [[#install ][Install ]]
- [[#prerequisites ][Prerequisites ]]
- [[#dotfile ][Dotfile ]]
- [[#key-bindings ][Key bindings ]]
2021-09-11 20:02:54 +00:00
- [[#djvu-read-mode ][djvu-read-mode ]]
- [[#annotations ][Annotations ]]
- [[#djvu-image-minor-mode ][djvu-image-minor-mode ]]
- [[#djvu-occur-mode ][djvu-occur-mode ]]
2021-07-11 23:20:48 +00:00
* Description
This layer adds support for reading djvu files with spacemacs.
Because of some difficulties, the layer does not lazy load the =djvu.el= and
=djvu3.el= packages.
** Features:
This layer provides a full featured djvu editor by implementing the [[https://github.com/dalanicolai/djvu2.el][djvu.el
package]] along with the [[https://github.com/dalanicolai/djvu3 ][djvu3 ]] extension (a newer alternative to [[https://github.com/dalanicolai/djvu2.el ][djvu2.el ]]).
- flexible annotation editing and rendering, covering most (but not all) of
[[https://linux.die.net/man/1/djvused ][djvused ]] annotation definitions
- fast navigation with imenu
- fast search with djvu-occur
- remember last view with djvu-restore
- dark mode
* Install
** Prerequisites
2021-09-11 20:02:54 +00:00
The =djvu= package requires the command =djvused= (from [[http://djvu.sourceforge.net/ ][djvulibre ]]) to be
available in =exec-path= .
2021-07-11 23:20:48 +00:00
2021-09-11 20:02:54 +00:00
Additionally, for =dark-mode= the command =pnminvert= (from
[[http://netpbm.sourceforge.net/ ][netpbm ]]) is required.
2021-09-11 22:58:39 +00:00
2021-07-11 23:20:48 +00:00
** Dotfile
2021-09-11 20:02:54 +00:00
After installing the dependencies, add this to your ~/.spacemacs.
2021-07-11 23:20:48 +00:00
#+BEGIN_SRC emacs-lisp
2021-09-11 22:58:39 +00:00
(setq-default dotspacemacs-configuration-layers '(djvu))
2021-07-11 23:20:48 +00:00
#+END_SRC
* Key bindings
2021-09-11 20:02:54 +00:00
** djvu-read-mode
2021-09-11 22:58:39 +00:00
| Key binding | Description |
2021-07-11 23:20:48 +00:00
|-------------+----------------------------------------------------------------------------------|
| ~i~ | djvu-image-toggle |
| ~j~ | scroll up |
| ~k~ | scroll down |
| ~J~ | next page |
| ~K~ | previous page |
| ~g~ | goto page |
| ~d~ | djvu-toggle-invert (dark-mode) |
| ~c~ | djvu-toggle-semi-continuous-scrolling (works only when image larger than window) |
| ~+/-~ | zoom-in/out |
| ~, s~ | djvu-occur |
| ~/~ | djvu fast search |
| ~n~ | djvu search continue |
| ~SPC j i~ | imenu navigation |
| ~o~ | outline |
2021-09-11 20:02:54 +00:00
** Annotations
2021-09-11 22:58:39 +00:00
| Key binding | Description |
|--------------------+------------------------------------------------------|
| ~SPC m h~ | keyboard highlight |
| ~mouse-1-drag~ | highlight |
| ~S-mouse-1-drag~ | text annotation ([[https://github.com/dalanicolai/djvu3#comments][comment]]) |
| ~C-mouse-1-drag~ | text pushpin (rendering pushpin not yet implemented) |
| ~mouse-2-drag~ | line |
| ~S-mouse-2-drag~ | horizontal line |
| ~C-mouse-2-drag~ | vertical line |
| ~C-S-mouse-2-drag~ | arrow |
2021-07-11 23:20:48 +00:00
2021-09-11 20:02:54 +00:00
** djvu-image-minor-mode
2021-09-11 22:58:39 +00:00
| Key binding | Description |
2021-09-11 20:02:54 +00:00
|-------------+-------------|
| ~s~ | save-image |
** djvu-occur-mode
2021-07-11 23:20:48 +00:00
2021-09-11 22:58:39 +00:00
| Key binding | Description |
2021-09-11 20:02:54 +00:00
|-------------+---------------------------|
| ~C-j~ | next entry and follow |
| ~C-k~ | prevoius entry and follow |