Wednesday, December 20, 2006

LaTeX Editing on the 13.3" Macbook (on Linux)

Here is my configuration for LaTeX editing on the 13.3" Macbook (running Linux). I configured gvim and xdvi so that the former occupies the left half of the screen and the latter occupies the right half of the screen. I then use a program that watches the tex file for changes; when I save any changes, the file is compiled and the xdvi window is updated. (One such program is atchange.)

My ~/.gvimrc file sets the window position and geometry of the gvim window.
set lines=39 columns=73
winpos 0 0
My ~/.Xresources file sets the window position, geometry and other options for xdvi.
xdvi*paper: us
xdvi*expert: true
xdvi*pixelsPerInch: 300
xdvi*mfMode: ljfour:600
xdvi*thorough: true
xdvi*background: light yellow
xdvi*shrinkFactor: 7
xdvi*geometry: 590x745-0+0
xdvi.sideMargin: 2cm
xdvi.topMargin: 2cm
xdvi.mainTranslations: #override\
Shift<key>space: up-or-previous()\n\
<key>space: unpause-or-next()\n\
<key>j: down(0.015)\n\
<key>k: up(0.015)\n\
<key>l: right(0.015)\n\
<key>h: left(0.015)
My ~/.vimrc file sets the textwidth, syntax-highlighting and some other options.
" enable syntax highlighting
syntax enable

" hightlight search
set hlsearch

" set textwidth to 70 to cause wrapping
set textwidth=70

" autoindenting
set ai

" 50 lines of command lines history
set history=50

" .viminfo file with 50 lines of registers
set viminfo='20,\"50

" show the cursor position all the time
set ruler

" turn on speel cheqing
set spell
Finally, check out the LaTeX Suite package that provides several useful tools for LaTeX editing with vim.