Nếu bạn đặt LaTeX-includegraphics-read-filethành LaTeX-includegraphics-read-file-relative, tự động hoàn thành với helmcung cấp tính năng này:

Thiết lập AocateeX
Bạn có thể tùy chỉnh LaTeX-includegraphics-read-file( M-x customize-variable RET LaTeX-includegraphics-read-file RET) và chọn relativetùy chọn hoặc thêm phần sau vào tệp init của mình:
(setq LaTeX-includegraphics-read-file 'LaTeX-includegraphics-read-file-relative)
Cài đặt và thiết lập helm
Bạn có thể cài đặt helmtừ kho lưu trữ Melpa, đây là hướng dẫn về cách thêm nó. Khi bạn hoàn thành, vấn đề M-x list-packages RET, đi đến helmmục và nhấn i x.
Bây giờ bạn cần phải thiết lập helm. Đây là một hướng dẫn tốt bắt đầu. Bạn có thể chọn giữa một cấu hình tối thiểu:
(require 'helm-config)
(helm-mode 1)
và một cấu hình mở rộng:
(require 'helm)
(require 'helm-config)
;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs.
;; Changed to "C-c h". Note: We must set "C-c h" globally, because we
;; cannot change `helm-command-prefix-key' once `helm-config' is loaded.
(global-set-key (kbd "C-c h") 'helm-command-prefix)
(global-unset-key (kbd "C-x c"))
(global-set-key (kbd "M-x") 'helm-M-x) ; This was not present in the suggested extended config
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebind tab to run persistent action
(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB works in terminal
(define-key helm-map (kbd "C-z") 'helm-select-action) ; list actions using C-z
(when (executable-find "curl")
(setq helm-google-suggest-use-curl-p t))
(setq helm-split-window-in-side-p t ; open helm buffer inside current window, not occupy whole other window
helm-move-to-line-cycle-in-source t ; move to end or beginning of source when reaching top or bottom of source.
helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp.
helm-scroll-amount 8 ; scroll 8 lines other window using M-<next>/M-<prior>
helm-ff-file-name-history-use-recentf t)
(helm-mode 1)
Xin vui lòng, lưu ý về sự khác biệt giữa hoàn thành mặc định của Emacs và helmcủa một .
Bắt đầu sử dụng tính năng mới
Khởi động lại Emacs và bạn sẽ sẵn sàng. Trong bộ đệm LaTeX, vấn đề C-c RET includegraphics RET(lưu ý bạn có thể khai thác helmtự động hoàn thành) và chọn ảnh bạn muốn đưa vào. Để xem bản xem trước, như được hiển thị ở đầu, nhấn hai lần liên kết phím được liên kết với helm-execute-persistent-action( C-ztheo mặc định hoặc TABtrong cấu hình mở rộng ở trên) hoặc di chuyển lên và xuống trong danh sách tệp với C-upvà C-down(xem câu trả lời này ).
helmvà đặtLaTeX-includegraphics-read-filethànhLaTeX-includegraphics-read-file-relativebạn sẽ có bản xem trước. Hãy cho tôi biết nếu điều này làm bạn hài lòng và tôi sẽ viết câu trả lời.