The Revolver’s Notepad

Emacs configurations — AucTeX

Posted in Quick References by Vincent on September 10, 2010

Here is the setting for working with Emacs and AucTeX under MS Windows.

;;; auctex
;; (add-to-list 'load-path "~/.emacs.d/site-lisp/auctex-11.85")
(load "auctex.el" nil t t)
(require 'latex)
(require 'tex-site)
(require 'tex-mik)

;; Set the default PDF reader to SumatraPDF. The executable should be in PATH
(setq TeX-view-style (quote (("^epsf$" "SumatraPDF.exe %f") ("." "yap -1 %dS %d"))))

(setq TeX-output-view-style 
      (quote 
       (("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$" "dvips %d -o && start %f") 
        ("^dvi$" "." "yap -1 %dS %d") 
        ("^pdf$" "." "SumatraPDF.exe -reuse-instance %o") 
        ("^html?$" "." "start %o"))))

;; Some helpful settings
(setq TeX-auto-untabify t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(setq TeX-electric-escape t)
(setq-default TeX-PDF-mode t)

(add-to-list 'LaTeX-indent-environment-list '("tikzpicture"))
(add-to-list 'LaTeX-verbatim-environments "comment")

;; Start RefTeX
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(add-hook 'latex-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)


Tagged with: , ,

Compiling Maude 2.5 under Ubuntu 10.04

Posted in Quick References by Vincent on July 6, 2010

To compile Maude, a few prior packages need to be installed.

build-essential and related utilities

dpkg -l build-essential
sudo apt-get install build-essential bison flex libncurses5-dev

GNU gmp

First grab the package from its site here. Untar and install.

wget ftp://ftp.gmplib.org/pub/gmp-5.0.1/gmp-5.0.1.tar.bz2
tar xvf gmp-5.0.1.tar.bz2
cd gmp-5.0.1/
./configure --enable-cxx --disable-shared
make check
make
sudo make install

The whole process may take a while.

GNU libsigsegv

sudo apt-get install libsigsegv0 libsigsegv-dev

Tecla

Download from here and do the usual stuff.

wget http://www.astro.caltech.edu/~mcs/tecla/libtecla.tar.gz
tar xvf libtecla.tar.gz
cd libtecla/
./configure CFLAGS="-O2 -D_POSIX_C_SOURCE=1"
make TARGETS=normal TARGET_LIBS=static
sudo make install

BuDDy

Same stuff for BuDDy from SourceForge.

wget "http://sourceforge.net/projects/buddy/files/buddy/BuDDy 2.4/buddy-2.4.tar.gz/download"
tar xvf buddy-2.4.tar.gz
cd buddy-2.4/
./configure --disable-shared
make
sudo make install

Maude

Now it is possible to build Maude from scratch. The steps are similar, but just remember to use the libraries that we just compiled, rather than the ones that (possibly) come by default.

wget http://maude.cs.uiuc.edu/download/current/Maude-2.5.tar.gz
tar xvf Maude-2.5.tar.gz
cd Maude-2.5.tar.gz/
mkdir Build
cd Build/
../configure GMP_LIBS="/usr/local/lib/libgmpxx.a /usr/local/lib/libgmp.a"
make
make check
sudo make install

The make step may take a while, just be patient.

Setting up Emacs Maude mode

After compiling and installing Maude, it may be helpful to set up Emacs so that experiment with Maude is easier. First download the Emacs Maude mode from SourceForge. Put it in your load path, and then add the following to a file maude.el under .emacs.d folder so that it is loaded by Emacs.

(autoload 'maude-mode "maude-mode" "MAUDE mode" nil t)
(setq auto-mode-alist
      (append
       (list (cons "\\.maude$"  'maude-mode)
		     (cons "\\.fm$"     'maude-mode))
       auto-mode-alist))
(setq maude-command "/usr/local/maude/maude.linux")
Tagged with: , ,

Emacs configurations — basics

Posted in Quick References by Vincent on November 13, 2009

In this series of posts a step by step introduction of configuring Emacs to a proper working environment will be covered. The Emacs configuration files will be pasted and explained.

When Emacs is started, it reads the initialization file .emacs from some default directories. One of those is the HOME directory of the current user. Under Linux, it is the directory ~. Under Windows it is typically under what the HOME environment has specified, or check here for a detailed description (Section 3.5).

Essentially you can put everything in this .emacs file, but here in this post a more structured way is introduce for easy management of configurations for different uses of Emacs. The .emacs file simply looks like the following.

(add-to-list 'load-path "~/.emacs.d/site-lisp")
(mapc 'load (directory-files "~/.emacs.d" t "\\.el\\'"))

The first line specifies where Emacs should find configuration files or packages in addition to its defaults. The Emacs LISP jargon ‘mapc’ function loads every .el file in the .emacs.d directory under the HOME directory one by one, so you can put your different configuration files separate. When you want to disable anyone of them, just change their extension from .el to .el.bak then you are fine. Using the Emacs dired mode or the Emacs shell, this is can be done quite easily.

Tagged with: , ,
Follow

Get every new post delivered to your Inbox.