-
Notifications
You must be signed in to change notification settings - Fork 160
Double pages layout #303
Comments
See #27. The same applies to a 2-column view or any other variant that wants to display more than one page per window. |
Another way to implement double page layout could be to have one page per buffer but with synchronized buffers (when I move forward on buffer 1 to see page 33, buiffer 2 moves also and display page 34). Double page mode is very useful when reading book in fullscreen mode. With the 16/9 ratio and the big screen of today, you have to display two page if you want to fill the space in fullscreen. |
Any news? Is it something you consider implementing in short or long term? |
Opening two windows to the same buffer seems to make this possible. Below is a function that scrolls both windows and jumps both to two pages ahead upon reaching the end when (defun my-pdf-view-double-scroll-up-or-next-page (&optional arg)
"Scroll page up ARG lines if possible, else go to the next page.
When `pdf-view-continuous' is non-nil, scrolling upward at the
bottom edge of the page moves to the next page. Otherwise, go to
next page only on typing SPC (ARG is nil)."
(interactive "P")
(if (or pdf-view-continuous (null arg))
(let ((hscroll (window-hscroll))
(cur-page (pdf-view-current-page)))
(when (or (= (window-vscroll) (image-scroll-up arg))
;; Workaround rounding/off-by-one issues.
(memq pdf-view-display-size
'(fit-height fit-page)))
(pdf-view-next-page 2)
(when (/= cur-page (pdf-view-current-page))
(image-bob)
(image-bol 1))
(set-window-hscroll (selected-window) hscroll)))
(image-scroll-up arg)))
(defun my-pdf-view-double-scroll-horizontal-view ()
(interactive)
(my-pdf-view-double-scroll-up-or-next-page)
(other-window 1)
(my-pdf-view-double-scroll-up-or-next-page)
(other-window 1)) The same technique could probably be used for #27 by additionally resizing the windows. Perhaps hiding the mode-line in the upper window would be a nice customization option as well, but I haven't figured out how to do that ( These could probably even be combined, to have four windows open, where you can scroll vertically through the double-page view. (defun my-pdf-view-double-scroll-vertical-view ()
(interactive)
(my-pdf-view-double-scroll-up-or-next-page)
(shrink-window 1)
(other-window 1)
(my-pdf-view-double-scroll-up-or-next-page)
(enlarge-window 1)
(other-window 1)) I'm not familiar enough with pdf-tools' internals to make this "production ready", but I hope it helps. A couple packages may be useful for ideas or code: |
@apnewberry Although I got the idea when I was reading about follow mode (Somehow I thought of buffers where they wrote windows), I now see that I have implemented your idea. So, great idea! Anyway, it has been realized now and works fine... |
Is it possible to display two pages in a row (double page layout in evince is an example)?
If no, I propose it as a feature request.
The text was updated successfully, but these errors were encountered: