dviout と emacs を相互に行き来する

dviout でダブルクリック→emacs で該当箇所に飛ぶ

emacs でdvi をプレビュー→dviout で該当箇所を開く

まず,前提として,platexに-src-specialのオプションをつけてコンパイル.

詳しくは適当なURLをあたられたい.

追記

有用だと思われるURL

src-special で TeX ソース⇔プレビューア相互参照

divout → emacs

[Option]-[Setup Parameter]-[Common] の src に

C:\unix\emacs-22.3\bin\emacsclientw.exe^s -n +%d %s

とする.

.emacs に

(server-start)

を追加.

emacs → dviout

.emacs に以下を追加.

(add-hook 'yatex-mode-hook
'(lambda ()
(define-key YaTeX-mode-map "\C-c\C-j" 'dviout-jump-to-line)))
(defun dviout-jump-to-line ()
(interactive)
(save-excursion
(save-restriction
(widen)
(let ((word (thing-at-point 'word)))
(beginning-of-line 1)
(let* ((curr-line (+ 1 (count-lines (point-min) (point))))
(dvi-master-file (expand-file-name
(cond
((and (eq major-mode 'yatex-mode)
(fboundp 'YaTeX-get-preview-file-name))
(YaTeX-get-preview-file-name))
((and (boundp 'TeX-master)
(stringp TeX-master))
TeX-master)
(t
(buffer-file-name)))))
(dvi-file (concat
(file-name-sans-extension dvi-master-file) ".dvi"))
(master-file (expand-file-name (buffer-file-name))))
(let ((args (list "-1" dvi-file
(concat "# " (int-to-string curr-line) "/" word
" '" master-file "'"))))
(process-query-on-exit-flag
(apply 'start-process " *preview-jump*" nil "dviout" args)
)
(message (apply 'concat "dviout" args))
))))))

More Reading
Newer// memo