Function: tex-file

tex-file is an interactive and byte-compiled function defined in tex-mode.el.gz.

Signature

(tex-file)

Documentation

Prompt to save all buffers and run TeX (or LaTeX) on current buffer's file.

This function is more useful than M-x tex-buffer (tex-buffer) when you need the
.aux file of LaTeX to have the correct name.

Probably introduced at or before Emacs version 20.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/tex-mode.el.gz
(defun tex-file ()
  "Prompt to save all buffers and run TeX (or LaTeX) on current buffer's file.
This function is more useful than \\[tex-buffer] when you need the
`.aux' file of LaTeX to have the correct name."
  (interactive)
  (when tex-offer-save
    (save-some-buffers))
  (let* ((source-file (tex-main-file))
	 (file-dir (file-name-directory (expand-file-name source-file))))
    (if (tex-shell-running)
        (tex-kill-job)
      (tex-start-shell))
    (tex-start-tex tex-command source-file file-dir)
    (setq tex-print-file (expand-file-name source-file))))