DocView mode 1 -- 手册翻译

文档原文在线地址

* 35 Document Viewing
**
DocView mode is a major mode for viewing DVI, PostScript (PS), PDF,OpenDocument, and Microsoft Office documents. It provides features such as slicing(截取), zooming(缩放), and searching inside documents. It works by converting the document to a set of images using the gs (GhostScript)(ubuntu 12.04 默认安装) command and other external tools , and displaying those images.

When you visit a document file that can be displayed with DocView mode, Emacs automatically uses DocView mode . As an exception, when you visit a PostScript file, Emacs switches to PS mode, a major mode for editing PostScript files as text; however, it also enables DocView minor mode, so you can type C-c C-c to view the document with DocView. In either DocView mode or DocView minor mode, repeating C-c C-c (doc-view-toggle-display) toggles between DocView and the underlying(放在下面的) file contents.

You can explicitly enable DocView mode with the command M-x doc-view-mode. You can toggle DocView minor mode with M-x doc-view-minor-mode.

When DocView mode starts, it displays a welcome screen and begins formatting the file, page by page. It displays the first page once that has been formatted.

To kill the DocView buffer, type k (doc-view-kill-proc-and-buffer). To bury it, type q (quit-window).


Footnotes

[1] gs is a hard requirement. For DVI files, dvipdf or dvipdfm is needed. For OpenDocument and Microsoft Office documents, the unoconv tool is needed.
《安装这些
gs dvipdf dvipdfm
怎么安装?

$ sudo apt-get install unoconv




[2] The needed external tools for the document type must be available, and Emacs must be running in a graphical frame and have PNG image support. If any of these requirements is not fulfilled, Emacs falls back to another major mode.
《怎么看支持?》

** 5.1 DocView Navigation

In DocView mode, you can scroll the current page using the usual Emacs movement keys: C-p, C-n, C-b, C-f, and the arrow keys.

By default, the line-motion keys C-p and C-n stop scrolling at the beginning and end of the current page, respectively. However, if you change the variable doc-view-continuous to a non-nil value, then C-p displays the previous page if you are already at the beginning of the current page, and C-n displays the next page if you are at the end of the current page.

You can also display the next page by typing n, <next> or C-x ] (doc-view-next-page). To display the previous page, type p, <prior> or C-x [ (doc-view-previous-page).

<SPC> (doc-view-scroll-up-or-next-page) is a convenient way to advance through the document. It scrolls within the current page or advances to the next. <DEL> moves backwards in a similar way (doc-view-scroll-down-or-previous-page).

To go to the first page, type M-< (doc-view-first-page); to go to the last one, type M-> (doc-view-last-page). To jump to a page by its number, type M-g M-g or M-g g (doc-view-goto-page).

You can enlarge or shrink the document with + (doc-view-enlarge) and - (doc-view-shrink). These commands work by reconverting the document at the new size. To specify the default size for DocView, customize the variable doc-view-resolution.

** 35.2 DocView Searching

In DocView mode, you can search the file's text for a regular expression (see Regexps). The interface for searching is inspired by isearch (see Incremental Search).

To begin a search, type C-s (doc-view-search) or C-r (doc-view-search-backward). This reads a regular expression using a minibuffer, then echoes the number of matches found within the document. You can move forward and back among the matches by typing C-s and C-r. DocView mode has no way to show the match inside the page image; instead, it displays a tooltip (at the mouse position) listing all matching lines in the current page. To force display of this tooltip, type C-t (doc-view-show-tooltip).

To start a new search, use the search command with a prefix argument; i.e., C-u C-s for a forward search or C-u C-r for a backward search.

** 35.3 DocView Slicing

Documents often have wide margins for printing. They are annoying when reading the document on the screen, because they use up(用尽) screen
space and can cause inconvenient scrolling.

With DocView you can hide these margins by selecting a slice of pages to display. A slice is a rectangle(矩形区域) within the page area; once you specify a slice in DocView, it applies to whichever page you look at.

To specify the slice numerically(数字的方式), type s s (doc-view-set-slice); then enter the top left pixel position and the slice's width and height.

A more convenient graphical way to specify the slice is with s m (doc-view-set-slice-using-mouse), where you use the mouse to select the slice.

The most convenient way is to set the optimal(优化的) slice by using BoundingBox information automatically determined from the document by typing s b (doc-view-set-slice-using-mouse).

To cancel the selected slice, type s r (doc-view-reset-slice). Then DocView shows the entire page including its entire margins(边界).


** 35.4 DocView Conversion

For efficiency, DocView caches the images produced by gs. The name of this directory is given by the variable doc-view-cache-directory. You can clear the cache directory by typing M-x doc-view-clear-cache.

To force reconversion of the currently viewed document, type r or g (revert-buffer). To kill the converter process associated with the current buffer, type K (doc-view-kill-proc). The command k (doc-view-kill-proc-and-buffer) kills the converter process and the DocView buffer.

posted on 2013-11-27 14:04  vipzrx  阅读(328)  评论(0编辑  收藏  举报

导航