Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!uwm.edu!lll-winken!sun-barr!ccut!s.u-tokyo!rkna50!nttlab!icot32!okilab!sh8810!ascgw!fgw!iias!ueda From: ueda@iias.fujitsu.co.jp (HALuyasu Ueda) Newsgroups: comp.emacs Subject: Re: TeX mode -- can't find included file. Message-ID: Date: 20 Jul 90 02:44:24 GMT Sender: news@iias.fujitsu.co.jp Organization: IIAS-SIS in System-Lab, FUJITSU LIMITED, Japan Lines: 68 In-reply-to: chris@ASYLUM.GSFC.NASA.GOV's message of 18 Jul 90 14:52:42 GMT Distributions: world >>>>> In article <9007181452.AA27255@asylum.gsfc.nasa.gov>, chris@ASYLUM.GSFC.NASA.GOV (Chris Shenton) writes: chris> When I do C-c C-b (TeX-buffer), it bombs because it can't find the include chris> file, which lives in the original directory, not /tmp. chris> The relevant part of the file looks like: chris> \documentstyle{letter} chris> \include{macros} chris> and C-c C-b generates the output: ..del.. chris> Is there a way to tell it to get the includes from the source directory chris> instead of /tmp? Is this a problem with the Abortext port of TeX? This also happend on my machine: SUN4. It is popular problem. To avoid this, I changed TEXINPUT environment variable for inferrior shell so that TEXINPUT includes the directory of processed file. ----------original TeX-start-shell in the tex-mode.el------------------- ;;; The utility functions: (defun TeX-start-shell () (require 'shell) (save-excursion ! (set-buffer (make-shell "TeX-shell" nil nil "-v")) (setq TeX-shell-map (copy-keymap shell-mode-map)) (TeX-define-common-keys TeX-shell-map) (use-local-map TeX-shell-map) (if (zerop (buffer-size)) (sleep-for 1)))) ----------And my reviced version --------------------------------------- (defun TeX-start-shell () (require 'shell) (save-excursion ! (set-buffer (make-shell "TeX-shell" ! (concat exec-directory "env") ! "/dev/null" ! (format "TEXINPUTS=%s:%s" ! (getenv "TEXINPUTS") ! default-directory ! ) ! "-" ! "sh" "-v")) (setq TeX-shell-map (copy-keymap shell-mode-map)) (TeX-define-common-keys TeX-shell-map) (use-local-map TeX-shell-map) (if (zerop (buffer-size)) (sleep-for 1)) )) ------------------------------------------------------------------------ Of cource this still has a problem. If you edit many tex-files under different directory, just the first processed directory is available. However, I haven't experenced such the situation yet. Because I use '\include{}' just for a big document like Theses or Book, and I NEVER edit such big documents at the same time. PS. This is my first article to the world. So, please ignore something strange character this article may include. It may be my signature written in Japanease/Kanji.