{"action":"created","issue":{"url":"https://api.github.com/repos/redguardtoo/emacs.d/issues/340","labels_url":"https://api.github.com/repos/redguardtoo/emacs.d/issues/340/labels{/name}","comments_url":"https://api.github.com/repos/redguardtoo/emacs.d/issues/340/comments","events_url":"https://api.github.com/repos/redguardtoo/emacs.d/issues/340/events","html_url":"https://github.com/redguardtoo/emacs.d/issues/340","id":100746089,"number":340,"title":"配置CDLaTeX","user":{"login":"yangdaweihit","id":10682606,"avatar_url":"https://avatars.githubusercontent.com/u/10682606?v=3","gravatar_id":"","url":"https://api.github.com/users/yangdaweihit","html_url":"https://github.com/yangdaweihit","followers_url":"https://api.github.com/users/yangdaweihit/followers","following_url":"https://api.github.com/users/yangdaweihit/following{/other_user}","gists_url":"https://api.github.com/users/yangdaweihit/gists{/gist_id}","starred_url":"https://api.github.com/users/yangdaweihit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yangdaweihit/subscriptions","organizations_url":"https://api.github.com/users/yangdaweihit/orgs","repos_url":"https://api.github.com/users/yangdaweihit/repos","events_url":"https://api.github.com/users/yangdaweihit/events{/privacy}","received_events_url":"https://api.github.com/users/yangdaweihit/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-13T11:29:40Z","updated_at":"2015-08-14T06:02:28Z","closed_at":"2015-08-13T20:29:58Z","body":"将cdlatex.el拷贝到～/.emacs.d/中后，尝试在init.el中加入elisp配置CDLaTeX：\r\n           (add-to-list 'load-path \"~/.emacs.d\")\r\n           (add-hook 'LaTeX-mode-hook 'turn-on-cdlatex)   ; with AUCTeX LaTeX mode\r\n           (add-hook 'latex-mode-hook 'turn-on-cdlatex) ; with Emacs latex mode\r\n再次启动后配置成功，打开tex文件时看到CDLTX菜单：\r\n![psb](https://cloud.githubusercontent.com/assets/10682606/9248736/0733d2d8-41f1-11e5-85e7-2b09cb5ac806.png)\r\n然而之后再次打启动Emacs打开tex文件后再也看不到CDLTX： \r\n![emacs thinkpad-t430u_025](https://cloud.githubusercontent.com/assets/10682606/9248757/31b142e8-41f1-11e5-9d7e-ae6441b60332.png)\r\n\r\n请问如何解决这个问题？ \r\n\r\n下面是我在init.el后面加的代码：\r\n(add-to-list 'load-path (expand-file-name \"~/.emacs.d\"))\r\n(add-hook 'LaTeX-mode-hook 'turn-on-cdlatex)   ; with AUCTeX LaTeX mode\r\n(add-hook 'latex-mode-hook 'turn-on-cdlatex) ; with Emacs latex mode\r\n\r\n;;;;;;;;;;;;;;;;;\r\n;;Auctex\r\n;;;;;;;;;;;;;;;;;\r\n(load \"auctex.el\" nil t t)\r\n(load \"preview-latex.el\" nil t t)\r\n(setq TeX-auto-save t)\r\n(setq TeX-parse-self t)\r\n(setq-default TeX-master nil)\r\n(mapc (lambda (mode)\r\n(add-hook 'LaTeX-mode-hook mode))\r\n      (list ;'auto-complete-mode\r\n   'auto-fill-mode\r\n   'LaTeX-math-mode\r\n   'turn-on-reftex\r\n   'linum-mode))\r\n(add-hook 'LaTeX-mode-hook\r\n          (lambda ()\r\n            (setq TeX-auto-untabify t     ; remove all tabs before saving\r\n                  TeX-engine 'xetex       ; use xelatex default\r\n                  TeX-show-compilation t) ; display compilation windows\r\n            (TeX-global-PDF-mode t)       ; PDF mode enable, not plain\r\n            (setq TeX-save-query nil)\r\n            (imenu-add-menubar-index)\r\n            (define-key LaTeX-mode-map (kbd \"TAB\") 'TeX-complete-symbol)))\r\n; set pdf view tool\r\n(setq TeX-view-program-list '((\"Evince\" \"evince %o\")))\r\n(cond\r\n ((eq system-type 'windows-nt)\r\n  (add-hook 'LaTeX-mode-hook\r\n            (lambda ()\r\n              (setq TeX-view-program-selection '((output-pdf \"SumatraPDF\")\r\n                                                 (output-dvi \"Yap\"))))))\r\n\r\n ((eq system-type 'gnu/linux)\r\n  (add-hook 'LaTeX-mode-hook\r\n            (lambda ()\r\n              (setq TeX-view-program-selection '((output-pdf \"Evince\")\r\n                                                 (output-dvi \"Evince\")))))))\r\n; XeLaTeX\r\n(add-hook 'LaTeX-mode-hook (lambda()\r\n    (add-to-list 'TeX-command-list '(\"XeLaTeX\" \"%`xelatex%(mode)%' %t\" TeX-run-TeX nil t))\r\n    (setq TeX-command-default \"XeLaTeX\")\r\n    (setq TeX-save-query  nil )\r\n    (setq TeX-show-compilation t)\r\n    ))\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/redguardtoo/emacs.d/issues/comments/130983451","html_url":"https://github.com/redguardtoo/emacs.d/issues/340#issuecomment-130983451","issue_url":"https://api.github.com/repos/redguardtoo/emacs.d/issues/340","id":130983451,"user":{"login":"redguardtoo","id":184553,"avatar_url":"https://avatars.githubusercontent.com/u/184553?v=3","gravatar_id":"","url":"https://api.github.com/users/redguardtoo","html_url":"https://github.com/redguardtoo","followers_url":"https://api.github.com/users/redguardtoo/followers","following_url":"https://api.github.com/users/redguardtoo/following{/other_user}","gists_url":"https://api.github.com/users/redguardtoo/gists{/gist_id}","starred_url":"https://api.github.com/users/redguardtoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redguardtoo/subscriptions","organizations_url":"https://api.github.com/users/redguardtoo/orgs","repos_url":"https://api.github.com/users/redguardtoo/repos","events_url":"https://api.github.com/users/redguardtoo/events{/privacy}","received_events_url":"https://api.github.com/users/redguardtoo/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T06:02:27Z","updated_at":"2015-08-14T06:02:27Z","body":"Yes, I will think about this.\r\n\r\nFor now, you could stick to my \"one year\" guide. It already covers everything you need to be great at Emacs.\r\n\r\nFor example, if you use Steve Purcell's setup, the cdlatex.el could be installed through melpa, so those `require` code is not necessary anymore, you just insert your own setup into custom.el (check its README). Besides, Steve Purcell's is the founder and maintainer of melpa, so you will never have  issue on installing packages.\r\n\r\n"}}