Function: tex-print

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

Signature

(tex-print &optional ALT)

Documentation

Print the .dvi file made by M-x tex-region (tex-region), M-x tex-buffer (tex-buffer) or M-x tex-file (tex-file).

Runs the shell command defined by tex-dvi-print-command. If prefix argument is provided, use the alternative command, tex-alt-dvi-print-command.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/tex-mode.el.gz
(defun tex-print (&optional alt)
  "Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file].
Runs the shell command defined by `tex-dvi-print-command'.  If prefix argument
is provided, use the alternative command, `tex-alt-dvi-print-command'."
  (interactive "P")
  (let ((print-file-name-dvi (tex-append tex-print-file
                                         tex-print-file-extension))
	test-name)
    (if (and (not (equal (current-buffer) tex-last-buffer-texed))
	     (buffer-file-name)
	     ;; Check that this buffer's printed file is up to date.
	     (file-newer-than-file-p
	      (setq test-name (tex-append (buffer-file-name)
                                          tex-print-file-extension))
	      (buffer-file-name)))
	(setq print-file-name-dvi test-name))
    (if (not (file-exists-p print-file-name-dvi))
        (error "No appropriate `.dvi' file could be found")
      (if (tex-shell-running)
          (tex-kill-job)
        (tex-start-shell))
      (tex-send-command
       (if alt tex-alt-dvi-print-command tex-dvi-print-command)
       print-file-name-dvi
       t))))