Sunday, November 25, 2007

Emacs (Auctex) Window XP installation instruction

Installation instruction:
This article describes the installation of emacs including Auctex for Window XP. Since most of these files have be precompiled, what you need just download the precompiled file and configurate them.

1) Download Emacs(including Auctex) for Window XP. The download page as follow:

http://www.gnu.org/software/auctex/download-for-windows.html

And here we use the version emacs+auctex-w32-2007-07-07.zip, you can download from
ftp://alpha.gnu.org/gnu/auctex/emacs+auctex-w32-2007-07-07.zip

Please read the README file before downloading, and in this manual, which included all lisp code and documentation. We put the unzipped file Emacs to the directory C:\Program Files\Emacs. Then we need to setup environmental variable:

HOME=C:\Program Files\Emacs

Afterwards, .emacs.d and .emacs are under the directory $HOME(C:\Program Files\Emacs)

Note: the configuration of the $HOME is very important, please set if first before the following configuration.

2) Configuration

Generally speaking, the main purpose of configuration to Emacs is to set up .emacs file, which was located in the $HOME directory. Here we take into account an example of how to set Aspell that could check spelling.

**********************************************************************************************************************
Configuration for Aspell:

(1) First, download full installer from
http://aspell.net/win32/
and then worldlist setup. Be aware of they are two separately installations.

(2) In my configuration, I installed them into the C:\Program Files\Emacs\Aspell. Then add the path C:\Program Files\Emacs\Aspell\bin to the environmental variable PATH.

(3) Download the ispell.el from
http://kdstevens.com/~stevens/ispell-page.html
and then put ispell.el to directory $HOME/site-lisp

(4) add to the .emacs as
(setq-default ispell-program-name "aspell")
(setq-default ispell-local-dictionary "american")
(global-set-key (kbd "") 'ispell-complete-word)
*********************************************************************************************************************
Configuration for Latex

Thought this emacs version includes Auctex, but we need to download latex for windown XP, you can find more information here:

http://www.hi.is/~tpr/latex/index.html

Here we use Miktex, a latex compiler. Generally set up and the installation will set latex command to the environmental variable PATH.

There is problem for preview functionality, what is resolution here is enter the Miktex installed directory, in my case is
C:\Program Files\MiKTeX 2.6\miktex\bin
change the yap to xdvi.
The reason for this operation is preview functionaliy here is "xdvi file.dvi", however, can not find xdvi in miktex, we just change the command name as xdvi here.
To produce PDF file:
dvipdft file.dvi
To produce PS file:
dvips file.dvi
***********************************************************************************
;my .emacs file
;------------------------------------------------------------------------------
; Basic set up
;------------------------------------------------------------------------------

(setq default-major-mode 'text-mode); set defalut mode as text-mode
(setq inhibit-startup-message t) ; Don't want any startup message
(setq auto-save-default nil) ; Don't want any auto saving
(setq auto-save-list-file-name nil) ; Don't want any .saves files
(show-paren-mode t) ;parathesis mathcing
;; the following setups are for color style, since here I used color.el, not necessary to set anything
;(setq make-backup-files nil) ; Don't want any backup files
;(set-cursor-color "blue") ; Set cursor and mouse-pointer colours
;(set-background-color "white") ; Set emacs bg color


(mouse-avoidance-mode 'jump) ;when cursor close to mouse, mouse avoid automatically, funny ^_^
(tool-bar-mode nil) ; disappear tool-bar
;(menu-bar-mode nil) ; disappear menu-bar
(global-set-key [f9] 'tool-bar-mode) ;keybindings for tool-bar
;(global-set-key [f10] 'menu-bar-mode) ;keybindings for menu-bar
(setq default-line-spacing 10)


;---------------------------------------------------------------------------
;Some (keybindings)keyboard shortcuts for instance copy f5, cut f6, paste f7
;---------------------------------------------------------------------------

;(global-set-key [f5] 'copy-region-as-kill) ; Copy
(global-set-key [f6] 'kill-region) ; Cut
(global-set-key [f7] 'yank) ; Paste


;-------------------------
;color package
;-------------------------
;(load-file "/home/wason/myemacs/color-theme-6.5.0.el")
;(load-file "C:\Program Files\emacs-22.1\site-lisp/color-theme.el")
;(load-file "/home/wason/myemacs/color-theme-6.6.0.el")
;(load-file "/home/wason/myemacs/color-theme-6.6.0/color-theme.el")
(require 'color-theme)
(color-theme-arjen)
;(color-theme-dark-blue2)

;-------------------------
;setup for aspell
;----------------------------
(setq-default ispell-program-name "Aspell")
(setq-default ispell-local-dictionary "american")
(global-set-key (kbd "") 'ispell-complete-word)


;(load "auctex.el" nil t t)
;(load "preview-latex.el" nil t t)

;(setq TeX-parse-self t)
;(setq-default TeX-master nil)
;(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
;(setq reftex-plug-into-AUCTeX t)

***********************************************************************************

Similar, we can configurate any other features in emacs. Enjoy it.

No comments: