spacemacs中latex配置

刚开始接触emacs,想请教关于latex layer配置的问题。急求,多谢。 tex文件和pdf文件如何才能同时出现在emacs界面上?就是左边是tex文件,右边是pdf文件,并且tex修改后pdf能够实时更新,同时可以点击pdf上的文字对应的tex文件的位置能够自动定位。 求大神指点~

给个效果图片看看?我是pdf不显示在emacs中,emacs查看pdf有点卡,pdf显示在skim中,能够正向反向定位,但修改tex不能及时更新pdf,以前用texmaker能够一边写tex,一边更新pdf,觉得挺鸡肋的,所以用着用着就关掉了pdf实时预览。

1 个赞

确实是,刚把问题解决,我也是用的skim,也不能实时更新。不过这些目前已经满足我的需求了,谢谢啦~

可以贴贴你是如何解决的吗?谢谢

请问你是如何实现正反定位的呢?谢谢了,我尝试了别人网站贴的代码,没有办法成功

我是安装了skim。请参考下面的网页Spacemacs and LaTeX - Mingshen Sun 和网页 http://www.stefanom.org/setting-up-a-nice-auctex-environment-on-mac-os-x/。反向定位shift+command+click 正向定位在重新生成的时候pdf中的高亮才出现

;; set pdf viewer on OSX and Linux
(cond
((string-equal system-type “darwin”)
(progn (setq TeX-view-program-selection '((output-pdf “Skim”))))))

;; enable PDF-LaTeX synchronization
;; press SPC m v to highlight line in PDF
;; press shift cmd and click in PDF to show line in sourcecode
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-start-server t)
(setq TeX-source-correlate-method 'synctex)
(setq TeX-view-program-list
(“Skim” “displayline -b -g %n %o %b”))

在spacemacs/user-config下加入这些之后,居然报错invalide function “skim”,不知如何解决?

我发的两个链接要结合看,(“Skim” “displayline -b -g %n %o %b”) 改为 (“PDF Viewer” “/Applications/Skim.app/Contents/SharedSupport/displayline -b -g %n %o %b”),应该可以

第二个链接出错,这样设置提示Invalid funciton “PDF Viewer"

这里提示Invalid function xxx的错误应该是你的配置文件的括号不匹配,检查一下括号再试试?

如果括号不匹配会提示的,而且出问题的就这两行:
(setq TeX-view-program-list ("Skim" "displayline -b -g %n %o %b"))

这个地方似乎要改成(加个 quote )

(setq TeX-view-program-list '("Skim" "displayline -b -g %n %o %b"))

1 个赞

(setq TeX-view-program-list '((“PDF Viewer” “/Applications/Skim.app/Contents/SharedSupport/displayline -b -g %n %o %b”)))

Linux可以试试zathura,好像安装好之后在设定好tex-view-programe之后就可以实时更新了

您好,我是spacemacs的初学者,想安装一下auctex,感觉你提供的配置很不错,但是不知道怎么安装。 我的系统是windows,emacs的版本是25.3。我现在是在自己的layer中新建了一个autex项, package.el代码是 (defconst auctex-packages '(auctex)) (defun auctex/init-auctex() ) 然后把 Aquamacs’s auctex-config.el 中的代码复制到了config.el文件中。然后出现了以下bug 请问怎么解决,或者我应该怎么安装配置呢?感谢

Debugger entered–Lisp error: (file-error “Cannot open load file” “No such file or directory” “tex-site”) load(“tex-site” nil nil nil) eval-buffer(#<buffer load-410476> nil “g:/configuration/emacs/.spacemacs.d/layers/auctex/config.el” nil t) ; Reading at buffer position 1795 load-with-code-conversion(“g:/configuration/emacs/.spacemacs.d/layers/auctex/config.el” “g:/configuration/emacs/.spacemacs.d/layers/auctex/config.el” nil nil) load(“g:/configuration/emacs/.spacemacs.d/layers/auctex/config.el”) (if (file-exists-p file) (load file)) (let ((file (concat (eieio-oref obj (quote :dir)) file))) (if (file-exists-p file) (load file))) (while --dolist-tail-- (setq file (car --dolist-tail–)) (let ((file (concat (eieio-oref obj (quote :dir)) file))) (if (file-exists-p file) (load file))) (setq --dolist-tail-- (cdr --dolist-tail–))) (let ((–dolist-tail-- files) file) (while --dolist-tail-- (setq file (car --dolist-tail–)) (let ((file (concat (eieio-oref obj (quote :dir)) file))) (if (file-exists-p file) (load file))) (setq --dolist-tail-- (cdr --dolist-tail–)))) (progn (let ((–dolist-tail-- files) file) (while --dolist-tail-- (setq file (car --dolist-tail–)) (let ((file (concat (eieio-oref obj …) file))) (if (file-exists-p file) (load file))) (setq --dolist-tail-- (cdr --dolist-tail–))))) (if obj (progn (let ((–dolist-tail-- files) file) (while --dolist-tail-- (setq file (car --dolist-tail–)) (let ((file (concat … file))) (if (file-exists-p file) (load file))) (setq --dolist-tail-- (cdr --dolist-tail–)))))) (let ((obj (configuration-layer/get-layer layer-name))) (if obj (progn (let ((–dolist-tail-- files) file) (while --dolist-tail-- (setq file (car --dolist-tail–)) (let ((file …)) (if (file-exists-p file) (load file))) (setq --dolist-tail-- (cdr --dolist-tail–))))))) configuration-layer//load-layer-files(auctex (“config.el”)) (while --dolist-tail-- (setq layer-name (car --dolist-tail–)) (configuration-layer//load-layer-files layer-name (quote (“config.el”))) (setq --dolist-tail-- (cdr --dolist-tail–))) (let ((–dolist-tail-- layer-names) layer-name) (while --dolist-tail-- (setq layer-name (car --dolist-tail–)) (configuration-layer//load-layer-files layer-name (quote (“config.el”))) (setq --dolist-tail-- (cdr --dolist-tail–)))) (let ((warning-minimum-level :error)) (let ((–dolist-tail-- layer-names) layer-name) (while --dolist-tail-- (setq layer-name (car --dolist-tail–)) (configuration-layer//load-layer-files layer-name (quote (“config.el”))) (setq --dolist-tail-- (cdr --dolist-tail–))))) configuration-layer//configure-layers((spacemacs-bootstrap spacemacs-ui-visual spacemacs-ui spacemacs-misc spacemacs-language spacemacs-evil spacemacs-editing-visual spacemacs-editing spacemacs-layouts spacemacs-completion spacemacs-base spacemacs auctex livky ivy auto-completion better-defaults emacs-lisp git markdown org spacemacs-org spell-checking syntax-checking)) configuration-layer/sync() (if (not (version<= spacemacs-emacs-min-version emacs-version)) (error (concat "Your version of Emacs (%s) is too old. " “Spacemacs requires Emacs version %s or above.”) emacs-version spacemacs-emacs-min-version) (load-file (concat (file-name-directory load-file-name) “core/core-load-paths.el”)) (require (quote core-spacemacs)) (spacemacs/init) (configuration-layer/sync) (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (require (quote server)) (if (server-running-p) nil (server-start))) eval-buffer(#<buffer load> nil “g:/configuration/emacs/.emacs.d/init.el” nil t) ; Reading at buffer position 1264 load-with-code-conversion(“g:/configuration/emacs/.emacs.d/init.el” “g:/configuration/emacs/.emacs.d/init.el” t t) load(“g:/configuration/emacs/.emacs.d/init” t t) #[0 "\205\266

Aquamacs 的東西直接用在 Windows 上真的大丈夫?Aquamacs 的 AucTeX 是定制的,配置不好直接用的。 Spacemacs 自有的 latex 就配的是 AucTeX。