How to offset page numbers to match actual page-numbers in the PDF? #142
Replies: 2 comments
-
There are You can set the mode line to anything you like, for example in plain Emacs just overwrite: (setq-local mode-line-position
'(" P" (:eval (number-to-string (pdf-view-current-page)))
;; Avoid errors during redisplay.
":" (:eval (or (ignore-errors
(number-to-string (pdf-cache-number-of-pages)))
"???"))
" PL" (:eval (pdf-view-current-pagelabel)))) If you're using doom-modeline you'd need to change |
Beta Was this translation helpful? Give feedback.
-
Just to help the newbies like me to add this code to (add-hook 'pdf-view-mode-hook
(lambda ()
(setq-local mode-line-position
'(" P " (:eval (number-to-string (pdf-view-current-page)))
;; Avoid errors during redisplay.
"/" (:eval (or (ignore-errors
(number-to-string (pdf-cache-number-of-pages)))
"???"))
" PL " (:eval (pdf-view-current-pagelabel)))
)
)
) And if you want to keep the % scroll page indicator: (add-hook 'pdf-view-mode-hook
(lambda ()
(setq-local mode-line-position
'((:eval (pdf-misc-size-indication))
" P " (:eval (number-to-string (pdf-view-current-page)))
;; Avoid errors during redisplay.
"/" (:eval (or (ignore-errors
(number-to-string (pdf-cache-number-of-pages)))
"???"))
" PL " (:eval (pdf-view-current-pagelabel)))))) |
Beta Was this translation helpful? Give feedback.
-
I have a number of books where the mode line shows the current page (
pdf-view-current-page
) different from the actual page number in the book. I wonder, could I somehow instructpdf-tools
to offset the page number by x for a particular book. How do you folks deal with the problem? Or, do you adjust the PDF instead? Or do you ignore the problem? It makes it slower to locate the page number when citing, which I do constantly (for my notes).Beta Was this translation helpful? Give feedback.
All reactions