Path: utzoo!attcan!uunet!comp.vuw.ac.nz!byrd From: Mike.Williams@comp.vuw.ac.nz (Mike Williams) Newsgroups: comp.emacs Subject: Re: TeX mode -- can't find included file. Message-ID: Date: 29 Jul 90 17:35:02 GMT References: <9007181452.AA27255@asylum.gsfc.nasa.gov> Sender: news@comp.vuw.ac.nz (News Admin) Organization: Dept. of Computer Science, Victoria Uni. of Wellington, NZ. Lines: 50 In-Reply-To: chris@ASYLUM.GSFC.NASA.GOV's message of 18 Jul 90 14:52:42 GMT +-- chris@ASYLUM.GSFC.NASA.GOV (Chris Shenton) writes: | | I'm editing a LaTeX file, and want to run an inferior LaTeX on the buffer. | When I do C-c C-b (TeX-buffer), it bombs because it can't find the include | file, which lives in the original directory, not /tmp. | | [...blah...] | | Is there a way to tell it to get the includes from the source directory | instead of /tmp? Is this a problem with the Abortext port of TeX? | | If I set TeX-directory to "." (the current directory) rather than "/tmp/", | then things work OK, but it's a drag having all those temporary files lying | around. I got really annoyed with creating temporary files everywhere ... so I wrote something to run TeX on the input file directly. If you're not editing a file, but just writing something small in a buffer, it just runs TeX-buffer. I don't know if this is what you want ... but this is what I use. If anyone has a better way of doing it, please speak up. --- cut here ------------------------------------------------------------- (defun TeX-file (&optional arg) "Run LaTeX on file specified - defaults to file shown in current buffer" (interactive) (let ((TeX-input-file (file-name-nondirectory (or arg (buffer-file-name)))) (TeX-directory (file-name-directory (or arg (buffer-file-name))))) (if (not TeX-input-file) (TeX-buffer) (progn (save-some-buffers) (if (get-buffer "*TeX-shell*") (TeX-kill-job) (TeX-start-shell)) (send-string "TeX-shell" (concat TeX-shell-cd-command " " TeX-directory "\n")) (send-string "TeX-shell" (concat TeX-command " \"" TeX-input-file "\"\n")) (TeX-recenter-output-buffer 2))) )) (define-key TeX-mode-map "\C-c\C-f" 'TeX-file) -- /-------------------- byrd@comp.vuw.ac.nz --------------------\ | Mike Williams, Victoria University of Wellington, Aotearoa. | \------------ "Everyone thinks I'm paranoid ..." -------------/