Closed thjwong closed 8 years ago
Thanks for reporting your issue and sorry to hear you are having trouble with LaTeX Preview Pane. So I can help you better could you paste me your .emacs file?
Thanks for taking the time. Here's my .emacs (I cut out half of those really unrelated sections, e.g. ess, slime, php-mode, org-mode, gnus, w3m, etc)
;; Disable showing the startup page (setq inhibit-startup-message t)
(setq default-directory "D:\home\jwong") ;; set default directory to "%HOME%" (setq default-directory "~/") ;; C-h v default-directory returns "d:/home/jwong/"
(push "~/.emacs.d/lisp" load-path)
;; http://ergoemacs.org/emacs/emacs_package_system.html (when (>= emacs-major-version 24) (require 'package)) ;; http://www.emacswiki.org/emacs/ELPA (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") ("marmalade" . "https://marmalade-repo.org/packages/") ("melpa" . "https://melpa.org/packages/"))) (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) ;; Org-mode's repository ;; as soon as packages in archive are initialized, you can use (require) on them (package-initialize) ;; GnuTLS gnutls.el uses nix style paths ;; e.g. "/usr/ssl/certs/ca-bundle.crt" ;; When cygwin-mount.el is loaded/activated, the Lisp-code properly parses and recognizes these paths. ;; However, presumably the C-code (which is not affected by cygwin-mount.el) does not know how to handle nix style paths and crashes Emacs. ;; https://lists.gnupg.org/pipermail/gnutls-devel/2013-October/006509.html (setq gnutls-trustfiles '("C:/Cygwin64/etc/ssl/certs/ca-certificates.crt" "C:/Cygwin64/etc/pki/tls/certs/ca-bundle.crt" "C:/Cygwin64/etc/ssl/ca-bundle.pem" "C:/Cygwin64/usr/ssl/certs/ca-bundle.crt")) ;; paradox-list-package shows ratings & website etc of the packages ;; get a list of installed packages in the variable package-activated-list (setq paradox-github-token "1fbc010373f73f1a3067b84aa64b8686ede3fbf4") (setq paradox-automatically-star t)
;; https://github.com/dholm/benchmark-init-el ;(add-to-list 'load-path "~/git/benchmark-init-el/") ;(require 'benchmark-init-loaddefs) (require 'benchmark-init) (benchmark-init/activate) ;(benchmark-init/deactivate) ;; Check benchmark by doing: ;; M-x benchmark-init/show-durations-tabulated ;; M-x benchmark-init/show-durations-tree
;; https://github.com/jwiegley/use-package (eval-when-compile (require 'use-package)) (require 'bind-key)
;;; unset unwanted key bindings in global or in specific mode ;;; http://emacs.stackexchange.com/questions/653/how-can-i-find-out-in-which-keymap-a-key-is-bound (add-hook 'python-mode-hook (lambda() (local-unset-key (kbd "C-c C-c"))))
(add-hook 'python-mode-hook (lambda() (define-key python-mode-map (kbd "C-c C-c") nil)))
(eval-after-load "zencoding-mode" '(define-key zencoding-mode-keymap (kbd "C-j") nil))
;; Emacs 2C Mode (Two-Column Mode) is only for text tables
;; Each of the below 3 lines does the exact same job
(define-key global-map (kbd "
;;; bind keys to my personal preference
(global-set-key (kbd "C-/") 'delete-backward-char)
(global-set-key (kbd "C-h") 'delete-backward-char)
(global-set-key (kbd "C-x ?") 'help-for-help)
(global-set-key (kbd "C-o") 'undo)
(global-set-key (kbd "C-'") 'set-mark-command)
(global-set-key (kbd "
(global-set-key (kbd "
;; same as C-x 1
(global-set-key (kbd "
(global-set-key (kbd "
;(setq default-input-method "chinese-b5-tsangchi") ;(global-set-key (kbd "C-S-SPC") 'toggle-input-method) ;(global-set-key (kbd "C->") 'set-input-method)
(global-set-key [(meta ?z)] 'dup-line) (global-set-key [f5] 'goto-line) ;(global-set-key [f8] 'auto-fill-mode) ;(global-set-key [f12] 'other-window) (global-set-key [(meta delete)] 'kill-word)
(require 'win-switch) ;(global-set-key "\C-xo" 'win-switch-dispatch) (win-switch-setup-keys-ijkl "\C-xo") ;(setq win-switch-idle-time 0.75) ;; default (setq win-switch-idle-time 1.0)
;; binding C-c C-i to reach init.el file as defined lower (global-set-key (kbd "C-c C-i") 'init-config) ;; visit ~/.emacs file (defun init-config () "Visit .emacs" (interactive) (find-file "~/.emacs"))
(setenv "PATH" (concat (getenv "PATH") ";C:\Cygwin64\bin\")) (setenv "PATH" (concat (getenv "PATH") ";C:\Cygwin64\usr\bin\")) (setq exec-path (append exec-path '("C:/Cygwin64/bin")))
(if (file-directory-p "C:/Cygwin64/usr/bin") (add-to-list 'exec-path "C:/Cygwin64/usr/bin"))
(push "C:/Cygwin64/bin" exec-path) (push "C:/Cygwin64/usr/bin" exec-path) ;; Not using GNU Win32 Tools anymore ;(push "C:/Program\ Files/GnuWin32/bin" load-path)
;; signs of me trying real hard to show Emacs the path to executable files (push "/bin" exec-path) (push "/usr/bin" exec-path) (push "/cygdrive/c/Cygwin64/bin" exec-path) (push "/cygdrive/c/Cygwin64/usr/bin" exec-path)
(if (or (eq window-system 'w32) (eq window-system 'win32)) (progn (print "we are in windows!") ;; making GNU Emacs to work with Cygwin (setenv "PATH" (concat "C:\Cygwin64\bin;" (getenv "PATH"))) (setq exec-path (cons "C:/Cygwin64/bin/" exec-path)) (require 'cygwin-mount) (require 'setup-cygwin) ;; content of setup-cygwin.el has to be modified ;; For subprocesses invoked via the shell ;; (e.g., "shell -c command") (setq shell-file-name explicit-shell-file-name) ;; prefer EN man pages. (setq manual-program "LANG=C man") (set-frame-parameter nil 'alpha '(99 81)) (defun w32-maximize-frame () "Maximize the current frame (windows only)" (interactive) (w32-send-sys-command 61488)) (defun w32-restore-frame () "Restore a minimized/maximized frame (windows only)" (interactive) (w32-send-sys-command 61728)) ;; Emacs 24.5 has two built-in functions now: ;; toggle-frame-fullscreen ;; toggle-frame-maximized ;; some commenting the following out ;(global-set-key [f12] 'w32-maximize-frame) ;(global-set-key [C-f12] 'w32-restore-frame) (setq default-frame-alist (append default-frame-alist '( (top . 9) (left . 9) (width . 144) (height . 51) ;(background-color . "Gray92") ;(foreground-color . "Black") ;(background-color . "light blue") ;(foreground-color . "navy") ;(cursor-color . "red3") ))) ))
(defun cygwin-shell () "Run cygwin bash in shell mode." (interactive) (let ((explicit-shell-file-name "C:/Cygwin64/bin/bash.exe")) (call-interactively 'shell)))
(add-to-list 'exec-path "C:/Cygwin64/bin") (setq explicit-shell-file-name "C:/Cygwin64/bin/bash") (setq shell-file-name explicit-shell-file-name) (setenv "SHELL" "C:/Cygwin64/bin/bash.exe")
(require 'shell) ;; Make sure that the bash executable can be found (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;;(set-frame-parameter (selected-frame) 'alpha '(
;;; ELscreen ;;; Emacs window session manager ;;; http://www.emacswiki.org/emacs/EmacsLispScreen ;;; https://github.com/knu/elscreen (require 'elscreen) (elscreen-start) (setq elscreen-display-tab nil) ;(elscreen-persist-mode 1) (global-set-key (kbd "C-z s") 'elscreen-persist-store) (global-set-key (kbd "C-z r") 'elscreen-persist-restore) ;; Also can use register: ;; C-x r w x to store the window configuration and C-x r j x to restore it ;; where x is the name of the register to store it in. ;(require 'elscreen-multi-term) ;(require 'elscreen-separate-buffer-list) ;(elscreen-separate-buffer-list-mode)
;;; =============== ;;; Look and feel ;;; =============== (blink-cursor-mode nil) ; curseur ne clignote pas (setq-default cursor-type 'bar) ; curseur étroit (set-face-background 'cursor "#CC00CC") ; curseur rouge foncé ;(tool-bar-mode nil) ; cacher les horribles icônes (tool-bar-mode -1) ; cacher les horribles icônes
(global-font-lock-mode t) ; colorisation du texte (transient-mark-mode t) ; mode de sélection "normal" (delete-selection-mode t) ; entrée efface texte sélectionné (setq-default mouse-yank-at-point t) ; coller avec la souris (show-paren-mode t) ; coupler les parenthèses (setq-default case-fold-search t) ; recherche sans égard à la casse
(setq default-major-mode 'text-mode) ; mode par défaut
;;; ================================== ;;; Polices de caractère et couleurs ;;; ================================== (set-face-font 'default "-outline-Consolas-normal-r-normal-normal-11--96-96-c--iso8859-1") (set-face-font 'bold "-outline-Consolas-bold-r-normal-normal---96-96-c--iso8859-1") (set-face-font 'italic "-outline-Consolas-normal-i-normal-normal---96-96-c--iso8859-1") (set-face-font 'bold-italic "-outline-Consolas-bold-i-normal-normal---96-96-c-*-iso8859-1") ;(set-face-background 'mode-line "#EFEEE2") ;(set-face-background 'region "lightskyblue1") ;(set-face-foreground 'font-lock-function-name-face "Blue3") ;(set-face-foreground 'font-lock-keyword-face "Orange")
(eval-when-compile (require 'cl)) (defun toggle-transparency () (interactive) (if (/= (cadr (find 'alpha (frame-parameters nil) :key #'car)) 100) (set-frame-parameter nil 'alpha '(100 100)) (set-frame-parameter nil 'alpha '(93 87)))) (global-set-key (kbd "C-c C-t") 'toggle-transparency)
; ;; set color-theme (require 'color-theme) (setq color-theme-is-global t) (eval-after-load "color-theme" '(progn (color-theme-initialize) ;(color-theme-clarity) ;(color-theme-dark-blue2) ;(color-theme-deep-blue) (color-theme-robin-hood) ) )
;; https://github.com/emacs-jp/replace-colorthemes/ ;; replaces color-theme with Emacs 24 theme framework ;; Somehow doesn't seem to look like the screenshot ;; i.e. ported themes' color off from original themes ; (load-theme 'clarity t t) ; (enable-theme 'clarity) ; (load-theme 'dark-blue2 t t) ; (enable-theme 'dark-blue2) ; (load-theme 'deep-blue t t) ; (enable-theme 'deep-blue) ; (load-theme 'robin-hood t t) ; (enable-theme 'robin-hood)
;; Display line number to the left of buffer ;; http://stud4.tuwien.ac.at/~e0225855/linum/linum.html (require 'linum)
;; http://elpa.gnu.org/packages/register-list.html (require 'register-list)
;; iswitch is now 'obsolete' since Emacs 24.4 ;; however, still iSwitchB is still available ;(iswitchb-mode t) ;;; ===== ;;; Ido ;;; ===== (require 'ido) (ido-mode t) (setq ido-enable-flex-matching t) (setq ido-everywhere t) (ido-mode 1)
;;; ====== ;;; smex ;;; ====== ;; Can be omitted. This might cause a (minimal) delay ;; when Smex is auto-initialized on its first run. (smex-initialize)
(global-set-key (kbd "M-x") 'smex) (global-set-key (kbd "M-X") 'smex-major-mode-commands) ;; This is your old M-x. (global-set-key (kbd "C-c M-x") 'execute-extended-command)
;;; ======== ;;; popwin ;;; ======== (require 'popwin) (popwin-mode 1)
;; Recentf is a minor mode that builds a list of recently opened files. This list is is automatically saved across Emacs sessions. You can then access this list through (require 'recentf) (recentf-mode 1) (setq recentf-max-menu-items 30) (global-set-key "\C-x\ \C-r" 'recentf-open-files) ;; exclude some files, e.g. .org .log (setq recentf-exclude '("~$")) (add-to-list 'recentf-exclude ".emacs") (add-to-list 'recentf-exclude "[[:ascii:]]+.org") (add-to-list 'recentf-exclude "[[:ascii:]]+.log") (add-to-list 'recentf-exclude ".newsrc[[:ascii:]]*") (add-to-list 'recentf-exclude "[[:ascii:]]+/elpa/[[:ascii:]]+") (add-to-list 'recentf-exclude "[[:ascii:]]+/AppData/[[:ascii:]]+") (add-to-list 'recentf-exclude "[[:ascii:]]+/Program Files[[:ascii:]]+")
;; set backup directory (setq backup-by-copying t ; don't clobber symlinks backup-directory-alist '(("." . "~/.emacs.d/backup")) ; don't litter my fs tree delete-old-versions t kept-new-versions 6 kept-old-versions 2 version-control t) ; use versioned backups
(require 'scratch-ext) (setq scratch-ext-log-directory "~/.emacs.d/backup/scratch")
(add-hook 'dired-load-hook (lambda () (require 'dired-sort) (require 'dired-sort-menu) (require 'dired-sort-menu+) ))
(require 'ssh) ;; buggy ESS R behavior on R remote session (require 'tramp)
;;; Text-mode-hook ;(add-hook 'text-mode-hook 'turn-on-auto-fill)
;;; Auto-compression mode ;; to edit compressed files transparently ;; .gz, .bz2, .Z (auto-compression-mode t)
;; Function to duplicate a line (defun dup-line () "Duplicates the line on which point lies." (interactive) (save-excursion (beginning-of-line) (let ((begin (point))) (forward-line) (copy-region-as-kill begin (point)) (yank) (forward-line -1) (back-to-indentation))))
;; My LaTeX section and my .emacs in general really need some consolidation. ;;; ============== ;;; LaTeX-mode ;;; ============== (add-hook 'LaTeX-mode-hook #'latex-extra-mode) ;(add-to-list 'load-path "C:\Program Files (x86)\GNU Emacs 24.5\share\emacs\site-lisp\auctex") ;(add-to-list 'load-path "~/.emacs.d/packages/ac-math") ;(add-to-list 'load-path "~/.emacs.d/packages/auto-complete") ;(add-to-list 'load-path "~/.emacs.d/packages/math-symbol-lists") ;(add-to-list 'load-path "~/.emacs.d/packages/popup-el")
;; https://github.com/tom-tan/auctex-latexmk/ (require 'auctex-latexmk) (auctex-latexmk-setup) ;; After that, by using M-x TeX-command-master (or C-c C-c), you can use LatexMk command to compile TeX source. ;; LatexMk will inherit many AUCTeX settings, including: ;; * Run with -interaction-nonestopmode if TeX-interactive-mode minor mode is active ;; * Run with -synctex if TeX-source-correlate-mode is active ;; If you would like LatexMk to pass the -pdf flag when TeX-PDF-mode is active add (setq auctex-latexmk-inherit-TeX-PDF-mode t)
(setenv "LC_ALL" "C") (setenv "LANG" "C")
(require 'auto-complete-config) (add-to-list 'ac-dictionary-directories "~/.emacs.d/lisp/auto-complete/dict") (ac-config-default) ;(load "C:\Program Files (x86)\GNU Emacs 24.4\share\emacs\site-lisp\auctex\tex-site.el" nil t t) (require 'tex) (require 'popup) (require 'auto-complete) (require 'reftex)
;; Somehow doesn't work ;; 1. have to manually provide real file name (pdftex.exe) instead of the pdflatex link ;; 2. cannot find the tex file itself ;(require 'preview-latex) ;(latex-preview-pane-enable) ; Or M-x latex-preview-pane-mode
(setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-electric-escapy t) (setq reftex-plug-into-AUCTeX t) (setq TeX-PDF-mode t) ;; show TeX output window (setq TeX-show-compilation t) (setq TeX-toggle-debug-boxes nil) (setq file_line_error_style t)
;; Change settings in Sumatra PDF from using Notepad++ to using Emacs ; "C:\Program Files (x86)\Notepad++\notepad++.exe" -n%l "%f" ; "C:\Program Files (x86)\GNU Emacs 24.5\bin\emacsclient.exe" --no-wait +%l "%f"
;(setf (nth 1 (assoc "LaTeX" TeX-command-list)) ; "%`%l --synctex=-1 -interaction=nonstopmode %(mode)%' %t") (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(LaTeX-command "latex -synctex=1") ;'(pdf-latex-command "pdftex") ) ;(require 'sumatra-forward) ;(setq TeX-view-program-list ; '(("Sumatra" ("D:/home/jwong/bin/Emacs_SumatraPDF.bat %o %t %n"))))
(setq TeX-PDF-mode t) (setq TeX-source-correlate-mode t) (setq TeX-source-correlate-method 'synctex) (setq TeX-source-correlate-start-server t) (server-start)
(setq TeX-view-program-list '(("Sumatra PDF" ("\"C:/Program Files (x86)/SumatraPDF/SumatraPDF.exe\" -reuse-instance" (mode-io-correlate " -forward-search %b %n ") " %o"))))
(eval-after-load 'tex '(progn (assq-delete-all 'output-pdf TeX-view-program-selection) (add-to-list 'TeX-view-program-selection '(output-pdf "Sumatra PDF")) ) ) ;(add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)
(add-hook 'LaTeX-mode-hook 'visual-line-mode) (add-hook 'LaTeX-mode-hook 'flyspell-prog-mode) (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) (add-hook 'LaTeX-mode-hook 'turn-on-reftex) (add-hook 'LaTeX-mode-hook 'turn-off-auto-fill)
; latex2rtf (eval-after-load "tex" '(add-to-list 'TeX-command-list '("latex2rtf" "latex2rt -f0 %t" TeX-run-command t t) t))
; snippets ;(require 'yasnippet "~/.emacs.d/packages/yasnippet/yasnippet.el") (require 'yasnippet) (yas/initialize) (setq yas/root-directory "~/.emacs.d/lisp/yasnippet") (yas/load-directory yas/root-directory)
; auto-completion (require 'ac-math) (add-to-list 'ac-modes 'LaTeX-mode) (add-to-list 'ac-modes 'latex-mode)
(defun ac-LaTeX-mode-setup () ; add ac-sources to default ac-sources (setq ac-sources (append '(ac-source-math-unicode ac-source-math-latex ac-source-latex-commands ac-source-yasnippet) ac-sources)))
(add-hook 'LaTeX-mode-hook 'ac-LaTeX-mode-setup) (ac-config-default)
;; Make RefTeX faster (setq reftex-enable-partial-scans t) (setq reftex-save-parse-info t) (setq reftex-use-multiple-selection-buffers t)
(require 'tex-smart-umlauts) (add-hook 'LaTeX-mode-hook #'tex-smart-umlauts-decode)
(setq latex-mode-hook '(lambda () (reftex-mode) (flyspell-mode) ;(flyspell-prog-mode) ;;just (flyspell-mode) has error of "invalid option -i" (yas/minor-mode) (ac-flyspell-workaround) (auto-complete-mode) (setq ac-delay 0.2) (define-key LaTeX-mode-map (kbd "C-c C-u") 'LaTeX-find-matching-begin) (define-key LaTeX-mode-map (kbd "C-c C-d") 'LaTeX-find-matching-end) (define-key LaTeX-mode-map (kbd "C-c C-i") 'LaTeX-insert-item) ))
; spell checking (require 'ispell)
(setq ispell-dictionary-base-alist '( ("de_DE" "[a-zäöüßA-ZÄÖÜ]" "[^a-zäöüßA-ZÄÖÜ]" "[']" nil ("-d" "de_DE" "-i" "iso-8859-1") nil iso-8859-1)
("en_US" "[a-zA-Z]" "[^a-zA-Z]" "[']" nil ;("-d" "en_US" "-i" "iso-8859-1") nil iso-8859-1) ;;invalid option "-i" ("-d" "en_US" "iso-8859-1") nil iso-8859-1)
("en_GB" "[a-zA-Z]" "[^a-zA-Z]" "[']" nil ;("-d" "en_GB" "-i" "iso-8859-1") nil iso-8859-1) ;;invalid option "-i" ("-d" "en_GB" "iso-8859-1") nil iso-8859-1) ))
(eval-after-load "ispell" (progn (setq ispell-dictionary "en_US") ;(setq ispell-extra-args '("-t")) ; input is tex or latex (setq ispell-silently-savep t) ; save personal dict without confirmation ))
(setq-default ispell-program-name "hunspell") (setq ispell-really-hunspell t)
;; the wrapping up of the two loads make sure ;; auctex is loaded only when editing tex files. (eval-after-load "tex-mode" '(progn (load "auctex.el" nil nil t) (load "preview-latex.el" nil nil t) (server-start) ;(require 'tex-mik) ))
;(setq preview-image-type 'png) ;(setq preview-image-type 'pnm) ;(setq preview-gs-command "gswin32c.exe")
;;AUCTeX replaces latex-mode-hook with LaTeX-mode-hook (add-hook 'LaTeX-mode-hook (lambda () (setq TeX-auto-save t) (setq TeX-parse-self t)
(setq-default TeX-auto-parse-length 200)
(setq-default TeX-master nil)
(setq LaTeX-default-options "16pt")
(setq TeX-source-correlate-method 'synctex)
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-start-server t)
(reftex-mode t)
(TeX-fold-mode t)))
(add-hook 'LaTeX-mode-hook 'turn-on-reftex) (setq reftex-plug-into-AUCTeX t) (setq-default ispell-program-name "aspell") (setq ispell-program-name "aspell") (setq ispell-dictionary "en_US")
;; if (aspell installed) { use aspell} ;; else if (hunspell installed) { use hunspell } ;; whatever spell checker I use, I always use English dictionary ;; I prefer use aspell because: ;; 1. aspell is older ;; 2. looks Kevin Atkinson still get some road map for aspell: ;; @see http://lists.gnu.org/archive/html/aspell-announce/2011-09/msg00000.html (defun flyspell-detect-ispell-args (&optional RUN-TOGETHER) "if RUN-TOGETHER is true, spell check the CamelCase words" (let (args) (cond ((string-match "aspell$" ispell-program-name) ;; force the English dictionary, support Camel Case spelling check (tested with aspell 0.6) (setq args (list "--sug-mode=ultra" "--lang=en_US")) (if RUN-TOGETHER (setq args (append args '("--run-together" "--run-together-limit=5" "--run-together-min=2"))))) ((string-match "hunspell$" ispell-program-name) (setq args nil))) args ))
(cond ((executable-find "aspell") (setq ispell-program-name "aspell")) ((executable-find "hunspell") (setq ispell-program-name "hunspell") ;; just reset dictionary to the safe one "en_US" for hunspell. ;; if we need use different dictionary, we specify it in command line arguments (setq ispell-local-dictionary "en_US") (setq ispell-local-dictionary-alist '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)))) (t (setq ispell-program-name nil)))
;; ispell-cmd-args is useless, it's the list of extra arguments we will append to the ispell process when "ispell-word" is called. ;; ispell-extra-args is the command arguments which will always be used when start ispell process (setq ispell-extra-args (flyspell-detect-ispell-args t)) ;; (setq ispell-cmd-args (flyspell-detect-ispell-args)) (defadvice ispell-word (around my-ispell-word activate) (let ((old-ispell-extra-args ispell-extra-args)) (ispell-kill-ispell t) (setq ispell-extra-args (flyspell-detect-ispell-args)) ad-do-it (setq ispell-extra-args old-ispell-extra-args) (ispell-kill-ispell t) ))
;(custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ; '(TeX-view-program-selection (quote ((engine-omega "dvips and gv") (output-dvi "xdvi") (output-pdf "Sumatra PDF") (output-html "xdg-open")))))
; (add-hook 'LaTeX-mode-hook 'my-latex-mode) ; (defun my-latex-mode () ; (latex-math-mode) ; (turn-on-reftex) ; (setq ispell-extra-args '("-t")))
;;;Wrapping the region in quotes ;;;http://www.emacswiki.org/emacs/TypographicalPunctuationMarks#toc10 (defadvice typopunct-insert-quotation-mark (around wrap-region activate) (let* ((lang (or (get-text-property (point) 'typopunct-language) typopunct-buffer-language)) (omark (if single (typopunct-opening-single-quotation-mark lang) (typopunct-opening-quotation-mark lang))) (qmark (if single (typopunct-closing-single-quotation-mark lang) (typopunct-closing-quotation-mark lang)))) (cond (mark-active (let ((skeleton-end-newline nil) (singleo (typopunct-opening-single-quotation-mark lang)) (singleq (typopunct-closing-single-quotation-mark lang))) (if (> (point) (mark)) (exchange-point-and-mark)) (save-excursion (while (re-search-forward (regexp-quote (string omark)) (mark) t) (replace-match (regexp-quote (string singleo)) nil nil))) (save-excursion (while (re-search-forward (regexp-quote (string qmark)) (mark) t) (replace-match (regexp-quote (string singleq)) nil nil))) (skeleton-insert (list nil omark '_ qmark) -1))) ((looking-at (regexp-opt (list (string omark) (string qmark)))) (forward-char 1)) (t ad-do-it))))
;; ;; Detex setup for AUCTeX ;; For converting TeX to text (require 'tex) (add-to-list 'TeX-command-list ;(list "DeTeX" "detex %s.tex > %s.txt" 'TeX-run-command nil t)) ;(list "DeTeX" "opendetex %s.tex" 'TeX-run-command nil t)) (list "DeTeX" "detex %s.tex" 'TeX-run-command nil t))
;; ;; TeXcount setup for TeXcount version 2.3 and later ;; http://app.uio.no/ifi/texcount/faq.html#emacs ;; (defun texcount () (interactive) (let* ( (this-file (buffer-file-name)) (enc-str (symbol-name buffer-file-coding-system)) (enc-opt (cond ((string-match "utf-8" enc-str) "-utf8") ((string-match "latin" enc-str) "-latin1") ("-encoding=guess") ) ) (word-count (with-output-to-string (with-current-buffer standard-output (call-process "texcount" nil t nil "-0" enc-opt this-file) ;(call-process "/cygdrive/c/Cygwin64/usr/share/texmf-dist/scripts/texcount/texcount.pl" nil t nil "-0" enc-opt this-file) ) ) ) ) (message word-count) ) ) (add-hook 'LaTeX-mode-hook (lambda () (define-key LaTeX-mode-map "\C-cw" 'texcount))) (add-hook 'latex-mode-hook (lambda () (define-key latex-mode-map "\C-cw" 'texcount)))
;; ;; TeXcount setup for AUCTeX ;; add to the command list (require 'tex) (add-to-list 'TeX-command-list (list "TeXcount" "texcount %s.tex" 'TeX-run-command nil t))
I think the problem you are experiencing is because you are using cygwin-mount, which makes emacs understand cygwin paths, but in your configuration, you are using Windows paths.
I'd suggest either dropping cygwin-mount (I personally don't use it / like it) and sticking with windows paths.
Also, be careful about the way you escape your paths. You want to write "C:/" not "C:\"
Thanks for the suggestion. I then commented out cygwin-mount in my dot-emacs file and when I pressed M-p in my LaTeX file buffer with the latex-preview-pane-mode on its side, it issued a message saying that pdflatex was not found:
Updating LaTeX Preview Pane lpp/invoke-pdf-latex-command: Searching for program: no such file or directory, pdflatex
However, what I do a M-! and type pdflatex, Emacs does have the pdflatex link (to C:\Cygwin64\bin\pdftex.exe in my case) in its path:
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Cygwin) (preloaded format=pdflatex) restricted \write18 enabled. ** ! End of file on the terminal... why?
If I do a C-h v and type exec-path, I have an output indicating that "C:/Cygwin64/usr/bin" and "C:/Cygwin64/bin" are included: exec-path is a variable defined in `C source code'. Its value is ("C:/Program Files (x86)/Mozilla Firefox/" "C:/Octave/Octave3.6.0_gcc4.6.2/bin" "C:/cygwin/bin" "C:/Cygwin64/bin/" "/cygdrive/c/Cygwin64/usr/bin" "/cygdrive/c/Cygwin64/bin" "/usr/bin" "/bin" "C:/Cygwin64/usr/bin" "C:/Cygwin64/bin" "c:/Program Files (x86)/PC Connectivity Solution/" "C:/ProgramData/Oracle/Java/javapath" "C:/WINDOWS/system32" "C:/WINDOWS" "C:/WINDOWS/System32/Wbem" "C:/WINDOWS/System32/WindowsPowerShell/v1.0/" "C:/Cygwin64/bin/" "C:/Cygwin64/usr/bin/" "C:/Program Files (x86)/Lenovo/Access Connections/" "C:/Program Files (x86)/Intel/Services/IPT/" "C:/Program Files (x86)/Lenovo/Password Manager/" "C:/Program Files/Intel/WiFi/bin/" "C:/Program Files/Common Files/Intel/WirelessCommon/" "C:/Program Files (x86)/Intel/OpenCL SDK/2.0/bin/x86" "C:/Program Files (x86)/Intel/OpenCL SDK/2.0/bin/x64" "C:/Program Files/ThinkPad/Bluetooth Software/" "C:/Program Files/ThinkPad/Bluetooth Software/syswow64" "C:/Program Files/OpenVPN/bin" "C:/Program Files (x86)/Skype/Phone/" "C:/Program Files/SBCL/1.3.0/" "C:/Program Files (x86)/GNU Emacs 24.5/bin/" "C:/xampp/mysql/bin/" "C:/Program Files (x86)/latex2rtf" "C:/Program Files (x86)/Common Files/lenovo/easyplussdk/bin" "C:/Program Files/Calibre2/" "c:/Program Files (x86)/GNU Emacs 24.5/libexec/emacs/24.5/i686-pc-mingw32" "C:/Cygwin64/bin")
Original value was ......
I would try removing the link to pdflatex -- make sure that the ONLY pdflatex on your path is the one in C:/Cygwin64/bin
If I recall correctly, symlinks don't play nicely on windows.
I replaced the pdflatex symlink with pdflatex.exe (a copy of the pdftex.exe), and I received a similar error of not finding the .tex file:
Error generating your PDF document. Please see the output below for more information.
Transcript written on texput.log. ! ==> Fatal error occurred, no output PDF file produced!
<*> ...jwong/Dropbox/sp/paper1_samefishbowl_v0.tex ! Emergency stop. Please type another input file name: (Press Enter to retry, or Control-D to exit)
<*> ...jwong/Dropbox/sp/paper1_samefishbowl_v0.tex ! I can't find file `d:/home/jwong/Dropbox/sp/paper1_samefishbowl_v0.tex'. entering extended mode restricted \write18 enabled. This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Cygwin) (preloaded format=pdflatex)
In the buffer of LaTeX Preview Panel, if I do a C-h v and type in 'default-directory' RET, I'll get: default-directory is a variable defined in `C source code'. Its value is "d:/home/jwong/Dropbox/sp/" Local in buffer Latex Preview Pane Errors; global value is nil
The value is the directory for the .tex I am editing on the other buffer side-by-side.
So it looks like this has allowed it to find the executable (hence the output).
However, sorry to hear you are still having trouble. I think the fact that your emacs setup is rather complex just complicates things a bit in terms of debugging. Let me give you a checklist of things you can go through and see if this helps:
1) Make sure you are running the official emacs windows builds and that you are not running it through the Cygwin command prompt. (Ie, use the click and run version) 2) Start fresh. Save your .emacs and .emacs.d directory somewhere safe and start with a blank .emacs file and install JUST latex-preview-pane 3) Make sure you are using the one from MELPA
See if just cleaning up makes this work for you. I developed LPP on windows originally and I've tested it a lot on that platform. I'm sure it's just something simple that's gumming up the works.
FYI, I am using GNU Emacs 24.5.1 (i686-pc-mingw32) on Windows 10 with Cygwin64.
Error generating your PDF document. Please see the output below for more information.
Most Recent Backtrace:
Transcript written on texput.log. ! ==> Fatal error occurred, no output PDF file produced!
<*> ...me/jwong/Dropbox/sp/paper1_theories_v25.tex ! Emergency stop. Please type another input file name: (Press Enter to retry, or Control-D to exit)
<*> ...me/jwong/Dropbox/sp/paper1_theories_v25.tex ! I can't find file `d:/home/jwong/Dropbox/sp/paper1_theories_v25.tex'. entering extended mode restricted \write18 enabled. This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Cygwin) (preloaded format=pdftex)