Quantcast
Channel: Super Nerdy Cool » LaTeX
Viewing all articles
Browse latest Browse all 20

emacs keybindings in xpdf and xdvi

$
0
0

I’ve been using xpdf and xdvi for reading documents I’ve downloaded or my LaTeX-generated documents on the laptop more and more these days due to their speed. The one thing I require (desire) in all programs I use on a day to day basis, especially when I have to navigate the file, is to have emacs keybindings.

To do so for the two readers, first, add the following to ~/.Xresources:

 <pre class="src src-sh">! look<span style="color: #00ffff;"> in</span> man xdvi

xdvi.mainTranslations: #override Ctrlv: down-or-next()n Altv: up-or-previous()n Alt Shift <: goto-page(1)n Alt Shift >: goto-page()n Ctrlf: right(0.015)n Ctrlb: left(0.015)n Ctrln: down(0.015)n Ctrlp: up(0.015)n l: right(0.015)n h: left(0.015)n j: down(0.015)n k: up(0.015)n Ctrls: find()n xdvigeometry: 1350×700 xdvishrinkFactor: 4

! look in man xpdf and xpdfrc; ~/.xpdfrc xpdfgeometry: 1350×700 xpdfinitialZoom: width

Also, create and add the following to ~/.xpdfrc:

 <pre class="src src-sh">initialZoom width

continuousView yes bind ctrl-v any pageDown bind alt-v any pageUp bind alt-shift-< any gotoPage(1) bind alt-shift-> any gotoLastPage bind ctrl-n any scrollDown(16) bind ctrl-p any scrollUp(16) bind ctrl-f any scrollRight(16) bind ctrl-b any scrollLeft(16) bind h any scrollLeft(16) bind l any scrollRight(16) bind k any scrollUp(16) bind j any scrollDown(16) bind ctrl-s any find

Now I can at least navigate the file with emacs keybindings.

I would also like to get this to work on ghostview (for postscript files) or djview (for djvu files), but have yet to find out how to do so on these programs (or found programs for these formats that allow custom keybindings). I’ve written about using emacs’ doc-view to view all my files, but it can be sub-optimal:

  • the conversion process on large files can take a long time,
  • no “continuous” view mode,
  • searching the text does not highlight the text,
  • and the file doesn’t update when the dvi or pdf file is updated (or have a keybinding to update) for use with LaTeX (editing and updating files). UPDsATE: actually, you can refresh using the r keybinding; it works quite fast and stays on the same page you are on.

Please do let me know if you know how to make custom keybindings on ghostview or djview (or similar, fast programs). Also let me know if I am not aware of any features in doc-view that would make my life easier. Thanks!


Viewing all articles
Browse latest Browse all 20

Trending Articles