dalanicolai / pdf-continuous-scroll-mode.el

A pdf-tools extension that provides continuous scrolling functionality
GNU General Public License v3.0
144 stars 10 forks source link

** THIS PACKAGE IS DEPRECATED A better implementation is provided by the [[https://github.com/dalanicolai/image-roll.el][image-roll]] package.

** Demo [[pdf-continuous-scroll-demo.gif]]

It includes keybindings to just work also on Spacemacs.

Development notes can be found in [[../../wiki][the wiki section]].

** Requirements To use the new pdf-continuous-scroll-mode, your Emacs must have been compiled with SVG support (the [[NOTE: cleaner version available][cleaner version]] of [[https://github.com/dalanicolai/pdf-tools][my pdf-tools fork]] eliminates this requirement).

However, compiling Emacs generally is very easy. Just make sure you have the =librsvg= development (dev/devel) library installed before compiling.

** Installation Note: If, for some reason, you prefer to use the previous two buffer solution then you could just download and load the script from e.g. [[https://github.com/dalanicolai/pdf-continuous-scroll-mode.el/tree/615dcfbf7a9b2ff602a39da189e5eb766600047f][this previous commit]].

Note: If you are using git to update the package, then you might want to use 'reset --hard', as I am frequently using 'push --force'.

To keep this package updated it is recommended to install it using a [[https://github.com/quelpa/quelpa#by-recipe][Quelpa recipe]]. Spacemacs users can install the package (using Quelpa) by adding the following lines to the list of =additional packages= in their .spacemacs file:

+begin_src emacs-lisp

(pdf-continuous-scroll-mode :location (recipe :fetcher github :repo "dalanicolai/pdf-continuous-scroll-mode.el"))

+end_src

Then just load the package using =use-package= (if you'd like to defer loading), =require= or just =M-x load-library=.

Unlike the previous two-buffer implementation, currently this implementation does not add an option for toggling the functionality.

You can set the scroll step size via the customizable variable =book-scroll-fraction=.

You might like to additionally run =M-x pdf-view-set-slice-from-bounding-box= for some

"super-continuous scroll".

** Comments

As it is not trivial to find out how this functionality works exactly, help or donations are very welcome.

Comment: Personally, I think the improved functionality quite much increases the value of Emacs for research/study purposes

Of course if you know some elisp you could also help investigating/fixing issues yourself. To save you a lot of time, you can read the 'development notes' in [[../../wiki][the wiki section]].

Any feedback is welcome (possibly by opening an issue in the repo).

[[pdf-continuous-scroll-demo.gif]]

** Keybindings | Emacs | Spacemacs | Function | |-------------+---------------------+-------------------------------------| | =C-n= | =j= | pdf-continuous-scroll-forward | | =C-p= | =k= | pdf-continuous-scroll-backward | | =n= | =J= | pdf-continuous-next-page | | =p= | =K= | pdf-continuous-previous-page | | =M-<= | =g g= | pdf-cscroll-first-page | | =M->= | =G= | pdf-cscroll-last-page | | =Q= | =q= | pdf-cscroll-kill-buffer-and-windows | | =C-c C-a l= | =SPC m a l (, a l)= | pdf-cscroll-annot-list-annotations |

| =C-f= | =l= | pdf-cscroll-image-forward-hscroll |

| =C-b= | =h= | pdf-cscroll-image-backward-hscroll |

| =T= | =M= | pdf-cscroll-toggle-mode-line |

| =M= | | pdf-cscroll-toggle-narrow-mode-line |

| =c= | =c= | toggle pdf-continuous-scroll-mode |

** Comments

** Related: double page layout [[https://github.com/politza/pdf-tools/issues/303#issuecomment-397744326][In this comment]] the user apnewberry* posted code to realize a double page layout

Related projects ** pymupdf-mode https://github.com/dalanicolai/pymupdf-mode.el Extend pdf-tools annotation capabilities via pymupdf. The new, alternative, pdf-tools server, will provide the same functionality directly as a pdf-tools feature (including possibility for scripting). djvu3 https://github.com/dalanicolai/djvu3 Show djvu annotations within Emacs (extending [[https://github.com/emacsmirror/djvu/blob/master/djvu.el][djvu.el]], and improving [[https://github.com/dalanicolai/djvu2.el][djvu2.2l]]). There is also a [[https://github.com/dalanicolai/djvu-layer][Spacemacs djvu layer]] which additionally [[https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-08/msg01014.html][implements smooth scrolling]] in djvu. toc-mode [[https://github.com/dalanicolai/toc-mode]] The best way to create and attach Table of contents to pdf and djvu documents. There is also a [[https://github.com/dalanicolai/toc-layer][toc-layer for Spacemacs]] calibredb https://melpa.org/#/calibredb A super nice [[https://calibre-ebook.com/][calibre]] frontend within Emacs *** handy or fun Emacs lisp functions https://github.com/dalanicolai/dala-emacs-lisp For example I like the elisp raytracer