These are my notes on using tex on unix/linux machines. In principle, all you need is some sort of editor to create tex files, the command "tex" or "latex" to compile these to dvi. The command "xdvi" to preview them, and "dvips" to print them. But if you're documents are at all complicated you might need more.
- Donu
If you're setting up your linux machine, then you probably have emacs already, but you probably don't have the AUCtex package; you'll need to download and intall it first. (Purdue math Solaris users can ignore this, since it's already installed.)
Next create a file .emacs in your home directory if it doesn't already exist. Add these lines to it:
(require 'tex-site)The last line turns on syntax colouring. Omit it, if you don't like this feature. If AUCtex was installed in some nonstandard place, say /X/Y . You'll have to tell emacs to look there by adding
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTex t)
(global-font-lock-mode t)
(setq load-path (cons "/X/Y" load-path))ahead of the previous lines. Restart emacs, and try editing a latex file. You'll notice some menus entitled "Latex", "Command" and "Ref" which are specific to editing/compiling/debugging latex files. Many of these commands should be self explanitory. See the manual for more information.
mkdir binand put this at the beginning of your path by putting
set path = ( ~/bin $path . )in your .cshrc Then type
cp ~dvb/xdvik-22.76.1/texk/xdvik/xdvi-xaw.bin ~/bin(Or if you're feeling adventurous, type
cp ~dvb/xdvik-22.76.1/texk/xdvik/xdvi-motif.bin ~/bininstead. You'll get some annoying warnings if you use this version, but xdvi will look a lot nicer.)
mkdir xdviinputsThe first command ensures that you'll have a copy of the program regardless of what I do. Put
cp ~dvb/xdvik-22.76.1/texk/xdvik/texmf/* xdviinputs
mkdir texinputs
cp ~dvb/texinputs/src* texinputs
setenv TEXMF /pkgs/teTeX/texmf/in your .cshrc
setenv XDVIINPUTS $HOME/xdviinputs
setenv TEXINPUTS ".:$HOME/texinputs/:"
tar xfvz xdvik-22.76.1.tar.gzThe output from the last command should give a directory, say /X/Y/texmf
cd xdvik-22.76.1
kpsewhich --expand-path='$TEXMFMAIN'
./configure --datadir=/X/Y (leave texmf out)If you're your own systems administrator, you can do an "su" and"make install" at this point. Or else modify the previous instructions appropriately.
make
xdvi -versionto check. It should say:
Xdvi version 22.76.1 (Xaw toolkit)Try an actual dvi file to really make sure this really works. It should do everything that the old xdvi did, and then some (such as interacting with an editor).
kpathsea version 3.4.5
Copyright (C) 1990-2002 Paul Vojta and others. (Yes, that Vojta.)
...
Tell xdvi to use emacs as the default editor by putting
xdvi.editor: emacsclient --no-wait +%l %f(or
xdvi.editor: gnuclient -q +%l %fif you prefer xemacs) in your .Xdefaults (create this if necessary), and type
xrdb .Xdefaultsor simply logout and back in.
Put emacs into server mode by putting
(server-start)in your .emacs file (Put
(gnuserv-start)in your .(x)emacs file if you're using xemacs.) If emacs is already running, quit and restart it.
Start emacs if you haven't already. Compile something.tex and preview with
xdvi something.dviHold down the control key and click with the left mouse button on any point in xdvi. Emacs should magically jump to the corresponding point in something.tex! This should work even if emacs is run from a terminal (i. e. with -nw option).